mirror of
https://github.com/YunoHost-Apps/nodebb_ynh.git
synced 2024-09-03 19:46:29 +02:00
Fix
This commit is contained in:
parent
4666e6a79a
commit
bf44830db1
4 changed files with 14 additions and 28 deletions
|
@ -1,7 +1,7 @@
|
|||
[Unit]
|
||||
Description=NodeBB
|
||||
Documentation=https://docs.nodebb.org
|
||||
After=system.slice multi-user.target mongod.service
|
||||
After=system.slice multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
|
|
|
@ -66,7 +66,6 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
|||
|
||||
# Install Nodejs
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
#ynh_install_mongo
|
||||
|
||||
#=================================================
|
||||
# CREATE A MYSQL DATABASE
|
||||
|
@ -120,7 +119,7 @@ chown -R $app:www-data "$final_path"
|
|||
# CONFIGURE NODEBB
|
||||
#=================================================
|
||||
|
||||
chown -R $app: $final_path
|
||||
chown -R $app $final_path
|
||||
|
||||
#pushd $final_path
|
||||
#ynh_exec_as $app env $ynh_node_load_PATH
|
||||
|
|
|
@ -59,6 +59,10 @@ ynh_script_progression --message="Restoring the app main directory..." --time --
|
|||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
|
@ -67,13 +71,6 @@ ynh_script_progression --message="Recreating the dedicated system user..." --tim
|
|||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app:$app $final_path
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
|
|
@ -64,16 +64,6 @@ if ynh_legacy_permissions_exists; then
|
|||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
if ! ynh_permission_exists --permission="admin"; then
|
||||
# Create the required permissions
|
||||
ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
|
||||
fi
|
||||
|
||||
# Create a permission if needed
|
||||
if ! ynh_permission_exists --permission="api"; then
|
||||
ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -97,6 +87,14 @@ ynh_script_progression --message="Stopping a systemd service..." --time --weight
|
|||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -124,14 +122,6 @@ ynh_script_progression --message="Upgrading dependencies..." --time --weight=1
|
|||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue