parent
ab07afb7bd
commit
50410acf8d
@ -30,10 +30,12 @@ function update_script() {
|
|||||||
fi
|
fi
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get -y upgrade
|
apt-get -y upgrade
|
||||||
sleep 2
|
if [[ ! -d /etc/wgdashboard ]]; then
|
||||||
cd /etc/wgdashboard/src
|
sleep 2
|
||||||
./wgd.sh update
|
cd /etc/wgdashboard/src
|
||||||
./wgd.sh start
|
./wgd.sh update
|
||||||
|
./wgd.sh start
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,5 +45,5 @@ description
|
|||||||
|
|
||||||
msg_ok "Completed Successfully!\n"
|
msg_ok "Completed Successfully!\n"
|
||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
echo -e "${INFO}${YW} WGDashboard Access it using the following URL:${CL}"
|
echo -e "${INFO}${YW}Access WGDashboard (if installed) using the following URL:${CL}"
|
||||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:10086${CL}"
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:10086${CL}"
|
||||||
|
@ -46,6 +46,10 @@
|
|||||||
{
|
{
|
||||||
"text": "Wireguard and WGDashboard are not the same. More info: `https://docs.wgdashboard.dev/what-is-wireguard-what-is-wgdashboard.html`",
|
"text": "Wireguard and WGDashboard are not the same. More info: `https://docs.wgdashboard.dev/what-is-wireguard-what-is-wgdashboard.html`",
|
||||||
"type": "info"
|
"type": "info"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "WGDashboard installation is optional.`",
|
||||||
|
"type": "info"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -13,28 +13,27 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
|
||||||
$STD apt-get install -y git
|
|
||||||
msg_ok "Installed Dependencies"
|
|
||||||
|
|
||||||
msg_info "Installing WireGuard"
|
msg_info "Installing WireGuard"
|
||||||
$STD apt-get install -y wireguard wireguard-tools net-tools iptables
|
$STD apt-get install -y wireguard wireguard-tools net-tools iptables
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confnew" install -y iptables-persistent &>/dev/null
|
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confnew" install -y iptables-persistent &>/dev/null
|
||||||
$STD netfilter-persistent reload
|
$STD netfilter-persistent reload
|
||||||
msg_ok "Installed WireGuard"
|
msg_ok "Installed WireGuard"
|
||||||
|
|
||||||
msg_info "Installing WGDashboard"
|
read -r -p "${TAB3}Would you like to add WGDashboard? <y/N> " prompt
|
||||||
git clone -q https://github.com/donaldzou/WGDashboard.git /etc/wgdashboard
|
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||||
cd /etc/wgdashboard/src
|
fetch_and_deploy_gh_release "wgdashboard" "donaldzou/WGDashboard" "tarball" "latest" "/etc/wgdashboard"
|
||||||
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 "Create Example Config for WGDashboard"
|
msg_info "Installing WGDashboard"
|
||||||
private_key=$(wg genkey)
|
cd /etc/wgdashboard/src
|
||||||
cat <<EOF >/etc/wireguard/wg0.conf
|
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 "Create Example Config for WGDashboard"
|
||||||
|
private_key=$(wg genkey)
|
||||||
|
cat <<EOF >/etc/wireguard/wg0.conf
|
||||||
[Interface]
|
[Interface]
|
||||||
PrivateKey = ${private_key}
|
PrivateKey = ${private_key}
|
||||||
Address = 10.0.0.1/24
|
Address = 10.0.0.1/24
|
||||||
@ -43,10 +42,10 @@ PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACC
|
|||||||
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
|
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
|
||||||
ListenPort = 51820
|
ListenPort = 51820
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Created Example Config for WGDashboard"
|
msg_ok "Created Example Config for WGDashboard"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/wg-dashboard.service
|
cat <<EOF >/etc/systemd/system/wg-dashboard.service
|
||||||
[Unit]
|
[Unit]
|
||||||
After=syslog.target network-online.target
|
After=syslog.target network-online.target
|
||||||
Wants=wg-quick.target
|
Wants=wg-quick.target
|
||||||
@ -66,8 +65,9 @@ Restart=always
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
systemctl enable -q --now wg-dashboard
|
systemctl enable -q --now wg-dashboard
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
fi
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user