mirror of
https://github.com/YunoHost-Apps/funkwhale_ynh.git
synced 2024-09-03 18:36:24 +02:00
Apply last example_ynh
This commit is contained in:
parent
2977a94f30
commit
183b21f862
12 changed files with 104 additions and 78 deletions
|
@ -1,13 +1,8 @@
|
||||||
# See here for more information
|
|
||||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
|
||||||
|
|
||||||
# Move this file from check_process.default to check_process when you have filled it.
|
|
||||||
|
|
||||||
;; Test complet
|
;; Test complet
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld"
|
||||||
admin="john" (USER)
|
admin="john"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=0
|
setup_sub_dir=0
|
||||||
|
@ -26,7 +21,6 @@
|
||||||
upgrade=1 from_commit=74255c1c278562eb174fb13ce538d4754f01186c
|
upgrade=1 from_commit=74255c1c278562eb174fb13ce538d4754f01186c
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=0
|
|
||||||
port_already_use=0
|
port_already_use=0
|
||||||
change_url=1
|
change_url=1
|
||||||
;;; Options
|
;;; Options
|
||||||
|
|
0
doc/.gitkeep
Normal file
0
doc/.gitkeep
Normal file
13
doc/DISCLAIMER.md
Normal file
13
doc/DISCLAIMER.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
* Any known limitations, constrains or stuff not working, such as (but not limited to):
|
||||||
|
* Installation requires a dedicated domain or subdomain. Installing in a subpath is not supported by the upstream project due to dependency requirements.
|
||||||
|
|
||||||
|
* Admin
|
||||||
|
|
||||||
|
The admin uses the login you provided at installation. The password is the same you use for YunoHost.
|
||||||
|
The admin interface is accessible at the address: `your.domain.fr/api/admin`
|
||||||
|
|
||||||
|
To add a collection of music files to a library in your YunoHost installation of Funkwhale, create a symlink to your collection titled "music" in `/home/yunohost.app/funkwhale/data`
|
||||||
|
```console
|
||||||
|
foo@bar:~$sudo ln -s /your/music/collection /home/yunohost.app/funkwhale/data/music
|
||||||
|
```
|
||||||
|
The files can then be added to your library from the *uploading* tab in a music library under the heading **Import music from your server**.
|
10
doc/DISCLAIMER_fr.md
Normal file
10
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
* L'installation nécessite un domaine ou un sous-domaine dédié. L'installation dans un chemin du domaine n'est pas prise en charge par le projet en amont en raison des exigences de dépendance.
|
||||||
|
|
||||||
|
* Admin
|
||||||
|
|
||||||
|
L'administrateur utilise le login que vous avez fourni lors de l'installation. Le mot de passe est le même que celui que vous utilisez pour YunoHost.
|
||||||
|
|
||||||
|
L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/admin
|
||||||
|
Pour ajouter une collection de fichiers musicaux à une bibliothèque dans votre installation YunoHost de Funkwhale, créez un lien symbolique vers votre collection intitulée "music" dans `/home/yunohost.app/funkwhale/data/`.
|
||||||
|
`foo@bar:~$sudo ln -s /your/music/collection /home/yunohost.app/funkwhale/data/music`
|
||||||
|
Les fichiers peuvent ensuite être ajoutés à votre bibliothèque à partir de l'onglet *Envoi* dans une bibliothèque musicale sous la rubrique **Importer de la musique de votre serveur**.
|
0
doc/screenshots/.gitkeep
Normal file
0
doc/screenshots/.gitkeep
Normal file
BIN
doc/screenshots/screenshot1.png
Normal file
BIN
doc/screenshots/screenshot1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 707 KiB |
|
@ -8,6 +8,14 @@
|
||||||
},
|
},
|
||||||
"version": "1.1.4~ynh1",
|
"version": "1.1.4~ynh1",
|
||||||
"url": "https://funkwhale.audio",
|
"url": "https://funkwhale.audio",
|
||||||
|
"upstream": {
|
||||||
|
"license": "AGPL-3.0-or-later",
|
||||||
|
"website": "https://funkwhale.audio/",
|
||||||
|
"demo": "https://demo.funkwhale.audio",
|
||||||
|
"admindoc": "https://docs.funkwhale.audio/admin/index.html",
|
||||||
|
"userdoc": "https://docs.funkwhale.audio/users/index.html",
|
||||||
|
"code": "https://dev.funkwhale.audio/funkwhale"
|
||||||
|
},
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "Ciarán Ainsworth",
|
"name": "Ciarán Ainsworth",
|
||||||
|
|
|
@ -43,6 +43,12 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP THE DATA DIR
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="$datadir" --is_big
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -67,12 +73,6 @@ ynh_backup --src_path="/etc/systemd/system/${app}-server.service"
|
||||||
ynh_backup --src_path="/etc/systemd/system/${app}-worker.service"
|
ynh_backup --src_path="/etc/systemd/system/${app}-worker.service"
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app.target"
|
ynh_backup --src_path="/etc/systemd/system/$app.target"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup --src_path="$datadir" --is_big
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE POSTGRESQL DATABASE
|
# BACKUP THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -78,7 +78,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_script_progression --message="Configuring system user..."
|
ynh_script_progression --message="Configuring system user..."
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A POSTGRESQL DATABASE
|
# CREATE A POSTGRESQL DATABASE
|
||||||
|
@ -86,7 +86,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
ynh_script_progression --message="Creating a PostgreSQL database..."
|
ynh_script_progression --message="Creating a PostgreSQL database..."
|
||||||
|
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
|
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_string_random)
|
db_pwd=$(ynh_string_random)
|
||||||
|
@ -102,7 +101,6 @@ ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||||
ynh_script_progression --message="Setting up source files..."
|
ynh_script_progression --message="Setting up source files..."
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path/api" --source_id="api"
|
ynh_setup_source --dest_dir="$final_path/api" --source_id="api"
|
||||||
ynh_setup_source --dest_dir="$final_path/front" --source_id="front"
|
ynh_setup_source --dest_dir="$final_path/front" --source_id="front"
|
||||||
|
@ -115,7 +113,26 @@ chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# NGINX CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring NGINX web server..."
|
||||||
|
|
||||||
|
# Create a dedicated NGINX config
|
||||||
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC SETUP
|
||||||
|
#=================================================
|
||||||
|
# CREATE DATA DIRECTORY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Creating a data directory..."
|
||||||
|
|
||||||
|
datadir=/home/yunohost.app/$app
|
||||||
|
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||||
|
|
||||||
mkdir -p $datadir
|
mkdir -p $datadir
|
||||||
|
|
||||||
pushd $datadir
|
pushd $datadir
|
||||||
mkdir -p static media music
|
mkdir -p static media music
|
||||||
popd
|
popd
|
||||||
|
@ -124,20 +141,10 @@ chmod 750 "$datadir"
|
||||||
chmod -R o-rwx "$datadir"
|
chmod -R o-rwx "$datadir"
|
||||||
chown -R $app:www-data "$datadir"
|
chown -R $app:www-data "$datadir"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring NGINX web server..."
|
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config "datadir"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC SETUP
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a config file..."
|
ynh_script_progression --message="Adding a configuration file..."
|
||||||
|
|
||||||
key=$(ynh_string_random --length=45 | base64)
|
key=$(ynh_string_random --length=45 | base64)
|
||||||
redis_db=$(ynh_redis_get_free_db)
|
redis_db=$(ynh_redis_get_free_db)
|
||||||
|
|
|
@ -72,14 +72,6 @@ ynh_script_progression --message="Removing the PostgreSQL database..."
|
||||||
# Remove a database if it exists, along with the associated user
|
# Remove a database if it exists, along with the associated user
|
||||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE THE REDIS DATABASE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing the Redis database..."
|
|
||||||
|
|
||||||
# Remove a database if it exists, along with the associated user
|
|
||||||
ynh_redis_remove_db $redis_db
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -107,11 +99,21 @@ ynh_remove_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE FAIL2BAN CONFIGURATION
|
# REMOVE FAIL2BAN CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing Fail2ban configuration..."
|
ynh_script_progression --message="Removing Fail2Ban configuration..."
|
||||||
|
|
||||||
# Remove the dedicated Fail2Ban config
|
# Remove the dedicated Fail2Ban config
|
||||||
ynh_remove_fail2ban_config
|
ynh_remove_fail2ban_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC REMOVE
|
||||||
|
#=================================================
|
||||||
|
# REMOVE THE REDIS DATABASE
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing the Redis database..."
|
||||||
|
|
||||||
|
# Remove a database if it exists, along with the associated user
|
||||||
|
ynh_redis_remove_db $redis_db
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -32,7 +32,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -60,7 +59,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_script_progression --message="Recreating the dedicated system user..."
|
ynh_script_progression --message="Recreating the dedicated system user..."
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
|
@ -74,15 +73,14 @@ chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# RESTORE THE DATA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE VARIOUS FILES
|
ynh_script_progression --message="Restoring the data directory..."
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring various files..."
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$datadir" --not_mandatory
|
ynh_restore_file --origin_path="$datadir" --not_mandatory
|
||||||
|
|
||||||
mkdir -p $datadir
|
mkdir -p $datadir
|
||||||
|
|
||||||
pushd $datadir
|
pushd $datadir
|
||||||
mkdir -p static media music
|
mkdir -p static media music
|
||||||
popd
|
popd
|
||||||
|
@ -104,6 +102,7 @@ ynh_install_app_dependencies $pkg_dependencies
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the PostgreSQL database..."
|
ynh_script_progression --message="Restoring the PostgreSQL database..."
|
||||||
|
|
||||||
|
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
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
|
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
||||||
|
|
|
@ -34,37 +34,6 @@ ynh_script_progression --message="Checking version..."
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
|
||||||
|
|
||||||
# If redis_db doesn't exist, create it
|
|
||||||
if [ -z "$redis_db" ]; then
|
|
||||||
redis_db=$(ynh_redis_get_free_db)
|
|
||||||
ynh_app_setting_set --app=$app --key=redis_db --value=$redis_db
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If db_pwd doesn't exist, create it
|
|
||||||
if [ -z "$db_pwd" ]; then
|
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
|
||||||
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
|
||||||
if ynh_legacy_permissions_exists; then
|
|
||||||
ynh_legacy_permissions_delete_all
|
|
||||||
|
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
|
||||||
if ynh_legacy_permissions_exists; then
|
|
||||||
ynh_legacy_permissions_delete_all
|
|
||||||
|
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -91,6 +60,30 @@ ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="syst
|
||||||
ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped"
|
ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped"
|
||||||
ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped"
|
ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
|
|
||||||
|
# If redis_db doesn't exist, create it
|
||||||
|
if [ -z "$redis_db" ]; then
|
||||||
|
redis_db=$(ynh_redis_get_free_db)
|
||||||
|
ynh_app_setting_set --app=$app --key=redis_db --value=$redis_db
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If db_pwd doesn't exist, create it
|
||||||
|
if [ -z "$db_pwd" ]; then
|
||||||
|
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||||
|
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cleaning legacy permissions
|
||||||
|
if ynh_legacy_permissions_exists; then
|
||||||
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MOVE DATAS
|
# MOVE DATAS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -156,7 +149,7 @@ fi
|
||||||
ynh_script_progression --message="Making sure dedicated system user exists..."
|
ynh_script_progression --message="Making sure dedicated system user exists..."
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -183,7 +176,7 @@ chown -R $app:www-data "$final_path"
|
||||||
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config "datadir"
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
|
@ -212,7 +205,7 @@ popd
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating a config file..."
|
ynh_script_progression --message="Updating a configuration file..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/env.prod" --destination="$final_path/config/.env"
|
ynh_add_config --template="../conf/env.prod" --destination="$final_path/config/.env"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue