diff options
Diffstat (limited to 'scripts/install')
| -rw-r--r-- | scripts/install | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/scripts/install b/scripts/install index 0b79b96..91133d3 100644 --- a/scripts/install +++ b/scripts/install @@ -81,6 +81,14 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_install_ruby --ruby_version=$RUBY_VERSION #================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + +#================================================= # CREATE A POSTGRESQL DATABASE #================================================= ynh_script_progression --message="Creating a PostgreSQL database..." @@ -104,23 +112,19 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path/live" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R root:$app "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config 'port_web port_stream' #================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path - -#================================================= # SPECIFIC SETUP #================================================= # ADD SWAP IF NEEDED @@ -235,21 +239,13 @@ ynh_store_file_checksum --file="$config" #================================================= # GENERIC FINALIZATION #================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -# Set permissions to app files -chown -R "$app": "$final_path" - -#================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add "$app-web" --description "$app web service" -yunohost service add "$app-sidekiq" --description "$app sidekiq service" -yunohost service add "$app-streaming" --description "$app streaming service" +yunohost service add "$app-web" --description="$app web service" +yunohost service add "$app-sidekiq" --description="$app sidekiq service" +yunohost service add "$app-streaming" --description="$app streaming service" #================================================= # START SYSTEMD SERVICE @@ -278,7 +274,7 @@ ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --aut #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload |
