Skip to content

Commit 32864d9

Browse files
committed
update screenshots
1 parent e66cca6 commit 32864d9

File tree

8 files changed

+80
-117
lines changed

8 files changed

+80
-117
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Subsequently, `bash /opt/waf/manager.sh` is used to manage the UUSEC WAF contain
7979

8080
1. Login to the management: Access https://ip:4443 ,the IP address is the server IP address for installing the UUSEC WAF, the default username is "admin", and the default password is "Passw0rd!".
8181
2. Add a site: Go to the "Sites" menu, click the "Add Site" button, and follow the prompts to add the site domain name and website server IP.
82-
3. Add SSL certificate: Go to the certificate management menu, click the "Add Certificate" button, and upload the HTTPS certificate and private key file of the domain name. If you do not add an SSL certificate, the UUSEC WAF will automatically attempt to apply for a Let's Encrypt free SSL certificate and renew it automatically before the certificate expires.
82+
3. Add SSL certificate: Go to the certificate management menu, click the "Add Certificate" button, and upload the HTTPS certificate and private key file of the domain name. If you don‘t have a SSL certificate, you can also apply for a Let's Encrypt free SSL certificate and renew it automatically before the certificate expires.
8383
4. Change the DNS address of the domain: Go to the domain name service provider's management backend and change the IP address recorded in the DNS A of the domain name to the IP address of the UUSEC WAF server.
8484
5. Test connectivity: Visit the site domain to see if the website can be opened, and check if the returned HTTP header server field is uuWAF.
8585

docker/docker-compose.yml

Lines changed: 37 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,58 +12,47 @@
1212

1313
services:
1414
uuwaf:
15-
image: swr.ap-southeast-1.myhuaweicloud.com/uusec/uuwaf:latest
16-
ulimits:
17-
nproc: 65535
18-
nofile:
19-
soft: 102400
20-
hard: 102400
21-
container_name: uuwaf
22-
restart: always
23-
network_mode: host
24-
volumes:
25-
- /etc/localtime:/etc/localtime:ro
26-
- waf_config:/uuwaf/web/conf
27-
- waf_acme_accounts:/uuwaf/web/accounts
28-
- waf_acme_certificates:/uuwaf/web/certificates
29-
command: ["/run.sh"]
30-
environment:
31-
- UUWAF_DB_DSN=root:${MYSQL_PASSWORD}@tcp(127.0.0.1:6612)/uuwaf?charset=utf8mb4&parseTime=true&loc=Local
32-
depends_on:
15+
image: uusec/waf:latest
16+
ulimits:
17+
nproc: 65535
18+
nofile:
19+
soft: 102400
20+
hard: 102400
21+
container_name: uuwaf
22+
restart: always
23+
network_mode: host
24+
volumes:
25+
- /etc/localtime:/etc/localtime:ro
26+
- ./waf_config:/uuwaf/web/conf
27+
- ./waf_acme:/uuwaf/acme
28+
- ./waf_logs:/uuwaf/logs
29+
environment:
30+
- UUWAF_DB_DSN=root:${MYSQL_PASSWORD}@tcp(127.0.0.1:6612)/uuwaf?charset=utf8mb4&parseTime=true&loc=Local
31+
depends_on:
3332
wafdb:
3433
condition: service_healthy
3534

3635
wafdb:
37-
image: swr.ap-southeast-1.myhuaweicloud.com/uusec/percona-server:5.7
38-
ulimits:
39-
nproc: 65535
40-
nofile:
41-
soft: 102400
42-
hard: 102400
43-
container_name: wafdb
44-
restart: always
45-
networks:
36+
image: mysql:5.7.44
37+
container_name: wafdb
38+
restart: always
39+
networks:
4640
wafnet:
4741
ipv4_address: 172.31.254.3
48-
ports:
49-
- "6612:3306"
50-
volumes:
51-
- /etc/localtime:/etc/localtime:ro
52-
- waf_data:/var/lib/mysql
53-
#- ./low-memory-my.cnf:/etc/mysql/my.cnf
54-
environment:
55-
- INIT_ROCKSDB
56-
- MYSQL_MAX_CONNECTIONS=512
57-
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
58-
healthcheck:
59-
test: ["CMD", "mysqladmin", "-uroot", "-p${MYSQL_PASSWORD}", "ping", "-h", "127.0.0.1", "--silent"]
60-
start_period: 3s
61-
interval: 5s
62-
timeout: 3s
63-
retries: 10
42+
ports:
43+
- "6612:3306"
44+
volumes:
45+
- /etc/timezone:/etc/timezone:ro
46+
- /etc/localtime:/etc/localtime:ro
47+
- ./waf_data:/var/lib/mysql
48+
#- ./low-memory-my.cnf:/etc/mysql/my.cnf
49+
environment:
50+
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
51+
command: ["--max_connections=512"]
52+
healthcheck:
53+
test: ["CMD", "mysqladmin", "-uroot", "-p${MYSQL_PASSWORD}", "ping", "-h", "127.0.0.1", "--silent"]
54+
start_period: 3s
55+
interval: 5s
56+
timeout: 3s
57+
retries: 10
6458

