Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workflow and update readme #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Update CDN assets
name: Update CDN assets (hourly)

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:
Expand All @@ -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: |
Expand Down
Empty file removed .nojekyll
Empty file.
59 changes: 32 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- <https://ublockorigin.github.io/uAssetsCDN/>
- <https://ublockorigin.pages.dev/>
- <https://www.jsdelivr.com/package/gh/uBlockOrigin/uAssetsCDN>
- <https://cdn.statically.io/>
### 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/)
73 changes: 38 additions & 35 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<title>uAssetsCDN</title>
</head>

<body>
<h1>uAssetsCDN</h1>
<p>CDN content mirroring uAssets.</p>
<p>This site is used as a <a href="https://en.wikipedia.org/wiki/Content_delivery_network">Content Delivery Network</a> for <a href="https://github.com/uBlockOrigin/uAssets/tree/master/filters">uBlock Origin's own filter lists</a>:</p>
<ul>
<li><a href="./ublock/assets.json">uBlock's <code>assets.json</code></a> (internal)</li>
<li><a href="./ublock/assets.dev.json">uBlock's <code>assets.dev.json</code></a> (internal)</li>
<li><a href="./filters/badlists.txt">Bad filter lists</a> (internal)</li>
<li>uBlock filter lists
<ul>
<li><a href="./filters/filters.min.txt">uBlock filters – Ads</a> (default)</li>
<li><a href="./filters/privacy.min.txt">uBlock filters – Privacy</a> (default)</li>
<li><a href="./filters/badware.txt">uBlock filters – Badware risks</a> (default)</li>
<li><a href="./filters/quick-fixes.txt">uBlock filters – Quick fixes</a> (default)</li>
<li><a href="./filters/unbreak.txt">uBlock filters – Unbreak</a> (default)</li>
<li><a href="./filters/annoyances.txt">uBlock filters – Annoyances</a></li>
<li><a href="./filters/lan-block.txt">Block Outsider Intrusion into LAN</a></li>
</ul>
</li>
<li>EasyList filter lists
<ul>
<li><a href="./thirdparties/easylist.txt">EasyList – Ads</a> (default)</li>
<li><a href="./thirdparties/easyprivacy.txt">EasyPrivacy</a> (default)</li>
<li>EasyList – Annoyances</li>
<h1>uAssetsCDN</h1>
<p>CDN content mirroring uAssets.</p>
<p>This site is used as a <a href="https://en.wikipedia.org/wiki/Content_delivery_network">Content Delivery Network</a> for
<a href="https://github.com/uBlockOrigin/uAssets/tree/master/filters">uBlock Origin's own filter lists</a>:
</p>
<ul>
<li><a href="./thirdparties/easylist-annoyances.txt">EasyList – Annoyances</a></li>
<li><a href="./thirdparties/easylist-cookies.txt">EasyList – Cookie Notices</a></li>
<li><a href="./thirdparties/easylist-newsletters.txt">EasyList – Newsletter Notices</a></li>
<li><a href="./thirdparties/easylist-notifications.txt">EasyList – Notifications</a></li>
<li><a href="./thirdparties/easylist-social.txt">EasyList – Social Widgets</a></li>
<li><a href="./ublock/assets.json">uBlock's <code>assets.json</code></a> (internal)</li>
<li><a href="./ublock/assets.dev.json">uBlock's <code>assets.dev.json</code></a> (internal)</li>
<li><a href="./filters/badlists.txt">Bad filter lists</a> (internal)</li>
<li>uBlock filter lists
<ul>
<li><a href="./filters/filters.min.txt">uBlock filters – Ads</a> (default)</li>
<li><a href="./filters/privacy.min.txt">uBlock filters – Privacy</a> (default)</li>
<li><a href="./filters/badware.txt">uBlock filters – Badware risks</a> (default)</li>
<li><a href="./filters/quick-fixes.txt">uBlock filters – Quick fixes</a> (default)</li>
<li><a href="./filters/unbreak.txt">uBlock filters – Unbreak</a> (default)</li>
<li><a href="./filters/annoyances.txt">uBlock filters – Annoyances</a></li>
<li><a href="./filters/lan-block.txt">Block Outsider Intrusion into LAN</a></li>
</ul>
</li>
<li>EasyList filter lists
<ul>
<li><a href="./thirdparties/easylist.txt">EasyList – Ads</a> (default)</li>
<li><a href="./thirdparties/easyprivacy.txt">EasyPrivacy</a> (default)</li>
<li>EasyList – Annoyances
<ul>
<li><a href="./thirdparties/easylist-annoyances.txt">EasyList – Annoyances</a></li>
<li><a href="./thirdparties/easylist-cookies.txt">EasyList – Cookie Notices</a></li>
<li><a href="./thirdparties/easylist-newsletters.txt">EasyList – Newsletter Notices</a></li>
<li><a href="./thirdparties/easylist-notifications.txt">EasyList – Notifications</a></li>
<li><a href="./thirdparties/easylist-social.txt">EasyList – Social Widgets</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</ul>
</ul>
</body>
</html>