diff --git a/conf/.env b/conf/.env new file mode 100644 index 0000000..5348400 --- /dev/null +++ b/conf/.env @@ -0,0 +1,24 @@ +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" +PHOTOPRISM_UPLOAD_NSFW="true" \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index 8557650..c9face9 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,8 +6,9 @@ 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 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": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 46cf29b..348f26c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -25,7 +25,7 @@ function detect_arch() { } #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 diff --git a/scripts/install b/scripts/install index fd535ac..4f77f31 100755 --- a/scripts/install +++ b/scripts/install @@ -156,10 +156,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 @@ -207,6 +207,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 f9c718f..e80393f 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 #================================================= @@ -153,10 +158,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