From 54b794da54d8ee827a45274e7e6b072c64a25112 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:10:36 +0200 Subject: [PATCH] Alpine-AdGuardHome (#3875) * Alpine-AdGuardHome * modify tag * Update alpine-adguard.sh --- ct/alpine-adguard.sh | 47 +++++++++++++++++++++++++++++++ frontend/public/json/adguard.json | 11 ++++++++ install/alpine-adguard-install.sh | 47 +++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 ct/alpine-adguard.sh create mode 100644 install/alpine-adguard-install.sh diff --git a/ct/alpine-adguard.sh b/ct/alpine-adguard.sh new file mode 100644 index 000000000..c5d43a7db --- /dev/null +++ b/ct/alpine-adguard.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://adguardhome.com/ + +APP="Alpine-AdGuard" +var_tags="${var_tags:-alpine;adblock}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-256}" +var_disk="${var_disk:-1}" +var_os="${var_os:-alpine}" +var_version="${var_version:-3.21}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + msg_info "Updating Alpine Packages" + $STD apk update + $STD apk upgrade + msg_ok "Updated Alpine Packages" + + msg_info "Updating AdGuard Home" + $STD /opt/AdGuardHome/AdGuardHome --update + msg_ok "Updated AdGuard Home" + + msg_info "Restarting AdGuard Home" + $STD rc-service adguardhome restart + msg_ok "Restarted AdGuard Home" + + exit 0 +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/frontend/public/json/adguard.json b/frontend/public/json/adguard.json index f91416c3f..be3eb1996 100644 --- a/frontend/public/json/adguard.json +++ b/frontend/public/json/adguard.json @@ -24,6 +24,17 @@ "os": "debian", "version": "12" } + }, + { + "type": "alpine", + "script": "ct/alpine-adguard.sh", + "resources": { + "cpu": 1, + "ram": 256, + "hdd": 1, + "os": "alpine", + "version": "3.21" + } } ], "default_credentials": { diff --git a/install/alpine-adguard-install.sh b/install/alpine-adguard-install.sh new file mode 100644 index 000000000..e8cf53c78 --- /dev/null +++ b/install/alpine-adguard-install.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://adguardhome.com/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Downloading AdGuard Home" +$STD curl -fsSL -o /tmp/AdGuardHome_linux_amd64.tar.gz \ + "https://github.com/AdguardTeam/AdGuardHome/releases/latest/download/AdGuardHome_linux_amd64.tar.gz" +msg_ok "Downloaded AdGuard Home" + +msg_info "Installing AdGuard Home" +$STD tar -xzf /tmp/AdGuardHome_linux_amd64.tar.gz -C /opt +$STD rm /tmp/AdGuardHome_linux_amd64.tar.gz +msg_ok "Installed AdGuard Home" + +msg_info "Creating AdGuard Home Service" +cat </etc/init.d/adguardhome +#!/sbin/openrc-run +name="AdGuardHome" +description="AdGuard Home Service" +command="/opt/AdGuardHome/AdGuardHome" +command_background="yes" +pidfile="/run/adguardhome.pid" +EOF +$STD chmod +x /etc/init.d/adguardhome +msg_ok "Created AdGuard Home Service" + +msg_info "Enabling AdGuard Home Service" +$STD rc-update add adguardhome default +msg_ok "Enabled AdGuard Home Service" + +msg_info "Starting AdGuard Home" +$STD rc-service adguardhome start +msg_ok "Started AdGuard Home" + +motd_ssh +customize