From 289d89d54bc531fda94af3a369e3f9c140d9d27b Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:08:06 +0100 Subject: [PATCH 01/24] init use official builds --- manifest.toml | 17 +++++------------ scripts/install | 24 ++---------------------- 2 files changed, 7 insertions(+), 34 deletions(-) diff --git a/manifest.toml b/manifest.toml index 526c4ba..7f376c5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Photoprism" description.en = "AI-Powered Photos App for the Decentralized Web" description.fr = "Gestion de photos en ligne" -version = "2022.09.01~ynh4" +version = "2023.11.28~ynh1" maintainers = ["Thovi98"] @@ -59,18 +59,11 @@ ram.runtime = "50M" [resources] [resources.sources] [resources.sources.main] - format = "docker" - extract = true - prefetch = false + amd64.url = "https://github.com/photoprism/photoprism/releases/download/231128-f48ff16ef/photoprism_231128-f48ff16ef-linux-amd64.tar.gz" + amd64.sha256 = "" - amd64.url = "photoprism/photoprism:220901-bullseye" - amd64.sha256 = "3381d40181ecdf62932e9530c6b81e6e0f8828a3d373d8dedf662aab96dafba4" - - arm64.url = "photoprism/photoprism:220901-bullseye" - arm64.sha256 = "3dcffda0a2b58c91479c883205025edee4ea799fc35be419f9bec708ccb54b7f" - - armhf.url = "photoprism/photoprism:220901-bullseye" - armhf.sha256 = "a74f4d0a220af9a5291307bfba36f662d97c4df143f04d951e3c30111916317e" + arm64.url = "https://github.com/photoprism/photoprism/releases/download/231128-f48ff16ef/photoprism_231128-f48ff16ef-linux-arm64.tar.gz" + arm64.sha256 = "" [resources.system_user] diff --git a/scripts/install b/scripts/install index 5eb1c29..4579ddd 100755 --- a/scripts/install +++ b/scripts/install @@ -34,7 +34,9 @@ ynh_app_setting_set --app=$app --key=password --value="$password" #================================================= ynh_script_progression --message="Setting up source files..." + # Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" @@ -48,33 +50,11 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# MAKE INSTALL -#================================================= -ynh_script_progression --message="Making install..." - -ynh_setup_source --dest_dir="$install_dir/build" - -mkdir -p "$install_dir/live/" - -rsync -a "$install_dir/build/opt/photoprism/" "$install_dir/live/" -ynh_secure_remove --file="$install_dir/build" - -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:$app "$install_dir" - #================================================= # CREATE DATA DIRECTORY #================================================= ynh_script_progression --message="Creating a data directory..." -#mkdir -p $data_dir -rsync -a "$install_dir/live/assets/" "$data_dir/assets/" -ynh_secure_remove --file="$install_dir/live/assets/" - chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" chown -R $app:www-data "$data_dir" From 961d36214093f26aa3d8955ef3b179d49892b206 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:12:10 +0100 Subject: [PATCH 02/24] Update shasum --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 7f376c5..ecc764d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -60,10 +60,10 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] amd64.url = "https://github.com/photoprism/photoprism/releases/download/231128-f48ff16ef/photoprism_231128-f48ff16ef-linux-amd64.tar.gz" - amd64.sha256 = "" + amd64.sha256 = "4fb91a67191ffff840f2d92f59fde06bc13d0d92f914ff9a31314b598a5a2cbd" arm64.url = "https://github.com/photoprism/photoprism/releases/download/231128-f48ff16ef/photoprism_231128-f48ff16ef-linux-arm64.tar.gz" - arm64.sha256 = "" + arm64.sha256 = "2ddc7500d2055fd76bab229920330f25e007ad1e8e3c36ca34ace16bafa16b09" [resources.system_user] From 992bf063301dc97cfeeb9138c625df561473a442 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:28:38 +0100 Subject: [PATCH 03/24] Update systemd.service --- conf/systemd.service | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 36af161..be56141 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -15,11 +15,11 @@ TemporaryFileSystem=/:ro BindReadOnlyPaths=-/lib/ -/lib64/ -/usr/lib/ -/usr/lib64/ -/etc/ld.so.cache -/etc/ld.so.conf -/etc/ld.so.conf.d/ -/etc/bindresvport.blacklist -/usr/share/zoneinfo/ -/usr/share/locale/ -/etc/localtime -/usr/share/common-licenses/ -/etc/ssl/certs/ -/etc/alternatives/ BindReadOnlyPaths=-/dev/log -/run/systemd/journal/socket -/run/systemd/journal/stdout -/run/systemd/notify -BindPaths=/var/www/photoprism /var/www/photoprism/live/bin /home/yunohost.app/photoprism -/usr -/etc -/var -/home -/dev -/etc -/media -/mnt -/opt -/proc -/run -/srv -/sys -/tmp +BindPaths=__INSTALL_DIR__ __INSTALL_DIR__/bin __DATA_DIR__ -/usr -/etc -/var -/home -/dev -/etc -/media -/mnt -/opt -/proc -/run -/srv -/sys -/tmp EnvironmentFile=__INSTALL_DIR__/.env -WorkingDirectory=__INSTALL_DIR__/live/bin -ExecStart=__INSTALL_DIR__/live/bin/photoprism --trace start +WorkingDirectory=__INSTALL_DIR__/bin +ExecStart=__INSTALL_DIR__/bin/photoprism --trace start StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit TimeoutSec=900 From 242187fdcf619344f3e8846f3fd5672d0a5d9a21 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:01:47 +0100 Subject: [PATCH 04/24] change assets path --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index ecc764d..2f78f9d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -68,9 +68,9 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] - - [resources.data_dir] subdirs = ["assets"] + + [resources.data_dir] [resources.permissions] main.url = "/" From 48ef01a57dc046504df3137701fa41b0d6a96cc1 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:02:36 +0100 Subject: [PATCH 05/24] change assets path --- conf/.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env b/conf/.env index 45a980d..2c31a1a 100644 --- a/conf/.env +++ b/conf/.env @@ -1,4 +1,4 @@ -PHOTOPRISM_ASSETS_PATH="/home/yunohost.app/__APP__/assets" +PHOTOPRISM_ASSETS_PATH="__INSTALL_DIR__/assets" PHOTOPRISM_CACHE_PATH="/home/yunohost.app/__APP__/cache" PHOTOPRISM_ORIGINALS_PATH="/home/yunohost.app/__APP__/photos/originals" PHOTOPRISM_IMPORT_PATH="/home/yunohost.app/__APP__/photos/import" @@ -21,4 +21,4 @@ PHOTOPRISM_DARKTABLE_BIN="/usr/bin/darktable-cli" PHOTOPRISM_HEIFCONVERT_BIN="__INSTALL_DIR__/bin/heif-convert" PHOTOPRISM_FFMPEG_BIN="/usr/bin/ffmpeg" PHOTOPRISM_EXIFTOOL_BIN="/usr/bin/exiftool" -PHOTOPRISM_UPLOAD_NSFW="true" \ No newline at end of file +PHOTOPRISM_UPLOAD_NSFW="true" From c98021e8fd0e7f8412817f7bc7e451bcbdf5ac32 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:20:44 +0100 Subject: [PATCH 06/24] finish the transition to official builds --- conf/.env | 8 ++++---- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- manifest.toml | 6 +++++- scripts/change_url | 6 +++--- scripts/install | 2 +- scripts/upgrade | 44 +++++++++++++++----------------------------- 7 files changed, 30 insertions(+), 40 deletions(-) diff --git a/conf/.env b/conf/.env index 2c31a1a..68ec1a8 100644 --- a/conf/.env +++ b/conf/.env @@ -1,8 +1,8 @@ PHOTOPRISM_ASSETS_PATH="__INSTALL_DIR__/assets" -PHOTOPRISM_CACHE_PATH="/home/yunohost.app/__APP__/cache" -PHOTOPRISM_ORIGINALS_PATH="/home/yunohost.app/__APP__/photos/originals" -PHOTOPRISM_IMPORT_PATH="/home/yunohost.app/__APP__/photos/import" -PHOTOPRISM_TEMP_PATH="/home/yunohost.app/__APP__/temp" +PHOTOPRISM_CACHE_PATH="__DATA_DIR__/cache" +PHOTOPRISM_ORIGINALS_PATH="__DATA_DIR__/photos/originals" +PHOTOPRISM_IMPORT_PATH="__DATA_DIR__/photos/import" +PHOTOPRISM_TEMP_PATH="__DATA_DIR__/temp" PHOTOPRISM_SITE_URL="https://__DOMAIN____PATH__" PHOTOPRISM_ADMIN_PASSWORD="__PASSWORD__" PHOTOPRISM_HTTP_HOST="127.0.0.1" diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 399c75c..bcfdfaf 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -1 +1 @@ -All data is stored in `__DATA_DIR__/photos/`. Be careful, this data is not backed-up by default when doing a backup +All data is stored in `__DATA_DIR__/photos/`. Be careful, this data is not backed-up by default when doing a backup. diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index cf3b6fa..c41aca5 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -1 +1 @@ -Les données sont stockées dans `__DATA_DIR__/photos/`. Attention, ces données ne sont pas sauvegardées par défaut lorsqu'une sauvegarde est lancée +Les données sont stockées dans `__DATA_DIR__/photos/`. Attention, ces données ne sont pas sauvegardées par défaut lorsqu'une sauvegarde est lancée. diff --git a/manifest.toml b/manifest.toml index 2f78f9d..70e94e6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -21,7 +21,7 @@ code = "https://github.com/photoprism/photoprism" fund = "https://www.photoprism.app/membership" [integration] -yunohost = ">= 11.2" +yunohost = ">= 12.0" architectures = ["amd64", "arm64", "armhf"] multi_instance = false ldap = false @@ -65,6 +65,10 @@ ram.runtime = "50M" arm64.url = "https://github.com/photoprism/photoprism/releases/download/231128-f48ff16ef/photoprism_231128-f48ff16ef-linux-arm64.tar.gz" arm64.sha256 = "2ddc7500d2055fd76bab229920330f25e007ad1e8e3c36ca34ace16bafa16b09" + autoupdate.strategy = "latest_github_release" + autoupdate.asset.amd64 = ".*amd64.tar.gz" + autoupdate.asset.arm64 = ".*arm64.tar.gz" + [resources.system_user] [resources.install_dir] diff --git a/scripts/change_url b/scripts/change_url index 1643020..649e15d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -36,10 +36,10 @@ ynh_script_progression --message="Updating a configuration file..." domain=$new_domain path=$new_path -ynh_add_config --template="options.yml" --destination="$install_dir/live/config/options.yml" +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$install_dir/live/config/options.yml" -chown $app:$app "$install_dir/live/config/options.yml" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 4579ddd..5dfad28 100755 --- a/scripts/install +++ b/scripts/install @@ -66,7 +66,7 @@ ynh_script_progression --message="Adding a configuration file..." ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 600 "$install_dir/.env" +chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8b0463d..ae7a75a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,6 +30,18 @@ if [ -z "${language_key:-}" ]; then ynh_app_setting_delete --app=$app --key=language fi +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." + +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" + +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # NGINX CONFIGURATION #================================================= @@ -38,39 +50,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE -#================================================= -# MAKE INSTALL -#================================================= -ynh_script_progression --message="Making install..." - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir/build/" - - mkdir -p "$install_dir/live/" - rsync -a "$install_dir/build/opt/photoprism/" "$install_dir/live/" - ynh_secure_remove --file="$install_dir/build" -fi - -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:$app "$install_dir" - #================================================= # UPDATE DATA DIRECTORY #================================================= ynh_script_progression --message="Updating data directory..." -mkdir -p $data_dir -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - rsync -a "$install_dir/live/assets/" "$data_dir/assets/" - ynh_secure_remove --file="$install_dir/live/assets/" -fi +# assets location has changed to the $install_dir +ynh_secure_remove $data_dir/assets chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" @@ -83,7 +69,7 @@ ynh_script_progression --message="Updating a configuration file..." ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 600 "$install_dir/.env" +chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" #================================================= From 36c9bfcbaec91a9cbb958a168b8ed6b43090d02f Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 5 Feb 2024 21:38:17 +0100 Subject: [PATCH 07/24] cleaning --- conf/.env | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/.env b/conf/.env index 68ec1a8..63fa33d 100644 --- a/conf/.env +++ b/conf/.env @@ -1,24 +1,30 @@ +PHOTOPRISM_CONFIG_PATH="__DATA_DIR/config/" PHOTOPRISM_ASSETS_PATH="__INSTALL_DIR__/assets" PHOTOPRISM_CACHE_PATH="__DATA_DIR__/cache" PHOTOPRISM_ORIGINALS_PATH="__DATA_DIR__/photos/originals" PHOTOPRISM_IMPORT_PATH="__DATA_DIR__/photos/import" PHOTOPRISM_TEMP_PATH="__DATA_DIR__/temp" + PHOTOPRISM_SITE_URL="https://__DOMAIN____PATH__" PHOTOPRISM_ADMIN_PASSWORD="__PASSWORD__" PHOTOPRISM_HTTP_HOST="127.0.0.1" PHOTOPRISM_HTTP_MODE="release" PHOTOPRISM_HTTP_PORT="__PORT__" + PHOTOPRISM_DATABASE_DRIVER="MySQL" PHOTOPRISM_DATABASE_SERVER="127.0.0.1" PHOTOPRISM_DATABASE_NAME="photoprism" PHOTOPRISM_DATABASE_USER="photoprism" PHOTOPRISM_DATABASE_PASSWORD="__DB_PWD__" + PHOTOPRISM_DEFAULT_THEME="lavendel" PHOTOPRISM_DEFAULT_LOCALE="__LANGUAGE_KEY__" PHOTOPRISM_SITE_DESCRIPTION="__APP__" + PHOTOPRISM_DEBUG="false" PHOTOPRISM_DARKTABLE_BIN="/usr/bin/darktable-cli" PHOTOPRISM_HEIFCONVERT_BIN="__INSTALL_DIR__/bin/heif-convert" PHOTOPRISM_FFMPEG_BIN="/usr/bin/ffmpeg" PHOTOPRISM_EXIFTOOL_BIN="/usr/bin/exiftool" + PHOTOPRISM_UPLOAD_NSFW="true" From ac0d7db2d970734b91f4647a8179301756b81122 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 5 Feb 2024 21:58:27 +0100 Subject: [PATCH 08/24] remove incorrect value --- manifest.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 70e94e6..c9e31b5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -72,7 +72,6 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] - subdirs = ["assets"] [resources.data_dir] From e569f89c8bce8ca7220864cdb43bc3961c5abbc2 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:33:54 +0200 Subject: [PATCH 09/24] update to latest version + some tweaks and fixes --- conf/.env | 5 +++++ manifest.toml | 17 ++++++++++++----- scripts/change_url | 2 +- scripts/install | 2 +- scripts/upgrade | 16 ++++++++++++++-- 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/conf/.env b/conf/.env index 63fa33d..05b5350 100644 --- a/conf/.env +++ b/conf/.env @@ -4,8 +4,12 @@ PHOTOPRISM_CACHE_PATH="__DATA_DIR__/cache" PHOTOPRISM_ORIGINALS_PATH="__DATA_DIR__/photos/originals" PHOTOPRISM_IMPORT_PATH="__DATA_DIR__/photos/import" PHOTOPRISM_TEMP_PATH="__DATA_DIR__/temp" +PHOTOPRISM_USERS_PATH="__DATA_DIR__/users" + +PHOTOPRISM_BACKUP_PATH="__DATA_DIR__/backups" PHOTOPRISM_SITE_URL="https://__DOMAIN____PATH__" +PHOTOPRISM_ADMIN_USER="__ADMIN__" PHOTOPRISM_ADMIN_PASSWORD="__PASSWORD__" PHOTOPRISM_HTTP_HOST="127.0.0.1" PHOTOPRISM_HTTP_MODE="release" @@ -20,6 +24,7 @@ PHOTOPRISM_DATABASE_PASSWORD="__DB_PWD__" PHOTOPRISM_DEFAULT_THEME="lavendel" PHOTOPRISM_DEFAULT_LOCALE="__LANGUAGE_KEY__" PHOTOPRISM_SITE_DESCRIPTION="__APP__" +PHOTOPRISM_APP_NAME="__APP__" PHOTOPRISM_DEBUG="false" PHOTOPRISM_DARKTABLE_BIN="/usr/bin/darktable-cli" diff --git a/manifest.toml b/manifest.toml index c9e31b5..05c7d2a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Photoprism" description.en = "AI-Powered Photos App for the Decentralized Web" description.fr = "Gestion de photos en ligne" -version = "2023.11.28~ynh1" +version = "2022.09.01~ynh4" maintainers = ["Thovi98"] @@ -44,6 +44,9 @@ ram.runtime = "50M" type = "group" default = "visitors" + [install.admin] + type = "user" + [install.language] ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" @@ -59,15 +62,19 @@ ram.runtime = "50M" [resources] [resources.sources] [resources.sources.main] - amd64.url = "https://github.com/photoprism/photoprism/releases/download/231128-f48ff16ef/photoprism_231128-f48ff16ef-linux-amd64.tar.gz" - amd64.sha256 = "4fb91a67191ffff840f2d92f59fde06bc13d0d92f914ff9a31314b598a5a2cbd" + amd64.url = "https://github.com/photoprism/photoprism/releases/download/240531-60b3a4628/photoprism_240531-60b3a4628-linux-amd64.tar.gz" + amd64.sha256 = "1859df8e95c054fb4ff9c9de80ed0db96a1126f91d3e57946628fa92008229eb" - arm64.url = "https://github.com/photoprism/photoprism/releases/download/231128-f48ff16ef/photoprism_231128-f48ff16ef-linux-arm64.tar.gz" - arm64.sha256 = "2ddc7500d2055fd76bab229920330f25e007ad1e8e3c36ca34ace16bafa16b09" + arm64.url = "https://github.com/photoprism/photoprism/releases/download/240531-60b3a4628/photoprism_240531-60b3a4628-linux-arm64.tar.gz" + arm64.sha256 = "16d5ef94dd733bd46db49b10c25a019b9510e690d40efee1d691c20a72263044" + + armhf.url = "https://github.com/photoprism/photoprism/releases/download/240531-60b3a4628/photoprism_240531-60b3a4628-linux-arm.tar.gz" + armhf.sha256 = "be9f10f8fe65d2cde285d0eafca3067c9f4344eb56cc01566e52f14027f929f2" autoupdate.strategy = "latest_github_release" autoupdate.asset.amd64 = ".*amd64.tar.gz" autoupdate.asset.arm64 = ".*arm64.tar.gz" + autoupdate.asset.armhf = ".*arm.tar.gz" [resources.system_user] diff --git a/scripts/change_url b/scripts/change_url index 649e15d..cd20f68 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -38,7 +38,7 @@ path=$new_path ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$install_dir/.env" +chmod 600 "$install_dir/.env" chown $app:$app "$install_dir/.env" #================================================= diff --git a/scripts/install b/scripts/install index 5dfad28..4579ddd 100755 --- a/scripts/install +++ b/scripts/install @@ -66,7 +66,7 @@ ynh_script_progression --message="Adding a configuration file..." ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$install_dir/.env" +chmod 600 "$install_dir/.env" chown $app:$app "$install_dir/.env" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ae7a75a..c9ebfc3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,7 +17,6 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -69,9 +68,22 @@ ynh_script_progression --message="Updating a configuration file..." ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$install_dir/.env" +chmod 600 "$install_dir/.env" chown $app:$app "$install_dir/.env" +#================================================= +# RUNNNING DB MIGRATIONS +#================================================= +ynh_script_progression --message="Running database migrations..." + +if ynh_compare_current_package_version --comparison lt --version 2022.09.01~ynh4 +then + ynh_exec_warn_less $final_path/live/bin/photoprism \ + --assets-path=/home/yunohost.app/photoprism/assets \ + --originals-path=/home/yunohost.app/photoprism/photos/originals \ + --import-path=/home/yunohost.app/photoprism/photos/import users reset --yes +fi + #================================================= # SETUP SYSTEMD #================================================= From a43b38008c3d28f548c6e12082153ff0303f4f42 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:38:13 +0200 Subject: [PATCH 10/24] more tests + try multi_instance --- conf/.env | 4 ++-- conf/options.yml | 21 --------------------- manifest.toml | 2 +- tests.toml | 1 + 4 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 conf/options.yml diff --git a/conf/.env b/conf/.env index 05b5350..ed31a4e 100644 --- a/conf/.env +++ b/conf/.env @@ -17,8 +17,8 @@ PHOTOPRISM_HTTP_PORT="__PORT__" PHOTOPRISM_DATABASE_DRIVER="MySQL" PHOTOPRISM_DATABASE_SERVER="127.0.0.1" -PHOTOPRISM_DATABASE_NAME="photoprism" -PHOTOPRISM_DATABASE_USER="photoprism" +PHOTOPRISM_DATABASE_NAME="__DB_NAME__" +PHOTOPRISM_DATABASE_USER="__DB_USER__" PHOTOPRISM_DATABASE_PASSWORD="__DB_PWD__" PHOTOPRISM_DEFAULT_THEME="lavendel" diff --git a/conf/options.yml b/conf/options.yml deleted file mode 100644 index 730b5cb..0000000 --- a/conf/options.yml +++ /dev/null @@ -1,21 +0,0 @@ -Debug: false -DarktableBin: /usr/bin/darktable-cli -AssetsPath: /home/yunohost.app/__APP__/assets -CachePath: /home/yunohost.app/__APP__/cache -OriginalsPath: /home/yunohost.app/__APP__/photos/originals -ImportPath: /home/yunohost.app/__APP__/photos/import -TempPath: /home/yunohost.app/__APP__/temp -SiteUrl: https://__DOMAIN____PATH__ -AdminPassword: __PASSWORD__ -HttpServerHost: 127.0.0.1 -HttpMode: release -HttpPort: __PORT__ -HttpPassword: -DatabaseDriver: MySQL -DatabaseServer: 127.0.0.1 -DatabaseName: photoprism -DatabaseUser: photoprism -DatabasePassword: __DB_PWD__ -Theme: lavendel -Language: __LANGUAGE_KEY__ -SiteDescription: __APP__ \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 05c7d2a..da22913 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,7 +23,7 @@ fund = "https://www.photoprism.app/membership" [integration] yunohost = ">= 12.0" architectures = ["amd64", "arm64", "armhf"] -multi_instance = false +multi_instance = true ldap = false sso = false disk = "50M" diff --git a/tests.toml b/tests.toml index 63cc1b8..da49ae4 100644 --- a/tests.toml +++ b/tests.toml @@ -5,3 +5,4 @@ test_format = 1.0 [default] test_upgrade_from.fe71ba9.name = "Packaging v1" +test_upgrade_from.678f0f9.name = "2022.09.01~ynh4" From 023b6e59fdb04bf5c5bae8531f54e76bb328fb8a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:02:35 +0200 Subject: [PATCH 11/24] fix libvips issue? --- conf/.env | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/.env b/conf/.env index ed31a4e..2215a75 100644 --- a/conf/.env +++ b/conf/.env @@ -33,3 +33,4 @@ PHOTOPRISM_FFMPEG_BIN="/usr/bin/ffmpeg" PHOTOPRISM_EXIFTOOL_BIN="/usr/bin/exiftool" PHOTOPRISM_UPLOAD_NSFW="true" +PHOTOPRISM_DISABLE_VIPS="true" From 1b989c7fcb4b7d73def37fe66d4f32f0c7217795 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:20:12 +0200 Subject: [PATCH 12/24] wrong guess, adapt dependencies --- conf/.env | 1 - manifest.toml | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/conf/.env b/conf/.env index 2215a75..ed31a4e 100644 --- a/conf/.env +++ b/conf/.env @@ -33,4 +33,3 @@ PHOTOPRISM_FFMPEG_BIN="/usr/bin/ffmpeg" PHOTOPRISM_EXIFTOOL_BIN="/usr/bin/exiftool" PHOTOPRISM_UPLOAD_NSFW="true" -PHOTOPRISM_DISABLE_VIPS="true" diff --git a/manifest.toml b/manifest.toml index da22913..1bb5e34 100644 --- a/manifest.toml +++ b/manifest.toml @@ -95,6 +95,22 @@ ram.runtime = "50M" [resources.apt] packages = [ + "exiftool", + "darktable", + "rawtherapee", + "libheif", + "imagemagick", + "libvips", + "libjxl", + "libjxl-tools", + "ffmpeg", + "libavcodec-extra", + "libde265", + "libaom", + "libvpx", + "libwebm", + "sqlite3", + "tzdata" "libc6-dev", "libssl-dev", "libxft-dev", @@ -110,7 +126,6 @@ ram.runtime = "50M" "libfontconfig1", "libfontconfig1-dev", "libzmq3-dev", - "ffmpeg", "libimage-exiftool-perl", "mariadb-server", ] From 9526d7293acc7fafa4077d40372dca9e88550c98 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:21:50 +0200 Subject: [PATCH 13/24] fix formatting --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 1bb5e34..ef0c694 100644 --- a/manifest.toml +++ b/manifest.toml @@ -110,7 +110,7 @@ ram.runtime = "50M" "libvpx", "libwebm", "sqlite3", - "tzdata" + "tzdata", "libc6-dev", "libssl-dev", "libxft-dev", From 78b51067e59871498fdbec96688f26d8f28d6b7c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:28:36 +0200 Subject: [PATCH 14/24] fix dependencies --- manifest.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index ef0c694..4f2e917 100644 --- a/manifest.toml +++ b/manifest.toml @@ -98,17 +98,11 @@ ram.runtime = "50M" "exiftool", "darktable", "rawtherapee", - "libheif", "imagemagick", "libvips", - "libjxl", "libjxl-tools", "ffmpeg", "libavcodec-extra", - "libde265", - "libaom", - "libvpx", - "libwebm", "sqlite3", "tzdata", "libc6-dev", From c4224edec8e0ff3e150bb8d76355b5f682c65e9c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:42:57 +0200 Subject: [PATCH 15/24] declare admin for upgrade --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index c9ebfc3..b2edef0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,11 @@ if [ -z "${language_key:-}" ]; then ynh_app_setting_delete --app=$app --key=language fi +if [ -z "${admin:-}" ]; then + admin=$admin + ynh_app_setting_set --app=$app --key=admin --value=$admin +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From b3135f6666bb2284d70cfe79d5f21e320222e9a4 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 13 Jun 2024 08:55:47 +0200 Subject: [PATCH 16/24] fix upgrade admin variable --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b2edef0..225d934 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,7 +30,7 @@ if [ -z "${language_key:-}" ]; then fi if [ -z "${admin:-}" ]; then - admin=$admin + admin="admin" ynh_app_setting_set --app=$app --key=admin --value=$admin fi From 531c41f6eb4cb417bbde1c6026d601ea7a634963 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:52:31 +0200 Subject: [PATCH 17/24] stupid copy/pasta mistake --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 225d934..7ea9610 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,8 +83,8 @@ ynh_script_progression --message="Running database migrations..." if ynh_compare_current_package_version --comparison lt --version 2022.09.01~ynh4 then - ynh_exec_warn_less $final_path/live/bin/photoprism \ - --assets-path=/home/yunohost.app/photoprism/assets \ + ynh_exec_warn_less $install_dir/bin/photoprism \ + --assets-path=$install_dir/assets \ --originals-path=/home/yunohost.app/photoprism/photos/originals \ --import-path=/home/yunohost.app/photoprism/photos/import users reset --yes fi From 5f6d587b312551b3bbde88cf8d042ccd58b142ce Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:58:11 +0200 Subject: [PATCH 18/24] fix upstream version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 4f2e917..a696841 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Photoprism" description.en = "AI-Powered Photos App for the Decentralized Web" description.fr = "Gestion de photos en ligne" -version = "2022.09.01~ynh4" +version = "2024.05.31~ynh1" maintainers = ["Thovi98"] From 477566accf814378a201e1cdc7a48a27349d0223 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:58:50 +0200 Subject: [PATCH 19/24] fix when command used --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7ea9610..ed0ba98 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,7 +81,7 @@ chown $app:$app "$install_dir/.env" #================================================= ynh_script_progression --message="Running database migrations..." -if ynh_compare_current_package_version --comparison lt --version 2022.09.01~ynh4 +if ynh_compare_current_package_version --comparison lt --version 2024.05.31~ynh1 then ynh_exec_warn_less $install_dir/bin/photoprism \ --assets-path=$install_dir/assets \ From a255e75c01ce7d679021de50696288ae17158042 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:13:34 +0200 Subject: [PATCH 20/24] do not remove logs on remove --- scripts/remove | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scripts/remove b/scripts/remove index 3a39fdc..768f74d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -46,16 +46,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." - -# Remove the log files -ynh_secure_remove --file="/var/log/$app" - #================================================= # END OF SCRIPT #================================================= From a91b0b100abfe3fa0a35d6950dccbe4c62dde307 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:22:01 +0200 Subject: [PATCH 21/24] remove failed dependencies --- manifest.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index a696841..c9f5fac 100644 --- a/manifest.toml +++ b/manifest.toml @@ -96,13 +96,7 @@ ram.runtime = "50M" [resources.apt] packages = [ "exiftool", - "darktable", - "rawtherapee", - "imagemagick", - "libvips", - "libjxl-tools", "ffmpeg", - "libavcodec-extra", "sqlite3", "tzdata", "libc6-dev", From 15a10b3bb49b9a8f5ae180daf2ca4844ffad1141 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 29 Jul 2024 08:23:12 +0200 Subject: [PATCH 22/24] fix dependencies --- manifest.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifest.toml b/manifest.toml index c9f5fac..e0fb443 100644 --- a/manifest.toml +++ b/manifest.toml @@ -96,7 +96,13 @@ ram.runtime = "50M" [resources.apt] packages = [ "exiftool", + "darktable", + "rawtherapee", + "imagemagick", + "libvips42", + "libjxl-tools", "ffmpeg", + "libavcodec-extra", "sqlite3", "tzdata", "libc6-dev", From 02e67b2f30fe9f45eeff900380562ca9f7facc4a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:03:38 +0200 Subject: [PATCH 23/24] fix dependencies --- manifest.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index e0fb443..87c5d7e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,6 @@ ram.runtime = "50M" "libvips42", "libjxl-tools", "ffmpeg", - "libavcodec-extra", "sqlite3", "tzdata", "libc6-dev", From 5f7a924e46431077a8d4ec08a4612b120f73ed88 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:13:50 +0200 Subject: [PATCH 24/24] fix variable --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index ed31a4e..673c4c2 100644 --- a/conf/.env +++ b/conf/.env @@ -1,4 +1,4 @@ -PHOTOPRISM_CONFIG_PATH="__DATA_DIR/config/" +PHOTOPRISM_CONFIG_PATH="__DATA_DIR__/config/" PHOTOPRISM_ASSETS_PATH="__INSTALL_DIR__/assets" PHOTOPRISM_CACHE_PATH="__DATA_DIR__/cache" PHOTOPRISM_ORIGINALS_PATH="__DATA_DIR__/photos/originals"