1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/librephotos_ynh.git synced 2024-09-03 19:36:12 +02:00

Update to latest version, and use N to install/manage Node

This commit is contained in:
Jules Bertholet 2021-03-31 21:44:37 -04:00
parent e9b3deb38d
commit a2c164736b
8 changed files with 37 additions and 13 deletions

View file

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

View file

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

View file

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

View file

@ -26,3 +26,4 @@ httpPort=__PORT__
BACKEND_PORT=__BACKEND_PORT__
IMAGE_SIMILARITY_SERVER_PORT=__SIMILARITY_PORT__
MPLCONFIGDIR=__DATA_PATH__/matplotlib
NODEJS_PATH=__NODEJS_PATH__

View file

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

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================