From d28a5e701937eb6dc561edf17ab3501704d2d405 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 30 Mar 2025 11:13:02 +0300 Subject: [PATCH 001/106] Streamline actions, format and switch to Node.js 22 Signed-off-by: XhmikosR --- .github/dependabot.yml | 42 +++++++++++----------- .github/workflows/codespell.yml | 11 +++--- .github/workflows/editorconfig-checker.yml | 5 ++- .github/workflows/stale.yml | 28 ++++++++------- .github/workflows/stale_pr.yml | 11 +++--- .github/workflows/sync-back-to-dev.yml | 4 ++- .github/workflows/test.yml | 4 ++- 7 files changed, 57 insertions(+), 48 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9dadbca7..00a476c5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,23 +1,23 @@ version: 2 updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: weekly - day: saturday - time: "10:00" - open-pull-requests-limit: 10 - target-branch: development - versioning-strategy: increase - reviewers: - - "pi-hole/web-maintainers" -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: weekly - day: saturday - time: "10:00" - open-pull-requests-limit: 10 - target-branch: development - reviewers: - - "pi-hole/web-maintainers" + - package-ecosystem: npm + directory: "/" + schedule: + interval: weekly + day: saturday + time: "10:00" + open-pull-requests-limit: 10 + target-branch: development + versioning-strategy: increase + reviewers: + - "pi-hole/web-maintainers" + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + day: saturday + time: "10:00" + open-pull-requests-limit: 10 + target-branch: development + reviewers: + - "pi-hole/web-maintainers" diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index a7aeda61..f0545956 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -3,7 +3,7 @@ name: Codespell on: push: branches: - - '**' + - "**" pull_request: types: [opened, synchronize, reopened, ready_for_review] @@ -12,11 +12,12 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - - name: Checkout repository + - name: Clone repository uses: actions/checkout@v4.2.2 - - - name: Spell-Checking + with: + persist-credentials: false + + - name: Spell-Checking uses: codespell-project/actions-codespell@master with: ignore_words_file: .codespellignore diff --git a/.github/workflows/editorconfig-checker.yml b/.github/workflows/editorconfig-checker.yml index c67463b0..6aa9f269 100644 --- a/.github/workflows/editorconfig-checker.yml +++ b/.github/workflows/editorconfig-checker.yml @@ -9,6 +9,9 @@ jobs: name: editorconfig-checker runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.2.2 + - name: Clone repository + uses: actions/checkout@v4.2.2 + with: + persist-credentials: false - uses: editorconfig-checker/action-editorconfig-checker@main - run: editorconfig-checker diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index dc06b505..439bb43c 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,7 +2,7 @@ name: Mark stale issues on: schedule: - - cron: '0 8 * * *' + - cron: "0 8 * * *" workflow_dispatch: issue_comment: @@ -17,17 +17,17 @@ jobs: issues: write steps: - - uses: actions/stale@v9.1.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 30 - days-before-close: 5 - stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.' - stale-issue-label: '${{ env.stale_label }}' - exempt-issue-labels: 'internal, Fixed In Next Release, Bug, never-stale' - exempt-all-issue-assignees: true - operations-per-run: 300 - close-issue-reason: 'not_planned' + - uses: actions/stale@v9.1.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 30 + days-before-close: 5 + stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days." + stale-issue-label: "${{ env.stale_label }}" + exempt-issue-labels: "internal, Fixed In Next Release, Bug, never-stale" + exempt-all-issue-assignees: true + operations-per-run: 300 + close-issue-reason: "not_planned" remove_stale: # trigger "stale" removal immediately when stale issues are commented on @@ -40,8 +40,10 @@ jobs: issues: write # to edit issues label runs-on: ubuntu-latest steps: - - name: Checkout + - name: Clone repository uses: actions/checkout@v4.2.2 + with: + persist-credentials: false - name: Remove 'stale' label run: gh issue edit ${{ github.event.issue.number }} --remove-label ${{ env.stale_label }} env: diff --git a/.github/workflows/stale_pr.yml b/.github/workflows/stale_pr.yml index e446d447..08033013 100644 --- a/.github/workflows/stale_pr.yml +++ b/.github/workflows/stale_pr.yml @@ -5,12 +5,11 @@ name: Close stale PR on: schedule: - - cron: '0 10 * * *' + - cron: "0 10 * * *" workflow_dispatch: jobs: stale: - runs-on: ubuntu-latest permissions: issues: write @@ -27,9 +26,9 @@ jobs: # Close PRs immediately, after marking them 'stale' days-before-pr-close: 0 # only run the action on merge conflict PR - any-of-labels: 'Merge Conflicts' - exempt-pr-labels: 'internal, never-stale, ON HOLD, WIP' + any-of-labels: "Merge Conflicts" + exempt-pr-labels: "internal, never-stale, ON HOLD, WIP" exempt-all-pr-assignees: true operations-per-run: 300 - stale-pr-message: '' - close-pr-message: 'Existing merge conflicts have not been addressed. This PR is considered abandoned.' + stale-pr-message: "" + close-pr-message: "Existing merge conflicts have not been addressed. This PR is considered abandoned." diff --git a/.github/workflows/sync-back-to-dev.yml b/.github/workflows/sync-back-to-dev.yml index cbe3fbc3..0116402c 100644 --- a/.github/workflows/sync-back-to-dev.yml +++ b/.github/workflows/sync-back-to-dev.yml @@ -10,8 +10,10 @@ jobs: runs-on: ubuntu-latest name: Syncing branches steps: - - name: Checkout + - name: Clone repository uses: actions/checkout@v4.2.2 + with: + persist-credentials: false - name: Opening pull request run: gh pr create -B development -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'internal' env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0923091b..51e3fff2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,11 +20,13 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v4.2.2 + with: + persist-credentials: false - name: Set up Node.js uses: actions/setup-node@v4.3.0 with: - node-version: "20.x" + node-version: "22.x" cache: npm - name: Install npm dependencies From f343fac2ab9e2210c1b1a443b468c03798233fa0 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 30 Mar 2025 15:37:00 +0300 Subject: [PATCH 002/106] Remove `x-dns-prefetch-control` meta tag This is now included in FTL Signed-off-by: XhmikosR --- scripts/lua/header.lp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/lua/header.lp b/scripts/lua/header.lp index 6397b9a3..46334395 100644 --- a/scripts/lua/header.lp +++ b/scripts/lua/header.lp @@ -47,12 +47,8 @@ is_authenticated = mg.request_info.is_authenticated - - - Pi-hole <?=hostname?> - From 510b3c84c9c0942d2cf559f96d0d30be81fe381d Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 30 Mar 2025 15:39:07 +0300 Subject: [PATCH 003/106] groups-lists: remove unneeded HTML escape Signed-off-by: XhmikosR --- scripts/js/groups-lists.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/js/groups-lists.js b/scripts/js/groups-lists.js index b5646c06..f8d56b25 100644 --- a/scripts/js/groups-lists.js +++ b/scripts/js/groups-lists.js @@ -552,7 +552,7 @@ function editList() { const dataId = tr.attr("data-id"); const address = utils.hexDecode(tr.attr("data-address")); const enabled = tr.find("#enabled_" + dataId).is(":checked"); - const comment = utils.escapeHtml(tr.find("#comment_" + dataId).val()); + const comment = tr.find("#comment_" + dataId).val(); // Convert list of string integers to list of integers using map(Number) const groups = tr .find("#multiselect_" + dataId) From a5349439b46f24f3c5beed682c814d8b5e81f58c Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 30 Mar 2025 17:56:52 +0300 Subject: [PATCH 004/106] Update Dockerfile Signed-off-by: XhmikosR --- .devcontainer/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 98212f28..5060f0d9 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,7 @@ -FROM node:21-alpine3.18 +FROM node:22-alpine3.21 RUN apk add --no-cache \ - git \ - nano\ - openssh + git \ + nano \ + openssh USER node From edbe0145425a5fb83691115decc36dae3e1088b9 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 31 Mar 2025 17:33:16 +0300 Subject: [PATCH 005/106] login.js: fix deprecated submit() usage Signed-off-by: XhmikosR --- scripts/js/login.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/js/login.js b/scripts/js/login.js index b8ce0aa3..48cf50c5 100644 --- a/scripts/js/login.js +++ b/scripts/js/login.js @@ -110,7 +110,7 @@ function doLogin(password) { }); } -$("#loginform").submit(function (e) { +$("#loginform").on("submit", e => { // Cancel the native submit event (prevent the form from being // submitted) because we want to do a two-step challenge-response login e.preventDefault(); @@ -129,7 +129,7 @@ $("#totp").on("input", function () { const code = $(this).val(); const password = $("#current-password").val(); if (code.length === 6 && password.length > 0) { - $("#loginform").submit(); + $("#loginform").trigger("submit"); } }); From 0bcdec2a28bd00f5445bd79469ea4e9341c2dc06 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Mon, 31 Mar 2025 17:02:26 +0200 Subject: [PATCH 006/106] Fix Local CNAME records records mistake Signed-off-by: yubiuser --- README.md | 2 +- settings-dnsrecords.lp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a2a01623..fedd2a19 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ Lists, domains (block or allow) and regex entries can be managed through groups. **Local DNS Settings:** - Local DNS records - - Local CNAME records records + - Local CNAME records **All Settings** (only visible in Expert mode): - Advanced settings page, containing all available options diff --git a/settings-dnsrecords.lp b/settings-dnsrecords.lp index 0ac2b620..11a4c12d 100644 --- a/settings-dnsrecords.lp +++ b/settings-dnsrecords.lp @@ -59,7 +59,7 @@ mg.include('scripts/lua/settings_header.lp','r')
-

