From 7309a53356dae9870e1b09cf4cb1829badfabb71 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Wed, 14 Jun 2023 13:09:09 +0300 Subject: [PATCH 1/2] Pull request 1874: upd-github-templates Merge in DNS/adguard-home from upd-github-templates to master Squashed commit of the following: commit 713a98668e5ee1fa3d64881496043b499ad6ac09 Author: Ainar Garipov Date: Tue Jun 13 20:10:35 2023 +0300 all: imp github issue templates more commit 308a3fcd5564d7536b6ae1192cd17c04b6752ea1 Author: Ainar Garipov Date: Tue Jun 13 19:38:28 2023 +0300 all: imp issue tmpls --- .github/ISSUE_TEMPLATE/bug.yml | 130 ++++++++++++++------- .github/ISSUE_TEMPLATE/feature.yml | 35 ++++-- .github/PULL_REQUEST_TEMPLATE | 20 ++++ .github/workflows/potential-duplicates.yml | 18 +++ 4 files changed, 147 insertions(+), 56 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE create mode 100644 .github/workflows/potential-duplicates.yml diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index a5c40e4f..98db03e0 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -10,52 +10,58 @@ - 'label': > I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and - [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions) + [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a) and found no answer 'required': true - 'label': > I have searched other issues and found no duplicates 'required': true - 'label': > - I want to report a bug and not ask a question + I want to report a bug and not [ask a question or ask for + help](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a) + 'required': true + - 'label': > + I have set up AdGuard Home correctly and [configured clients to + use it](https://github.com/AdguardTeam/AdGuardHome/wiki/Clients). + (Use the + [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a) + for help with installing and configuring clients.) 'required': true 'id': 'prerequisites' 'type': 'checkboxes' - 'attributes': - 'description': 'On which operating system type does the issue occur?' - 'label': 'Operating system type' + 'description': 'On which Platform does the issue occur?' + 'label': 'Platform (OS and CPU architecture)' 'options': - - 'FreeBSD' - - 'Linux, OpenWrt' - - 'Linux, Other (please mention the version in the description)' - - 'macOS (aka Darwin)' - - 'OpenBSD' - - 'Windows' - - 'Other (please mention in the description)' + - 'Darwin (aka macOS)/AMD64 (aka x86_64)' + - 'Darwin (aka macOS)/ARM64' + - 'FreeBSD/386' + - 'FreeBSD/AMD64 (aka x86_64)' + - 'FreeBSD/ARM64' + - 'FreeBSD/ARMv5' + - 'FreeBSD/ARMv6' + - 'FreeBSD/ARMv7' + - 'Linux/386' + - 'Linux/AMD64 (aka x86_64)' + - 'Linux/ARM64' + - 'Linux/ARMv5' + - 'Linux/ARMv6' + - 'Linux/ARMv7' + - 'Linux/MIPS LE' + - 'Linux/MIPS' + - 'Linux/MIPS64 LE' + - 'Linux/MIPS64' + - 'Linux/PPC64 LE' + - 'OpenBSD/AMD64 (aka x86_64)' + - 'OpenBSD/ARM64' + - 'Windows/386' + - 'Windows/AMD64 (aka x86_64)' + - 'Windows/ARM64' + - 'Custom (please mention in the description)' 'id': 'os' 'type': 'dropdown' 'validations': 'required': true - - 'attributes': - 'description': 'On which CPU architecture does the issue occur?' - 'label': 'CPU architecture' - 'options': - - 'AMD64' - - 'x86' - - '64-bit ARM' - - 'ARMv5' - - 'ARMv6' - - 'ARMv7' - - '64-bit MIPS' - - '64-bit MIPS LE' - - '32-bit MIPS' - - '32-bit MIPS LE' - - '64-bit PowerPC LE' - - 'Other (please mention in the description)' - 'id': 'arch' - 'type': 'dropdown' - 'validations': - 'required': true - 'attributes': 'description': 'How did you install AdGuard Home?' 'label': 'Installation' @@ -63,7 +69,7 @@ - 'GitHub releases or script from README' - 'Docker' - 'Snapcraft' - - 'Custom port' + - 'Custom package (OpenWrt, HomeAssistant, etc; please mention in the description)' - 'Other (please mention in the description)' 'id': 'install' 'type': 'dropdown' @@ -89,21 +95,55 @@ 'validations': 'required': true - 'attributes': - 'description': 'Please describe the bug' - 'label': 'Description' + 'description': > + Please describe what you did. An `nslookup` or a `dig` command is + the best way. For crashes, please provide a full failure log. + 'label': 'Action' 'value': | - #### What did you do? - - #### Expected result - - #### Actual result - - #### Screenshots (if applicable) - - #### Additional information - 'id': 'description' + ```sh + nslookup -debug -type=a 'www.example.com' '$YOUR_AGH_ADDRESS' + ``` + 'id': 'failing_action' 'type': 'textarea' 'validations': 'required': true -'description': 'File a bug report' + - 'attributes': + 'description': > + What did you expect to see? Please add a description and/or + screenshots, if applicable. + 'label': 'Expected result' + 'placeholder': > + What did you expect to see? + 'id': 'expected' + 'type': 'textarea' + 'validations': + 'required': true + - 'attributes': + 'description': > + What happened instead? Please add a description and/or screenshots, + if applicable. + 'label': 'Actual result' + 'placeholder': > + What did you see instead? + 'id': 'result' + 'type': 'textarea' + 'validations': + 'required': true + - 'attributes': + 'description': > + Please add additional information, such as non-standard OS or port, + here. You can also put screenshots here, if applicable. For + example, it is better to copy and paste text from a terminal instead + of posting a screenshot of the terminal. + 'label': 'Additional information and/or screenshots' + 'placeholder': > + Additional OS information, screenshots of the UI, etc. + 'id': 'additional' + 'type': 'textarea' + 'validations': + 'required': false +'description': > + Open a bug report. Please do not open bug reports for questions or help + with configuring clients. If you want to ask for help, use the Discussions + section. 'name': 'Bug' diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index 0ad6f5d8..154a137d 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -23,19 +23,32 @@ 'id': 'prerequisites' 'type': 'checkboxes' - 'attributes': - 'description': 'Please describe the request' - 'label': 'Description' - 'value': | - #### What problem are you trying to solve? - - #### Proposed solution - - #### Alternatives considered - - #### Additional information - 'id': 'description' + 'description': 'Please describe the problem you are trying to solve' + 'label': 'The problem' + 'placeholder': > + Please describe the problem you are trying to solve + 'id': 'problem' 'type': 'textarea' 'validations': 'required': true + - 'attributes': + 'description': 'What feature are you proposing to solve this problem?' + 'label': 'Proposed solution' + 'placeholder': > + What feature are you proposing to solve this problem? + 'id': 'proposed_solution' + 'type': 'textarea' + 'validations': + 'required': true + - 'attributes': + 'label': 'Alternatives considered and additional information' + 'placeholder': > + Are there any other ways to solve the problem? + 'id': 'additional' + 'type': 'textarea' + 'validations': + 'required': false 'description': 'Suggest a feature or an enhancement for AdGuard Home' +'labels': + - 'feature request' 'name': 'Feature request or enhancement' diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000..d969343d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE @@ -0,0 +1,20 @@ +Before submitting a PR please make sure that: + +1. You have discussed your solution in an issue and have got an + approval from a maintainer. + +2. This isn't a localization fix; please send those to our + [CrowdIn](https://crowdin.com/project/adguard-applications/en#/adguard-home) + page. + +3. Your code follows our + [code guidelines](https://github.com/AdguardTeam/CodeGuidelines/blob/master/Go/Go.md). + +Add a short description here. The description should include: + +1. Which issue this PR closes (`Closes #NNNN.`) or updates (`Updates + #NNNN.`). + +2. A short description of how the change achieves that. + +Do not forget to remove these instructions. diff --git a/.github/workflows/potential-duplicates.yml b/.github/workflows/potential-duplicates.yml new file mode 100644 index 00000000..dd065845 --- /dev/null +++ b/.github/workflows/potential-duplicates.yml @@ -0,0 +1,18 @@ +'name': 'potential-duplicates' +'on': + 'issues': + 'types': + - 'opened' +'jobs': + 'run': + 'runs-on': 'ubuntu-latest' + 'steps': + - 'uses': 'wow-actions/potential-duplicates@v1' + 'with': + 'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}' + 'state': 'all' + 'threshold': 0.6 + 'comment': | + Potential duplicates: {{#issues}} + * [#{{ number }}] {{ title }} ({{ accuracy }}%) + {{/issues}} From d3ada9881ac0333deeaa13a77a78d6c4d891d14b Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Wed, 14 Jun 2023 15:08:57 +0300 Subject: [PATCH 2/2] Pull request 1854: 951-blocked-services-schedule Merge in DNS/adguard-home from 951-blocked-services-schedule to master Squashed commit of the following: commit 0f0770292f8aa9dc0dddc05edefacf6655f329b8 Merge: 2705fbcfb 7309a5335 Author: Stanislav Chzhen Date: Wed Jun 14 15:00:56 2023 +0300 Merge branch 'master' into 951-blocked-services-schedule commit 2705fbcfba57392bcc0fa9b6e1f1dfdce9796963 Author: Stanislav Chzhen Date: Wed Jun 14 14:56:01 2023 +0300 schedule: imp field alignment commit ff8fa040558e97192a5a2c91c1d5722c67d88b3d Merge: f99936f36 9fda7bfd3 Author: Stanislav Chzhen Date: Tue Jun 13 11:49:15 2023 +0300 Merge branch 'master' into 951-blocked-services-schedule commit f99936f36be3453b50d772ce10bfdc1ad14879c5 Author: Stanislav Chzhen Date: Fri Jun 9 19:14:06 2023 +0300 schedule: add tests commit 8436c2c5675d5cc22a3554ded2ce4a49eeeefc91 Author: Stanislav Chzhen Date: Thu Jun 8 20:10:03 2023 +0300 schedule: imp code commit 850a3d93e659e0584bd449cf5af3f13b36be9e62 Author: Stanislav Chzhen Date: Thu Jun 8 18:57:23 2023 +0300 schedule: imp tests commit d54c42b782a4a806d2f35abbea1826ba6394a64c Merge: 21dfa51ea 156c199bb Author: Stanislav Chzhen Date: Thu Jun 8 18:12:03 2023 +0300 Merge branch 'master' into 951-blocked-services-schedule commit 21dfa51ea7441c655ac39f2cbceeaa598d364bff Author: Stanislav Chzhen Date: Thu Jun 8 18:02:47 2023 +0300 all: add todo commit d0d4532c8911fb6365f6af66ceb72a70b158b77d Author: Stanislav Chzhen Date: Wed Jun 7 18:54:44 2023 +0300 all: upd chlog commit dc1d55fa23c0ec8e7f7b7cd25d3d0cbf3e51e236 Author: Stanislav Chzhen Date: Wed Jun 7 17:34:28 2023 +0300 all: add tests commit 601775307c2b23fa9d6cf2aa271793e8fd5f1797 Author: Stanislav Chzhen Date: Wed Jun 7 13:20:00 2023 +0300 all: add schedule pkg commit e0bcad0193a559a89f5f5052f5a985fa730d23be Author: Stanislav Chzhen Date: Fri Jun 2 13:03:04 2023 +0300 filtering: add test case commit da7a7c20c84151ff83414cb5d576a91740a1be7e Author: Stanislav Chzhen Date: Wed May 31 15:31:48 2023 +0300 filtering: imp code commit 9845a11cdae25eafe39a50f8cdc408fefe1fd746 Author: Stanislav Chzhen Date: Mon May 29 17:46:24 2023 +0300 filtering: add type check commit f4bcea8ad90d584ceff236ccce4f246e391e0e33 Author: Stanislav Chzhen Date: Mon May 29 17:37:25 2023 +0300 all: imp code commit 9de3a0f37eb65d0db2431c27dd4d69136c1485a7 Author: Stanislav Chzhen Date: Mon May 29 15:20:33 2023 +0300 filtering: imp err msg commit 1befab59cf2a12a3bc8296066ce1115dff5a8843 Author: Stanislav Chzhen Date: Mon May 29 14:31:14 2023 +0300 filtering: imp tests commit 09506f924f363f1563009cec0c44ad40d08b8ddd Author: Stanislav Chzhen Date: Fri May 26 18:44:12 2023 +0300 filtering: add tests commit 36c42f523fcfe7fa6dca5f6f13e6c79f491c1ad5 Author: Stanislav Chzhen Date: Fri May 26 17:57:01 2023 +0300 all: fix typos commit 69399cd3ea17691ff0848baf43ff09b18b82114c Author: Stanislav Chzhen Date: Thu May 25 18:50:51 2023 +0300 all: upd chlog ... and 2 more commits --- CHANGELOG.md | 58 +++ internal/dnsforward/filter.go | 6 +- internal/filtering/blocked.go | 32 +- internal/filtering/filtering.go | 27 +- internal/filtering/http.go | 6 +- internal/home/config.go | 6 + internal/home/dns.go | 4 +- internal/home/upgrade.go | 53 ++- internal/home/upgrade_test.go | 43 +++ internal/schedule/schedule.go | 220 ++++++++++++ internal/schedule/schedule_internal_test.go | 371 ++++++++++++++++++++ 11 files changed, 798 insertions(+), 28 deletions(-) create mode 100644 internal/schedule/schedule.go create mode 100644 internal/schedule/schedule_internal_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 88ca9e69..d23c574c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,9 +25,67 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Added +- The ability to set inactivity periods for filtering blocked services in the + configuration file ([#951]). The UI changes are coming in the upcoming + releases. - The ability to edit rewrite rules via `PUT /control/rewrite/update` HTTP API ([#1577]). +### Changed + +#### Configuration Changes + +In this release, the schema version has changed from 20 to 21. + +- Property `dns.blocked_services`, which in schema versions 20 and earlier used + to be a list containing ids of blocked services, is now an object containing + ids and schedule for blocked services: + + ```yaml + # BEFORE: + 'blocked_services': + - id_1 + - id_2 + + # AFTER: + 'blocked_services': + 'ids': + - id_1 + - id_2 + 'schedule': + 'time_zone': 'Local' + 'sun': + 'start': '0s' + 'end': '24h' + 'mon': + 'start': '10m' + 'end': '23h30m' + 'tue': + 'start': '20m' + 'end': '23h' + 'wed': + 'start': '30m' + 'end': '22h30m' + 'thu': + 'start': '40m' + 'end': '22h' + 'fri': + 'start': '50m' + 'end': '21h30m' + 'sat': + 'start': '1h' + 'end': '21h' + ``` + + To rollback this change, replace `dns.blocked_services` object with the list + of ids of blocked services and change the `schema_version` back to `20`. + +### Fixed + + - DNSCrypt upstream not resetting the client and resolver information on + dialing errors ([#5872]). + +[#951]: https://github.com/AdguardTeam/AdGuardHome/issues/951 [#1577]: https://github.com/AdguardTeam/AdGuardHome/issues/1577