forked from forkanization/Proxmox-arm64
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
16
CHANGELOG.md
16
CHANGELOG.md
@@ -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.
|
||||
|
||||
## 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
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -71,7 +71,7 @@ function update_script() {
|
||||
header_info
|
||||
case $CHOICE in
|
||||
1)
|
||||
apk update && apk upgrade
|
||||
apk update && apk upgrade && rc-service vaultwarden restart -q
|
||||
exit
|
||||
;;
|
||||
2)
|
||||
|
||||
@@ -66,7 +66,7 @@ Pin: version ${RELEASE}
|
||||
Pin-Priority: 1001
|
||||
EOF
|
||||
apt-get update
|
||||
apt-get install nginx -y
|
||||
apt-get install -y nginx=1.26.1*
|
||||
apt-get install -y bunkerweb=${RELEASE}
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
||||
|
||||
@@ -55,19 +55,27 @@ function default_settings() {
|
||||
function update_script() {
|
||||
header_info
|
||||
if [[ ! -d /opt/commafeed ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_info "Stopping CommaFeed"
|
||||
systemctl stop commafeed
|
||||
msg_ok "Stopped CommaFeed"
|
||||
RELEASE=$(curl -sL https://api.github.com/repos/Athou/commafeed/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
msg_info "Stopping ${APP}"
|
||||
systemctl stop commafeed
|
||||
msg_ok "Stopped ${APP}"
|
||||
|
||||
msg_info "Updating CommaFeed"
|
||||
cd /opt/commafeed
|
||||
rm commafeed.jar
|
||||
wget -q https://github.com/Athou/commafeed/releases/latest/download/commafeed.jar
|
||||
msg_ok "Updated CommaFeed"
|
||||
msg_info "Updating ${APP} to ${RELEASE}"
|
||||
wget -q https://github.com/Athou/commafeed/releases/download/${RELEASE}/commafeed-${RELEASE}-h2-jvm.zip
|
||||
unzip -q commafeed-${RELEASE}-h2-jvm.zip
|
||||
rsync -a --exclude 'data/' commafeed-${RELEASE}-h2/ /opt/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"
|
||||
systemctl start commafeed
|
||||
msg_ok "Update Completed Successfully"
|
||||
msg_info "Starting ${APP}"
|
||||
systemctl start commafeed
|
||||
msg_ok "Started ${APP}"
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
@@ -54,37 +54,8 @@ function default_settings() {
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
if [[ ! -d /opt/matterbridge ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
|
||||
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
|
||||
if [[ ! -d /root/Matterbridge ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_error "Update via the Matterbridge UI"
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ EOF
|
||||
header_info
|
||||
echo -e "Loading..."
|
||||
APP="Wireguard"
|
||||
var_disk="2"
|
||||
var_disk="4"
|
||||
var_cpu="1"
|
||||
var_ram="512"
|
||||
var_os="ubuntu"
|
||||
var_version="20.04"
|
||||
var_os="debian"
|
||||
var_version="12"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
@@ -53,71 +53,9 @@ function default_settings() {
|
||||
}
|
||||
|
||||
function update_script() {
|
||||
if [[ ! -d /etc/pivpn/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 \
|
||||
"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"
|
||||
if [[ ! -d /etc/wireguard ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_error "Update WireGuard via apt"
|
||||
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
|
||||
@@ -125,3 +63,5 @@ build_container
|
||||
description
|
||||
|
||||
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"
|
||||
|
||||
@@ -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
|
||||
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 install -y nginx
|
||||
$STD apt-get install -y nginx=1.26.1*
|
||||
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) }')
|
||||
|
||||
@@ -76,7 +76,7 @@ msg_ok "Installed Change Detection"
|
||||
msg_info "Installing Browserless & Playwright"
|
||||
mkdir /opt/browserless
|
||||
$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 run build --prefix /opt/browserless
|
||||
$STD npm prune production --prefix /opt/browserless
|
||||
@@ -126,8 +126,8 @@ Wants=browserless.service
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/changedetection
|
||||
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=WEBDRIVER_URL=http://127.0.0.1:4444/wd/hub
|
||||
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
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -19,6 +19,7 @@ $STD apt-get install -y sudo
|
||||
$STD apt-get install -y mc
|
||||
$STD apt-get install -y wget
|
||||
$STD apt-get install -y openssh-server
|
||||
$STD apt-get install -y rsync
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing Azul Zulu"
|
||||
@@ -29,11 +30,14 @@ $STD apt-get update
|
||||
$STD apt-get -y install zulu17-jdk
|
||||
msg_ok "Installed Azul Zulu"
|
||||
|
||||
msg_info "Installing CommaFeed"
|
||||
mkdir /opt/commafeed && cd /opt/commafeed
|
||||
wget -q https://github.com/Athou/commafeed/releases/latest/download/commafeed.jar
|
||||
wget -q https://github.com/Athou/commafeed/releases/latest/download/config.yml.example -O config.yml
|
||||
msg_ok "Installed CommaFeed"
|
||||
RELEASE=$(curl -sL https://api.github.com/repos/Athou/commafeed/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
msg_info "Installing CommaFeed ${RELEASE}"
|
||||
mkdir /opt/commafeed
|
||||
wget -q https://github.com/Athou/commafeed/releases/download/${RELEASE}/commafeed-${RELEASE}-h2-jvm.zip
|
||||
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"
|
||||
cat <<EOF >/etc/systemd/system/commafeed.service
|
||||
@@ -42,7 +46,7 @@ Description=CommaFeed Service
|
||||
After=network.target
|
||||
|
||||
[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/
|
||||
Restart=always
|
||||
|
||||
@@ -56,7 +60,7 @@ motd_ssh
|
||||
customize
|
||||
|
||||
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 autoclean
|
||||
msg_ok "Cleaned"
|
||||
|
||||
@@ -171,17 +171,16 @@ msg_ok "Installed Coral Object Detection Model"
|
||||
|
||||
msg_info "Building Nginx with Custom Modules"
|
||||
$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 -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
|
||||
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_info "Installing Tempio"
|
||||
sed -i 's|/rootfs/usr/local|/usr/local|g' /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_info "Creating Services"
|
||||
@@ -211,8 +210,7 @@ Restart=always
|
||||
RestartSec=1
|
||||
User=root
|
||||
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
|
||||
StandardError=file:/dev/shm/logs/go2rtc/current
|
||||
|
||||
@@ -234,8 +232,7 @@ Restart=always
|
||||
RestartSec=1
|
||||
User=root
|
||||
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
|
||||
StandardError=file:/dev/shm/logs/frigate/current
|
||||
|
||||
@@ -257,7 +254,6 @@ Restart=always
|
||||
RestartSec=1
|
||||
User=root
|
||||
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 '"
|
||||
StandardOutput=file:/dev/shm/logs/nginx/current
|
||||
StandardError=file:/dev/shm/logs/nginx/current
|
||||
|
||||
@@ -14,19 +14,13 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies (Patience)"
|
||||
$STD apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
unzip \
|
||||
curl \
|
||||
sudo \
|
||||
git \
|
||||
make \
|
||||
gnupg \
|
||||
ca-certificates \
|
||||
mc \
|
||||
wget \
|
||||
openssh-server
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y curl
|
||||
$STD apt-get install -y sudo
|
||||
$STD apt-get install -y mc
|
||||
$STD apt-get install -y gpg
|
||||
$STD apt-get install -y wget
|
||||
$STD apt-get install -y openssh-server
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setting up Node.js Repository"
|
||||
@@ -41,15 +35,8 @@ $STD apt-get install -y nodejs
|
||||
msg_ok "Installed Node.js"
|
||||
|
||||
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) }')
|
||||
wget -q "https://github.com/Luligu/matterbridge/archive/refs/tags/${RELEASE}.zip"
|
||||
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
|
||||
mkdir -p /root/Matterbridge
|
||||
$STD npm install -g matterbridge
|
||||
msg_ok "Installed Matterbridge"
|
||||
|
||||
msg_info "Creating Service"
|
||||
@@ -60,16 +47,13 @@ After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/npm run start:bridge
|
||||
WorkingDirectory=/opt/matterbridge
|
||||
ExecStart=matterbridge -bridge -service
|
||||
WorkingDirectory=/root/Matterbridge
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStopSec=30s
|
||||
User=root
|
||||
Environment=PATH=/usr/bin:/usr/local/bin:/opt/matterbridge/bin
|
||||
Environment=NODE_ENV=production
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -17,31 +17,48 @@ msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y curl
|
||||
$STD apt-get install -y sudo
|
||||
$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 openssh-server
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing WireGuard (using pivpn.io)"
|
||||
OPTIONS_PATH='/options.conf'
|
||||
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_info "Installing WireGuard"
|
||||
$STD apt-get install -y wireguard wireguard-tools net-tools iptables
|
||||
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
|
||||
customize
|
||||
|
||||
|
||||
Reference in New Issue
Block a user