1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00

Update change_url

This commit is contained in:
ericgaspar 2021-11-08 23:04:19 +01:00
parent 795df0d2b1
commit eb1dc82b7e
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -110,39 +110,22 @@ fi
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
REPO_PATH="/home/yunohost.app/$app/repositories"
DATA_PATH="/home/yunohost.app/$app/data"
cp ../conf/app.ini "$final_path/custom/conf"
cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf"
if [ "$path_url" = "/" ]
then
ynh_replace_string --match_string="__URL__" --replace_string="$new_domain" --target_file="$final_path/custom/conf/app.ini"
url="$new_domain"
else
ynh_replace_string --match_string="__URL__" --replace_string="$new_domain${new_path%/}" --target_file="$final_path/custom/conf/app.ini"
url="$new_domain${new_path%/}"
fi
ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini"
domain=$new_domain
if [[ "$is_public" = '1' ]]
then
ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini"
else
ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini"
fi
ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/custom/conf/auth.d/ldap.conf"
chmod 400 "$final_path/custom/conf/app.ini"
chown $app:$app "$final_path/custom/conf/app.ini"
ynh_store_file_checksum --file="$final_path/custom/conf/app.ini"
ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf"
#=================================================
# GENERIC FINALISATION