1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/opensondage_ynh.git synced 2024-09-03 19:46:28 +02:00

Add a dedicated user

This commit is contained in:
Jean-Baptiste Holcroft 2017-10-26 16:41:26 +02:00
parent 419c5ab0fc
commit 478912c5b8
5 changed files with 39 additions and 10 deletions

View file

@ -50,8 +50,8 @@ listen.mode = 0600
; Unix user/group of processes ; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group ; Note: The user is mandatory. If the group is not set, the default user's group
; will be used. ; will be used.
user = www-data user = __USER__
group = www-data group = __USER__
; Choose how the process manager will control the number of child processes. ; Choose how the process manager will control the number of child processes.
; Possible Values: ; Possible Values:

View file

@ -90,6 +90,13 @@ ynh_setup_source "$final_path"
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
# Create a system user
ynh_system_user_create "$app"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -143,15 +150,15 @@ touch $final_path/admin/stdout.log
#================================================= #=================================================
# Set permissions # Set permissions
chown -R www-data: $final_path chown -R "$app": "$final_path"
#================================================= #=================================================
# Run database initilization # Run database initilization
#================================================= #=================================================
init_composer "www-data" "$final_path" init_composer "$app" "$final_path"
sudo -u "www-data" php "$final_path/admin/migration.php" sudo -u "$app" php "$final_path/admin/migration.php"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT

View file

@ -55,3 +55,12 @@ ynh_remove_nginx_config
# Remove the dedicated php-fpm config # Remove the dedicated php-fpm config
ynh_remove_fpm_config ynh_remove_fpm_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
# Delete a system user
ynh_system_user_delete "$app"

View file

@ -61,13 +61,19 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file "$final_path" ynh_restore_file "$final_path"
#=================================================
# CREATE DEDICATED USER
#=================================================
# Create a system user
ynh_system_user_create "$app"
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
# Set permissions # Set permissions
chown -R www-data:www-data $final_path chown -R "$app": "$final_path"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION

View file

@ -104,6 +104,13 @@ ynh_setup_source "$final_path"
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
# Create a system user
ynh_system_user_create "$app"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -158,15 +165,15 @@ touch $final_path/admin/stdout.log
#================================================= #=================================================
# Set permissions to roundcube directory # Set permissions to roundcube directory
chown -R www-data: $final_path chown -R "$app": "$final_path"
#================================================= #=================================================
# Run database initilization # Run database initilization
#================================================= #=================================================
init_composer "www-data" "$final_path" init_composer "$app" "$final_path"
sudo -u "www-data" php "$final_path/admin/migration.php" sudo -u "$app" php "$final_path/admin/migration.php"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT