Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Sam Heinz
2024-08-22 19:08:47 +10:00
12 changed files with 112 additions and 176 deletions
+16
View File
@@ -12,6 +12,22 @@ Be cautious of copycat or coat-tailing sites that exploit the project's populari
- All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment. - All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
## 2024-08-21
### Changed
- **WireGuard LXC** [(Commit)](https://github.com/tteck/Proxmox/commit/723365a79df7cc0fd29b1af8f7ef200a7e0921b1)
- Refactor Code
- Breaking Change
## 2024-08-19
### Changed
- **CommaFeed LXC** [(Commit)](https://github.com/tteck/Proxmox/commit/0a33d1739ec3a49011411929bd46a260e92e99f9)
- Refactor Code
- Breaking Change
## 2024-08-06 ## 2024-08-06
### Changed ### Changed
+1 -1
View File
@@ -71,7 +71,7 @@ function update_script() {
header_info header_info
case $CHOICE in case $CHOICE in
1) 1)
apk update && apk upgrade apk update && apk upgrade && rc-service vaultwarden restart -q
exit exit
;; ;;
2) 2)
+1 -1
View File
@@ -66,7 +66,7 @@ Pin: version ${RELEASE}
Pin-Priority: 1001 Pin-Priority: 1001
EOF EOF
apt-get update apt-get update
apt-get install nginx -y apt-get install -y nginx=1.26.1*
apt-get install -y bunkerweb=${RELEASE} apt-get install -y bunkerweb=${RELEASE}
echo "${RELEASE}" >/opt/${APP}_version.txt echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}" msg_ok "Updated ${APP} to ${RELEASE}"
+19 -11
View File
@@ -55,19 +55,27 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/commafeed ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/commafeed ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_info "Stopping CommaFeed" RELEASE=$(curl -sL https://api.github.com/repos/Athou/commafeed/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
systemctl stop commafeed if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_ok "Stopped CommaFeed" msg_info "Stopping ${APP}"
systemctl stop commafeed
msg_ok "Stopped ${APP}"
msg_info "Updating CommaFeed" msg_info "Updating ${APP} to ${RELEASE}"
cd /opt/commafeed wget -q https://github.com/Athou/commafeed/releases/download/${RELEASE}/commafeed-${RELEASE}-h2-jvm.zip
rm commafeed.jar unzip -q commafeed-${RELEASE}-h2-jvm.zip
wget -q https://github.com/Athou/commafeed/releases/latest/download/commafeed.jar rsync -a --exclude 'data/' commafeed-${RELEASE}-h2/ /opt/commafeed/
msg_ok "Updated CommaFeed" rm -rf commafeed-${RELEASE}-h2 commafeed-${RELEASE}-h2-jvm.zip
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"
msg_info "Starting CommaFeed" msg_info "Starting ${APP}"
systemctl start commafeed systemctl start commafeed
msg_ok "Update Completed Successfully" msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
} }
+2 -31
View File
@@ -54,37 +54,8 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/matterbridge ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /root/Matterbridge ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_error "Update via the Matterbridge UI"
RELEASE=$(curl -s https://api.github.com/repos/Luligu/matterbridge/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP} Service"
systemctl stop matterbridge
msg_ok "Stopped ${APP} Service"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt/matterbridge
wget -q "https://github.com/Luligu/matterbridge/archive/refs/tags/${RELEASE}.zip"
unzip -q ${RELEASE}.zip
mv matterbridge-${RELEASE} /opt/matterbridge
cd /opt/matterbridge
npm ci >/dev/null 2>&1
npm run build >/dev/null 2>&1
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"
msg_info "Cleaning up"
rm /opt/${RELEASE}.zip
msg_ok "Cleaned"
msg_info "Starting ${APP} Service"
systemctl start matterbridge
sleep 1
msg_ok "Started ${APP} Service"
msg_ok "Updated Successfully!\n"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
} }
+7 -67
View File
@@ -19,11 +19,11 @@ EOF
header_info header_info
echo -e "Loading..." echo -e "Loading..."
APP="Wireguard" APP="Wireguard"
var_disk="2" var_disk="4"
var_cpu="1" var_cpu="1"
var_ram="512" var_ram="512"
var_os="ubuntu" var_os="debian"
var_version="20.04" var_version="12"
variables variables
color color
catch_errors catch_errors
@@ -53,71 +53,9 @@ function default_settings() {
} }
function update_script() { function update_script() {
if [[ ! -d /etc/pivpn/wireguard ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /etc/wireguard ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 2 \ msg_error "Update WireGuard via apt"
"1" "Update ${APP} LXC" ON \
"2" "Install WGDashboard" OFF \
3>&1 1>&2 2>&3)
header_info
if [ "$UPD" == "1" ]; then
msg_info "Updating ${APP} LXC"
apt-get update &>/dev/null
apt-get -y upgrade &>/dev/null
msg_ok "Updated ${APP} LXC"
exit exit
fi
if [ "$UPD" == "2" ]; then
if [[ -f /etc/systemd/system/wg-dashboard.service ]]; then
cd /etc/wgdashboard/src
chmod u+x wgd.sh
./wgd.sh update
msg_ok "Updated Successfully"
exit
fi
IP=$(hostname -I | awk '{print $1}')
msg_info "Installing Python3-pip"
apt-get install -y python3-pip &>/dev/null
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
pip install flask &>/dev/null
pip install ifcfg &>/dev/null
pip install flask_qrcode &>/dev/null
pip install icmplib &>/dev/null
msg_ok "Installed Python3-pip"
msg_info "Installing WGDashboard"
WGDREL=$(curl -s https://api.github.com/repos/donaldzou/WGDashboard/releases/latest |
grep "tag_name" |
awk '{print substr($2, 2, length($2)-3) }')
git clone -b ${WGDREL} https://github.com/donaldzou/WGDashboard.git /etc/wgdashboard &>/dev/null
cd /etc/wgdashboard/src
chmod u+x wgd.sh
./wgd.sh install &>/dev/null
chmod -R 755 /etc/wireguard
msg_ok "Installed WGDashboard"
msg_info "Creating Service"
service_path="/etc/systemd/system/wg-dashboard.service"
echo "[Unit]
After=systemd-networkd.service
[Service]
WorkingDirectory=/etc/wgdashboard/src
ExecStart=/usr/bin/python3 /etc/wgdashboard/src/dashboard.py
Restart=always
[Install]
WantedBy=default.target" >$service_path
chmod 664 /etc/systemd/system/wg-dashboard.service
systemctl daemon-reload
systemctl enable wg-dashboard.service &>/dev/null
systemctl start wg-dashboard.service &>/dev/null
msg_ok "Created Service"
echo -e "WGDashboard should be reachable by going to the following URL.
${BL}http://${IP}:10086${CL} admin|admin \n"
exit
fi
} }
start start
@@ -125,3 +63,5 @@ build_container
description description
msg_ok "Completed Successfully!\n" msg_ok "Completed Successfully!\n"
echo -e "WGDashboard should be reachable by going to the following URL.
${BL}http://${IP}:10086${CL} admin|admin \n"
+1 -1
View File
@@ -27,7 +27,7 @@ msg_info "Installing Nginx"
wget -qO- https://nginx.org/keys/nginx_signing.key | gpg --dearmor >/usr/share/keyrings/nginx-archive-keyring.gpg wget -qO- https://nginx.org/keys/nginx_signing.key | gpg --dearmor >/usr/share/keyrings/nginx-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/debian $(lsb_release -cs) nginx" >/etc/apt/sources.list.d/nginx.list echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/debian $(lsb_release -cs) nginx" >/etc/apt/sources.list.d/nginx.list
$STD apt-get update $STD apt-get update
$STD apt-get install -y nginx $STD apt-get install -y nginx=1.26.1*
msg_ok "Installed Nginx" msg_ok "Installed Nginx"
RELEASE=$(curl -s https://api.github.com/repos/bunkerity/bunkerweb/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -s https://api.github.com/repos/bunkerity/bunkerweb/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
+3 -3
View File
@@ -76,7 +76,7 @@ msg_ok "Installed Change Detection"
msg_info "Installing Browserless & Playwright" msg_info "Installing Browserless & Playwright"
mkdir /opt/browserless mkdir /opt/browserless
$STD python3 -m pip install playwright $STD python3 -m pip install playwright
$STD git clone -b v1 https://github.com/browserless/chrome /opt/browserless $STD git clone https://github.com/browserless/chrome /opt/browserless
$STD npm install --prefix /opt/browserless $STD npm install --prefix /opt/browserless
$STD npm run build --prefix /opt/browserless $STD npm run build --prefix /opt/browserless
$STD npm prune production --prefix /opt/browserless $STD npm prune production --prefix /opt/browserless
@@ -126,8 +126,8 @@ Wants=browserless.service
[Service] [Service]
Type=simple Type=simple
WorkingDirectory=/opt/changedetection WorkingDirectory=/opt/changedetection
Environment="WEBDRIVER_URL=http://127.0.0.1:4444/wd/hub" Environment=WEBDRIVER_URL=http://127.0.0.1:4444/wd/hub
Environment="PLAYWRIGHT_DRIVER_URL=ws://127.0.0.1:3000/?stealth=1&--disable-web-security=true" Environment=PLAYWRIGHT_DRIVER_URL=ws://browserless-chrome:3000/chrome?launch={"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}&blockAds=true
ExecStart=changedetection.io -d /opt/changedetection -p 5000 ExecStart=changedetection.io -d /opt/changedetection -p 5000
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
+11 -7
View File
@@ -19,6 +19,7 @@ $STD apt-get install -y sudo
$STD apt-get install -y mc $STD apt-get install -y mc
$STD apt-get install -y wget $STD apt-get install -y wget
$STD apt-get install -y openssh-server $STD apt-get install -y openssh-server
$STD apt-get install -y rsync
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing Azul Zulu" msg_info "Installing Azul Zulu"
@@ -29,11 +30,14 @@ $STD apt-get update
$STD apt-get -y install zulu17-jdk $STD apt-get -y install zulu17-jdk
msg_ok "Installed Azul Zulu" msg_ok "Installed Azul Zulu"
msg_info "Installing CommaFeed" RELEASE=$(curl -sL https://api.github.com/repos/Athou/commafeed/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
mkdir /opt/commafeed && cd /opt/commafeed msg_info "Installing CommaFeed ${RELEASE}"
wget -q https://github.com/Athou/commafeed/releases/latest/download/commafeed.jar mkdir /opt/commafeed
wget -q https://github.com/Athou/commafeed/releases/latest/download/config.yml.example -O config.yml wget -q https://github.com/Athou/commafeed/releases/download/${RELEASE}/commafeed-${RELEASE}-h2-jvm.zip
msg_ok "Installed CommaFeed" unzip -q commafeed-${RELEASE}-h2-jvm.zip
mv commafeed-${RELEASE}-h2/* /opt/commafeed/
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed CommaFeed ${RELEASE}"
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/commafeed.service cat <<EOF >/etc/systemd/system/commafeed.service
@@ -42,7 +46,7 @@ Description=CommaFeed Service
After=network.target After=network.target
[Service] [Service]
ExecStart=/usr/bin/java -Djava.net.preferIPv4Stack=true -jar /opt/commafeed/commafeed.jar server /opt/commafeed/config.yml ExecStart=java -jar quarkus-run.jar
WorkingDirectory=/opt/commafeed/ WorkingDirectory=/opt/commafeed/
Restart=always Restart=always
@@ -56,7 +60,7 @@ motd_ssh
customize customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -rf zulu-repo_1.0.0-3_all.deb rm -rf commafeed-${RELEASE}-h2 commafeed-${RELEASE}-h2-jvm.zip zulu-repo_1.0.0-3_all.deb
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleaned"
+4 -8
View File
@@ -171,17 +171,16 @@ msg_ok "Installed Coral Object Detection Model"
msg_info "Building Nginx with Custom Modules" msg_info "Building Nginx with Custom Modules"
$STD /opt/frigate/docker/main/build_nginx.sh $STD /opt/frigate/docker/main/build_nginx.sh
#sed -i 's/exec nginx/exec \/usr\/local\/nginx\/sbin\/nginx/g' /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/nginx/run
sed -e '/s6-notifyoncheck/ s/^#*/#/' -i /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/nginx/run sed -e '/s6-notifyoncheck/ s/^#*/#/' -i /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/nginx/run
sed -i 's/error_log \/dev\/stdout warn\;/error_log \/dev\/shm\/logs\/nginx\/current warn\;/' /usr/local/nginx/conf/nginx.conf sed -i 's/error_log \/dev\/stdout warn\;/error_log \/dev\/shm\/logs\/nginx\/current warn\;/' /usr/local/nginx/conf/nginx.conf
sed -i 's/access_log \/dev\/stdout main\;/access_log \/dev\/shm\/logs\/nginx\/current main\;/' /usr/local/nginx/conf/nginx.conf sed -i 's/access_log \/dev\/stdout main\;/access_log \/dev\/shm\/logs\/nginx\/current main\;/' /usr/local/nginx/conf/nginx.conf
ln -svf /usr/local/nginx/sbin/nginx /usr/local/bin/nginx ln -sf /usr/local/nginx/sbin/nginx /usr/local/bin/nginx
msg_ok "Built Nginx" msg_ok "Built Nginx"
msg_info "Installing Tempio" msg_info "Installing Tempio"
sed -i 's|/rootfs/usr/local|/usr/local|g' /opt/frigate/docker/main/install_tempio.sh sed -i 's|/rootfs/usr/local|/usr/local|g' /opt/frigate/docker/main/install_tempio.sh
$STD /opt/frigate/docker/main/install_tempio.sh $STD /opt/frigate/docker/main/install_tempio.sh
ln -svf /usr/local/tempio/bin/tempio /usr/local/bin/tempio ln -sf /usr/local/tempio/bin/tempio /usr/local/bin/tempio
msg_ok "Installed Tempio" msg_ok "Installed Tempio"
msg_info "Creating Services" msg_info "Creating Services"
@@ -211,8 +210,7 @@ Restart=always
RestartSec=1 RestartSec=1
User=root User=root
ExecStartPre=+rm /dev/shm/logs/go2rtc/current ExecStartPre=+rm /dev/shm/logs/go2rtc/current
ExecStart=bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/run ExecStart=/bin/bash -c "bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/run 2> >(/usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S ' >&2) | /usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S '"
#ExecStart=/bin/bash -c "bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/run 2> >(/usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S ' >&2) | /usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S '"
StandardOutput=file:/dev/shm/logs/go2rtc/current StandardOutput=file:/dev/shm/logs/go2rtc/current
StandardError=file:/dev/shm/logs/go2rtc/current StandardError=file:/dev/shm/logs/go2rtc/current
@@ -234,8 +232,7 @@ Restart=always
RestartSec=1 RestartSec=1
User=root User=root
ExecStartPre=+rm /dev/shm/logs/frigate/current ExecStartPre=+rm /dev/shm/logs/frigate/current
ExecStart=bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run ExecStart=/bin/bash -c "bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run 2> >(/usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S ' >&2) | /usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S '"
#ExecStart=/bin/bash -c "bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run 2> >(/usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S ' >&2) | /usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S '"
StandardOutput=file:/dev/shm/logs/frigate/current StandardOutput=file:/dev/shm/logs/frigate/current
StandardError=file:/dev/shm/logs/frigate/current StandardError=file:/dev/shm/logs/frigate/current
@@ -257,7 +254,6 @@ Restart=always
RestartSec=1 RestartSec=1
User=root User=root
ExecStartPre=+rm /dev/shm/logs/nginx/current ExecStartPre=+rm /dev/shm/logs/nginx/current
#ExecStart=bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/nginx/run
ExecStart=/bin/bash -c "bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/nginx/run 2> >(/usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S ' >&2) | /usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S '" ExecStart=/bin/bash -c "bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/nginx/run 2> >(/usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S ' >&2) | /usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S '"
StandardOutput=file:/dev/shm/logs/nginx/current StandardOutput=file:/dev/shm/logs/nginx/current
StandardError=file:/dev/shm/logs/nginx/current StandardError=file:/dev/shm/logs/nginx/current
+11 -27
View File
@@ -14,19 +14,13 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies"
$STD apt-get install -y --no-install-recommends \ $STD apt-get install -y curl
build-essential \ $STD apt-get install -y sudo
unzip \ $STD apt-get install -y mc
curl \ $STD apt-get install -y gpg
sudo \ $STD apt-get install -y wget
git \ $STD apt-get install -y openssh-server
make \
gnupg \
ca-certificates \
mc \
wget \
openssh-server
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository" msg_info "Setting up Node.js Repository"
@@ -41,15 +35,8 @@ $STD apt-get install -y nodejs
msg_ok "Installed Node.js" msg_ok "Installed Node.js"
msg_info "Install Matterbridge" msg_info "Install Matterbridge"
RELEASE=$(curl -s https://api.github.com/repos/Luligu/matterbridge/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') mkdir -p /root/Matterbridge
wget -q "https://github.com/Luligu/matterbridge/archive/refs/tags/${RELEASE}.zip" $STD npm install -g matterbridge
unzip -q ${RELEASE}.zip
mv matterbridge-${RELEASE} /opt/matterbridge
rm -R ${RELEASE}.zip
cd /opt/matterbridge
$STD npm ci
$STD npm run build
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Matterbridge" msg_ok "Installed Matterbridge"
msg_info "Creating Service" msg_info "Creating Service"
@@ -60,16 +47,13 @@ After=network-online.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/npm run start:bridge ExecStart=matterbridge -bridge -service
WorkingDirectory=/opt/matterbridge WorkingDirectory=/root/Matterbridge
StandardOutput=inherit StandardOutput=inherit
StandardError=inherit StandardError=inherit
Restart=always Restart=always
RestartSec=10s RestartSec=10s
TimeoutStopSec=30s TimeoutStopSec=30s
User=root
Environment=PATH=/usr/bin:/usr/local/bin:/opt/matterbridge/bin
Environment=NODE_ENV=production
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
+36 -19
View File
@@ -17,31 +17,48 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl $STD apt-get install -y curl
$STD apt-get install -y sudo $STD apt-get install -y sudo
$STD apt-get install -y mc $STD apt-get install -y mc
$STD apt-get install -y gunicorn $STD apt-get install -y git
$STD apt-get install -y wget $STD apt-get install -y wget
$STD apt-get install -y openssh-server $STD apt-get install -y openssh-server
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing WireGuard (using pivpn.io)" msg_info "Installing WireGuard"
OPTIONS_PATH='/options.conf' $STD apt-get install -y wireguard wireguard-tools net-tools iptables
cat >$OPTIONS_PATH <<EOF
IPv4dev=eth0
install_user=root
VPN=wireguard
pivpnNET=$(printf "10.%d.%d.0" $((RANDOM % 256)) $((RANDOM % 256)))
subnetClass=24
ALLOWED_IPS="0.0.0.0/0, ::0/0"
pivpnMTU=1420
pivpnPORT=51820
pivpnDNS1=1.1.1.1
pivpnDNS2=8.8.8.8
pivpnHOST=
pivpnPERSISTENTKEEPALIVE=25
UNATTUPG=1
EOF
$STD bash <(curl -fsSL https://install.pivpn.io) --unattended options.conf
msg_ok "Installed WireGuard" msg_ok "Installed WireGuard"
msg_info "Installing WGDashboard"
git clone -q https://github.com/donaldzou/WGDashboard.git /etc/wgdashboard
cd /etc/wgdashboard/src
chmod u+x wgd.sh
$STD ./wgd.sh install
echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf
$STD sysctl -p /etc/sysctl.conf
msg_ok "Installed WGDashboard"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/wg-dashboard.service
[Unit]
After=syslog.target network-online.target
Wants=wg-quick.target
ConditionPathIsDirectory=/etc/wireguard
[Service]
Type=forking
PIDFile=/etc/wgdashboard/src/gunicorn.pid
WorkingDirectory=/etc/wgdashboard/src
ExecStart=/etc/wgdashboard/src/wgd.sh start
ExecStop=/etc/wgdashboard/src/wgd.sh stop
ExecReload=/etc/wgdashboard/src/wgd.sh restart
TimeoutSec=120
PrivateTmp=yes
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now wg-dashboard.service
msg_ok "Created Service"
motd_ssh motd_ssh
customize customize