diff --git a/README.md b/README.md index 1b141dc..19d22e1 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 LibrePhotos is a Google Photos-like app. It supports automatic classification of faces, grouping photos by date, location, or objects present, and album creation. -**Shipped version:** 2020-03-29 +**Shipped version:** 2020-03-31 ## Screenshots diff --git a/README_fr.md b/README_fr.md index ccd2c6d..f838063 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 LibrePhotos est un sercice inspiré par Google Photos. Il prend en charge la classification des visages, le groupement des photos par date, la localisation géographique, ou objets présents, et la création d'albums. -**Version incluse :** 2020-03-29 +**Version incluse :** 2020-03-31 ## Captures d'écran diff --git a/conf/backend.src b/conf/backend.src index 1301276..cea1f99 100644 --- a/conf/backend.src +++ b/conf/backend.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/LibrePhotos/librephotos/tarball/b921c5342647acbc4c2b92d09fa79a3ac45744db -SOURCE_SUM=7d9c07702c60582bc4d5b51815e9df843f092cb44e34dd03602790b87f275835 +SOURCE_URL=https://github.com/LibrePhotos/librephotos/tarball/2ddf922e39c83671b07d0d7eba49bdf52c910148 +SOURCE_SUM=9ab6ae75379080bd570ede4085ddd831b87dff51ca922eaee06102c8535743b9 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=b921c5342647acbc4c2b92d09fa79a3ac45744db +SOURCE_FILENAME=2ddf922e39c83671b07d0d7eba49bdf52c910148 SOURCE_EXTRACT=true diff --git a/conf/librephotos.env b/conf/librephotos.env index 8156452..ddac611 100644 --- a/conf/librephotos.env +++ b/conf/librephotos.env @@ -26,3 +26,4 @@ httpPort=__PORT__ BACKEND_PORT=__BACKEND_PORT__ IMAGE_SIMILARITY_SERVER_PORT=__SIMILARITY_PORT__ MPLCONFIGDIR=__DATA_PATH__/matplotlib +NODEJS_PATH=__NODEJS_PATH__ \ No newline at end of file diff --git a/manifest.json b/manifest.json index a81b47e..4f678e6 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A photo viewer and manager similar to Google Photos", "fr": "Un gestionnaire de photos semblable à Google Photos" }, - "version": "0.0.20210329~ynh2", + "version": "0.0.20210331~ynh2", "url": "https://github.com/LibrePhotos/librephotos", "license": "MIT", "maintainer": { diff --git a/scripts/install b/scripts/install index 5af3eb7..0628d33 100755 --- a/scripts/install +++ b/scripts/install @@ -157,15 +157,19 @@ popd || ynh_die #================================================= # SET UP FRONTEND #================================================= -ynh_script_progression --message="Setting up frontend..." --weight=5 +ynh_script_progression --message="Setting up frontend..." --weight=15 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=10 +ynh_use_nodejs +node_PATH=$nodejs_path:$(sudo -u $app sh -c 'echo $PATH') frontend_path=$final_path/frontend pushd $final_path/frontend || ynh_die chown -R $app:$app $frontend_path sudo -u $app touch $frontend_path/.yarnrc - sudo -u $app yarnpkg --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc install 2>&1 - sudo -u $app yarnpkg --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc run build 2>&1 - sudo -u $app yarnpkg --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc add serve 2>&1 + sudo -u $app PATH=$node_PATH yarn --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc install 2>&1 + sudo -u $app PATH=$node_PATH yarn --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc run build 2>&1 + sudo -u $app PATH=$node_PATH yarn --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc add serve 2>&1 chown -R root:root $frontend_path popd || ynh_die @@ -191,6 +195,8 @@ ynh_add_config --template="librephotos.env" --destination="$final_path/librephot for file in $final_path/bin/*; do ynh_replace_string -m '#!/usr/bin/env bash' -r "#!/usr/bin/env bash\nsource $final_path/librephotos.env" -f $file echo "$(uniq $file)" > $file + ynh_replace_string -m "source $final_path/librephotos.env" -r "source $final_path/librephotos.env\nexport PATH=\$NODEJS_PATH:\$PATH" -f $file + echo "$(uniq $file)" > $file ynh_replace_string -m "/usr/lib/librephotos" -r "$final_path" -f $file ynh_replace_string -m 3000 -r '$httpPort' -f $file ynh_replace_string -m 8001 -r '$BACKEND_PORT' -f $file @@ -203,6 +209,8 @@ for file in $final_path/bin/*; do ynh_replace_string -m "gunicorn --workers" -r "$backend_path/venv/bin/gunicorn --workers" -f $file ynh_replace_string -m "$backend_path/venv/bin/$backend_path/venv/bin/python" -r "$backend_path/venv/bin/python" -f $file ynh_replace_string -m "$backend_path/venv/bin/$backend_path/venv/bin/gunicorn --workers" -r "$backend_path/venv/bin/gunicorn --workers" -f $file + ynh_replace_string -m 'npm install' -r " " -f $file + ynh_replace_string -m 'npm' -r "yarn" -f $file done #================================================= diff --git a/scripts/remove b/scripts/remove index 6449f29..88ad86b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -98,6 +98,13 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate +#================================================= +# REMOVE NODE +#================================================= +ynh_script_progression --message="Removing Node.js..." --weight=1 + +ynh_remove_nodejs + #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ad06f6a..fb2f6df 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -144,13 +144,17 @@ popd || ynh_die #================================================= ynh_script_progression --message="Setting up frontend..." --weight=5 +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=10 +ynh_use_nodejs +node_PATH=$nodejs_path:$(sudo -u $app sh -c 'echo $PATH') + frontend_path=$final_path/frontend pushd $final_path/frontend || ynh_die chown -R $app:$app $frontend_path sudo -u $app touch $frontend_path/.yarnrc - sudo -u $app yarnpkg --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc install 2>&1 - sudo -u $app yarnpkg --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc run build 2>&1 - sudo -u $app yarnpkg --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc add serve 2>&1 + sudo -u $app PATH=$node_PATH yarn --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc install 2>&1 + sudo -u $app PATH=$node_PATH yarn --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc run build 2>&1 + sudo -u $app PATH=$node_PATH yarn --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc add serve 2>&1 chown -R root:root $frontend_path popd || ynh_die @@ -176,6 +180,8 @@ ynh_add_config --template="librephotos.env" --destination="$final_path/librephot for file in $final_path/bin/*; do ynh_replace_string -m '#!/usr/bin/env bash' -r "#!/usr/bin/env bash\nsource $final_path/librephotos.env" -f $file echo "$(uniq $file)" > $file + ynh_replace_string -m "source $final_path/librephotos.env" -r "source $final_path/librephotos.env\nexport PATH=\$NODEJS_PATH:\$PATH" -f $file + echo "$(uniq $file)" > $file ynh_replace_string -m "/usr/lib/librephotos" -r "$final_path" -f $file ynh_replace_string -m 3000 -r '$httpPort' -f $file ynh_replace_string -m 8001 -r '$BACKEND_PORT' -f $file @@ -188,6 +194,8 @@ for file in $final_path/bin/*; do ynh_replace_string -m "gunicorn --workers" -r "$backend_path/venv/bin/gunicorn --workers" -f $file ynh_replace_string -m "$backend_path/venv/bin/$backend_path/venv/bin/python" -r "$backend_path/venv/bin/python" -f $file ynh_replace_string -m "$backend_path/venv/bin/$backend_path/venv/bin/gunicorn --workers" -r "$backend_path/venv/bin/gunicorn --workers" -f $file + ynh_replace_string -m 'npm install' -r " " -f $file + ynh_replace_string -m 'npm' -r "yarn" -f $file done #=================================================