mirror of
https://github.com/YunoHost-Apps/discourse_ynh.git
synced 2024-09-03 18:26:18 +02:00
Fix change_url for domain change w/o path change
This commit is contained in:
parent
b14d57cb2a
commit
89cffbd74a
1 changed files with 1 additions and 4 deletions
|
@ -119,16 +119,13 @@ fi
|
|||
discourse_config_file="$final_path/config/discourse.conf"
|
||||
# Configure hostname
|
||||
ynh_replace_string --match_string="hostname = .*" --replace_string="hostname = \"$new_domain\"" --target_file="$discourse_config_file"
|
||||
ynh_replace_string --match_string="relative_url_root = .*" --replace_string="relative_url_root = ${path_url%/}" --target_file="$discourse_config_file"
|
||||
ynh_replace_string --match_string="relative_url_root = .*" --replace_string="relative_url_root = ${new_path%/}" --target_file="$discourse_config_file"
|
||||
ynh_replace_string --match_string="smtp_domain = .*" --replace_string="smtp_domain = $new_domain" --target_file="$discourse_config_file"
|
||||
|
||||
# Calculate and store the config file checksum
|
||||
ynh_store_file_checksum --file="$discourse_config_file"
|
||||
|
||||
# Change URL setting
|
||||
echo "UPDATE site_settings SET value = replace(value, '${old_path%/}/images/', '${new_path%/}/images/');
|
||||
UPDATE site_settings SET value = '${new_path}') WHERE name='long_polling_base_url';"
|
||||
|
||||
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "UPDATE site_settings SET value = replace(value, '${old_path%/}/images/', '${new_path%/}/images/');
|
||||
UPDATE site_settings SET value = '${new_path}' WHERE name='long_polling_base_url';"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue