mirror of
https://github.com/YunoHost-Apps/invidious_ynh.git
synced 2024-09-03 19:15:55 +02:00
Reorder
This commit is contained in:
parent
0484ec8547
commit
cd0de90e5c
4 changed files with 42 additions and 29 deletions
|
@ -7,7 +7,7 @@
|
|||
version_commit=0db23f925225f50ed574c69abbb0bd5de58bf709
|
||||
|
||||
# dependencies used by the app
|
||||
pkg_dependencies="apt-transport-https libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev postgresql librsvg2-bin libsqlite3-dev zlib1g-dev libevent-dev pkg-config libpcre3-dev"
|
||||
pkg_dependencies="apt-transport-https libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev postgresql librsvg2-bin imagemagick libsqlite3-dev zlib1g-dev libevent-dev pkg-config libpcre3-dev"
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
|
|
|
@ -129,10 +129,10 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Building Invidious.. (this will take some time and resources!)" --weight=60
|
||||
|
||||
pushd "$final_path" || ynh_die
|
||||
pushd "$final_path"
|
||||
shards update && shards install
|
||||
crystal build $final_path/src/invidious.cr --release
|
||||
popd || ynh_die
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
|
|
|
@ -92,6 +92,13 @@ ynh_psql_test_if_first_run
|
|||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
||||
|
||||
#=================================================
|
||||
# RESTORE VARIOUS FILES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring various files..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
|
@ -100,6 +107,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
|
|||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
|
|
|
@ -31,26 +31,6 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
|||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
# Cleaning legacy permissions
|
||||
if ynh_legacy_permissions_exists; then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
||||
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
|
||||
#=================================================
|
||||
|
@ -75,16 +55,24 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|||
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..." --weight=8
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
# Cleaning legacy permissions
|
||||
if ynh_legacy_permissions_exists; then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
||||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
tempdir="$(mktemp -d)"
|
||||
ynh_setup_source --dest_dir=$tempdir --source_id=crystal
|
||||
ynh_exec_warn_less dpkg -i $tempdir/crystal_1.0.0-1_amd64.deb
|
||||
#=================================================
|
||||
# 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"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -127,6 +115,17 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
|
|||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..." --weight=8
|
||||
|
||||
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_1.0.0-1_amd64.deb
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue