1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00
This commit is contained in:
ericgaspar 2021-08-14 23:17:26 +02:00
parent 4b2f7ab0dc
commit 61dd2fed3c
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 16 additions and 10 deletions

View file

@ -53,6 +53,14 @@ ynh_script_progression --message="Restoring the NGINX configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -60,13 +68,9 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=10
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
#================================================= chmod 750 "$final_path"
# RECREATE THE DEDICATED USER chmod -R o-rwx "$final_path"
#================================================= chown -R $app:www-data "$final_path"
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
@ -97,7 +101,7 @@ yunohost service add $app --description="Lightweight Git forge" --log="/var/log/
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION

View file

@ -88,6 +88,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$final_path --source_id="$architecture" ynh_setup_source --dest_dir=$final_path --source_id="$architecture"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini"
cp ../conf/app.ini "$final_path/custom/conf" cp ../conf/app.ini "$final_path/custom/conf"
@ -140,10 +144,8 @@ ynh_add_nginx_config
#================================================= #=================================================
# Set permissions to app files # Set permissions to app files
chown -R $app:$app "$final_path"
chown -R $app:$app "/home/$app" chown -R $app:$app "/home/$app"
chown -R $app:$app "/var/log/$app" chown -R $app:$app "/var/log/$app"
chmod u=rwX,g=rX,o= "$final_path"
chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/home/$app"
chmod u=rwX,g=rX,o= "/var/log/$app" chmod u=rwX,g=rX,o= "/var/log/$app"