change_url 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. ## this script is only run if actual change to domain/path is detected, if you're here either $domain or $path changed
  3. ## new location is available via $domain and $path (or $new_domain and $new_path variables if you want to be explicit)
  4. ## old values are available via, you guessed it, $old_domain and $old_path
  5. #=================================================
  6. # IMPORT GENERIC HELPERS
  7. #=================================================
  8. source _common.sh
  9. source /usr/share/yunohost/helpers
  10. #=================================================
  11. # MODIFY URL IN NGINX CONF
  12. #=================================================
  13. ynh_script_progression "Updating NGINX web server configuration..."
  14. # this will most likely adjust NGINX config correctly
  15. ynh_config_change_url_nginx
  16. #=================================================
  17. # SPECIFIC MODIFICATIONS
  18. #=================================================
  19. ## do any changes to files that reference specific installation domain/path, i.e. regenerate configs etc
  20. ynh_config_add --template=".env" --destination="$install_dir/.env"
  21. chmod 400 "$install_dir/.env"
  22. chown "$app:$app" "$install_dir/.env"
  23. pushd
  24. ynh_exec_as_app open-webui serve
  25. popd
  26. #=================================================
  27. # END OF SCRIPT
  28. #=================================================
  29. ynh_script_progression "Change of URL completed for $app"