diff options
| author | yalh76 <yalh@yahoo.com> | 2021-04-10 00:18:53 +0200 |
|---|---|---|
| committer | yalh76 <yalh@yahoo.com> | 2021-04-10 00:18:53 +0200 |
| commit | f376290f1397f56e8d12bad5d15ac952fbdc25c6 (patch) | |
| tree | 792622e5e6c915524ed0924921f2bf93ef98ae23 /scripts/install | |
| parent | a7eb98db3fac0697b923072dcd78c1ca04bf0a12 (diff) | |
| download | mastodon_ynh-f376290f1397f56e8d12bad5d15ac952fbdc25c6.tar.gz mastodon_ynh-f376290f1397f56e8d12bad5d15ac952fbdc25c6.tar.bz2 mastodon_ynh-f376290f1397f56e8d12bad5d15ac952fbdc25c6.zip | |
Apply example_ynh
Diffstat (limited to 'scripts/install')
| -rw-r--r-- | scripts/install | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/scripts/install b/scripts/install index 7d21d45..da81c3b 100644 --- a/scripts/install +++ b/scripts/install @@ -76,10 +76,18 @@ ynh_app_setting_set --app=$app --key=port_stream --value=$port_stream ynh_script_progression --message="Installing dependencies..." ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= +# 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..." @@ -103,23 +111,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 @@ -232,21 +236,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 @@ -275,7 +271,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 |
