Skip to content

Commit 5099e7c

Browse files
authored
Merge pull request #31 from NOXCIS/quickdev
Quickdev
2 parents 3d42074 + 127e0dc commit 5099e7c

23 files changed

+246
-177
lines changed

.gitignore

+22-16
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,26 @@ src/db
55
__pycache__
66
src/test.py
77
*.db
8-
docker-compose-test.yml
9-
src/wg-dashboard.ini
8+
9+
1010
src/static/pic.xd
1111
private_key.txt
1212
public_key.txt
1313
venv/**
1414
log/**
1515
*.log
1616
release/*
17-
src/db/wgdashboard.db
17+
18+
1819
.jshintrc
1920
wireguard/
2021
etc-dnsmasq.d/*
2122
etc-pihole/*
2223
!etc-pihole/custom.list
2324
etc-dnsmasq.d/
24-
WG-Dash/config/*.conf
2525
data/
26-
WG-Dash/src/test.sh
27-
WG-Dash/master-key/master.conf
28-
test.sh
26+
27+
2928
Unbound-Custom-Config/root.hints
3029
.gitignore
3130
.idea/
@@ -38,17 +37,24 @@ Channels/.pytest_cache/
3837
Channels/.mypy_cache/
3938
Channels/.ipynb_checkpoints/
4039

41-
wget-log
4240

43-
dev-docker-compose.yml
44-
ch-dev-docker-compose.yml
45-
dev-docker-compose.yml
46-
WG-Dash/master-key/master.conf.enc
47-
WG-Dash/master-key/master.conf.enc
41+
42+
Global-Configs/Master-Key/master.conf
43+
Global-Configs/Master-Key/master.conf.enc
44+
Global-Configs/Master-Key/*.conf
45+
Global-Configs/Master-Key/*.enc
46+
47+
WG-Dash/master-key/master.conf
4848
WG-Dash/master-key/master.conf.enc
49+
WG-Dash/master-key/*.enc
50+
WG-Dash/master-key/*.conf
51+
4952
*.enc
50-
WG-Dash/src/env
53+
5154
WG-Dash/src/wg-dashboard.ini
55+
56+
wget-log
5257
run-log.txt
53-
Global-Configs/Master-Key/master.conf
54-
Global-Configs/Master-Key/master.conf
58+
59+
test.py
60+
test.sh

Core-Installer-Functions/AdGuard/AdGuard-ENV-setup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set_adguard_pass() {
1111

1212
# Print the updated timer value
1313
set_pass_adguard_title
14-
echo "Press Enter to set Adguard Password $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for no password: $(tput sgr0)"
14+
echo "Press Enter to set Adguard Password $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for random password: $(tput sgr0)"
1515

1616
# Decrement the timer value by 1
1717
timer=$((timer - 1))
@@ -96,7 +96,7 @@ set_adguard_user() {
9696

9797
# Print the updated timer value
9898
set_uname_adguard_title
99-
echo "Press Enter to set AdGuard Username $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for no password: $(tput sgr0)"
99+
echo "Press Enter to set AdGuard Username $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for random username: $(tput sgr0)"
100100

101101
# Decrement the timer value by 1
102102
timer=$((timer - 1))

Core-Installer-Functions/Menu.sh

+19-15
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,27 @@ menu() {
88
EOF
99

1010
title
11-
echo "Please choose an DNS Provider:"
11+
echo "Please choose a DNS Provider:"
12+
echo "-----------------------------------------------------"
1213
echo "1. Pihole Install"
1314
echo "2. AdGuard Install"
14-
echo "3. Reset Wormhole Deployment"
15-
echo "4. Switch to local deploy I.E RaspberryPi"
16-
echo "5. Switch to Cloud deploy I.E AWS"
17-
echo "6. Exit"
15+
echo "3. Launch Developement Build"
16+
echo "4. Switch to Local Install Mode I.E RaspberryPi"
17+
echo "5. Switch to Cloud Install Mode I.E AWS"
18+
echo "6. Reset WireGate Deployment"
19+
echo "7. Exit"
20+
echo "-----------------------------------------------------"
1821
read -p "Enter your choice: " choice
1922
echo ""
2023

2124
case $choice in
2225
1) pihole_install_menu ;;
2326
2) adguard_install_menu ;;
24-
3) fresh_install ;;
27+
3) dev_build ;;
2528
4) unbound_config_swap ;;
2629
5) unbound_config_swapback ;;
27-
6) exit ;;
30+
6) fresh_install ;;
31+
7) exit ;;
2832
*) echo "Invalid choice. Please try again." ;;
2933
esac
3034
}
@@ -35,20 +39,20 @@ pihole_install_menu() {
3539
pihole_install_title
3640
pihole_compose_swap >/dev/null 2>&1
3741
echo "Please choose an option:"
42+
echo "-----------------------------------------------------"
3843
echo "1. Express Install"
3944
echo "2. Advanced Install"
4045
echo "3. Custom PreConfigured Install"
41-
echo "4. Reset Wormhole Deployment"
42-
echo "5. Back to Main Menu"
46+
echo "4. Back to Main Menu"
47+
echo "-----------------------------------------------------"
4348
read -p "Enter your choice: " choice
4449
echo ""
4550

4651
case $choice in
4752
1) pihole_express_setup ;;
4853
2) pihole_advanced_setup ;;
4954
3) pihole_predefined_setup ;;
50-
4) fresh_install ;;
51-
5) menu ;;
55+
4) menu ;;
5256
*) echo "Invalid choice. Please try again." ;;
5357
esac
5458
}
@@ -58,20 +62,20 @@ adguard_install_menu() {
5862
adguard_install_title
5963
adguard_compose_swap >/dev/null 2>&1
6064
echo "Please choose an option:"
65+
echo "-----------------------------------------------------"
6166
echo "1. Express Install"
6267
echo "2. Advanced Install"
6368
echo "3. Custom PreConfigured Install"
64-
echo "4. Reset Wormhole Deployment"
65-
echo "5. Back to Main Menu"
69+
echo "4. Back to Main Menu"
70+
echo "-----------------------------------------------------"
6671
read -p "Enter your choice: " choice
6772
echo ""
6873

6974
case $choice in
7075
1) adguard_express_setup ;;
7176
2) adguard_advanced_setup ;;
7277
3) adguard_predefined_setup ;;
73-
4) fresh_install ;;
74-
5) menu ;;
78+
4) menu ;;
7579
*) echo "Invalid choice. Please try again." ;;
7680
esac
7781
}

Core-Installer-Functions/Pihole/Pihole-ENV-setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set_pihole_password() {
2828

2929
# Print the updated timer value
3030
set_pass_pihole_title
31-
echo "Press Enter to set Pihole Dashboard Password $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for no password: $(tput sgr0)"
31+
echo "Press Enter to set Pihole Dashboard Password $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for random password: $(tput sgr0)"
3232

3333
# Decrement the timer value by 1
3434
timer=$((timer - 1))

Core-Installer-Functions/Reset-WormHole.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fresh_install() {
2-
local masterkey_file="./WG-Dash/master-key/master.conf"
3-
local config_folder="./WG-Dash/config"
2+
local masterkey_file="./Global-Configs/Master-Key/master.conf"
3+
local database_folder="./Global-Configs/Wiregate-Database"
44
local yml_file="docker-compose.yml"
55

66
clear
@@ -27,7 +27,7 @@ fresh_install() {
2727

2828
if [[ $answer == [Yy] || -z $answer ]]; then
2929
port_mappings="770-777:770-777/udp"
30-
export PORT_MAPPINGS="$port_mappings"
30+
export WG_DASH_PORT_MAPPINGS="$port_mappings"
3131
docker compose down --volumes --remove-orphans
3232

3333
if [ -f "$masterkey_file" ]; then
@@ -36,10 +36,10 @@ fresh_install() {
3636
echo "Existing '$masterkey_file' removed."
3737
fi
3838

39-
if [ -d "$config_folder" ]; then
40-
echo "Removing existing '$config_folder'..."
41-
sudo rm -r "$config_folder"
42-
echo "Existing '$config_folder' removed."
39+
if [ -d "$database_folder" ]; then
40+
echo "Removing existing '$database_folder'..."
41+
sudo rm -r "$database_folder"
42+
echo "Existing '$database_folder' removed."
4343
fi
4444

4545
echo "Removing existing Compose File"

Core-Installer-Functions/Title.sh

+20-4
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ ________________________________________________________________________________
9999
ENVIRONMENT VARIABLES | VALUES
100100
____________________________________|_________________________________________________________________________________________________
101101
|
102-
SERVER IP | \033[33m'"$SERVER_IP"'\033[0m
102+
SERVER IP | \033[33m'"$WG_DASH_SERVER_IP"'\033[0m
103103
------------------------------------|-------------------------------------------------------------------------------------------------
104104
PIHOLE PASSWORD | \033[33m'"$PI_HOLE_PASS"'\033[0m
105105
------------------------------------|-------------------------------------------------------------------------------------------------
106106
WIREGUARD DASHBOARD USER | \033[33m'"$WG_DASH_USER"'\033[0m
107107
------------------------------------|-------------------------------------------------------------------------------------------------
108108
WIREGUARD DASHBOARD PASSWORD | \033[33m'"$WG_DASH_PASS"'\033[0m
109109
------------------------------------|-------------------------------------------------------------------------------------------------
110-
WIREGUARD PORT MAPPINGS | \033[33m'"$PORT_MAPPINGS"'\033[0m
110+
WIREGUARD PORT MAPPINGS | \033[33m'"$WG_DASH_PORT_MAPPINGS"'\033[0m
111111
------------------------------------|-------------------------------------------------------------------------------------------------
112112
CHANNELS INFORMATION | \033[33m'"$DB_URI"'\033[0m
113113
------------------------------------|-------------------------------------------------------------------------------------------------
@@ -125,7 +125,7 @@ ________________________________________________________________________________
125125
ENVIRONMENT VARIABLES | VALUES
126126
____________________________________|_________________________________________________________________________________________________
127127
|
128-
SERVER IP | \033[33m'"$SERVER_IP"'\033[0m
128+
SERVER IP | \033[33m'"$WG_DASH_SERVER_IP"'\033[0m
129129
------------------------------------|-------------------------------------------------------------------------------------------------
130130
ADGUARD USERNAME | \033[33m'"$AD_GUARD_USER"'\033[0m
131131
------------------------------------|-------------------------------------------------------------------------------------------------
@@ -135,7 +135,7 @@ ____________________________________|___________________________________________
135135
------------------------------------|-------------------------------------------------------------------------------------------------
136136
WIREGUARD DASHBOARD PASSWORD | \033[33m'"$WG_DASH_PASS"'\033[0m
137137
------------------------------------|-------------------------------------------------------------------------------------------------
138-
WIREGUARD PORT MAPPINGS | \033[33m'"$PORT_MAPPINGS"'\033[0m
138+
WIREGUARD PORT MAPPINGS | \033[33m'"$WG_DASH_PORT_MAPPINGS"'\033[0m
139139
------------------------------------|-------------------------------------------------------------------------------------------------
140140
CHANNELS INFORMATION | \033[33m'"$DB_URI"'\033[0m
141141
------------------------------------|-------------------------------------------------------------------------------------------------
@@ -156,6 +156,22 @@ ____________________________________|___________________________________________
156156
ADGUARD USERNAME | \033[33m'"$AD_GUARD_USER"'\033[0m
157157
------------------------------------|-------------------------------------------------------------------------------------------------
158158
ADGUARD PASSWORD | \033[33m'"$AD_GUARD_PASS"'\033[0m
159+
------------------------------------|-------------------------------------------------------------------------------------------------
160+
WIREGUARD PORT MAPPINGS | \033[33m'"$WG_DASH_PORT_MAPPINGS"'\033[0m
161+
------------------------------------|-------------------------------------------------------------------------------------------------'
162+
echo -e "\033[0m" # Reset text color to default
163+
return 0
164+
}
165+
166+
env_var_pihole_title_short() {
167+
168+
echo -e '
169+
______________________________________________________________________________________________________________________________________
170+
|
171+
ENVIRONMENT VARIABLES | VALUES
172+
____________________________________|_________________________________________________________________________________________________
173+
|
174+
WIREGUARD PORT MAPPINGS | \033[33m'"$WG_DASH_PORT_MAPPINGS"'\033[0m
159175
------------------------------------|-------------------------------------------------------------------------------------------------'
160176
echo -e "\033[0m" # Reset text color to default
161177
return 0

Core-Installer-Functions/WG-Dash/WG-Dash-ENV-setup.sh

+11-24
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
update_server_ip() {
44

55
ip=$(hostname -I | awk '{print $1}')
6-
export SERVER_IP="$ip"
6+
export WG_DASH_SERVER_IP="$ip"
77

88
}
99
set_port_range() {
@@ -34,8 +34,8 @@ set_port_range() {
3434
HOST_PORT_END=$((HOST_PORT_START + pcount-1))
3535
port_mappings="${HOST_PORT_START}-${HOST_PORT_END}:${HOST_PORT_START}-${HOST_PORT_END}/udp"
3636
echo -e "Wireguard Port Range Set To: \033[32m$port_mappings\033[0m"
37-
export PORT_RANGE_START="$HOST_PORT_START"
38-
export PORT_MAPPINGS="$port_mappings"
37+
export WG_DASH_PORT_RANGE_STARTPORT="$HOST_PORT_START"
38+
export WG_DASH_PORT_MAPPINGS="$port_mappings"
3939
fi
4040

4141

@@ -48,8 +48,8 @@ set_port_range() {
4848
HOST_PORT_END=$((HOST_PORT_START + pcount-1))
4949
port_mappings="${HOST_PORT_START}-${HOST_PORT_END}:${HOST_PORT_START}-${HOST_PORT_END}/udp"
5050
echo -e "Wireguard Port Range Set To: \033[32m$port_mappings\033[0m"
51-
export PORT_RANGE_START="$HOST_PORT_START"
52-
export PORT_MAPPINGS="$port_mappings"
51+
export WG_DASH_PORT_RANGE_STARTPORT="$HOST_PORT_START"
52+
export WG_DASH_PORT_MAPPINGS="$port_mappings"
5353
break
5454
done
5555
fi
@@ -90,7 +90,7 @@ set_wg-dash_pass() {
9090

9191
# Print the updated timer value
9292
set_pass_wgdash_title
93-
echo "Press Enter to set Wireguard Dashboard Password $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for no password: $(tput sgr0)"
93+
echo "Press Enter to set Wireguard Dashboard Password $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for random password: $(tput sgr0)"
9494

9595
# Decrement the timer value by 1
9696
timer=$((timer - 1))
@@ -108,16 +108,9 @@ set_wg-dash_pass() {
108108

109109
plaintext_wgdash_pass=$(head /dev/urandom | tr -dc "$characters" | head -c 16)
110110

111-
output=$(htpasswd -B -n -b "$username" "$plaintext_wgdash_pass")
112-
113-
# Use sed to delete the first 5 characters of $output and assign it to wgdash_password
114-
wgdash_password=$(echo "$output" | sed 's/.....//')
115-
116-
117-
#sed -i -E "s|^( *password: ).*|\1$wgdash_password|" "$adguard_yaml_file"
118-
111+
119112
export WG_DASH_PASS="$plaintext_wgdash_pass"
120-
export WG_DASH_PASS_ENCRYPTED="$wgdash_password"
113+
121114

122115

123116

@@ -145,18 +138,12 @@ set_wg-dash_pass() {
145138
else
146139
# Passwords match, set the Database Password
147140

148-
output=$(htpasswd -B -n -b "$username" "$wgdash_pass")
149-
150-
# Use sed to delete the first 5 characters of $output and assign it to wgdash_password
151-
manual_adguard_password=$(echo "$output" | sed 's/.....//')
152-
153141

154-
#sed -i -E "s|^( *password: ).*|\1$manual_adguard_password|" "$adguard_yaml_file"
155142

156143

157144

158145
export WG_DASH_PASS="$wgdash_pass"
159-
export WG_DASH_PASS_ENCRYPTED="$manual_adguard_password"
146+
160147

161148

162149
break
@@ -176,7 +163,7 @@ set_wg-dash_user() {
176163

177164
# Print the updated timer value
178165
set_uname_wgdash_title
179-
echo "Press Enter to set Wireguard Dashboard Username $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for no password: $(tput sgr0)"
166+
echo "Press Enter to set Wireguard Dashboard Username $(tput setaf 1)or wait $(tput sgr0)$(tput setaf 3)$timer$(tput sgr0)$(tput setaf 1) seconds for random username: $(tput sgr0)"
180167

181168
# Decrement the timer value by 1
182169
timer=$((timer - 1))
@@ -236,7 +223,7 @@ set_wg-dash_key() {
236223
# Generate a 512-bit random key using OpenSSL and convert it to hexadecimal
237224
secret_key_hex=$(openssl rand -hex 64)
238225
# Export the key to the MSG_SECRET_KEY variable
239-
export WGDASH_SECRET_KEY="$secret_key_hex"
226+
export WG_DASH_SECRET_KEY="$secret_key_hex"
240227
}
241228
set_wg-dash_config() {
242229
set_wg-dash_key

Global-Configs/Docker-Compose/adguard-custom-docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ services:
2222
wg_dashboard:
2323
depends_on: [unbound, adguard]
2424
#build: ./WG-Dash
25-
image: noxcis/wg-dashboard:mantis-shrimp
25+
image: noxcis/wg-dashboard:cetus
2626
container_name: wg_dashboard
2727
cap_add:
2828
- NET_ADMIN
2929
- SYS_MODULE
3030
restart: unless-stopped
3131
volumes:
32+
- ./Global-Configs/Wiregate-Database:/home/app/db
3233
- ./Global-Configs/Master-Key:/home/app/master-key
3334
- ./Global-Configs/Firewall-Rules:/home/app/FIREWALLS
3435
env_file:

0 commit comments

Comments
 (0)