65-
volumes:
66-
waf_config:
67-
waf_acme_accounts:
68-
waf_acme_certificates:
69-
waf_data:

docker/install-docker.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ get_distribution() {
256256
# Every system that we officially support has /etc/os-release
257257
if [ -r /etc/os-release ]; then
258258
lsb_dist="$(. /etc/os-release && echo "$ID")"
259+
case "$lsb_dist" in
260+
rocky|almalinux)
261+
lsb_dist="centos"
262+
;;
263+
esac
259264
fi
260265
# Returning an empty string here should be alright since the
261266
# case statements don't act unless you provide an actual value

docker/uuwaf.sh renamed to docker/manager.sh

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
info() {
4+
echo -e "\033[32m[UUSEC WAF] $*\033[0m"
5+
}
6+
37
warning() {
48
echo -e "\033[33m[UUSEC WAF] $*\033[0m"
59
}
@@ -10,7 +14,7 @@ abort() {
1014
}
1115

1216
if [ -z "$BASH" ]; then
13-
abort "Please execute this script using bash and refer to the latest official technical documentation https://uuwaf.uusec.com/"
17+
abort "Please execute this script using bash and refer to the latest official technical documentation https://www.uusec.com/"
1418
fi
1519

1620
if [ "$EUID" -ne "0" ]; then
@@ -37,44 +41,38 @@ fi
3741

3842
if [ ! -f ".env" ];then
3943
echo "MYSQL_PASSWORD=$(LC_ALL=C tr -dc A-Za-z0-9 </dev/urandom | head -c 32)" > .env
40-
if [ $(command -v firewall-cmd) ]; then
41-
firewall-cmd --permanent --add-port={80,443,4443}/tcp > /dev/null 2>&1
42-
firewall-cmd --reload > /dev/null 2>&1
43-
elif [ $(command -v ufw) ]; then
44-
for port in 80 443 4443; do ufw allow $port/tcp > /dev/null 2>&1; done
45-
ufw reload > /dev/null 2>&1
46-
fi
4744
fi
4845

