1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invidious_ynh.git synced 2024-09-03 19:15:55 +02:00
This commit is contained in:
ericgaspar 2021-05-23 10:38:54 +02:00
parent fb2a274120
commit 8ccf8a28b8
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 29 additions and 34 deletions

View file

@ -64,7 +64,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=9
ynh_script_progression --message="Installing dependencies..." --weight=15
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
@ -72,6 +72,14 @@ tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id=crystal
ynh_exec_warn_less dpkg -i $tempdir/crystal_0.36.1-1_amd64.deb
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# CREATE A POSTGRESQL DATABASE
#=================================================
@ -83,14 +91,6 @@ ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================

View file

@ -52,6 +52,14 @@ ynh_script_progression --message="Restoring the NGINX configuration..."
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
#=================================================
@ -59,20 +67,6 @@ ynh_script_progression --message="Restoring Invidious main directory..." --weigh
ynh_restore_file --origin_path="$final_path"
#=================================================
# 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
#=================================================
# RESTORE USER RIGHTS
#=================================================
ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
@ -84,12 +78,13 @@ chown -R $app:www-data "$final_path"
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=7
ynh_exec_warn_less apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
ynh_install_extra_repo --repo="deb https://dl.bintray.com/crystal/deb all stable" --append
# Define and install dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id=crystal
ynh_exec_warn_less dpkg -i $tempdir/crystal_0.36.1-1_amd64.deb
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================

View file

@ -44,6 +44,14 @@ if ynh_legacy_permissions_exists; then
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -120,14 +128,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# SETUP SYSTEMD
#=================================================