From dc16c0829d66f673c41e6e064ed21a271d82ec8e Mon Sep 17 00:00:00 2001 From: daylight Date: Sun, 27 Oct 2024 12:23:37 +0300 Subject: [PATCH 1/5] Make the workflow run hourly --- .github/workflows/main.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25be1c764..8a4f491eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,8 @@ name: Update CDN assets on: - # https://unix.stackexchange.com/questions/519538/how-to-set-cron-job-for-every-5-hours schedule: - - cron: '11 */1 * * *' + - cron: '0 * * * *' workflow_dispatch: jobs: @@ -21,49 +20,58 @@ jobs: exit 1 fi exit 0 - - name: Clone uAssetsCDN + + - name: Checkout repository uses: actions/checkout@v4 + - name: Copy shell script from uAssets run: | TMPDIR="$(mktemp -d)" git clone --depth=1 --single-branch --branch=master https://github.com/uBlockOrigin/uAssets.git "$TMPDIR" - cp -v "$TMPDIR"/tools/need-patch.mjs . - cp -v "$TMPDIR"/tools/make-diffpatch.sh . - cp -v "$TMPDIR"/tools/update-diffpatches.sh . + cp -v "$TMPDIR/tools/need-patch.mjs" . + cp -v "$TMPDIR/tools/make-diffpatch.sh" . + cp -v "$TMPDIR/tools/update-diffpatches.sh" . + - name: Time check run: | UPDATE_PERIOD_IN_HOURS=5 echo "CAN_DO=$(node ./need-patch.mjs delay="$UPDATE_PERIOD_IN_HOURS")" >> $GITHUB_ENV + - name: Generate version string if: ${{ env.CAN_DO == 'yes' }} run: | TAGNAME=$(date -u "+%Y.%-m.%-d.")$(date -u "+%H*60+%M" | bc) echo "TAGNAME=$TAGNAME" >> $GITHUB_ENV echo "Version string is $TAGNAME" + - name: Copy uAssets/filters to uAssetsCDN if: ${{ env.CAN_DO == 'yes' }} run: | TMPDIR="$(mktemp -d)" git clone --depth=1 --single-branch --branch=gh-pages https://github.com/uBlockOrigin/uAssets.git "$TMPDIR" - cp -v "$TMPDIR"/filters/*.txt filters/ - cp -v "$TMPDIR"/thirdparties/*.txt thirdparties/ + cp -v "$TMPDIR/filters/*.txt" filters/ + cp -v "$TMPDIR/thirdparties/*.txt" thirdparties/ + - name: Copy uBlock/assets*.json to uAssetsCDN if: ${{ env.CAN_DO == 'yes' }} run: | TMPDIR="$(mktemp -d)" git clone --depth=1 --single-branch --branch=master https://github.com/gorhill/uBlock.git "$TMPDIR" - cp -v "$TMPDIR"/assets/assets*.json ublock/ + cp -v "$TMPDIR/assets/assets*.json" ublock/ + - name: Create new patch if: ${{ env.CAN_DO == 'yes' }} run: | PATCHES_DIR="patches" ./make-diffpatch.sh "${{ env.TAGNAME }}" "$PATCHES_DIR" + - name: Update existing patches if: ${{ env.CAN_DO == 'yes' }} run: | PATCHES_DIR="patches" FILTER_FILES=$(git ls-files --exclude-standard -- filters/*.min.txt thirdparties/*.txt) ./update-diffpatches.sh "$GITHUB_REPOSITORY" "$PATCHES_DIR" "$FILTER_FILES" + - name: Commit changes, if any if: ${{ env.CAN_DO == 'yes' }} run: | From fec6e9976bd2ce3646d130174971b65c05404365 Mon Sep 17 00:00:00 2001 From: daylight Date: Sun, 27 Oct 2024 12:26:22 +0300 Subject: [PATCH 2/5] Update readme --- README.md | 59 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 17d41195c..2f850d59a 100644 --- a/README.md +++ b/README.md @@ -2,33 +2,38 @@ [![](https://data.jsdelivr.com/v1/package/gh/uBlockOrigin/uAssetsCDN/badge)](https://www.jsdelivr.com/package/gh/uBlockOrigin/uAssetsCDN) -CDN content mirroring uAssets +**CDN content mirroring uAssets** -This site is used as a [Content Delivery Network](https://en.wikipedia.org/wiki/Content_delivery_network) for [uBlock Origin's own filter lists](https://github.com/uBlockOrigin/uAssets/tree/master/filters): +This site serves as a [Content Delivery Network](https://en.wikipedia.org/wiki/Content_delivery_network) for [uBlock Origin's filter lists](https://github.com/uBlockOrigin/uAssets/tree/master/filters): -* [uBlock's `assets.json`](./ublock/assets.json) (internal) -* [uBlock's `assets.dev.json`](./ublock/assets.dev.json) (internal) -* [Bad filter lists](./filters/badlists.txt) (internal) -* uBlock filter lists - * [uBlock filters – Ads](./filters/filters.min.txt) (default) - * [uBlock filters – Privacy](./filters/privacy.min.txt) (default) - * [uBlock filters – Badware risks](./filters/badware.txt) (default) - * [uBlock filters – Quick fixes](./filters/quick-fixes.txt) (default) - * [uBlock filters – Unbreak](./filters/unbreak.txt) (default) - * [uBlock filters – Annoyances](./filters/annoyances.txt) - * [Block Outsider Intrusion into LAN](./filters/lan-block.txt) -* EasyList filter lists - * [EasyList – Ads](./thirdparties/easylist.txt) (default) - * [EasyPrivacy](./thirdparties/easyprivacy.txt) (default) - * EasyList – Annoyances - * [EasyList – Annoyances](./thirdparties/easylist-annoyances.txt) - * [EasyList – Cookie Notices](./thirdparties/easylist-cookies.txt) - * [EasyList – Newsletter Notices](./thirdparties/easylist-newsletters.txt) - * [EasyList – Notifications](./thirdparties/easylist-notifications.txt) - * [EasyList – Social Widgets](./thirdparties/easylist-social.txt) +### Internal Files +- [uBlock's `assets.json`](./ublock/assets.json) +- [uBlock's `assets.dev.json`](./ublock/assets.dev.json) +- [Bad filter lists](./filters/badlists.txt) -Mirrors: -- -- -- -- +### uBlock Filter Lists +- **Default** + - [Ads](./filters/filters.min.txt) + - [Privacy](./filters/privacy.min.txt) + - [Badware risks](./filters/badware.txt) + - [Quick fixes](./filters/quick-fixes.txt) + - [Unbreak](./filters/unbreak.txt) +- [Annoyances](./filters/annoyances.txt) +- [Block Outsider Intrusion into LAN](./filters/lan-block.txt) + +### EasyList Filter Lists +- **Default** + - [Ads](./thirdparties/easylist.txt) + - [EasyPrivacy](./thirdparties/easyprivacy.txt) +- **Annoyances** + - [EasyList – Annoyances](./thirdparties/easylist-annoyances.txt) + - [EasyList – Cookie Notices](./thirdparties/easylist-cookies.txt) + - [EasyList – Newsletter Notices](./thirdparties/easylist-newsletters.txt) + - [EasyList – Notifications](./thirdparties/easylist-notifications.txt) + - [EasyList – Social Widgets](./thirdparties/easylist-social.txt) + +### Mirrors +- [uAssetsCDN Homepage](https://ublockorigin.github.io/uAssetsCDN/) +- [uBlock Origin Pages](https://ublockorigin.pages.dev/) +- [jsDelivr Package](https://www.jsdelivr.com/package/gh/uBlockOrigin/uAssetsCDN) +- [Statically CDN](https://statically.io/) From 81549c0d4222b5fed4ac6beb438d5d414e4de8fc Mon Sep 17 00:00:00 2001 From: daylight Date: Sun, 27 Oct 2024 12:26:59 +0300 Subject: [PATCH 3/5] Update site --- index.html | 73 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index ffe4c53ed..ad4c15f33 100644 --- a/index.html +++ b/index.html @@ -1,43 +1,46 @@ - + - - - + + + uAssetsCDN - -

uAssetsCDN

-

CDN content mirroring uAssets.

-

This site is used as a Content Delivery Network for uBlock Origin's own filter lists:

- From 84f9ef6ae8faa90728f40046254753a686d19428 Mon Sep 17 00:00:00 2001 From: daylight Date: Sun, 27 Oct 2024 12:27:43 +0300 Subject: [PATCH 4/5] Delete .nojekyll --- .nojekyll | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .nojekyll diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29bb..000000000 From 71ff37a327974a6e592df9d1b6d1a2a6d31abe6a Mon Sep 17 00:00:00 2001 From: daylight Date: Fri, 1 Nov 2024 17:55:42 +0300 Subject: [PATCH 5/5] Add hourly label --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a4f491eb..77d78afef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Update CDN assets +name: Update CDN assets (hourly) on: schedule: