Compare commits

...

7 Commits

Author SHA1 Message Date
Andrey Meshkov
d2bf1e176e Update urlfilter to v0.11.2 2020-07-23 20:48:50 +03:00
Simon Zolin
ffeb88ac0c * openapi: update changelog
Squashed commit of the following:

commit a42d1762c2ffbfe65d728a5e76a3d0c5cc03a9c5
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu Jul 23 19:17:05 2020 +0300

    * openapi: update changelog
2020-07-23 19:25:42 +03:00
Simon Zolin
c71b8d3ad2 * use urlfilter v0.11.1
Squashed commit of the following:

commit 35d2c34355b093ec1daa40f156809a7cae089c20
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu Jul 23 18:00:43 2020 +0300

    * use urlfilter v0.11.1
2020-07-23 18:09:39 +03:00
Andrey Meshkov
01957bf503 * updater: cut 'v' prefix when comparing SelfUpdateMinVersion
Fix #1908

* commit '1e5419714ddcaab0913162460474dea8959529be':
  * (ui): fix the version check - strip the v prefix
  * updater: cut 'v' prefix when comparing SelfUpdateMinVersion
2020-07-23 13:21:12 +03:00
Andrey Meshkov
1e5419714d * (ui): fix the version check - strip the v prefix 2020-07-23 12:27:14 +03:00
Simon Zolin
4f4a688ee6 * updater: cut 'v' prefix when comparing SelfUpdateMinVersion 2020-07-23 12:17:20 +03:00
Andrey Meshkov
ccf5494f67 Fix edge channel version string 2020-07-22 21:29:22 +03:00
10 changed files with 53 additions and 19 deletions

View File

@@ -55,7 +55,11 @@ SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
VERSION=$(RELEASE_VERSION)
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
@@ -192,7 +196,7 @@ define write_version_file
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"https://github.com/AdguardTeam/AdGuardHome/releases\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"v0.0\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json

View File

@@ -1,9 +1,9 @@
module.exports = {
"disableEmoji": true,
"list": [
"+",
"*",
"-",
"+ ",
"* ",
"- ",
],
"maxMessageLength": 64,
"minMessageLength": 3,
@@ -12,7 +12,7 @@ module.exports = {
"scope",
"subject",
"body",
"issues"
"issues",
],
"scopes": [
"",
@@ -26,20 +26,20 @@ module.exports = {
"documentation",
],
"types": {
"+": {
"+ ": {
"description": "A new feature",
"emoji": "",
"value": "+"
"value": "+ "
},
"*": {
"* ": {
"description": "A code change that neither fixes a bug or adds a feature",
"emoji": "",
"value": "*"
"value": "* "
},
"-": {
"- ": {
"description": "A bug fix",
"emoji": "",
"value": "-"
"value": "- "
}
}
};

View File

@@ -4,6 +4,7 @@ import axios from 'axios';
import { splitByNewLine, sortClients } from '../helpers/helpers';
import { CHECK_TIMEOUT, SETTINGS_NAMES } from '../helpers/constants';
import { areEqualVersions } from '../helpers/version';
import { getTlsStatus } from './encryption';
import apiClient from '../api/Api';
import { addErrorToast, addNoticeToast, addSuccessToast } from './toasts';
@@ -121,7 +122,7 @@ export const getVersion = (recheck = false) => async (dispatch, getState) => {
const { dnsVersion } = getState().dashboard;
const currentVersion = dnsVersion === 'undefined' ? 0 : dnsVersion;
if (data && currentVersion !== data.new_version) {
if (data && !areEqualVersions(currentVersion, data.new_version)) {
dispatch(addSuccessToast('updates_checked'));
} else {
dispatch(addSuccessToast('updates_version_equal'));

View File

@@ -0,0 +1,17 @@
/**
* Checks if versions are equal.
* Please note, that this method strips the "v" prefix.
*
* @param left {string} - left version
* @param right {string} - right version
* @return {boolean} true if versions are equal
*/
export const areEqualVersions = (left, right) => {
if (!left || !right) {
return false;
}
const leftVersion = left.replace(/^v/, '');
const rightVersion = right.replace(/^v/, '');
return leftVersion === rightVersion;
};

View File

@@ -14,6 +14,7 @@ import stats from './stats';
import queryLogs from './queryLogs';
import dnsConfig from './dnsConfig';
import filtering from './filtering';
import { areEqualVersions } from '../helpers/version';
const settings = handleActions(
{
@@ -81,7 +82,7 @@ const dashboard = handleActions(
[actions.getVersionSuccess]: (state, { payload }) => {
const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion;
if (!payload.disabled && currentVersion !== payload.new_version) {
if (!payload.disabled && !areEqualVersions(currentVersion, payload.new_version)) {
const {
announcement_url: announcementUrl,
new_version: newVersion,

2
go.mod
View File

@@ -5,7 +5,7 @@ go 1.14
require (
github.com/AdguardTeam/dnsproxy v0.29.1
github.com/AdguardTeam/golibs v0.4.2
github.com/AdguardTeam/urlfilter v0.11.0
github.com/AdguardTeam/urlfilter v0.11.2
github.com/NYTimes/gziphandler v1.1.1
github.com/fsnotify/fsnotify v1.4.7
github.com/gobuffalo/packr v1.30.1

4
go.sum
View File

@@ -4,8 +4,8 @@ github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKU
github.com/AdguardTeam/golibs v0.4.2 h1:7M28oTZFoFwNmp8eGPb3ImmYbxGaJLyQXeIFVHjME0o=
github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
github.com/AdguardTeam/urlfilter v0.11.0 h1:tgZss6uZs1UZAaxpovD/QuX+VVIQLDOlKc7rdF8dwNw=
github.com/AdguardTeam/urlfilter v0.11.0/go.mod h1:aMuejlNxpWppOVjiEV87X6z0eMf7wsXHTAIWQuylfZY=
github.com/AdguardTeam/urlfilter v0.11.2 h1:gCrWGh63Yqw3z4yi9pgikfsbshIEyvAu/KYV3MvTBlc=
github.com/AdguardTeam/urlfilter v0.11.2/go.mod h1:aMuejlNxpWppOVjiEV87X6z0eMf7wsXHTAIWQuylfZY=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=

View File

@@ -242,7 +242,7 @@ func applyAdditionalFiltering(clientAddr string, setts *dnsfilter.RequestFilteri
return
}
log.Debug("Using settings for client with IP %s", clientAddr)
log.Debug("Using settings for client %s with IP %s", c.Name, clientAddr)
if c.UseOwnBlockedServices {
Context.dnsFilter.ApplyBlockedServices(setts, c.BlockedServices, false)

View File

@@ -2,12 +2,22 @@
## v0.103: API changes
### API: replace settings in GET /control/dns_info & POST /control/dns_config
* added "upstream_mode"
"upstream_mode": "" | "parallel" | "fastest_addr"
* removed "fastest_addr", "parallel_requests"
### API: Get querylog: GET /control/querylog
* Added optional "offset" and "limit" parameters
We are still using "older_than" approach in AdGuard Home UI, but we realize that it's easier to use offset/limit so here is this option now.
## v0.102: API changes
### API: Get general status: GET /control/status

View File

@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"strings"
"time"
)
@@ -66,7 +67,7 @@ func (u *Updater) parseVersionResponse(data []byte) (VersionInfo, error) {
if ok &&
info.NewVersion != u.VersionString &&
u.VersionString >= info.SelfUpdateMinVersion {
strings.TrimPrefix(u.VersionString, "v") >= strings.TrimPrefix(info.SelfUpdateMinVersion, "v") {
info.CanAutoUpdate = true
}