1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00

Apply example_ynh

This commit is contained in:
yalh76 2021-04-10 00:46:33 +02:00
parent e496d312a5
commit 2010081fe4
7 changed files with 43 additions and 57 deletions

View file

@ -48,8 +48,8 @@ The admin interface is accessible at the address: `your.domain.fr/api/admin`
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/)
## Links

View file

@ -44,8 +44,8 @@ L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/
#### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/)
## Liens

View file

@ -24,7 +24,7 @@
multi_instance=1
incorrect_path=0
port_already_use=0
change_url=0
change_url=1
;;; Options
Email=cda@rootkey.co.uk
Notification=all

View file

@ -6,7 +6,7 @@
"en": "Modern, convivial and free music server",
"fr": "Serveur de musique moderne, convivial et gratuit"
},
"version": "1.1~ynh2",
"version": "1.1~ynh3",
"url": "https://funkwhale.audio",
"license": "AGPL-3.0-or-later",
"maintainer": {

View file

@ -72,6 +72,14 @@ ynh_script_progression --message="Installing dependencies..."
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# 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
#=================================================
@ -103,11 +111,19 @@ pushd $final_path
mkdir -p config
popd
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R root:$app "$final_path"
mkdir -p $datadir
pushd $datadir
mkdir -p static media music
popd
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R root:$app "$datadir"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -116,14 +132,6 @@ ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated NGINX config
ynh_add_nginx_config "datadir"
#=================================================
# 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
#=================================================
@ -185,15 +193,6 @@ ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.serv
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..."
# Set permissions to app files
chown -R $app: $final_path
chown -R $app: $datadir
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================

View file

@ -23,7 +23,7 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading settings..."
ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
@ -54,6 +54,14 @@ ynh_script_progression --message="Restoring the NGINX web server configuration..
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..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
@ -61,21 +69,9 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# RESTORE USER RIGHTS
#=================================================
ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files
chown -R $app: $final_path
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R root:$app "$final_path"
#=================================================
# SPECIFIC RESTORATION
@ -131,7 +127,7 @@ ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="s
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring the various files..."
ynh_script_progression --message="Restoring various files..."
ynh_restore_file --origin_path="$datadir" --not_mandatory

View file

@ -127,6 +127,14 @@ if [ -z "$datadir" ]; then
upgrade_type="UPGRADE_APP"
fi
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -157,14 +165,6 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# SPECIFIC UPGRADE
#=================================================
@ -238,15 +238,6 @@ ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.serv
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..."
# Set permissions on app files
chown -R $app: $final_path
chown -R $app: $datadir
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================