Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdGuard Home #6077

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions cross/adguardhome/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
PKG_NAME = adguardhome
PKG_VERS = 0.107.48
PKG_EXT = tar.gz
PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/AdguardTeam/$(PKG_NAME)/archive/refs/tags
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = AdGuardHome-$(PKG_VERS)

BUILD_DEPENDS = native/go native/nodejs
HOMEPAGE = https://github.com/AdguardTeam/$(PKG_NAME)
COMMENT = Network-wide ads & trackers blocking DNS server
LICENSE = GPL-3.0

PATCHES_LEVEL = 1
GO_SRC_DIR = $(WORK_DIR)/AdGuardHome-$(PKG_VERS)
GO_BIN_DIR = $(GO_SRC_DIR)/$(PKG_NAME)
GO_BUILD_ARGS += -ldflags "-X 'github.com/AdguardTeam/AdGuardHome/internal/version.version=v$(PKG_VERS)' -X 'github.com/AdguardTeam/AdGuardHome/internal/version.channel=release'"
PATH := $(WORK_DIR)/../../../native/nodejs/work-native/node/bin:$(PATH)
PRE_COMPILE_TARGET = adguardhome_pre_compile
# avoid webpack error ERR_OSSL_EVP_UNSUPPORTED with nodejs 18
ENV += NODE_OPTIONS=--openssl-legacy-provider

include ../../mk/spksrc.cross-go.mk

.PHONY: adguardhome_pre_compile
adguardhome_pre_compile:
@$(RUN) $(MAKE) js-deps
@$(RUN) $(MAKE) js-build
1 change: 1 addition & 0 deletions cross/adguardhome/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin:bin/adguardhome
3 changes: 3 additions & 0 deletions cross/adguardhome/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
adguardhome-0.107.48.tar.gz SHA1 9d3adecba9e799160ed25292d48cf1ef4386e25a
adguardhome-0.107.48.tar.gz SHA256 189afe8ccc4efd229c3554d812f590cc8727e966c05a6129d444c88a905b83a1
adguardhome-0.107.48.tar.gz MD5 515ff04dd9bb3884605269fd635c9be6
11 changes: 11 additions & 0 deletions cross/adguardhome/patches/fix-unprivileged-ports-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/internal/aghnet/net_linux.go
+++ b/internal/aghnet/net_linux.go
@@ -22,6 +22,7 @@
const dhcpcdConf = "etc/dhcpcd.conf"

func canBindPrivilegedPorts() (can bool, err error) {
+ return true, nil
res, err := unix.PrctlRetInt(
unix.PR_CAP_AMBIENT,
unix.PR_CAP_AMBIENT_IS_SET,

29 changes: 29 additions & 0 deletions spk/adguardhome/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
SPK_NAME = adguardhome
SPK_VERS = 0.107.48
SPK_REV = 0
SPK_ICON = src/adguardhome.png

DEPENDS = cross/adguardhome
UNSUPPORTED_ARCHS = $(PPC_ARCHS)
SPK_CONFLICT = DNSServer DhcpServer

MAINTAINER = publicarray
DISPLAY_NAME = AdGuardHome
DESCRIPTION = "Network-wide ads & trackers blocking DNS server"
HOMEPAGE = https://adguard.com/en/adguard-home/overview.html
LICENSE = GPL-3.0
CHANGELOG = "Initial release"

STARTABLE = yes
SERVICE_USER = auto
SERVICE_SETUP = src/service-setup.sh

SERVICE_PORT = 6053
SERVICE_PORT_TITLE = $(DISPLAY_NAME)

# Admin link for in DSM UI
ADMIN_PORT = $(SERVICE_PORT)

WIZARDS_DIR = src/wizard

include ../../mk/spksrc.spk.mk
Binary file added spk/adguardhome/src/adguardhome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions spk/adguardhome/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ADGUARDHOME="${SYNOPKG_PKGDEST}/bin/adguardhome"
CFG_FILE="${SYNOPKG_PKGVAR}/AdGuardHome.yml"
PID_FILE="${SYNOPKG_PKGVAR}/adguardhome.pid"
WEB_UI="0.0.0.0:${SYNOPKG_PKGPORT}"
SERVICE_COMMAND="${ADGUARDHOME} --web-addr ${WEB_UI} --config ${CFG_FILE} --pidfile ${PID_FILE} --logfile ${LOG_FILE} --work-dir ${SYNOPKG_PKGVAR}"
SVC_BACKGROUND=y

service_postinst () {
mkdir -p "${SYNOPKG_PKGVAR}/data/"
}
8 changes: 8 additions & 0 deletions spk/adguardhome/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"step_title": "Install Instructions",
"items": [{
"desc": "Please <b style=\"color: red\">unselect 'Run after installation'</b>, To run adguard you need to first run the following command via SSH and everytime there is an update"
}, {
"desc": "<code style=\"user-select: all\">setcap 'CAP_NET_BIND_SERVICE=+eip CAP_NET_RAW=+eip' /var/packages/adguardhome/target/bin/adguardhome</code>"
}]
}]