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

Let's create a specific user

This commit is contained in:
Jean-Baptiste Holcroft 2017-10-21 23:15:17 +02:00
parent 570d57458b
commit 33415b8fe7
4 changed files with 20 additions and 6 deletions

View file

@ -8,8 +8,8 @@ listen.group = www-data
listen.mode = 0600
; Unix user/group of processes.
user = www-data
group = www-data
user = __USER__
group = __USER__
; Choose how the process manager will control the number of child processes.
pm = dynamic

View file

@ -89,7 +89,8 @@ ynh_add_nginx_config
# CREATE DEDICATED USER
#=================================================
# Create a system user
ynh_system_user_create "$app"
#=================================================
# PHP-FPM CONFIGURATION
@ -131,7 +132,7 @@ ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < "${final_path}/app/Schema/S
# Set permissions to kanboard and data directory
chown -R root:root "$final_path"
chown -R www-data "$final_path"/{data,plugins}
chown -R "$app" "$final_path"/{data,plugins}
#=================================================
# SETUP SSOWAT

View file

@ -70,12 +70,19 @@ ynh_restore_file "$final_path"
ynh_mysql_setup_db "$dbuser" "$dbname" "$dbpass"
ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ./db.sql
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
# Create the dedicated user (if not existing)
ynh_system_user_create "$app"
#=================================================
# RESTORE USER RIGHTS
#=================================================
chown -R root:root "$final_path"
chown -R www-data "$final_path"/{data,plugins}
chown -R "$app" "$final_path"/{data,plugins}
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION

View file

@ -76,6 +76,12 @@ ynh_secure_remove "$final_path.old"
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
# Create a system user
ynh_system_user_create "$app"
# flush php sessions before upgrade
ynh_secure_remove /var/lib/php5/session/*
@ -118,7 +124,7 @@ ynh_replace_string "yuno_domain" "$domain" "$config_php"
# Set permissions to kanboard and data directory
chown -R root:root "$final_path"
chown -R www-data "$final_path"/{data,plugins}
chown -R "$app" "$final_path"/{data,plugins}
#=================================================
# SETUP SSOWAT