Merge in DNS/adguard-home from ADG-9415 to master Squashed commit of the following: commit76bf99499aMerge:29529970a0389515eeAuthor: Ildar Kamalov <ik@adguard.com> Date: Wed Feb 26 18:31:41 2025 +0300 Merge branch 'master' into ADG-9415 commit29529970a3Merge:b49790daf782a1a982Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Feb 24 15:44:38 2025 +0300 Merge branch 'master' into ADG-9415 commitb49790daf8Author: Ildar Kamalov <ik@adguard.com> Date: Mon Feb 24 15:30:18 2025 +0300 fix default lease duration value commitcb307472ecAuthor: Ildar Kamalov <ik@adguard.com> Date: Mon Feb 24 10:35:26 2025 +0300 fix default response status commit115e743e1aAuthor: Ildar Kamalov <ik@adguard.com> Date: Mon Feb 24 10:32:46 2025 +0300 fix upstream description commit26b0eddacaAuthor: Ildar Kamalov <ik@adguard.com> Date: Tue Feb 18 17:40:41 2025 +0300 use const for test config file commit58faa7c537Author: Ildar Kamalov <ik@adguard.com> Date: Tue Feb 18 17:31:04 2025 +0300 fix install config commit0a3346d911Author: Ildar Kamalov <ik@adguard.com> Date: Mon Feb 17 15:25:23 2025 +0300 fix install check config commit17c4c26ea8Author: Ildar Kamalov <ik@adguard.com> Date: Fri Feb 14 17:18:20 2025 +0300 fix query log commit14a2685ae3Author: Ildar Kamalov <ik@adguard.com> Date: Fri Feb 14 15:52:36 2025 +0300 fix dhcp initial values commite7a8db7afdAuthor: Ildar Kamalov <ik@adguard.com> Date: Fri Feb 14 14:37:24 2025 +0300 fix encryption form values commit1c8917f7acAuthor: Ildar Kamalov <ik@adguard.com> Date: Fri Feb 14 14:07:29 2025 +0300 fix blocked services submit commit4dfa536ceaAuthor: Ildar Kamalov <ik@adguard.com> Date: Fri Feb 14 13:50:47 2025 +0300 dns config ip validation commit4fee83fe13Author: Ildar Kamalov <ik@adguard.com> Date: Wed Feb 12 17:49:54 2025 +0300 add playwright warning commit8c2f36e7a6Author: Ildar Kamalov <ik@adguard.com> Date: Tue Feb 11 18:36:18 2025 +0300 fix config file name commit83db5f33dcAuthor: Ildar Kamalov <ik@adguard.com> Date: Tue Feb 11 16:16:43 2025 +0300 temp config file commit9080c1620fAuthor: Ildar Kamalov <ik@adguard.com> Date: Tue Feb 11 15:01:46 2025 +0300 update readme commitee1520307fMerge:fd12e33c02fe2d254bAuthor: Ildar Kamalov <ik@adguard.com> Date: Tue Feb 11 14:44:06 2025 +0300 Merge branch 'master' into ADG-9415 commitfd12e33c06Author: Igor Lobanov <bniwredyc@gmail.com> Date: Mon Feb 10 10:29:43 2025 +0100 added typecheck on build, fixed eslint commitb3849eebc4Merge:225167a8b9bf3ee128Author: Igor Lobanov <bniwredyc@gmail.com> Date: Mon Feb 10 09:43:32 2025 +0100 Merge branch 'ADG-9415' of https://bit.int.agrd.dev/scm/dns/adguard-home into ADG-9415 ... and 94 more commits
144 lines
4.8 KiB
Makefile
144 lines
4.8 KiB
Makefile
# Keep the Makefile POSIX-compliant. We currently allow hyphens in
|
|
# target names, but that may change in the future.
|
|
#
|
|
# See https://pubs.opengroup.org/onlinepubs/9799919799/utilities/make.html.
|
|
.POSIX:
|
|
|
|
# This comment is used to simplify checking local copies of the
|
|
# Makefile. Bump this number every time a significant change is made to
|
|
# this Makefile.
|
|
#
|
|
# AdGuard-Project-Version: 9
|
|
|
|
# Don't name these macros "GO" etc., because GNU Make apparently makes
|
|
# them exported environment variables with the literal value of
|
|
# "${GO:-go}" and so on, which is not what we need. Use a dot in the
|
|
# name to make sure that users don't have an environment variable with
|
|
# the same name.
|
|
#
|
|
# See https://unix.stackexchange.com/q/646255/105635.
|
|
GO.MACRO = $${GO:-go}
|
|
VERBOSE.MACRO = $${VERBOSE:-0}
|
|
|
|
CHANNEL = development
|
|
CLIENT_DIR = client
|
|
DEPLOY_SCRIPT_PATH = not/a/real/path
|
|
DIST_DIR = dist
|
|
GOAMD64 = v1
|
|
GOPROXY = https://proxy.golang.org|direct
|
|
GOTELEMETRY = off
|
|
GOTOOLCHAIN = go1.23.6
|
|
GPG_KEY = devteam@adguard.com
|
|
GPG_KEY_PASSPHRASE = not-a-real-password
|
|
NPM = npm
|
|
NPM_FLAGS = --prefix $(CLIENT_DIR)
|
|
NPM_INSTALL_FLAGS = $(NPM_FLAGS) --quiet --no-progress
|
|
RACE = 0
|
|
REVISION = $${REVISION:-$$(git rev-parse --short HEAD)}
|
|
SIGN = 1
|
|
SIGNER_API_KEY = not-a-real-key
|
|
VERSION = v0.0.0
|
|
YARN = yarn
|
|
|
|
NEXTAPI = 0
|
|
|
|
# Macros for the build-release target. If FRONTEND_PREBUILT is 0, the
|
|
# default, the macro $(BUILD_RELEASE_DEPS_$(FRONTEND_PREBUILT)) expands
|
|
# into BUILD_RELEASE_DEPS_0, and so both frontend and backend
|
|
# dependencies are fetched and the frontend is built. Otherwise, if
|
|
# FRONTEND_PREBUILT is 1, only backend dependencies are fetched and the
|
|
# frontend isn't rebuilt.
|
|
#
|
|
# TODO(a.garipov): We could probably do that from .../build-release.sh,
|
|
# but that would mean either calling make from inside make or
|
|
# duplicating commands in two places, both of which don't seem to me
|
|
# like nice solutions.
|
|
FRONTEND_PREBUILT = 0
|
|
BUILD_RELEASE_DEPS_0 = deps js-build
|
|
BUILD_RELEASE_DEPS_1 = go-deps
|
|
|
|
ENV = env\
|
|
CHANNEL='$(CHANNEL)'\
|
|
DEPLOY_SCRIPT_PATH='$(DEPLOY_SCRIPT_PATH)' \
|
|
DIST_DIR='$(DIST_DIR)'\
|
|
GO="$(GO.MACRO)"\
|
|
GOAMD64='$(GOAMD64)'\
|
|
GOPROXY='$(GOPROXY)'\
|
|
GOTELEMETRY='$(GOTELEMETRY)'\
|
|
GOTOOLCHAIN='$(GOTOOLCHAIN)'\
|
|
GPG_KEY='$(GPG_KEY)'\
|
|
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
|
|
NEXTAPI='$(NEXTAPI)'\
|
|
PATH="$${PWD}/bin:$$( "$(GO.MACRO)" env GOPATH )/bin:$${PATH}"\
|
|
RACE='$(RACE)'\
|
|
REVISION='$(REVISION)'\
|
|
SIGN='$(SIGN)'\
|
|
SIGNER_API_KEY='$(SIGNER_API_KEY)' \
|
|
VERBOSE="$(VERBOSE.MACRO)"\
|
|
VERSION="$(VERSION)"\
|
|
|
|
# Keep the line above blank.
|
|
|
|
ENV_MISC = env\
|
|
PATH="$${PWD}/bin:$$("$(GO.MACRO)" env GOPATH)/bin:$${PATH}"\
|
|
VERBOSE="$(VERBOSE.MACRO)"\
|
|
|
|
# Keep the line above blank.
|
|
|
|
# Keep this target first, so that a naked make invocation triggers a
|
|
# full build.
|
|
build: deps quick-build
|
|
|
|
init: ; git config core.hooksPath ./scripts/hooks
|
|
|
|
quick-build: js-build go-build
|
|
|
|
deps: js-deps go-deps
|
|
lint: js-lint go-lint
|
|
test: js-test go-test
|
|
|
|
# Here and below, keep $(SHELL) in quotes, because on Windows this will
|
|
# expand to something like "C:/Program Files/Git/usr/bin/sh.exe".
|
|
build-docker: ; $(ENV) "$(SHELL)" ./scripts/make/build-docker.sh
|
|
|
|
build-release: $(BUILD_RELEASE_DEPS_$(FRONTEND_PREBUILT))
|
|
$(ENV) "$(SHELL)" ./scripts/make/build-release.sh
|
|
|
|
js-build: ; $(NPM) $(NPM_FLAGS) run build-prod
|
|
js-deps: ; $(NPM) $(NPM_INSTALL_FLAGS) ci
|
|
js-typecheck: ; $(NPM) $(NPM_FLAGS) run typecheck
|
|
js-lint: ; $(NPM) $(NPM_FLAGS) run lint
|
|
js-test: ; $(NPM) $(NPM_FLAGS) run test
|
|
js-test-e2e: ; $(NPM) $(NPM_FLAGS) run test:e2e
|
|
|
|
go-bench: ; $(ENV) "$(SHELL)" ./scripts/make/go-bench.sh
|
|
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
|
|
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
|
|
go-env: ; $(ENV) "$(GO.MACRO)" env
|
|
go-fuzz: ; $(ENV) "$(SHELL)" ./scripts/make/go-fuzz.sh
|
|
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
|
|
# TODO(a.garipov): Think about making RACE='1' the default for all
|
|
# targets.
|
|
go-test: ; $(ENV) RACE='1' "$(SHELL)" ./scripts/make/go-test.sh
|
|
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
|
|
go-upd-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-upd-tools.sh
|
|
|
|
go-check: go-tools go-lint go-test
|
|
|
|
# A quick check to make sure that all operating systems relevant to the
|
|
# development of the project can be typechecked and built successfully.
|
|
go-os-check:
|
|
$(ENV) GOOS='darwin' "$(GO.MACRO)" vet ./internal/...
|
|
$(ENV) GOOS='freebsd' "$(GO.MACRO)" vet ./internal/...
|
|
$(ENV) GOOS='openbsd' "$(GO.MACRO)" vet ./internal/...
|
|
$(ENV) GOOS='linux' "$(GO.MACRO)" vet ./internal/...
|
|
$(ENV) GOOS='windows' "$(GO.MACRO)" vet ./internal/...
|
|
|
|
txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh
|
|
|
|
md-lint: ; $(ENV_MISC) "$(SHELL)" ./scripts/make/md-lint.sh
|
|
sh-lint: ; $(ENV_MISC) "$(SHELL)" ./scripts/make/sh-lint.sh
|
|
|
|
openapi-lint: ; cd ./openapi/ && $(YARN) test
|
|
openapi-show: ; cd ./openapi/ && $(YARN) start
|