diff --git a/README.md b/README.md index e1b4e6f..e42ad47 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A modern, convivial and free music server on YunoHost Installation requires a dedicated domain or subdomain. Installing in a subpath is not supported by the upstream project due to dependency requirements. -**Shipped version:** 1.1.2 +**Shipped version:** 1.1.4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index a61b722..8865e54 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Un serveur de musique moderne, convivial et gratuit sur YunoHost 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. -**Version incluse :** 1.1.2 +**Version incluse :** 1.1.4 ## Captures d'écran diff --git a/check_process b/check_process index 9a0f2e2..77673c0 100644 --- a/check_process +++ b/check_process @@ -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 ; Manifest - domain="domain.tld" (DOMAIN) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + admin="john" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=0 @@ -22,9 +17,10 @@ upgrade=1 from_commit=8172790fb461d16f09089593fdac380f0d499c83 # 1.1.1~ynh1 upgrade=1 from_commit=fa9587f61e4bb4f9db8667b1c6701ede37ac8e91 + # 1.1.2~ynh1 + upgrade=1 from_commit=74255c1c278562eb174fb13ce538d4754f01186c backup_restore=1 multi_instance=1 - incorrect_path=0 port_already_use=0 change_url=1 ;;; Options @@ -38,3 +34,5 @@ Notification=all name=1.1~ynh1 ; commit=fa9587f61e4bb4f9db8667b1c6701ede37ac8e91 name=1.1.1~ynh1 + ; commit=74255c1c278562eb174fb13ce538d4754f01186c + name=1.1.2~ynh1 diff --git a/conf/api.src b/conf/api.src index d2878e9..f2a77fa 100644 --- a/conf/api.src +++ b/conf/api.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/1.1.2/download?job=build_api -SOURCE_SUM=a0057edcff716327e49eafe7cff95e64919f8e6f32541525cc1462a25097635e +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/1.1.4/download?job=build_api +SOURCE_SUM=82fb761ec4d98c732771011b3053f52237b85d575debf08f7184eede5fb0e37b SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/front.src b/conf/front.src index 23c8cff..47bfc2a 100644 --- a/conf/front.src +++ b/conf/front.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.1.2/download?job=build_front -SOURCE_SUM=746f204834faba05a10104223509d8d012d989a98510b73b232d8ebcd17dddf3 +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.1.4/download?job=build_front +SOURCE_SUM=4e7461510a7bbfefa78c514f35597ea7b95836cc4407ea0421463d7798c8a7cd SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..cf5cac1 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -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**. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..8343524 --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -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**. diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/screenshot1.png b/doc/screenshots/screenshot1.png new file mode 100644 index 0000000..a4f9f9d Binary files /dev/null and b/doc/screenshots/screenshot1.png differ diff --git a/manifest.json b/manifest.json index 4389aff..1ffe232 100644 --- a/manifest.json +++ b/manifest.json @@ -6,8 +6,16 @@ "en": "Modern, convivial and free music server", "fr": "Serveur de musique moderne, convivial et gratuit" }, - "version": "1.1.2~ynh1", + "version": "1.1.4~ynh1", "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", "maintainer": { "name": "Ciarán Ainsworth", diff --git a/scripts/backup b/scripts/backup index 1f8656c..66dfe55 100644 --- a/scripts/backup +++ b/scripts/backup @@ -43,6 +43,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" +#================================================= +# BACKUP THE DATA DIR +#================================================= + +ynh_backup --src_path="$datadir" --is_big + #================================================= # 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.target" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="$datadir" --is_big - #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index 08c4709..c030df1 100644 --- a/scripts/install +++ b/scripts/install @@ -78,7 +78,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Configuring 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 @@ -86,7 +86,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path" ynh_script_progression --message="Creating a PostgreSQL database..." ynh_psql_test_if_first_run - db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name 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_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 ynh_setup_source --dest_dir="$final_path/api" --source_id="api" 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" 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 + pushd $datadir mkdir -p static media music popd @@ -124,20 +141,10 @@ chmod 750 "$datadir" chmod -R o-rwx "$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 #================================================= -ynh_script_progression --message="Adding a config file..." +ynh_script_progression --message="Adding a configuration file..." key=$(ynh_string_random --length=45 | base64) redis_db=$(ynh_redis_get_free_db) diff --git a/scripts/remove b/scripts/remove index 5ad36aa..86dcec7 100644 --- a/scripts/remove +++ b/scripts/remove @@ -72,14 +72,6 @@ ynh_script_progression --message="Removing the PostgreSQL database..." # Remove a database if it exists, along with the associated user 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 #================================================= @@ -107,11 +99,21 @@ ynh_remove_nginx_config #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Removing Fail2ban configuration..." +ynh_script_progression --message="Removing Fail2Ban configuration..." # Remove the dedicated 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 #================================================= diff --git a/scripts/restore b/scripts/restore index 9b33c98..60b5027 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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) db_name=$(ynh_app_setting_get --app=$app --key=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) #================================================= @@ -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..." # 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 @@ -74,15 +73,14 @@ chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" #================================================= -# SPECIFIC RESTORATION +# RESTORE THE DATA DIRECTORY #================================================= -# RESTORE VARIOUS FILES -#================================================= -ynh_script_progression --message="Restoring various files..." +ynh_script_progression --message="Restoring the data directory..." ynh_restore_file --origin_path="$datadir" --not_mandatory mkdir -p $datadir + pushd $datadir mkdir -p static media music popd @@ -104,6 +102,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= 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_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 diff --git a/scripts/upgrade b/scripts/upgrade index 60e2228..891ef85 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,37 +34,6 @@ ynh_script_progression --message="Checking version..." 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 #================================================= @@ -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}-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 #================================================= @@ -156,7 +149,7 @@ fi 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" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # 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..." # Create a dedicated NGINX config -ynh_add_nginx_config "datadir" +ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES @@ -212,7 +205,7 @@ popd #================================================= # 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"