-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add and improve data fetching and processing
- Loading branch information
Showing
10 changed files
with
1,544 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Fetch and process FAQs, releases and versions. | ||
|
||
.PHONY: faq-data releases-data versions-data clean | ||
|
||
all: faq/all.json releases/all.json versions-data | ||
|
||
update: clean all | ||
|
||
faq/all.json: faq-data | ||
jq -s 'add | map({title, url, body}) | map(.keywords = (.body | capture("Keywords: (?<c>[^\r\n]+)").c | split(", "))) | map(.categories = (.body | capture("Categories: (?<c>[^\r\n]+)").c | split(", "))) | sort_by(.title)' faq/src/* > $@ | ||
|
||
faq-data: faq/src/portmaster.json faq/src/portmaster-ui.json faq/src/spn.json faq/src/faqs.json | ||
|
||
faq/src/%.json: | ||
mkdir -p faq/src | ||
cd faq/src | ||
wget -O $@ "https://api.github.com/repos/safing/$*/issues?labels=faq&per_page=100" | ||
|
||
releases/all.json: releases-data | ||
jq -s 'add | map({name, tag_name, body, prerelease, html_url, created_at}) | map(.date = .created_at[:10]) | map(.body = (.body | gsub("Changelog:"; "") | gsub("[a-f0-9]{40}"; "-"))) | map(.repo = (.html_url | capture("github.com/safing/(?<repo>[^/]+)/").repo)) | sort_by(.created_at) | reverse' releases/src/* > $@ | ||
|
||
releases-data: releases/src/portmaster.json releases/src/portmaster-ui.json releases/src/spn.json | ||
|
||
releases/src/%.json: | ||
mkdir -p releases/src | ||
cd faq/src | ||
wget -O $@ "https://api.github.com/repos/safing/$*/releases" | ||
|
||
versions-data: versions/stable.json versions/beta.json | ||
|
||
versions/%.json: | ||
cd versions | ||
wget -O $@ "https://updates.safing.io/$*.v2.json" | ||
|
||
clean: | ||
rm -f faq/src/* | ||
rm -f releases/src/* | ||
rm -f versions/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,25 @@ | ||
# Data | ||
# Sourced Data | ||
|
||
### Update faq-data.json | ||
|
||
1. Check if the current list has new entries | ||
|
||
https://github.com/issues?q=archived%3Afalse+user%3Asafing+sort%3Aupdated-desc+label%3Afaq | ||
|
||
2. Get the current list with these commands (you might need to add new ones for additional repos) | ||
### Update all data | ||
|
||
``` | ||
gh issue list --label faq --repo safing/portmaster --json title,url,body > faq-data.json | ||
gh issue list --label faq --repo safing/portmaster-ui --json title,url,body >> faq-data.json | ||
make update | ||
``` | ||
|
||
3. Fix JSON format. | ||
### Create faq/all.json | ||
|
||
``` | ||
sed -i ':a;N;$!ba;s/\]\n\[/,/g;s/},{/},\n{/g;s/\[{/\[\n{/g;s/}\]/}\n\]/g' faq-data.json | ||
make faq/all.json | ||
``` | ||
|
||
4. Sort and make pretty | ||
### Create releases/all.json | ||
|
||
``` | ||
cat faq-data.json | jq 'sort_by(.title)' | tee faq-data.json | ||
make releases/all.json | ||
``` | ||
|
||
Here is everything together: | ||
### Create versions/* | ||
|
||
``` | ||
gh issue list --label faq --repo safing/portmaster --json title,url,body > faq-data.json && \ | ||
gh issue list --label faq --repo safing/portmaster-ui --json title,url,body >> faq-data.json && \ | ||
gh issue list --label faq --repo safing/spn --json title,url,body >> faq-data.json && \ | ||
sed -i ':a;N;$!ba;s/\]\n\[/,/g;s/},{/},\n{/g;s/\[{/\[\n{/g;s/}\]/}\n\]/g' faq-data.json && \ | ||
cat faq-data.json | jq 'sort_by(.title)' | tee faq-data.json | ||
make versions-data | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ categories: | |
- Starting and Stopping | ||
- Compatibility | ||
- Leaks | ||
- Windows | ||
- Linux | ||
- Other |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
repos: | ||
- id: portmaster | ||
name: "Portmaster" | ||
resource: "windows_amd64/core/portmaster-core.exe" | ||
- id: spn | ||
name: "SPN" | ||
resource: "linux_amd64/hub/spn-hub" | ||
- id: portmaster-ui | ||
tag-names: | ||
portmaster: "UI" | ||
notifier: "Notifier" | ||
assets: "UI Assets" | ||
app-electron: "UI App" | ||
tag-resources: | ||
portmaster: "all/ui/modules/portmaster.zip" | ||
notifier: "windows_amd64/notifier/portmaster-notifier.exe" | ||
assets: "all/ui/modules/assets.zip" | ||
app-electron: "windows_amd64/app/portmaster-app.zip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"Channel": "beta", | ||
"Published": "2022-10-19T12:43:20Z", | ||
"Releases": { | ||
"all/ui/modules/assets.zip": "0.3.1", | ||
"all/ui/modules/portmaster.zip": "0.4.2", | ||
"darwin_amd64/core/portmaster-core": "1.0.0", | ||
"darwin_amd64/jess/jess": "0.3.1", | ||
"darwin_amd64/start/portmaster-start": "1.0.0", | ||
"darwin_arm64/core/portmaster-core": "1.0.0", | ||
"darwin_arm64/jess/jess": "0.3.1", | ||
"darwin_arm64/start/portmaster-start": "1.0.0", | ||
"linux_all/packages/install.sh": "1.0.0", | ||
"linux_all/packages/installer-assets.tar.gz": "1.0.0", | ||
"linux_amd64/core/portmaster-core": "1.0.0", | ||
"linux_amd64/jess/jess": "0.3.1", | ||
"linux_amd64/notifier/portmaster-notifier": "0.3.5", | ||
"linux_amd64/packages/portmaster-installer.deb": "1.0.0", | ||
"linux_amd64/packages/portmaster-installer.rpm": "1.0.0", | ||
"linux_amd64/start/portmaster-start": "1.0.0", | ||
"linux_arm64/core/portmaster-core": "1.0.0", | ||
"linux_arm64/jess/jess": "0.3.1", | ||
"linux_arm64/notifier/portmaster-notifier": "0.3.5", | ||
"linux_arm64/start/portmaster-start": "1.0.0", | ||
"windows_amd64/core/portmaster-core.exe": "1.0.0", | ||
"windows_amd64/jess/jess.exe": "0.3.1", | ||
"windows_amd64/kext/portmaster-kext.dll": "1.0.14", | ||
"windows_amd64/kext/portmaster-kext.pdb": "1.0.14", | ||
"windows_amd64/kext/portmaster-kext.sys": "1.0.14", | ||
"windows_amd64/notifier/portmaster-notifier.exe": "0.3.5", | ||
"windows_amd64/notifier/portmaster-wintoast.dll": "0.1.4", | ||
"windows_amd64/packages/portmaster-installer.exe": "1.0.0", | ||
"windows_amd64/start/portmaster-start.exe": "1.0.0", | ||
"windows_arm64/core/portmaster-core.exe": "1.0.0", | ||
"windows_arm64/jess/jess.exe": "0.3.1", | ||
"windows_arm64/notifier/portmaster-notifier.exe": "0.3.5", | ||
"windows_arm64/start/portmaster-start.exe": "1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"Channel": "stable", | ||
"Published": "2022-10-20T06:37:10Z", | ||
"Releases": { | ||
"all/intel/geoip/geoipv4.mmdb.gz": "20220804.11.58", | ||
"all/intel/geoip/geoipv6.mmdb.gz": "20220804.12.24", | ||
"all/ui/modules/assets.zip": "0.3.1", | ||
"all/ui/modules/base.zip": "0.2.11", | ||
"all/ui/modules/console.zip": "0.1.11", | ||
"all/ui/modules/monitor.zip": "0.2.4", | ||
"all/ui/modules/portmaster.zip": "0.4.2", | ||
"all/ui/modules/profilemgr.zip": "0.1.7", | ||
"all/ui/modules/settings.zip": "0.1.8", | ||
"darwin_amd64/core/portmaster-core": "1.0.0", | ||
"darwin_amd64/hub/spn-hub": "0.5.1", | ||
"darwin_amd64/jess/jess": "0.3.1", | ||
"darwin_amd64/start/portmaster-start": "1.0.0", | ||
"darwin_arm64/core/portmaster-core": "1.0.0", | ||
"darwin_arm64/jess/jess": "0.3.1", | ||
"darwin_arm64/start/portmaster-start": "1.0.0", | ||
"linux_all/packages/install.sh": "1.0.0", | ||
"linux_all/packages/installer-assets.tar.gz": "1.0.0", | ||
"linux_amd64/app/portmaster-app.zip": "0.2.5", | ||
"linux_amd64/core/portmaster-core": "1.0.0", | ||
"linux_amd64/hub/spn-hub": "0.5.1", | ||
"linux_amd64/jess/jess": "0.3.1", | ||
"linux_amd64/notifier/portmaster-notifier": "0.3.5", | ||
"linux_amd64/packages/portmaster-installer.deb": "1.0.0", | ||
"linux_amd64/packages/portmaster-installer.rpm": "1.0.0", | ||
"linux_amd64/start/portmaster-start": "1.0.0", | ||
"linux_arm64/app/portmaster-app.zip": "0.2.5", | ||
"linux_arm64/core/portmaster-core": "1.0.0", | ||
"linux_arm64/jess/jess": "0.3.1", | ||
"linux_arm64/notifier/portmaster-notifier": "0.3.5", | ||
"linux_arm64/start/portmaster-start": "1.0.0", | ||
"windows_amd64/app/portmaster-app.zip": "0.2.5", | ||
"windows_amd64/core/portmaster-core.exe": "1.0.0", | ||
"windows_amd64/hub/spn-hub.exe": "0.5.1", | ||
"windows_amd64/jess/jess.exe": "0.3.1", | ||
"windows_amd64/kext/portmaster-kext.dll": "1.0.14", | ||
"windows_amd64/kext/portmaster-kext.pdb": "1.0.14", | ||
"windows_amd64/kext/portmaster-kext.sys": "1.0.14", | ||
"windows_amd64/notifier/portmaster-notifier.exe": "0.3.5", | ||
"windows_amd64/notifier/portmaster-snoretoast.exe": "0.6.0", | ||
"windows_amd64/notifier/portmaster-wintoast.dll": "0.1.4", | ||
"windows_amd64/packages/portmaster-installer.exe": "1.0.0", | ||
"windows_amd64/start/portmaster-start.exe": "1.0.0", | ||
"windows_arm64/app/portmaster-app.zip": "0.2.5", | ||
"windows_arm64/core/portmaster-core.exe": "1.0.0", | ||
"windows_arm64/jess/jess.exe": "0.3.1", | ||
"windows_arm64/notifier/portmaster-notifier.exe": "0.3.5", | ||
"windows_arm64/start/portmaster-start.exe": "1.0.0" | ||
} | ||
} |