mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 10:17:15 +08:00
Update init.sh.jinja2
This commit is contained in:
parent
26d964180d
commit
ce532c0909
@ -14,6 +14,7 @@ sudo sed -i "s/POWER_PASSWORD=.*/POWER_PASSWORD=$new_password/g" /data/apps/{{ap
|
|||||||
# has_app_encrypt
|
# has_app_encrypt
|
||||||
has_app_encrypt=$(cat /data/apps/{{app_name}}/.env |grep "APP_ENCRYPT=")
|
has_app_encrypt=$(cat /data/apps/{{app_name}}/.env |grep "APP_ENCRYPT=")
|
||||||
if [ $has_app_encrypt != "" ]; then
|
if [ $has_app_encrypt != "" ]; then
|
||||||
|
echo "encrypt password" 1>> /tmp/init_debug.txt
|
||||||
app_encrypt_password=$(bash /data/apps/{{app_name}}/src/encrypt.sh $new_password)
|
app_encrypt_password=$(bash /data/apps/{{app_name}}/src/encrypt.sh $new_password)
|
||||||
sudo sed -i "s/APP_ENCRYPT_PASSWORD=.*/APP_ENCRYPT_PASSWORD=$app_encrypt_password/g" /data/apps/{{app_name}}/.env
|
sudo sed -i "s/APP_ENCRYPT_PASSWORD=.*/APP_ENCRYPT_PASSWORD=$app_encrypt_password/g" /data/apps/{{app_name}}/.env
|
||||||
fi
|
fi
|
||||||
@ -32,6 +33,7 @@ cat .env |grep 'DB_\|APP_' > /credentials/password.txt
|
|||||||
# init APP_URL
|
# init APP_URL
|
||||||
app_url_replace=$(cat /data/apps/{{app_name}}/.env |grep APP_URL_REPLACE)
|
app_url_replace=$(cat /data/apps/{{app_name}}/.env |grep APP_URL_REPLACE)
|
||||||
if [ $app_url_replace == "APP_URL_REPLACE=true" ]; then
|
if [ $app_url_replace == "APP_URL_REPLACE=true" ]; then
|
||||||
|
echo "change APP_URL" 1>> /tmp/init_debug.txt
|
||||||
public_ip=`wget -O - https://download.websoft9.com/ansible/get_ip.sh | bash`
|
public_ip=`wget -O - https://download.websoft9.com/ansible/get_ip.sh | bash`
|
||||||
sudo sed -i "s/APP_URL=.*/APP_URL=$public_ip/g" /data/apps/{{app_name}}/.env
|
sudo sed -i "s/APP_URL=.*/APP_URL=$public_ip/g" /data/apps/{{app_name}}/.env
|
||||||
else
|
else
|
||||||
@ -45,7 +47,7 @@ sudo docker compose -f /data/apps/{{app_name}}/docker-compose.yml up -d
|
|||||||
#2 init for applist of special
|
#2 init for applist of special
|
||||||
after_path=/data/apps/{{app_name}}/src/after_up.sh
|
after_path=/data/apps/{{app_name}}/src/after_up.sh
|
||||||
if [ -f "$after_path" ]; then
|
if [ -f "$after_path" ]; then
|
||||||
echo "after_up execute" 1>> /tmp/init_debug.txt'
|
echo "after_up execute" 1>> /tmp/init_debug.txt
|
||||||
bash /data/apps/{{app_name}}/src/after_up.sh $newpassword
|
bash /data/apps/{{app_name}}/src/after_up.sh $newpassword
|
||||||
else
|
else
|
||||||
echo "There is not after_up"
|
echo "There is not after_up"
|
||||||
|
Loading…
Reference in New Issue
Block a user