mirror of
https://github.com/YunoHost-Apps/etherpad_ynh.git
synced 2024-09-03 18:36:10 +02:00
Add proper permission for config file
This commit is contained in:
parent
c829140598
commit
b730c603f8
3 changed files with 27 additions and 24 deletions
|
@ -74,6 +74,14 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
|||
|
||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --weight=4
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||
|
||||
#=================================================
|
||||
# CREATE A POSTQRESQL DATABASE
|
||||
#=================================================
|
||||
|
@ -101,14 +109,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=4
|
|||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --weight=4
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||
|
||||
#=================================================
|
||||
# INSTALL ETHERPAD
|
||||
#=================================================
|
||||
|
@ -140,6 +140,7 @@ ynh_store_file_checksum --file="$final_path/credentials.json"
|
|||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
chmod 600 $final_path/settings.json
|
||||
chmod 600 $final_path/credentials.json
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -51,6 +51,14 @@ test ! -d $final_path \
|
|||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
@ -78,20 +86,13 @@ ynh_psql_test_if_first_run
|
|||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chmod 600 $final_path/settings.json
|
||||
chmod 600 $final_path/credentials.json
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -84,6 +84,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=42
|
|||
|
||||
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..." --weight=1
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -113,14 +121,6 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
|||
|
||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
@ -156,6 +156,7 @@ popd || ynh_die
|
|||
|
||||
# Set permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chmod 600 $final_path/settings.json
|
||||
chmod 600 $final_path/credentials.json
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue