1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mopidy_ynh.git synced 2024-09-03 19:46:21 +02:00

Merge pull request #18 from YunoHost-Apps/testing

for CI test  !testme
This commit is contained in:
siwinter 2021-04-07 12:46:03 +02:00 committed by GitHub
commit 6938356765
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 38 additions and 64 deletions

View file

@ -1,7 +1,7 @@
# Mopidy for YunoHost # Mopidy for YunoHost
[![Integration level](https://dash.yunohost.org/integration/mopidy.svg)](https://dash.yunohost.org/appci/app/mopidy) ![](https://ci-apps.yunohost.org/ci/badges/mopidy.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mopidy.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/mopidy.svg)](https://dash.yunohost.org/appci/app/mopidy) ![](https://ci-apps.yunohost.org/ci/badges/mopidy.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mopidy.maintain.svg)
[![Install mopidy with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mopidy) [![Install Mopidy with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mopidy)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
@ -9,8 +9,7 @@
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview ## Overview
Mopidy - is an extensible music server. Mopidy - is an extensible music server. It plays music, podcasts and radio programs from local disk and various streaming services. You edit the playlist from any phone, tablet, or computer.
It plays music, podcasts and radio programs from local disk and various streaming services. You edit the playlist from any phone, tablet, or computer.
**Shipped version:** 3.1.1 **Shipped version:** 3.1.1
@ -42,13 +41,13 @@ This installation is shipped with various extensions:
#### Multi-user support #### Multi-user support
Are LDAP and HTTP auth supported? No \ * Are LDAP and HTTP auth supported? **No**
Can the app be used by multiple users? ?? * Can the app be used by multiple users? ??
#### Supported architectures #### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mopidy%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mopidy/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mopidy.svg)](https://ci-apps.yunohost.org/ci/apps/mopidy/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mopidy%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mopidy/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mopidy.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mopidy/)
## Limitations ## Limitations
@ -57,12 +56,9 @@ Can the app be used by multiple users? ??
## Additional information ## Additional information
* To list current settings enter `sudo mopidyctl config`. * To list current settings enter `sudo mopidyctl config`.
* Edit the file `/opt/yunohost/mopidy/mopidy.conf` to adjust mopidy's configuration. * Edit the file `/opt/yunohost/mopidy/mopidy.conf` to adjust Mopidy's configuration.
* To rebuild the database of your local music collection enter `sudo mopidyctl local scan`. * To rebuild the database of your local music collection enter `sudo mopidyctl local scan`.
**More info on the documentation page:**
https://yunohost.org/packaging_apps
## Links ## Links
* Report a bug: https://github.com/YunoHost-Apps/mopidy_ynh/issues * Report a bug: https://github.com/YunoHost-Apps/mopidy_ynh/issues
@ -73,7 +69,6 @@ https://yunohost.org/packaging_apps
## Developer info ## Developer info
**Only if you want to use a testing branch for coding, instead of merging directly into master.**
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/mopidy_ynh/tree/testing). Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/mopidy_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.

View file

@ -1,7 +1,7 @@
# Mopidy pour YunoHost # Mopidy pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/mopidy.svg)](https://dash.yunohost.org/appci/app/mopidy) ![](https://ci-apps.yunohost.org/ci/badges/mopidy.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mopidy.maintain.svg) [![Niveau d'intégration](https://dash.yunohost.org/integration/mopidy.svg)](https://dash.yunohost.org/appci/app/mopidy) ![](https://ci-apps.yunohost.org/ci/badges/mopidy.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mopidy.maintain.svg)
[![Installer mopidy avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mopidy) [![Installer Mopidy avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mopidy)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
@ -9,8 +9,7 @@
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
## Vue d'ensemble ## Vue d'ensemble
Mopidy - est un serveur de musique extensible. Mopidy - est un serveur de musique extensible. Mopidy lit de la musique, des podcasts et des programmes de radio à partir d'un disque local et de divers services de streaming.
Mopidy lit de la musique, des podcasts et des programmes de radio à partir d'un disque local et de divers services de streaming.
Vous pouvez modifier la liste de lecture à partir d'un téléphone, d'une tablette ou d'un ordinateur. Vous pouvez modifier la liste de lecture à partir d'un téléphone, d'une tablette ou d'un ordinateur.
**Version incluse :** 3.1.1 **Version incluse :** 3.1.1
@ -40,17 +39,18 @@ Cette installation est livrée avec différentes extensions:
## Documentation ## Documentation
* Documentation officielle : https://docs.mopidy.com/en/latest/ * Documentation officielle : https://docs.mopidy.com/en/latest/
## Caractéristiques spécifiques YunoHost ## Caractéristiques spécifiques YunoHost
#### Support multi-utilisateur #### Support multi-utilisateur
* L'authentification LDAP et HTTP est-elle prise en charge ? Non * L'authentification LDAP et HTTP est-elle prise en charge ? **Non**
* L'application peut-elle être utilisée par plusieurs utilisateurs ? * L'application peut-elle être utilisée par plusieurs utilisateurs ?
#### Architectures supportées #### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mopidy%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mopidy/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mopidy.svg)](https://ci-apps.yunohost.org/ci/apps/mopidy/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mopidy%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mopidy/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mopidy.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mopidy/)
## Limitations ## Limitations
@ -59,12 +59,9 @@ Cette installation est livrée avec différentes extensions:
## Informations additionnelles ## Informations additionnelles
* Pour lister les paramètres actuels, entrez `sudo mopidyctl config` * Pour lister les paramètres actuels, entrez `sudo mopidyctl config`
* Modifiez le fichier /opt/yunohost/mopidy/mopidy.conf pour ajuster la configuration de mopidy * Modifiez le fichier `/opt/yunohost/mopidy/mopidy.conf` pour ajuster la configuration de mopidy
* Pour reconstruire la base de données de votre collection de musique locale, entrez `sudo mopidyctl local scan` * Pour reconstruire la base de données de votre collection de musique locale, entrez `sudo mopidyctl local scan`
**Plus d'informations sur la page de documentation :**
https://yunohost.org/packaging_apps
## Liens ## Liens
* Signaler un bug : https://github.com/YunoHost-Apps/mopidy_ynh/issues * Signaler un bug : https://github.com/YunoHost-Apps/mopidy_ynh/issues
@ -75,7 +72,6 @@ https://yunohost.org/packaging_apps
## Informations pour les développeurs ## Informations pour les développeurs
**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.**
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mopidy_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mopidy_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.

View file

@ -12,8 +12,8 @@
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1
setup_root=1 setup_root=1
setup_nourl=1 setup_nourl=0
setup_private=0 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# upgrade=1 from_commit=CommitHash # upgrade=1 from_commit=CommitHash

View file

@ -17,7 +17,7 @@
"email": "cyp@rouquin.me" "email": "cyp@rouquin.me"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.0.8" "yunohost": ">= 4.1.7"
}, },
"multi_instance": false, "multi_instance": false,
"services": [ "services": [
@ -28,29 +28,21 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain name for Mopidy"
},
"example": "example.com" "example": "example.com"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for Mopidy"
},
"example": "/example", "example": "/example",
"default": "/mopidy" "default": "/mopidy"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": { "help": {
"en": "Is it a public application?" "en": "Public app can be used by anonymous visitors",
"fr": "L'application publique peut être utilisée par des visiteurs anonymes "
}, },
"help": {
"en": "public app can be used by anonymous visitors"
},
"default": false "default": false
} }
] ]

View file

@ -4,7 +4,7 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
# dependencies used by the app # dependencies used by the app
pkg_dependencies="build-essential python3-dev python3-pip python3-venv git postgresql postgresql-contrib \ pkg_dependencies="acl build-essential python3-dev python3-pip python3-venv git postgresql postgresql-contrib \
gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly lsb-base \ gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly lsb-base \
python3-gst-1.0 python3-tornado (>= 4.4) debconf python3-pkg-resources python3-pykka python3-requests \ python3-gst-1.0 python3-tornado (>= 4.4) debconf python3-pkg-resources python3-pykka python3-requests \
gstreamer1.0-alsa gstreamer1.0-pulseaudio gstreamer1.0-tools" gstreamer1.0-alsa gstreamer1.0-pulseaudio gstreamer1.0-tools"
@ -33,13 +33,13 @@ myynh_install() {
$final_path/env/bin/python3 -m pip install vext $final_path/env/bin/python3 -m pip install vext
$final_path/env/bin/python3 -m pip install --no-binary=:all: vext.gi $final_path/env/bin/python3 -m pip install --no-binary=:all: vext.gi
# install essential packages # install essential packages
ynh_exec_as $app $final_path/env/bin/python3 -m pip install --no-cache-dir Mopidy==3.1.1 ynh_exec_as $app $final_path/env/bin/python3 -m pip install --no-cache-dir Mopidy==3.1.1
# patch -u $final_path/env/lib/python$python_version/site-packages/mopidy/__main__.py -i ../sources/patches/__main__.patch --forward # patch -u $final_path/env/lib/python$python_version/site-packages/mopidy/__main__.py -i ../sources/patches/__main__.patch --forward
ynh_exec_as $app $final_path/env/bin/python3 -m pip install --no-cache-dir Mopidy-local==3.2.1 ynh_exec_as $app $final_path/env/bin/python3 -m pip install --no-cache-dir Mopidy-local==3.2.1
ynh_exec_as $app $final_path/env/bin/python3 -m pip install --no-cache-dir Mopidy-MusicBox-Webclient==3.1.0 ynh_exec_as $app $final_path/env/bin/python3 -m pip install --no-cache-dir Mopidy-MusicBox-Webclient==3.1.0
# ynh_script_progression --message="Installing Mopidy-YouTube..." --weight=7 # ynh_script_progression --message="Installing Mopidy-YouTube..." --weight=7
ynh_exec_as $app $final_path/env/bin/python3 -m pip install --no-cache-dir Mopidy-YouTube==3.2 ynh_exec_as $app $final_path/env/bin/python3 -m pip install --no-cache-dir Mopidy-YouTube==3.2

View file

@ -105,8 +105,8 @@ then
ynh_permission_url --permission="main" --add_url="$new_domain/mopidy/ws" --remove_url="$old_domain/mopidy/ws" ynh_permission_url --permission="main" --add_url="$new_domain/mopidy/ws" --remove_url="$old_domain/mopidy/ws"
ynh_permission_url --permission="main" --add_url="$new_domain/local" --remove_url="$old_domain/local" ynh_permission_url --permission="main" --add_url="$new_domain/local" --remove_url="$old_domain/local"
ynh_permission_url --permission="main" --add_url="$new_domain/musicbox_webclient" --remove_url="$old_domain/musicbox_webclient" ynh_permission_url --permission="main" --add_url="$new_domain/musicbox_webclient" --remove_url="$old_domain/musicbox_webclient"
fi fi
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
#================================================= #=================================================

View file

@ -66,7 +66,8 @@ ynh_app_setting_set --app=$app --key=port --value=$port
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=30 ynh_script_progression --message="Installing dependencies..." --weight=30
ynh_install_app_dependencies $pkg_dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -101,7 +102,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# CREATE YUNOHOST DIRECTORIES # CREATE YUNOHOST DIRECTORIES
#================================================= #=================================================
ynh_script_progression --message="Creating yunohost directories..." ynh_script_progression --message="Creating YunoHost directories..."
ynh_multimedia_build_main_dir # /home/yunohost.multimedia ynh_multimedia_build_main_dir # /home/yunohost.multimedia
@ -151,7 +152,7 @@ chown $app: $final_path
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --log_type systemd --description "this is mopidy, a music server" yunohost service add $app --description "Mopidy music server" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -185,12 +186,12 @@ ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# PROVIDE ADDITIONAL SHELL COMAND # PROVIDE ADDITIONAL SHELL COMAND
#================================================= #=================================================
ynh_script_progression --message="Provide additional shell comand..." ynh_script_progression --message="Provide additional shell command..."
cp -a ../sources/extra_files/mopidyctl "$cmd_file" cp -a ../sources/extra_files/mopidyctl "$cmd_file"
ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="$cmd_file" ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="$cmd_file"
ynh_replace_string --match_string="__FINAL_PATH__" --replace_string=$final_path --target_file="$cmd_file" ynh_replace_string --match_string="__FINAL_PATH__" --replace_string=$final_path --target_file="$cmd_file"
ynh_replace_string --match_string="__CONF_FILE__" --replace_string=$conf_file --target_file="$cmd_file" ynh_replace_string --match_string="__CONF_FILE__" --replace_string=$conf_file --target_file="$cmd_file"
chmod +x "$cmd_file" chmod +x "$cmd_file"

View file

@ -89,7 +89,7 @@ ynh_restore_file --origin_path="$final_path" # /opt/yunohost/mopidy
ynh_script_progression --message="Reinstalling dependencies..." --weight=50 ynh_script_progression --message="Reinstalling dependencies..." --weight=50
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
@ -104,7 +104,7 @@ systemctl enable $app.service --quiet
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --log_type systemd --description "this is mopidy, a music server" yunohost service add $app --description "Mopidy music server" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# RESTORE VARIOUS FILES # RESTORE VARIOUS FILES

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=2
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -27,17 +27,10 @@ work_dir="/home/yunohost.app/$app"
conf_file="$final_path/$app.conf" conf_file="$final_path/$app.conf"
cmd_file="/usr/local/bin/mopidyctl" cmd_file="/usr/local/bin/mopidyctl"
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
### This helper will compare the version of the currently installed app and the version of the upstream package.
### $upgrade_type can have 2 different values
### - UPGRADE_APP if the upstream app version has changed
### - UPGRADE_PACKAGE if only the YunoHost package has changed
### ynh_check_app_version_changed will stop the upgrade if the app is up to date.
### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do.
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
@ -102,7 +95,7 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=11 ynh_script_progression --message="Upgrading dependencies..." --weight=11
ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -127,11 +120,8 @@ ynh_add_systemd_config --others_var="conf_file start_file" # substitute __CO
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
ynh_backup_if_checksum_is_different --file="$conf_file" ynh_backup_if_checksum_is_different --file="$conf_file"
cp ../conf/app.conf "$conf_file" cp ../conf/app.conf "$conf_file"
ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file="$conf_file" ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file="$conf_file"
@ -162,7 +152,7 @@ chown $app: $final_path
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --log_type systemd --description "this is mopidy, a music server" yunohost service add $app --description "Mopidy music server" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE