mirror of
https://github.com/YunoHost-Apps/pleroma_ynh.git
synced 2024-09-03 20:15:59 +02:00
Fix multi-instance
This commit is contained in:
parent
a6f5efd686
commit
45b7f7353e
2 changed files with 15 additions and 15 deletions
|
@ -164,41 +164,41 @@ yunohost firewall allow Both "$port" 2>&1
|
|||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
cp -f ../conf/prod.secret.exs "$final_path/$app/config/$app.secret.exs"
|
||||
cp -f ../conf/prod.exs "$final_path/$app/config/$app.exs"
|
||||
cp -f ../conf/setup_db.psql "$final_path/$app/config/setup_db.psql"
|
||||
|
||||
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__KEY__" "$random_key" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__INSTANCE_NAME__" "$name" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__DB_NAME__" "$app" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__ADMIN_EMAIL__" "$admin_email" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/$app/config/$app.exs"
|
||||
ynh_replace_string "__KEY__" "$random_key" "$final_path/$app/config/$app.exs"
|
||||
ynh_replace_string "__INSTANCE_NAME__" "$name" "$final_path/$app/config/$app.exs"
|
||||
ynh_replace_string "__DB_NAME__" "$app" "$final_path/$app/config/$app.exs"
|
||||
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/$app/config/$app.exs"
|
||||
ynh_replace_string "__ADMIN_EMAIL__" "$admin_email" "$final_path/$app/config/$app.exs"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/$app/config/$app.exs"
|
||||
ynh_replace_string "__DB_NAME__" "$app" "$final_path/$app/config/setup_db.psql"
|
||||
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/$app/config/setup_db.psql"
|
||||
if [ $cache -eq 1 ]
|
||||
then
|
||||
ynh_replace_string "__MEDIA_CACHE__" "true" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__MEDIA_CACHE__" "true" "$final_path/$app/config/$app.exs"
|
||||
else
|
||||
ynh_replace_string "__MEDIA_CACHE__" "false" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__MEDIA_CACHE__" "false" "$final_path/$app/config/$app.exs"
|
||||
fi
|
||||
|
||||
# Set registrations open/closed
|
||||
if [ $registration -eq 1 ]
|
||||
then
|
||||
ynh_replace_string "__REG__" "true" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__REG__" "true" "$final_path/$app/config/$app.exs"
|
||||
else
|
||||
ynh_replace_string "__REG__" "false" "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_replace_string "__REG__" "false" "$final_path/$app/config/$app.exs"
|
||||
fi
|
||||
|
||||
# Recalculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_store_file_checksum "$final_path/$app/config/$app.exs"
|
||||
|
||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||
ynh_backup_if_checksum_is_different "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_backup_if_checksum_is_different "$final_path/$app/config/$app.exs"
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum "$final_path/$app/config/$app.secret.exs"
|
||||
ynh_store_file_checksum "$final_path/$app/config/$app.exs"
|
||||
|
||||
#=================================================
|
||||
# MAKE THE UPGRADE
|
||||
|
|
Loading…
Add table
Reference in a new issue