Local CNAME records records

+

Local CNAME records

From 58616bc8afcbf3788df841848fcd1eac802714dd Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 31 Mar 2025 21:30:27 +0200 Subject: [PATCH 007/106] Remove remaining hard-coded /admin/ paths in the webinterface Signed-off-by: DL6ER --- login.lp | 2 +- scripts/js/footer.js | 6 ++++-- scripts/js/logout.js | 2 +- scripts/lua/header_authenticated.lp | 2 +- settings-teleporter.lp | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/login.lp b/login.lp index 450cae74..204daaab 100644 --- a/login.lp +++ b/login.lp @@ -9,7 +9,7 @@ mg.include('scripts/lua/header.lp','r') ?> - +
- - - - + + + + diff --git a/groups-lists.lp b/groups-lists.lp index 3e94e83b..b82204ea 100644 --- a/groups-lists.lp +++ b/groups-lists.lp @@ -94,9 +94,9 @@ mg.include('scripts/lua/header_authenticated.lp','r')
- - - - + + + + diff --git a/groups.lp b/groups.lp index dcf4691d..06db01da 100644 --- a/groups.lp +++ b/groups.lp @@ -79,9 +79,9 @@ mg.include('scripts/lua/header_authenticated.lp','r')
- - - - + + + + diff --git a/index.lp b/index.lp index 4d85c23f..bcbc57e5 100644 --- a/index.lp +++ b/index.lp @@ -279,7 +279,7 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - + + diff --git a/interfaces.lp b/interfaces.lp index 2d5f02ec..d3f1a915 100644 --- a/interfaces.lp +++ b/interfaces.lp @@ -32,5 +32,5 @@ mg.include('scripts/lua/header_authenticated.lp','r') - + diff --git a/login.lp b/login.lp index 204daaab..82f03279 100644 --- a/login.lp +++ b/login.lp @@ -117,7 +117,7 @@ mg.include('scripts/lua/header.lp','r') Donate if you found this useful. - - + + diff --git a/messages.lp b/messages.lp index 9bf440bf..23968958 100644 --- a/messages.lp +++ b/messages.lp @@ -41,6 +41,6 @@ mg.include('scripts/lua/header_authenticated.lp','r') - + diff --git a/network.lp b/network.lp index c4566a36..75545221 100644 --- a/network.lp +++ b/network.lp @@ -64,7 +64,7 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - + + diff --git a/queries.lp b/queries.lp index 929c20f1..e911624e 100644 --- a/queries.lp +++ b/queries.lp @@ -194,9 +194,9 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - - - + + + + diff --git a/scripts/lua/footer.lp b/scripts/lua/footer.lp index eb14d072..34885011 100644 --- a/scripts/lua/footer.lp +++ b/scripts/lua/footer.lp @@ -66,7 +66,7 @@ end - + diff --git a/scripts/lua/header.lp b/scripts/lua/header.lp index 6397b9a3..9f5f77d1 100644 --- a/scripts/lua/header.lp +++ b/scripts/lua/header.lp @@ -114,10 +114,10 @@ is_authenticated = mg.request_info.is_authenticated - - - - - - - + + + + + + + diff --git a/scripts/lua/header_authenticated.lp b/scripts/lua/header_authenticated.lp index cf506ba2..5c6fb4e3 100644 --- a/scripts/lua/header_authenticated.lp +++ b/scripts/lua/header_authenticated.lp @@ -9,18 +9,18 @@ ]]-- mg.include('header.lp','r') ?> - - - - - - - - - - - - + + + + + + + + + + + +