mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-06-28 03:41:19 +00:00
Pull request 2674: custom-flt-upd-ivl
Some checks failed
build / test (macOS-latest) (push) Has been cancelled
build / test (ubuntu-latest) (push) Has been cancelled
build / test (windows-latest) (push) Has been cancelled
lint / go-lint (push) Has been cancelled
lint / eslint (push) Has been cancelled
build / build-release (push) Has been cancelled
build / notify (push) Has been cancelled
lint / notify (push) Has been cancelled
Some checks failed
build / test (macOS-latest) (push) Has been cancelled
build / test (ubuntu-latest) (push) Has been cancelled
build / test (windows-latest) (push) Has been cancelled
lint / go-lint (push) Has been cancelled
lint / eslint (push) Has been cancelled
build / build-release (push) Has been cancelled
build / notify (push) Has been cancelled
lint / notify (push) Has been cancelled
Squashed commit of the following: commit37db2dd9d3Author: Ainar Garipov <a.garipov@adguard.com> Date: Tue Jun 9 20:37:36 2026 +0300 filtering: imp docs commit1ebd8f30c6Author: Ainar Garipov <a.garipov@adguard.com> Date: Tue Jun 9 17:55:40 2026 +0300 all: allow custom filter update intervals
This commit is contained in:
parent
36600da549
commit
54e6e30022
11 changed files with 38 additions and 21 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -6,7 +6,7 @@
|
|||
# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions.
|
||||
'permissions': {}
|
||||
'env':
|
||||
'GO_VERSION': '1.26.3'
|
||||
'GO_VERSION': '1.26.4'
|
||||
'NODE_VERSION': '20'
|
||||
'on':
|
||||
'push':
|
||||
|
|
|
|||
|
|
@ -26,12 +26,16 @@ NOTE: Add new changes BELOW THIS COMMENT.
|
|||
|
||||
### Security
|
||||
|
||||
- Go version has been updated to prevent the possibility of exploiting the Go vulnerabilities fixed in [1.26.4][go-1.26.4].
|
||||
|
||||
- The H2C connection establishment via HTTP/1.1 request upgrade is no longer supported. See [RFC 9113][rfc9113].
|
||||
|
||||
- The size of rulelists is limited. This is necessary to prevent a user's machine from becoming overloaded if the filter source misbehaves.
|
||||
- The size of rulelists is limited. This is necessary to prevent a user's machine from becoming overloaded if the filter source misbehaves.
|
||||
|
||||
### Changed
|
||||
|
||||
- The interval of filter updates can now be set to any number of ours between 0 and 365 days in the configuration file.
|
||||
|
||||
#### Configuration changes
|
||||
|
||||
- The `filtering` object of the YAML configuration now includes a new property, `max_http_size`, which defines the maximum size of the HTTP request for rulelists. To disable the limitation, set a large size, such as `1 TB`.
|
||||
|
|
@ -40,7 +44,8 @@ NOTE: Add new changes BELOW THIS COMMENT.
|
|||
|
||||
- Blocked services check on the Custom filtering rules page does not work properly without specifying of a client.
|
||||
|
||||
[rfc9113]: https://datatracker.ietf.org/doc/html/rfc9113
|
||||
[rfc9113]: https://datatracker.ietf.org/doc/html/rfc9113
|
||||
[go-1.26.4]: https://groups.google.com/g/golang-announce/c/tKs3rmcBcKw
|
||||
|
||||
<!--
|
||||
NOTE: Add new changes ABOVE THIS COMMENT.
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -25,7 +25,7 @@ DIST_DIR = dist
|
|||
GOAMD64 = v1
|
||||
GOPROXY = https://proxy.golang.org|direct
|
||||
GOTELEMETRY = off
|
||||
GOTOOLCHAIN = go1.26.3
|
||||
GOTOOLCHAIN = go1.26.4
|
||||
GPG_KEY = devteam@adguard.com
|
||||
GPG_KEY_PASSPHRASE = not-a-real-password
|
||||
NPM = npm
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
'cacheBuster': '0'
|
||||
'channel': 'edge'
|
||||
'dockerFrontend': 'adguard/home-js-builder:4.0'
|
||||
'dockerGo': 'adguard/go-builder:1.26.3--1'
|
||||
'dockerGo': 'adguard/go-builder:1.26.4--1'
|
||||
|
||||
'stages':
|
||||
- 'Build frontend':
|
||||
|
|
@ -280,7 +280,7 @@
|
|||
'variables':
|
||||
'channel': 'beta'
|
||||
'dockerFrontend': 'adguard/home-js-builder:4.0'
|
||||
'dockerGo': 'adguard/go-builder:1.26.3--1'
|
||||
'dockerGo': 'adguard/go-builder:1.26.4--1'
|
||||
# release-vX.Y.Z branches are the branches from which the actual final
|
||||
# release is built.
|
||||
- '^release-v[0-9]+\.[0-9]+\.[0-9]+':
|
||||
|
|
@ -296,4 +296,4 @@
|
|||
'variables':
|
||||
'channel': 'release'
|
||||
'dockerFrontend': 'adguard/home-js-builder:4.0'
|
||||
'dockerGo': 'adguard/go-builder:1.26.3--1'
|
||||
'dockerGo': 'adguard/go-builder:1.26.4--1'
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
'cacheBuster': '0'
|
||||
'channel': 'development'
|
||||
'dockerFrontend': 'adguard/home-js-builder:4.0'
|
||||
'dockerGo': 'adguard/go-builder:1.26.3--1'
|
||||
'dockerGo': 'adguard/go-builder:1.26.4--1'
|
||||
|
||||
'stages':
|
||||
- 'Tests':
|
||||
|
|
@ -255,5 +255,5 @@
|
|||
# may need to build a few of these.
|
||||
'variables':
|
||||
'dockerFrontend': 'adguard/home-js-builder:4.0'
|
||||
'dockerGo': 'adguard/go-builder:1.26.3--1'
|
||||
'dockerGo': 'adguard/go-builder:1.26.4--1'
|
||||
'channel': 'candidate'
|
||||
|
|
|
|||
|
|
@ -4,20 +4,17 @@ import { Trans, useTranslation } from 'react-i18next';
|
|||
|
||||
import i18next from 'i18next';
|
||||
import { toNumber } from '../../../helpers/form';
|
||||
import { DAY, FILTERS_INTERVALS_HOURS, FILTERS_RELATIVE_LINK } from '../../../helpers/constants';
|
||||
import { DAY_HOURS, FILTERS_INTERVALS_HOURS, FILTERS_RELATIVE_LINK } from '../../../helpers/constants';
|
||||
import { Checkbox } from '../../ui/Controls/Checkbox';
|
||||
import { Select } from '../../ui/Controls/Select';
|
||||
|
||||
const THREE_DAYS_INTERVAL = DAY * 3;
|
||||
const SEVEN_DAYS_INTERVAL = DAY * 7;
|
||||
|
||||
const getTitleForInterval = (interval: number) => {
|
||||
if (interval === 0) {
|
||||
return i18next.t('disabled');
|
||||
}
|
||||
|
||||
if (interval === THREE_DAYS_INTERVAL || interval === SEVEN_DAYS_INTERVAL) {
|
||||
return i18next.t('interval_days', { count: interval / DAY });
|
||||
if (interval % DAY_HOURS === 0) {
|
||||
return i18next.t('interval_days', { count: interval / DAY_HOURS });
|
||||
}
|
||||
|
||||
return i18next.t('interval_hours', { count: interval });
|
||||
|
|
@ -58,6 +55,10 @@ export const FiltersConfig = ({ initialValues, setFiltersConfig, processing }: P
|
|||
a: <a href={FILTERS_RELATIVE_LINK} rel="noopener noreferrer" />,
|
||||
};
|
||||
|
||||
const options = FILTERS_INTERVALS_HOURS.includes(initialValues.interval)
|
||||
? FILTERS_INTERVALS_HOURS
|
||||
: [...FILTERS_INTERVALS_HOURS, initialValues.interval];
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="row">
|
||||
|
|
@ -99,7 +100,7 @@ export const FiltersConfig = ({ initialValues, setFiltersConfig, processing }: P
|
|||
const { value } = e.target;
|
||||
field.onChange(toNumber(value));
|
||||
}}>
|
||||
{FILTERS_INTERVALS_HOURS.map((interval) => (
|
||||
{options.map((interval) => (
|
||||
<option value={interval} key={interval}>
|
||||
{getTitleForInterval(interval)}
|
||||
</option>
|
||||
|
|
|
|||
|
|
@ -169,7 +169,9 @@ export const DISABLED_STATS_INTERVAL = 0;
|
|||
|
||||
export const HOUR = 60 * 60 * 1000;
|
||||
|
||||
export const DAY = HOUR * 24;
|
||||
export const DAY_HOURS = 24;
|
||||
|
||||
export const DAY = HOUR * DAY_HOURS;
|
||||
|
||||
export const STATS_INTERVALS_DAYS = [DAY, DAY * 7, DAY * 30, DAY * 90];
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
# needed. Keep it in sync with bamboo-specs/bamboo.yaml.
|
||||
|
||||
# NOTE: Keep in sync with bamboo-specs/bamboo.yaml.
|
||||
ARG BASE_IMAGE=adguard/go-builder:1.26.3--1
|
||||
ARG BASE_IMAGE=adguard/go-builder:1.26.4--1
|
||||
|
||||
# The dependencies stage is needed to install packages and tool dependencies.
|
||||
# This is also where binaries like osslsigncode, which may be required for tests
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/AdguardTeam/AdGuardHome
|
||||
|
||||
go 1.26.3
|
||||
go 1.26.4
|
||||
|
||||
require (
|
||||
github.com/AdguardTeam/dnsproxy v0.81.4
|
||||
|
|
|
|||
|
|
@ -760,7 +760,10 @@ func (d *DNSFilter) RegisterFilteringHandlers() {
|
|||
registerHTTP(http.MethodGet, "/control/filtering/check_host", d.handleCheckHost)
|
||||
}
|
||||
|
||||
// maxUpdateIvlHours is the maximum allowed filter update interval in hours.
|
||||
const maxUpdateIvlHours = 365 * 24
|
||||
|
||||
// ValidateUpdateIvl returns false if i is not a valid filters update interval.
|
||||
func ValidateUpdateIvl(i uint32) bool {
|
||||
return i == 0 || i == 1 || i == 12 || i == 1*24 || i == 3*24 || i == 7*24
|
||||
func ValidateUpdateIvl(i uint32) (ok bool) {
|
||||
return i <= maxUpdateIvlHours
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
<!-- TODO(a.garipov): Reformat in accordance with the KeepAChangelog spec. -->
|
||||
|
||||
## v0.107.78: API changes
|
||||
|
||||
### New `interval` values in `GET /control/filtering/status` and `POST /control/filtering/config` APIs
|
||||
|
||||
The property `interval` of the objects returned from and accepted by the aforementioned APIs can now be any integer between 0 and 8760 (365 days).
|
||||
|
||||
## v0.107.77: API changes
|
||||
|
||||
### New `reason` query parameter in 'GET /control/querylog'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue