Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sefinek committed Jan 23, 2025
0 parents commit 8756127
Show file tree
Hide file tree
Showing 474 changed files with 11,098,864 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ------------ Main ------------
# development or production
NODE_ENV=development

# ------------ Server ------------
DOMAIN=http://127.0.0.1
PORT=8080
WS_FULL=ws://127.0.0.1:8095
WS_PORT=8095

# ----------- MongoDB -----------
MONGODB_URL=mongodb://127.0.0.1:27017/blocklist-beta

# ----------- URLS -----------
SEFINEK_API=https://api.sefinek.net/api/v2
5 changes: 5 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
github: sefinek
ko_fi: sefinek
buy_me_a_coffee: sefinek
patreon: sefinek
custom: ['https://www.paypal.me/sefinek24']
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
32 changes: 32 additions & 0 deletions .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Broken Links

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "00 18 * * *"

jobs:
linkChecker:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: main

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
fail: false

- name: Create Issue From File
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
91 changes: 91 additions & 0 deletions .github/workflows/download-blocklists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Download and generate blocklists

on:
schedule: # https://crontab.guru
- cron: '0 */3 * * *' # At minute 0 past every 3rd hour.

workflow_dispatch:

jobs:
download:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: main

- name: Download blocklists
run: bash bash/download.sh

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Prepare templates
run: node scripts/prepare-templates.js

- name: Remove duplicates from templates
run: node scripts/remove-duplicates.js

- name: Remove domains that are on the whitelist
run: node scripts/whitelist.js

- name: Set valid encoding
run: node scripts/set-valid-encoding.js

- name: Count domains
run: node scripts/update-number-of-domains.js

- name: Generate No IP list
run: node scripts/generate/noip.js

- name: Generate 0.0.0.0 list
run: node scripts/generate/0.0.0.0.js

- name: Generate 127.0.0.1 list
run: node scripts/generate/127.0.0.1.js

- name: Generate AdGuard list
run: node scripts/generate/adguard.js

- name: Generate Dnsmasq list
run: node scripts/generate/dnsmasq.js

- name: Generate RPZ list
run: node scripts/generate/rpz.js

- name: Generate list for Unbound
run: node scripts/generate/unbound.js

- name: Lint
run: node scripts/lint.js

- name: Run git pull
run: git pull origin main

- name: Add files to staging
run: git add .

- name: Commit and push changes
run: |
git config user.name "Sefinek Actions"
git config user.email "[email protected]"
if [ -n "$(git status -s)" ]; then
MODIFIED_FILES=$(git diff --name-only HEAD | grep -v '^cache/')
FILE_COUNT=$(echo "$MODIFIED_FILES" | wc -l)
if [ "$FILE_COUNT" -gt 0 ]; then
git commit -am "Main blocklist update every 3h [$FILE_COUNT files] - $(date -u '+%Y-%m-%d %H:%M:%S UTC')" -m "$MODIFIED_FILES"
git push origin main
else
echo "Canceled. No files to commit after excluding cache/ files."
fi
else
echo "Canceled. No changes to commit."
fi
18 changes: 18 additions & 0 deletions .github/workflows/issue-assignment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Issue assignment

on:
issues:
types: [opened]

jobs:
auto-assign:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Auto-assign issue
uses: pozil/auto-assign-issue@v2
with:
assignees: sefinek
numOfAssignee: 1
allowSelfAssign: false
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on:
push:
paths:
- 'blocklists/**'

pull_request:
types: [opened, synchronize]
paths:
- 'blocklists/**'

workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x

- run: node scripts/lint.js
73 changes: 73 additions & 0 deletions .github/workflows/sefin-lists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Update Sefinek's lists

on:
schedule: # https://crontab.guru
- cron: '0 10 * * *' # At 10:00.

workflow_dispatch:

jobs:
sefin-lists:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: main

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Download lists
run: node scripts/generate/file-processor/download.js --expose-gc

- name: Generate lists
run: node scripts/generate/file-processor/generate.js

- name: Regex check
run: node scripts/generate/file-processor/regex.js

- name: Generate header
run: node scripts/generate/file-processor/header.js

- name: Prepare templates
run: node scripts/prepare-templates.js

- name: Remove duplicates from templates
run: node scripts/remove-duplicates.js

- name: Remove domains that are on the whitelist
run: node scripts/whitelist.js

- name: Count domains
run: node scripts/update-number-of-domains.js

- name: Run git pull
run: git pull origin main

- name: Add files to staging
run: git add .

- name: Commit and push changes
run: |
git config user.name "Sefinek Actions"
git config user.email "[email protected]"
if [ -n "$(git status -s)" ]; then
MODIFIED_FILES=$(git diff --name-only HEAD | grep -v '^cache/')
FILE_COUNT=$(echo "$MODIFIED_FILES" | wc -l)
if [ "$FILE_COUNT" -gt 0 ]; then
git commit -am "Update of Sefinek's lists [$FILE_COUNT files]" -m "$MODIFIED_FILES"
git push origin main
else
echo "Canceled. No files to commit after excluding cache/ files."
fi
else
echo "Canceled. No changes to commit."
fi
88 changes: 88 additions & 0 deletions .github/workflows/update-blocklists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Update manually approved blocklists

on:
push:
branches:
- main
paths:
- '**.txt'

workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: main

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Prepare templates
run: node scripts/prepare-templates.js

- name: Remove duplicates from templates
run: node scripts/remove-duplicates.js

- name: Remove domains that are on the whitelist
run: node scripts/whitelist.js

- name: Set valid encoding
run: node scripts/set-valid-encoding.js

- name: Count domains
run: node scripts/update-number-of-domains.js

- name: Generate No IP list
run: node scripts/generate/noip.js

- name: Generate 0.0.0.0 list
run: node scripts/generate/0.0.0.0.js

- name: Generate 127.0.0.1 list
run: node scripts/generate/127.0.0.1.js

- name: Generate AdGuard list
run: node scripts/generate/adguard.js

- name: Generate Dnsmasq list
run: node scripts/generate/dnsmasq.js

- name: Generate RPZ list
run: node scripts/generate/rpz.js

- name: Generate list for Unbound
run: node scripts/generate/unbound.js

- name: Run git pull
run: git pull origin main

- name: Add files to staging
run: git add .

- name: Commit and push changes
run: |
git config user.name "Sefinek Actions"
git config user.email "[email protected]"
if [ -n "$(git status -s)" ]; then
MODIFIED_FILES=$(git diff --name-only HEAD | grep -v '^cache/')
FILE_COUNT=$(echo "$MODIFIED_FILES" | wc -l)
if [ "$FILE_COUNT" -gt 0 ]; then
git commit -am "Update previously committed blocklists in $GITHUB_SHA [$FILE_COUNT files]" -m "$MODIFIED_FILES"
git push origin main
else
echo "Canceled. No files to commit after excluding cache/ files."
fi
else
echo "Canceled. No changes to commit."
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.env
tmp
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/Sefinek-Blocklist-Collection.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8756127

Please sign in to comment.