1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/forgejo_ynh.git synced 2024-09-03 18:36:26 +02:00
forgejo_ynh/scripts/change_url

56 lines
2 KiB
Text
Raw Normal View History

2023-01-05 14:48:22 +01:00
#!/bin/bash
#=================================================
# GENERIC STARTING
2023-01-05 14:48:22 +01:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
2023-01-05 14:48:22 +01:00
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=2
2023-01-05 14:48:22 +01:00
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/forgejo.log"
2023-01-05 14:48:22 +01:00
#=================================================
2023-01-05 14:48:22 +01:00
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3
2023-03-10 17:13:54 +01:00
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
2023-03-10 17:13:54 +01:00
#REMOVEME?
domain=$new_domain
2023-03-10 17:13:54 +01:00
path=$new_path
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
2023-01-05 14:48:22 +01:00
2023-03-10 17:13:54 +01:00
ynh_exec_warn_less ynh_add_config --template="../conf/app.ini" --destination="$install_dir/custom/conf/app.ini"
2023-01-05 14:48:22 +01:00
2023-03-10 17:13:54 +01:00
chmod 640 "$install_dir/custom/conf/app.ini"
chown $app:$app "$install_dir/custom/conf/app.ini"
2023-01-05 14:48:22 +01:00
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:"
#=================================================
# END OF SCRIPT
#=================================================
2023-01-05 14:48:22 +01:00
ynh_script_progression --message="Change of URL completed for $app" --last