diff --git a/check_process b/check_process index 7049297..c641fc2 100644 --- a/check_process +++ b/check_process @@ -1,13 +1,8 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - is_public=1 (PUBLIC|public=1|private=0) - mapbox_token= + domain="domain.tld" + is_public=1 + mapbox_token="" ; Checks pkg_linter=1 setup_sub_dir=0 @@ -16,6 +11,7 @@ setup_private=1 setup_public=1 upgrade=1 + # Version 2.3.2 upgrade=1 from_commit=069fc840e413e1d2cf80616498bcc052e05616a1 backup_restore=1 multi_instance=1 @@ -28,4 +24,3 @@ Notification=none ; commit=069fc840e413e1d2cf80616498bcc052e05616a1 name="Version 2.3.2" manifest_arg=domain=domain.tld&is_public=1&mapbox_token= - diff --git a/conf/app.src b/conf/app.src index 77272ec..cf643ad 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,5 +3,5 @@ SOURCE_SUM=d6fc5f1496eb698325af2844ee201db1ab55cecdbe2b4e9928e9299598ed47a8 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=v2.3.4.tar.gz +SOURCE_FILENAME=v2.3.5.tar.gz SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index e37e88e..3ad1e97 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,7 +7,7 @@ location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Forwarded-Port $server_port; - + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..8467219 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,2 @@ +* Any known limitations, constrains or stuff not working, such as (but not limited to): + * not-working single-sign on or LDAP integration diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..1128241 --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,2 @@ +* Toutes les limitations, contraintes ou éléments ne fonctionnant pas, tels que (mais sans s'y limiter) : + * authentification unique ou intégration LDAP non fonctionnelle diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/screenshot1.png b/doc/screenshots/screenshot1.png new file mode 100644 index 0000000..3dc26c8 Binary files /dev/null and b/doc/screenshots/screenshot1.png differ diff --git a/manifest.json b/manifest.json index 35ce0b0..8379dd4 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,13 @@ }, "version": "2.3.5~ynh1", "url": "https://photoview.github.io/", + "upstream": { + "license": "AGPL-3.0-only", + "website": "https://photoview.github.io/", + "demo": "https://photos.qpqp.dk/", + "admindoc": "https://photoview.github.io/docs/", + "code": "https://github.com/photoview/photoview" + }, "license": "AGPL-3.0-only", "maintainer": { "name": "Jules Bertholet", diff --git a/scripts/backup b/scripts/backup index 90b2e5e..8a1d93f 100755 --- a/scripts/backup +++ b/scripts/backup @@ -28,9 +28,9 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) -data_path=$(ynh_app_setting_get --app=$app --key=data_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +data_path=$(ynh_app_setting_get --app=$app --key=data_path) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -69,12 +69,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="/var/log/$app" - #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/change_url b/scripts/change_url index 70064a4..9c79e35 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -40,7 +40,7 @@ data_path=$(ynh_app_setting_get --app=$app --key=data_path) mapbox_token=$(ynh_app_setting_get --app=$app --key=mapbox_token) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=35 @@ -97,11 +97,14 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -# ADD A CONFIGURATION +# UPDATE A CONFIG FILE #================================================= +ynh_script_progression --message="Updating a configuration file..." ynh_add_config --template=".env" --destination="$final_path/output/.env" +set_permissions + #================================================= # GENERIC FINALISATION #================================================= @@ -109,6 +112,7 @@ ynh_add_config --template=".env" --destination="$final_path/output/.env" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 +# Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= diff --git a/scripts/install b/scripts/install index be972c9..33dd479 100755 --- a/scripts/install +++ b/scripts/install @@ -56,7 +56,7 @@ ynh_app_setting_set --app=$app --key=mapbox_token --value=$mapbox_token #================================================= # STANDARD MODIFICATIONS #================================================= -# FIND PORTS +# FIND AND OPEN A PORT #================================================= ynh_script_progression --message="Finding an available port..." --weight=1 @@ -78,7 +78,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # CREATE A MYSQL DATABASE @@ -131,21 +131,22 @@ ynh_script_progression --message="Building static UI files..." --weight=45 build_ui +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." + +ynh_add_config --template=".env" --destination="$final_path/output/.env" + +set_permissions + #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config -ynh_add_systemd_config --service=$app - -#================================================= -# ADD A CONFIGURATION -#================================================= - -ynh_add_config --template=".env" --destination="$final_path/output/.env" - -set_permissions +ynh_add_systemd_config #================================================= # GENERIC FINALIZATION diff --git a/scripts/remove b/scripts/remove index f023cca..626f0ca 100755 --- a/scripts/remove +++ b/scripts/remove @@ -44,6 +44,14 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # REMOVE THE MYSQL DATABASE #================================================= @@ -58,6 +66,8 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name ynh_script_progression --message="Removing dependencies..." --weight=5 # Remove metapackage and its dependencies +ynh_remove_go +ynh_remove_nodejs ynh_remove_app_dependencies #================================================= @@ -68,14 +78,6 @@ ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" -#================================================= -# REMOVE APP DATA DIR -#================================================= -ynh_script_progression --message="Removing app data directory..." --weight=1 - -# Remove the app directory securely -ynh_secure_remove --file="$data_path" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -84,36 +86,23 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - -# Remove the app-specific logrotate config -ynh_remove_logrotate - #================================================= # SPECIFIC REMOVE #================================================= # REMOVE VARIOUS FILES #================================================= +ynh_script_progression --message="Removing various files..." # Remove the log files ynh_secure_remove --file="/var/log/$app" #================================================= -# REMOVE GO +# REMOVE APP DATA DIR #================================================= -ynh_script_progression --message="Removing Go..." --weight=1 +ynh_script_progression --message="Removing app data directory..." --weight=1 -ynh_remove_go - -#================================================= -# REMOVE NODE -#================================================= -ynh_script_progression --message="Removing Node.js..." --weight=1 - -ynh_remove_nodejs +# Remove the app directory securely +ynh_secure_remove --file="$data_path" #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index bac7bb0..01dcfe0 100755 --- a/scripts/restore +++ b/scripts/restore @@ -52,25 +52,17 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX web server 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" - -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=30 - -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # RESTORE THE APP MAIN DIR @@ -84,7 +76,6 @@ set_permissions #================================================= # RESTORE THE APP DATA DIR #================================================= - ynh_script_progression --message="Restoring the app data directory..." --weight=1 ynh_restore_file --origin_path="$data_path" --not_mandatory @@ -93,6 +84,14 @@ set_permissions #================================================= # SPECIFIC RESTORATION +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=30 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -124,6 +123,15 @@ 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..." + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + +set_permissions + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -138,20 +146,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# RESTORE VARIOUS FILES -#================================================= - -ynh_restore_file --origin_path="/var/log/$app" - -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - -set_permissions - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2f4c717..6934691 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,7 @@ mapbox_token=$(ynh_app_setting_get --app=$app --key=mapbox_token) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -55,20 +56,25 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +# 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" - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -ynh_install_app_dependencies $pkg_dependencies +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -89,6 +95,13 @@ 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=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # SPECIFIC UPGRADE #================================================= @@ -116,29 +129,25 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then build_ui fi +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." + +ynh_add_config --template=".env" --destination="$final_path/output/.env" + +set_permissions + #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config -ynh_add_systemd_config --service=$app - -#================================================= -# UPDATE A CONFIG FILE -#================================================= - -ynh_add_config --template=".env" --destination="$final_path/output/.env" +ynh_add_systemd_config #================================================= # GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions on app files -set_permissions - #================================================= # SETUP LOGROTATE #================================================= diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/extra_files/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op]