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

Various minor fixes

This commit is contained in:
Jules Bertholet 2021-04-17 21:27:09 -04:00
parent 120e0e3f74
commit a57d759e72
3 changed files with 17 additions and 14 deletions

View file

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

View file

@ -50,18 +50,22 @@ function set_up_virtualenv {
popd || ynh_die
}
function set_up_frontend {
function set_node_vars {
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=10
ynh_use_nodejs
node_PATH=$nodejs_path:$(sudo -u $app sh -c 'echo $PATH')
}
function set_up_frontend {
set_node_vars
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 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
sudo -u $app env "PATH=$node_PATH" yarn --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc install 2>&1
sudo -u $app env "PATH=$node_PATH" yarn --cache-folder $frontend_path/yarn-cache --use-yarnrc $frontend_path/.yarnrc run build 2>&1
sudo -u $app env "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
}

View file

@ -113,15 +113,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
#=================================================
# Restore permissions on app files
chown -R root:$app $final_path
chmod -R g=u,g-w,o-rwx $final_path
chown -R $app:$app $data_path
chmod -R g=u,g-w,o-rwx $data_path
chown -R $app:$app $final_path/data_models
chown -R $app:$app /var/log/$app
chmod -R g-w,o-rwx /var/log/$app
setfacl -n -m user:www-data:rx $data_path
setfacl -n -R -m user:www-data:rx -m default:user:www-data:rx $data_path/protected_media $data_path/data $data_path/data/nextcloud_media
set_permissions
#=================================================
# SPECIFIC RESTORATION
@ -134,6 +126,13 @@ ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# RESTORE NODE.JS
#=================================================
ynh_script_progression --message="Restoring Node.js..." --weight=1
set_node_vars
#=================================================
# RESTORE SYSTEMD
#=================================================