diff --git a/README.md b/README.md index 444552f..4ba6b5b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Photonix is a photo management application that streamlines the process of storing, presenting and re-discovering photos. Smart filtering is made possible automatically by object recognition, location awareness, color analysis and other algorithms. -**Shipped version:** 2021-04-18 +**Shipped version:** 2021-05-03 ## Screenshots @@ -52,7 +52,7 @@ Can the app be used by multiple users? **Yes** * Report a bug: https://github.com/YunoHost-Apps/photonix_ynh/issues * App website: https://photonix.org/ -* Upstream app repository: https://github.com/damianmoore/photonix/ +* Upstream app repository: https://github.com/photonixapp/photonix/ * YunoHost website: https://yunohost.org/ --- diff --git a/README_fr.md b/README_fr.md index 3ef3354..84fbf7f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Vue d'ensemble Photonix est une application de gestion de photos qui simplifie le processus de stocker, présenter er re-découvrir ses photos. Le filtrage intelligent est rendu possible automatiquement grâce à la reconnaissance d'objets, la localisation, l'analyse de couleurs, et d'autres algorithmes. -**Version incluse :** 2021-04-18 +**Version incluse :** 2021-05-03 ## Captures d'écran @@ -52,7 +52,7 @@ Un panneau admin est accessible depuis `https://votre.domiane.tld/admin/`. * Signaler un bug : https://github.com/YunoHost-Apps/photonix_ynh/issues * Site de l'application : https://photonix.org/ -* Dépôt de l'application principale : https://github.com/damianmoore/photonix/ +* Dépôt de l'application principale : https://github.com/photonixapp/photonix/ * Site web YunoHost : https://yunohost.org/ --- diff --git a/conf/app.src b/conf/app.src index e34ae3e..76074da 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/damianmoore/photonix/tarball/1a0c9fb97aefb8cfccf7a61d086901d856980b14 -SOURCE_SUM=b653e6e101c26795c970e28e054922f0f5bdd61c608a5c10e6a82859960d34ca +SOURCE_URL=https://github.com/photonixapp/photonix/tarball/c0609b88895cd1b27fa6c769d19bebb6875cb869 +SOURCE_SUM=272ff9a4c3274463caeb7494839f7a0a23748a183af79bc2ba0c34d846532a19 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=1a0c9fb97aefb8cfccf7a61d086901d856980b14 +SOURCE_FILENAME=c0609b88895cd1b27fa6c769d19bebb6875cb869 SOURCE_EXTRACT=true diff --git a/manifest.json b/manifest.json index 5a99ea9..c5316b1 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Photo management application that streamlines the process of storing, presenting and re-discovering photos", "fr": "Application de gestion de photos qui simplifie le processus de stocker, présenter er re-découvrir ses photos" }, - "version": "0.0.20210418~ynh1", + "version": "0.0.20210503~ynh1", "url": "https://photonix.org/", "license": "AGPL-3.0-only", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index c0d5ee9..e81d200 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="acl python3 python3-pip python3-venv curl build-essential gnupg libjpeg-dev libpq-dev libtiff5-dev dcraw libimage-exiftool-perl netcat nodejs libpq-dev postgresql postgresql-contrib postgresql-common redis-server libsasl2-dev libldap2-dev libssl-dev" +pkg_dependencies="acl python3 python3-pip python3-venv nodejs postgresql postgresql-contrib postgresql-common redis-server libsasl2-dev libldap2-dev libssl-dev build-essential curl gfortran gnupg libatlas-base-dev libblas-dev libblas3 libfreetype6 libfreetype6-dev libhdf5-dev libjpeg-dev liblapack-dev liblapack3 libpq-dev libtiff5-dev netcat" #================================================= # PERSONAL HELPERS @@ -44,17 +44,21 @@ function patch_files { function build_django_backend { chown -R $app:$app "$final_path" - pushd "$final_path" || ynh_die - sudo -u $app python3 -m venv "$final_path/venv" - sudo -u $app $final_path/venv/bin/pip --cache-dir $final_path/.cache/pip install -U wheel pip setuptools 2>&1 - sudo -u $app $final_path/venv/bin/pip --cache-dir $final_path/.cache/pip install -U --requirement requirements.txt 2>&1 - sudo -u $app $final_path/venv/bin/pip --cache-dir $final_path/.cache/pip install -U django-auth-ldap 2>&1 + pushd "$final_path" + sudo -u $app python3 -m venv "$final_path/venv" + sudo -u $app $final_path/venv/bin/pip --cache-dir "$final_path/.cache/pip" install -U wheel pip setuptools 2>&1 + while read requirement ; do + if [ ! -z "$requirement" ] && [[ ! "$requirement" =~ ^'#'.* ]]; then + sudo -u $app PYTHONUNBUFFERED=1 "$final_path/venv/bin/pip" --cache-dir "$final_path/.cache/pip" install "$requirement" 2>&1 + fi + done < "$final_path/requirements.txt" + sudo -u $app $final_path/venv/bin/pip --cache-dir "$final_path/.cache/pip" install -U django-auth-ldap 2>&1 sudo -u $app mkdir -p "$final_path/srv" sudo -u $app cp -rT "$final_path/photonix" "$final_path/srv/photonix" - popd || ynh_die - pushd "$final_path/srv" || ynh_die + popd + pushd "$final_path/srv" sudo -u $app $final_path/venv/bin/python "$final_path/srv/photonix/manage.py" collectstatic --noinput --link 2>&1 - popd || ynh_die + popd set_permissions } @@ -71,17 +75,17 @@ function build_node_frontend { chown -R $app:$app "$final_path" sudo -u $app touch "$final_path/.yarnrc" sudo -u $app mkdir -p "$final_path/srv/ui" - pushd "$final_path" || ynh_die + pushd "$final_path" sudo -u $app cp -T "$final_path/ui/package.json" "$final_path/srv/ui/package.json" sudo -u $app cp -T "$final_path/ui/yarn.lock" "$final_path/srv/ui/yarn.lock" - popd || ynh_die + popd - pushd "$final_path/srv/ui" || ynh_die + pushd "$final_path/srv/ui" sudo -u $app env "PATH=$node_path" yarn --cache-folder $final_path/yarn-cache --use-yarnrc $final_path/.yarnrc install 2>&1 sudo -u $app cp -rT "$final_path/ui/public" "$final_path/srv/ui/public" sudo -u $app cp -rT "$final_path/ui/src" "$final_path/srv/ui/src" sudo -u $app env "PATH=$node_path" yarn --cache-folder $final_path/yarn-cache --use-yarnrc $final_path/.yarnrc build 2>&1 - popd || ynh_die + popd sudo -u $app cp -rT "$final_path/ui/public" "$final_path/srv/ui/public" @@ -109,8 +113,7 @@ function apply_db_migrations { source \"$final_path/photonix.env\" python \"$final_path/photonix/manage.py\" makemigrations python \"$final_path/photonix/manage.py\" migrate" - popd || ynh_die - + popd } services="app_server watch_photos raw_scheduler raw_processor thumbnail_processor classification_scheduler classification_color_processor classification_location_processor classification_style_processor classification_object_processor rescan_photos_periodically" diff --git a/sources/patches/app-00-photonix-web-settings.py.patch b/sources/patches/app-00-photonix-web-settings.py.patch index d871fb5..5378249 100644 --- a/sources/patches/app-00-photonix-web-settings.py.patch +++ b/sources/patches/app-00-photonix-web-settings.py.patch @@ -1,26 +1,22 @@ diff --git a/photonix/web/settings.py b/photonix/web/settings.py -index e6caf58..a5ca667 100644 +index 8428b0c..9008613 100644 --- a/photonix/web/settings.py +++ b/photonix/web/settings.py -@@ -13,7 +13,7 @@ https://docs.djangoproject.com/en/1.10/ref/settings/ - from datetime import timedelta - import os - from pathlib import Path -- +@@ -16,11 +16,12 @@ from pathlib import Path + + from django.core.management import utils + +import ldap # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = str(Path(__file__).parent.parent.resolve()) -@@ -22,7 +22,7 @@ BASE_DIR = str(Path(__file__).parent.parent.resolve()) - # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ - # SECURITY WARNING: keep the secret key used in production secret! --SECRET_KEY = 'r*z#sh2aqb!zjz#s7h@5&toyx@t_r4nfrgwg%r$4)2@d@8ypyb' +-SECRET_KEY = utils.get_random_secret_key() +SECRET_KEY = os.environ['SECRET_KEY'] - # SECURITY WARNING: don't run with debug turned on in production! DEBUG = os.environ.get('ENV', 'prd') != 'prd' -@@ -93,6 +93,7 @@ DATABASES = { + +@@ -92,6 +93,7 @@ DATABASES = { } AUTHENTICATION_BACKENDS = [ @@ -28,13 +24,11 @@ index e6caf58..a5ca667 100644 'graphql_jwt.backends.JSONWebTokenBackend', 'django.contrib.auth.backends.ModelBackend', ] -@@ -117,6 +118,9 @@ AUTH_PASSWORD_VALIDATORS = [ - }, - ] +@@ -189,3 +191,7 @@ GRAPHQL_JWT = { + APPEND_SLASHES = False + CORS_ORIGIN_WHITELIST = [] ++ +AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=users,dc=yunohost,dc=org" + +AUTH_LDAP_USER_ATTR_MAP = {"username": "uid", "first_name": "givenName", "email": "mail", "last_name": "sn"} - - # Internationalization - # https://docs.djangoproject.com/en/1.10/topics/i18n/