2024-07-24 18:41:04 +08:00
|
|
|
|
#!/bin/bash
|
2024-11-18 23:12:52 +08:00
|
|
|
|
declare installation_directory=$1
|
|
|
|
|
declare management_port=$2
|
|
|
|
|
cd $installation_directory
|
2024-07-24 18:41:04 +08:00
|
|
|
|
wget "https://waf-ce.chaitin.cn/release/latest/compose.yaml"
|
|
|
|
|
|
|
|
|
|
cat > ".env" << EOF
|
2024-11-18 23:12:52 +08:00
|
|
|
|
SAFELINE_DIR=$installation_directory
|
2024-07-24 18:41:04 +08:00
|
|
|
|
IMAGE_TAG=latest
|
2024-11-18 23:12:52 +08:00
|
|
|
|
MGT_PORT=$management_port
|
2024-07-24 18:41:04 +08:00
|
|
|
|
POSTGRES_PASSWORD="safeline"
|
|
|
|
|
SUBNET_PREFIX=172.22.222
|
2024-09-12 13:51:44 +08:00
|
|
|
|
IMAGE_PREFIX=swr.cn-east-3.myhuaweicloud.com/chaitin-safeline
|
2024-07-24 18:41:04 +08:00
|
|
|
|
EOF
|
2024-11-18 23:12:52 +08:00
|
|
|
|
docker compose up -d || echo "安装失败" && exit
|
|
|
|
|
declare admin_password=$( docker exec safeline-mgt resetadmin &> /dev/null | grep password | awk -F ":" '{print $2}' )
|
2024-07-24 18:41:04 +08:00
|
|
|
|
echo "账号:admin"
|
2024-11-18 23:12:52 +08:00
|
|
|
|
echo "密码:${admin_password}"
|