From 9cf2f1f232a88b4841400a54c3925c9b6e05c987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 27 May 2023 16:09:22 +0200 Subject: [PATCH] cleaning --- manifest.json | 12 ++++++------ scripts/_common.sh | 2 -- scripts/backup | 8 -------- scripts/change_url | 5 ----- scripts/install | 6 +----- scripts/restore | 10 ++-------- scripts/upgrade | 2 +- 7 files changed, 10 insertions(+), 35 deletions(-) diff --git a/manifest.json b/manifest.json index 3514cca..177a6b2 100644 --- a/manifest.json +++ b/manifest.json @@ -3,19 +3,19 @@ "id": "immich", "packaging_format": 1, "description": { - "en": "Self-hosted photo and video backup solution directly from your mobile phone.", - "fr": "Solution auto-hébergée pour la sauvegarde de photos et de vidéos directement depuis votre mobile." + "en": "Self-hosted photo and video backup solution directly from your mobile phone", + "fr": "Solution auto-hébergée pour la sauvegarde de photos et de vidéos directement depuis votre mobile" }, "version": "1.26.0~ynh1", "url": "https://www.immich.app", "upstream": { - "license": "mit", + "license": "MIT", "website": "https://www.immich.app", "admindoc": "https://github.com/immich-app/immich#getting-started", "userdoc": "https://github.com/immich-app/immich#getting-started", "code": "https://github.com/immich-app/immich" }, - "license": "mit", + "license": "MIT", "maintainer": { "name": "limezy" }, @@ -35,8 +35,8 @@ { "name": "path", "type": "path", - "example": "/example", - "default": "/example" + "example": "/immich", + "default": "/immich" }, { "name": "is_public", diff --git a/scripts/_common.sh b/scripts/_common.sh index 4d1345c..86dc907 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -38,8 +38,6 @@ pkg_dependencies="npm musl-dev libvips postgresql ffmpeg" # apt-get install musl-dev # ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 - - #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index f7cbfd7..cd2223e 100755 --- a/scripts/backup +++ b/scripts/backup @@ -40,11 +40,6 @@ jwt=$(ynh_app_setting_get --app=$app --key=jwt) #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= @@ -97,9 +92,6 @@ ynh_backup --src_path="/etc/$app/" #================================================= ynh_print_info --message="Backing up the MySQL database..." -### (However, things like MySQL dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) - ynh_mysql_dump_db --database="$db_name" > db.sql #================================================= diff --git a/scripts/change_url b/scripts/change_url index 322641b..cfea773 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,11 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= diff --git a/scripts/install b/scripts/install index 4636a0c..5860114 100755 --- a/scripts/install +++ b/scripts/install @@ -74,7 +74,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing dependencies..." --weight=1 # Install nodejs -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION 2>&1 +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_app_dependencies $pkg_dependencies # sudo ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 @@ -113,15 +113,11 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" - - #================================================= # NGINX CONFIGURATION #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=1 -### `ynh_add_nginx_config` will use the file conf/nginx.conf - # Create a dedicated NGINX config ynh_add_nginx_config diff --git a/scripts/restore b/scripts/restore index 1be949b..9e818fb 100755 --- a/scripts/restore +++ b/scripts/restore @@ -61,12 +61,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" -# FIXME: this should be managed by the core in the future -# Here, as a packager, you may have to tweak the ownerhsip/permissions -# such that the appropriate users (e.g. maybe www-data) can access -# files in some cases. -# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - -# this will be treated as a security issue. chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -112,14 +106,14 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 06074b3..8c0012a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -150,7 +150,7 @@ ynh_add_fpm_config #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config