From 75624dc8ce4cb5789f43cb62a7eecb208c3b20e6 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 4 Aug 2022 18:01:17 +0200 Subject: [PATCH 1/8] Make installation compatible with arm64 and armhf architectures --- scripts/_common.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 5260975..38e50e9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,23 @@ # COMMON VARIABLES #================================================= -PHOTOPRISM_VERSION="220617-bullseye" +case YNH_ARCH in + amd64) + PHOTOPRISM_VERSION="sha256:2a2fc58d5bf77642424854158a06713ce532026bd18a43e07fd71d75365cb8d3" + ;; + + arm64) + PHOTOPRISM_VERSION="sha256:ad6de95e77e90a64487085b55dbdbea21c04aff5a17ca3c8790d1deae19b9ee1" + ;; + + armhf) + PHOTOPRISM_VERSION="sha256:4e0b39a06e0f7ecd11aa8cbd84c739cba3417c99348f52e3433cdeaeeb5474cb" + ;; + + *) + ynh_die --message="Your server architecture ($YNH_ARCH) is not supported." + ;; +esac #pkg_dependencies="libc6-dev libssl-dev libxft-dev libhdf5-serial-dev libpng-dev libheif-examples librsvg2-bin libx264-dev libx265-dev libnss3 libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev libzmq3-dev" pkg_dependencies="" From db3e686de7a1ab3671573b5a6339bad04b8e0c0e Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 5 Aug 2022 11:05:58 +0200 Subject: [PATCH 2/8] Fix architecture detection --- scripts/_common.sh | 30 ++++++++++++++++-------------- scripts/install | 1 + scripts/upgrade | 1 + 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 38e50e9..46cf29b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,23 +4,25 @@ # COMMON VARIABLES #================================================= -case YNH_ARCH in - amd64) - PHOTOPRISM_VERSION="sha256:2a2fc58d5bf77642424854158a06713ce532026bd18a43e07fd71d75365cb8d3" - ;; +function detect_arch() { + case "$YNH_ARCH" in + "amd64") + PHOTOPRISM_VERSION="sha256:2a2fc58d5bf77642424854158a06713ce532026bd18a43e07fd71d75365cb8d3" + ;; - arm64) - PHOTOPRISM_VERSION="sha256:ad6de95e77e90a64487085b55dbdbea21c04aff5a17ca3c8790d1deae19b9ee1" - ;; + "arm64") + PHOTOPRISM_VERSION="sha256:ad6de95e77e90a64487085b55dbdbea21c04aff5a17ca3c8790d1deae19b9ee1" + ;; - armhf) - PHOTOPRISM_VERSION="sha256:4e0b39a06e0f7ecd11aa8cbd84c739cba3417c99348f52e3433cdeaeeb5474cb" - ;; + "armhf") + PHOTOPRISM_VERSION="sha256:4e0b39a06e0f7ecd11aa8cbd84c739cba3417c99348f52e3433cdeaeeb5474cb" + ;; - *) - ynh_die --message="Your server architecture ($YNH_ARCH) is not supported." - ;; -esac + *) + ynh_die --message="Your server architecture ($YNH_ARCH) is not supported." + ;; + esac +} #pkg_dependencies="libc6-dev libssl-dev libxft-dev libhdf5-serial-dev libpng-dev libheif-examples librsvg2-bin libx264-dev libx265-dev libnss3 libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev libzmq3-dev" pkg_dependencies="" diff --git a/scripts/install b/scripts/install index a20ae08..5716846 100755 --- a/scripts/install +++ b/scripts/install @@ -124,6 +124,7 @@ ynh_script_progression --message="Making install..." # Install photoprism pushd $final_path/build + detect_arch ./docker-image-extract photoprism/photoprism:$PHOTOPRISM_VERSION popd mkdir -p "$final_path/live/" diff --git a/scripts/upgrade b/scripts/upgrade index 1e244b6..1ae7ca4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,6 +120,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then # Install photoprism pushd $final_path/build + detect_arch ./docker-image-extract photoprism/photoprism:$PHOTOPRISM_VERSION popd mkdir -p "$final_path/live/" From deb0219165c30f9e65492ebe1e2e9c321c705232 Mon Sep 17 00:00:00 2001 From: navanchauhan Date: Fri, 5 Aug 2022 21:59:52 -0400 Subject: [PATCH 3/8] specify binary path envs --- conf/systemd.service | 3 +++ scripts/_common.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 8557650..a57db16 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -11,6 +11,9 @@ ExecStart=__FINALPATH__/live/bin/photoprism --config-path __FINALPATH__/live/con StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit TimeoutSec=900 +Environment="PHOTOPRISM_HEIFCONVERT_BIN=__FINALPATH__/bin/heif-convert" +Environment="PHOTOPRISM_FFMPEG_BIN=/usr/bin/ffmpeg" +Environment="PHOTOPRISM_EXIFTOOL_BIN=/usr/bin/exiftool" # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/scripts/_common.sh b/scripts/_common.sh index 7c2281f..ccaab8e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ PHOTOPRISM_VERSION="220730-bullseye" #pkg_dependencies="libc6-dev libssl-dev libxft-dev libhdf5-serial-dev libpng-dev libheif-examples librsvg2-bin libx264-dev libx265-dev libnss3 libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev libzmq3-dev" -pkg_dependencies="" +pkg_dependencies="ffmpeg libimage-exiftool-perl" #================================================= # PERSONAL HELPERS From 8f8631d4f51fd4f6359947c8542e93eeeaf0b90a Mon Sep 17 00:00:00 2001 From: navanchauhan Date: Sun, 7 Aug 2022 15:26:45 -0400 Subject: [PATCH 4/8] fix link sharing permissions --- scripts/install | 3 +++ scripts/upgrade | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/scripts/install b/scripts/install index 3d7d147..5a64668 100755 --- a/scripts/install +++ b/scripts/install @@ -206,6 +206,9 @@ then ynh_permission_update --permission="main" --add="visitors" fi +# Permission to make link-sharing work +ynh_permission_create --permission="sharing" --url="/s" --allowed="visitors" --show_tile="false" --protected="true" + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d50ebd9..0973d46 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,11 @@ if [ -z "$language_key" ]; then ynh_app_setting_delete --app=$app --key=language fi +# Create sharing permission if needed +if ! ynh_permission_exists --permission="sharing"; then + ynh_permission_create --permission="sharing" --url="/s" --allowed="visitors" --show_tile="false" --protected="true" +fi + #================================================= # CREATE DEDICATED USER #================================================= From 708ebb244b847502e110afbec4976e6a95ca1052 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Aug 2022 13:00:30 +0200 Subject: [PATCH 5/8] First try with .env --- conf/.env | 23 +++++++++++++++++++++++ conf/systemd.service | 6 ++---- scripts/install | 6 +++--- scripts/upgrade | 6 +++--- 4 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 conf/.env diff --git a/conf/.env b/conf/.env new file mode 100644 index 0000000..7706b4f --- /dev/null +++ b/conf/.env @@ -0,0 +1,23 @@ +PHOTOPRISM_ASSETS_PATH="/home/yunohost.app/__APP__/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_SITE_URL="https://__DOMAIN____PATH_URL__" +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="__FINALPATH__/bin/heif-convert" +PHOTOPRISM_FFMPEG_BIN="/usr/bin/ffmpeg" +PHOTOPRISM_EXIFTOOL_BIN="/usr/bin/exiftool" \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index a57db16..c9face9 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,14 +6,12 @@ After=network.target Type=simple User=__APP__ Group=__APP__ +EnvironmentFile=__FINALPATH__/.env WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/live/bin/photoprism --config-path __FINALPATH__/live/config/ --trace start +ExecStart=__FINALPATH__/live/bin/photoprism --trace start StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit TimeoutSec=900 -Environment="PHOTOPRISM_HEIFCONVERT_BIN=__FINALPATH__/bin/heif-convert" -Environment="PHOTOPRISM_FFMPEG_BIN=/usr/bin/ffmpeg" -Environment="PHOTOPRISM_EXIFTOOL_BIN=/usr/bin/exiftool" # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/scripts/install b/scripts/install index 5a64668..153ac7d 100755 --- a/scripts/install +++ b/scripts/install @@ -155,10 +155,10 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/options.yml" --destination="$final_path/live/config/options.yml" +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" -chmod 600 "$final_path/live/config/options.yml" -chown $app:$app "$final_path/live/config/options.yml" +chmod 600 "$final_path/.env" +chown $app:$app "$final_path/.env" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 0973d46..c68a7bf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -157,10 +157,10 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Updating a configuration file..." -ynh_add_config --template="../conf/options.yml" --destination="$final_path/live/config/options.yml" +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" -chmod 600 "$final_path/live/config/options.yml" -chown $app:$app "$final_path/live/config/options.yml" +chmod 600 "$final_path/.env" +chown $app:$app "$final_path/.env" #================================================= # SETUP SYSTEMD From 56d28f9aaac59dc26d951875b5ee9fa8ead0abc0 Mon Sep 17 00:00:00 2001 From: Limezy Date: Tue, 23 Aug 2022 12:43:58 +0700 Subject: [PATCH 6/8] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 99d581f..fb6902c 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "name": "Thovi98" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.7" }, "multi_instance": true, "services": [ From a701f2245bfce279a6cd9bc8e547197e082a7534 Mon Sep 17 00:00:00 2001 From: Limezy Date: Tue, 23 Aug 2022 13:09:15 +0700 Subject: [PATCH 7/8] Update .env --- conf/.env | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 7706b4f..5348400 100644 --- a/conf/.env +++ b/conf/.env @@ -20,4 +20,5 @@ PHOTOPRISM_DEBUG="false" PHOTOPRISM_DARKTABLE_BIN="/usr/bin/darktable-cli" PHOTOPRISM_HEIFCONVERT_BIN="__FINALPATH__/bin/heif-convert" PHOTOPRISM_FFMPEG_BIN="/usr/bin/ffmpeg" -PHOTOPRISM_EXIFTOOL_BIN="/usr/bin/exiftool" \ No newline at end of file +PHOTOPRISM_EXIFTOOL_BIN="/usr/bin/exiftool" +PHOTOPRISM_UPLOAD_NSFW="true" \ No newline at end of file From 8ab0cdef24484a000ca3fde0bc6fd4549b75eaf2 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 23 Aug 2022 06:09:38 +0000 Subject: [PATCH 8/8] Auto-update README --- README.md | 1 + README_fr.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 45b21de..96448a1 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ PhotoPrism® is an AI-Powered Photos App for the Decentralized Web. It makes use **Shipped version:** 2022.07.30~ynh1 + **Demo:** https://demo-fr.photoprism.app ## Screenshots diff --git a/README_fr.md b/README_fr.md index 2694617..7f922a8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,8 @@ PhotoPrism® est une application de photos alimentée par l'IA pour le Web déce - Classification automatique des photos en fonction de leur contenu et de leur emplacement -**Version incluse :** 2022.07.30~ynh1 +**Version incluse :** 2022.07.30~ynh1 + **Démo :** https://demo-fr.photoprism.app