1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/photoprism_ynh.git synced 2024-09-03 19:56:41 +02:00

Merge pull request #23 from YunoHost-Apps/testing

Testing to master
This commit is contained in:
Limezy 2022-08-23 13:10:09 +07:00 committed by GitHub
commit b278aa52a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 66 additions and 11 deletions

View file

@ -29,6 +29,7 @@ PhotoPrism® is an AI-Powered Photos App for the Decentralized Web. It makes use
**Shipped version:** 2022.07.30~ynh1 **Shipped version:** 2022.07.30~ynh1
**Demo:** https://demo-fr.photoprism.app **Demo:** https://demo-fr.photoprism.app
## Screenshots ## Screenshots

View file

@ -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 - 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 **Démo :** https://demo-fr.photoprism.app

24
conf/.env Normal file
View file

@ -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"

View file

@ -6,8 +6,9 @@ After=network.target
Type=simple Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
EnvironmentFile=__FINALPATH__/.env
WorkingDirectory=__FINALPATH__/ 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 StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit StandardError=inherit
TimeoutSec=900 TimeoutSec=900

View file

@ -21,7 +21,7 @@
"name": "Thovi98" "name": "Thovi98"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.3.0" "yunohost": ">= 11.0.7"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [

View file

@ -4,10 +4,28 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
PHOTOPRISM_VERSION="220730-bullseye" function detect_arch() {
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="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 # PERSONAL HELPERS

View file

@ -124,6 +124,7 @@ ynh_script_progression --message="Making install..."
# Install photoprism # Install photoprism
pushd $final_path/build pushd $final_path/build
detect_arch
./docker-image-extract photoprism/photoprism:$PHOTOPRISM_VERSION ./docker-image-extract photoprism/photoprism:$PHOTOPRISM_VERSION
popd popd
mkdir -p "$final_path/live/" mkdir -p "$final_path/live/"
@ -155,10 +156,10 @@ chown -R $app:www-data "$datadir"
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." 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" chmod 600 "$final_path/.env"
chown $app:$app "$final_path/live/config/options.yml" chown $app:$app "$final_path/.env"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -206,6 +207,9 @@ then
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission="main" --add="visitors"
fi fi
# Permission to make link-sharing work
ynh_permission_create --permission="sharing" --url="/s" --allowed="visitors" --show_tile="false" --protected="true"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================

View file

@ -70,6 +70,11 @@ if [ -z "$language_key" ]; then
ynh_app_setting_delete --app=$app --key=language ynh_app_setting_delete --app=$app --key=language
fi 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 # CREATE DEDICATED USER
#================================================= #=================================================
@ -120,6 +125,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
# Install photoprism # Install photoprism
pushd $final_path/build pushd $final_path/build
detect_arch
./docker-image-extract photoprism/photoprism:$PHOTOPRISM_VERSION ./docker-image-extract photoprism/photoprism:$PHOTOPRISM_VERSION
popd popd
mkdir -p "$final_path/live/" mkdir -p "$final_path/live/"
@ -152,10 +158,10 @@ chown -R $app:www-data "$datadir"
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." 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" chmod 600 "$final_path/.env"
chown $app:$app "$final_path/live/config/options.yml" chown $app:$app "$final_path/.env"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD