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:
parent
e496d312a5
commit
2010081fe4
7 changed files with 43 additions and 57 deletions
|
@ -48,8 +48,8 @@ The admin interface is accessible at the address: `your.domain.fr/api/admin`
|
||||||
|
|
||||||
#### Supported architectures
|
#### Supported architectures
|
||||||
|
|
||||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/funkwhale/)
|
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/funkwhale/)
|
||||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/)
|
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/)
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/
|
||||||
|
|
||||||
#### Architectures supportées
|
#### Architectures supportées
|
||||||
|
|
||||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/funkwhale/)
|
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/funkwhale/)
|
||||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/)
|
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/)
|
||||||
|
|
||||||
## Liens
|
## Liens
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=0
|
incorrect_path=0
|
||||||
port_already_use=0
|
port_already_use=0
|
||||||
change_url=0
|
change_url=1
|
||||||
;;; Options
|
;;; Options
|
||||||
Email=cda@rootkey.co.uk
|
Email=cda@rootkey.co.uk
|
||||||
Notification=all
|
Notification=all
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Modern, convivial and free music server",
|
"en": "Modern, convivial and free music server",
|
||||||
"fr": "Serveur de musique moderne, convivial et gratuit"
|
"fr": "Serveur de musique moderne, convivial et gratuit"
|
||||||
},
|
},
|
||||||
"version": "1.1~ynh2",
|
"version": "1.1~ynh3",
|
||||||
"url": "https://funkwhale.audio",
|
"url": "https://funkwhale.audio",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -72,6 +72,14 @@ ynh_script_progression --message="Installing dependencies..."
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_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
|
# CREATE A POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -103,11 +111,19 @@ pushd $final_path
|
||||||
mkdir -p config
|
mkdir -p config
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
chmod 750 "$final_path"
|
||||||
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R root:$app "$final_path"
|
||||||
|
|
||||||
mkdir -p $datadir
|
mkdir -p $datadir
|
||||||
pushd $datadir
|
pushd $datadir
|
||||||
mkdir -p static media music
|
mkdir -p static media music
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
chmod 750 "$datadir"
|
||||||
|
chmod -R o-rwx "$datadir"
|
||||||
|
chown -R root:$app "$datadir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -116,14 +132,6 @@ ynh_script_progression --message="Configuring NGINX web server..."
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config "datadir"
|
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
|
# SPECIFIC SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -185,15 +193,6 @@ ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.serv
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# 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
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -23,7 +23,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading settings..."
|
ynh_script_progression --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
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"
|
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
|
# 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"
|
ynh_restore_file --origin_path="$final_path"
|
||||||
|
|
||||||
#=================================================
|
chmod 750 "$final_path"
|
||||||
# RECREATE THE DEDICATED USER
|
chmod -R o-rwx "$final_path"
|
||||||
#=================================================
|
chown -R root:$app "$final_path"
|
||||||
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
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
|
@ -131,7 +127,7 @@ ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="s
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE VARIOUS FILES
|
# 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
|
ynh_restore_file --origin_path="$datadir" --not_mandatory
|
||||||
|
|
||||||
|
|
|
@ -127,6 +127,14 @@ if [ -z "$datadir" ]; then
|
||||||
upgrade_type="UPGRADE_APP"
|
upgrade_type="UPGRADE_APP"
|
||||||
fi
|
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
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -157,14 +165,6 @@ ynh_script_progression --message="Upgrading dependencies..."
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_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
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -238,15 +238,6 @@ ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.serv
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# 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
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue