1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tiddlywiki_ynh.git synced 2024-09-03 20:26:34 +02:00
This commit is contained in:
ericgaspar 2021-03-27 15:22:24 +01:00
parent 34025d7e9d
commit e454d22b6d
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 16 additions and 3 deletions

View file

@ -8,8 +8,7 @@ User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__
Environment='NODE_ENV=production'
Environment="__YNH_NODE_LOAD_PATH__"
ExecStart=__YNH_NODE_LOAD_PATH__ __FINALPATH__ mynewwiki --listen port=__PORT__ #authenticated-user-header=basic
ExecStart=__YNH_NODE__ mynewwiki --listen port=__PORT__ #authenticated-user-header=basic
Restart=always
[Install]

View file

@ -17,3 +17,16 @@ nodejs_version=14
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
# Execute a command as another user
# usage: ynh_exec_as USER COMMAND [ARG ...]
ynh_exec_as() {
local USER=$1
shift 1
if [[ $USER = $(whoami) ]]; then
eval "$@"
else
sudo -u "$USER" "$@"
fi
}

View file

@ -98,7 +98,8 @@ ynh_script_progression --message="Configuring TiddlyWiki..." --weight=2
pushd $final_path
ynh_use_nodejs
ynh_npm install -g tiddlywiki
#ynh_npm install -g tiddlywiki
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install -g tiddlywiki
tiddlywiki mynewwiki --init server
popd