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

use data dir for config

This commit is contained in:
Éric Gaspar 2024-05-27 14:55:21 +02:00
parent de83ec9fdd
commit ce8d5b0eb9
3 changed files with 9 additions and 9 deletions

View file

@ -8,7 +8,7 @@ User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__/
Environment="__YNH_NODE_LOAD_PATH__"
ExecStart=__YNH_NODE__ server/cli.js start --config __INSTALL_DIR__/config.json
ExecStart=__YNH_NODE__ server/cli.js start --config __DATA_DIR__/config.json
# Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these

View file

@ -68,8 +68,7 @@ ynh_script_progression --message="Installing app dependencies and creating admin
pushd $install_dir
ynh_use_nodejs
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install # Install dependencies
#ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn build
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH ./server/cli.js users create $mail $password admin --config ./config.json
popd

View file

@ -22,7 +22,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="config.json"
ynh_setup_source --dest_dir="$install_dir" --full_replace=1
chown -R $app:www-data "$install_dir"
@ -53,12 +53,12 @@ yunohost service add $app --description="Federated shared agenda for local commu
#=================================================
# UPDATE A CONFIG FILE
#=================================================
#ynh_script_progression --message="Updating a configuration file..." --weight=1
ynh_script_progression --message="Updating a configuration file..." --weight=1
#ynh_add_config --template="config.json" --destination="$install_dir/config.json"
ynh_add_config --template="config.json" --destination="$data_dir/config.json"
#chmod 400 "$install_dir/config.json"
#chown $app:$app "$install_dir/config.json"
chmod 400 "$data_dir/config.json"
chown $app:$app "$data_dir/config.json"
#=================================================
# CONFIGURE THE APP
@ -67,7 +67,8 @@ ynh_script_progression --message="Updating app dependencies..." --weight=15
pushd $install_dir
ynh_use_nodejs
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install # Install/upgrade dependencies
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH ./server/cli.js users create $mail $password admin --config $data_dir/config.json
popd
#=================================================