49-
stop_uuwaf(){
46+
stop_waf(){
5047
$DC_CMD down
5148
}
5249

53-
uninstall_uuwaf(){
54-
stop_uuwaf
50+
uninstall_waf(){
51+
stop_waf
5552
docker rm -f uuwaf wafdb > /dev/null 2>&1
5653
docker network rm wafnet > /dev/null 2>&1
5754
docker images|grep uuwaf|awk '{print $3}'|xargs docker rmi -f > /dev/null 2>&1
58-
docker volume ls|grep waf|awk '{print $2}'|xargs docker volume rm -f > /dev/null 2>&1
55+
docker volume ls|grep _waf_|awk '{print $2}'|xargs docker volume rm -f > /dev/null 2>&1
5956
}
6057

61-
start_uuwaf(){
58+
start_waf(){
6259
if [ ! $(command -v netstat) ]; then
63-
$( command -v yum || command -v apt-get ) -y install net-tools
60+
$( command -v yum || command -v apt-get || command -v zypper ) -y install net-tools
6461
fi
65-
port_status=`netstat -nlt|grep -E ':(80|443|4443|6612)\s'|wc -l`
62+
port_status=`netstat -nlt|grep -E ':(80|443|777|4443|4447)\s'|wc -l`
6663
if [ $port_status -gt 0 ]; then
67-
abort "One or more of ports 80, 443, 4443, 6612 are occupied. Please shutdown the corresponding service or modify its port"
64+
abort "One or more of ports 80, 443, 777, 4443, 4447 are occupied. Please shutdown the corresponding service or modify its port"
6865
fi
6966
$DC_CMD up -d --remove-orphans
7067
}
7168

72-
upgrade_uuwaf(){
69+
upgrade_waf(){
70+
curl https://uuwaf.uusec.com/docker-compose.yml -o docker-compose.yml
7371
$DC_CMD pull
7472
$DC_CMD up -d --remove-orphans
7573
}
7674

77-
repair_uuwaf(){
75+
repair_waf(){
7876
if [ $(command -v firewall-cmd) ]; then
7977
systemctl restart firewalld > /dev/null 2>&1
8078
elif [ $(command -v ufw) ]; then
@@ -84,66 +82,56 @@ repair_uuwaf(){
8482
systemctl restart docker
8583
}
8684

87-
restart_uuwaf(){
88-
stop_uuwaf
89-
start_uuwaf
90-
}
91-
92-
clean_uuwaf(){
93-
docker system prune -a -f
94-
docker volume prune -a -f
85+
restart_waf(){
86+
stop_waf
87+
start_waf
9588
}
9689

9790
start_menu(){
9891
clear
9992
echo "========================="
100-
echo "UUSEC WAF Docker Management"
93+
echo "UUSEC WAF Management"
10194
echo "========================="
10295
echo "1. Start"
10396
echo "2. Stop"
10497
echo "3. Restart"
10598
echo "4. Upgrade"
10699
echo "5. Repair"
107100
echo "6. Uninstall"
108-
echo "7. Clean"
109-
echo "8. Exit"
101+
echo "7. Exit"
110102
echo
111103
read -p "Please enter the number: " num
112104
case "$num" in
113-
1)
114-
start_uuwaf
115-
echo "Startup completed"
105+
1)
106+
start_waf
107+
info "Startup completed"
116108
;;
117109
2)
118-
stop_uuwaf
119-
echo "Stop completed"
110+
stop_waf
111+
info "Stop completed"
120112
;;
121-
3)
122-
restart_uuwaf
123-
echo "Restart completed"
113+
3)
114+
restart_waf
115+
info "Restart completed"
124116
;;
125117
4)
126-
upgrade_uuwaf
127-
echo "Upgrade completed"
118+
upgrade_waf
119+
info "Upgrade completed"
128120
;;
129121
5)
130-
repair_uuwaf
131-
echo "Repair completed"
122+
repair_waf
123+
info "Repair completed"
132124
;;
133125
6)
134-
uninstall_uuwaf
135-
echo "Uninstall completed"
126+
uninstall_waf
127+
info "Uninstall completed"
136128
;;
137129
7)
138-
clean_uuwaf
139-
echo "Clean completed"
140-
;;
141-
8)
142130
exit 1
143131
;;
144132
*)
145133
clear
146-
echo "Please enter the right number"
134+
info "Please enter the right number"
147135
;;
148136
esac
149137
sleep 3s

docker/readme.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs-cn/_media/waf.png

-41.1 KB
Loading

docs/_media/waf.png

-29.9 KB
Loading

docs/guide/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Subsequently, `bash /opt/waf/manager.sh` is used to manage the UUSEC WAF contain
3434

3535
1. Login to the management: Access https://ip:4443 ,the IP address is the server IP address for installing the UUSEC WAF, the default username is "admin", and the default password is "#Passw0rd".
3636
2. Add a site: Go to the "Sites" menu, click the "Add Site" button, and follow the prompts to add the site domain name and website server IP.
37-
3. Add SSL certificate: Go to the certificate management menu, click the "Add Certificate" button, and upload the HTTPS certificate and private key file of the domain name. If you do not have a SSL certificate, you can also apply for a Let's Encrypt free SSL certificate and renew it automatically before the certificate expires.
37+
3. Add SSL certificate: Go to the certificate management menu, click the "Add Certificate" button, and upload the HTTPS certificate and private key file of the domain name. If you don‘t have a SSL certificate, you can also apply for a Let's Encrypt free SSL certificate and renew it automatically before the certificate expires.
3838
4. Change the DNS address of the domain: Go to the domain name service provider's management backend and change the IP address recorded in the DNS A of the domain name to the IP address of the UUSEC WAF server.
3939
5. Test connectivity: Visit the site domain to see if the website can be opened, and check if the returned HTTP header server field is uuWAF.
4040

0 commit comments

Comments
 (0)