diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 7536da5..c1bab3f 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -2,16 +2,14 @@ At first run, UMS will ask you to create an admin user. This can be disable later on in the settings -Once installed, UMS will create config file in `/home/yunohost.app/ums/.config/UMS/` +Once installed, UMS will create config file in `__DATA_DIR__/.config/UMS/` All settings are pretty well documented directly in the files. -The default setting will use the shared multimedia directory by default (located into `/home/yunohost.multimedia/share`), you may change this setting in `/home/yunohost.app/ums/.config/UMS/UMS.conf` with the setting "folders" +The default setting will use the shared multimedia directory by default (located into `/home/yunohost.multimedia/share`), you may change this setting in `__DATA_DIR__/.config/UMS/UMS.conf` with the setting "folders" ### Limitations - - No multi-instance - No User integration with Yunohost - - work only on its own subdomain (ums.mydomain.tld, not on mydomain.tld/ums) ### Other infos @@ -19,7 +17,7 @@ If you can't find the server on a renderer, you may try the following trouble sh - Wait a little bit : the first start up will intialized the database and if you have a lot of media, this may take a while - Wait a little more : the server will broadcast an ALIVE message every 30 sec, so it may take this long for a renderer to find it - check if the service ums is running in the yunohost admin -- check on which network interface the server is annoucing : You may find the network and address used in `/home/yunohost.app/ums/.config/UMS/debug.log` or `/var/log/ums/ums.log`. Search for a line like `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)` +- check on which network interface the server is annoucing : You may find the network and address used in `__DATA_DIR__/.config/UMS/debug.log` or `/var/log/ums/ums.log`. Search for a line like `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)` The subnet to be used should be the same as your renderer (ie : if your TV is on 192.168.0.X and ums on 192.168.1.X, this will not work) -On small device (Raspberry for example), transco may be requiring too much power : try some alternate transcoder. +On small device (Raspberry for example), transco may be requiring too much power: try some alternate transcoder. diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 894107a..75b1004 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -2,16 +2,13 @@ A la première connexion, UMS vous demandera de créer un user administrateur. Cela peut-être désactivé plus tard dans les réglages. -Une fois installé, tous les réglages peuvent être trouvés dans `/home/yunohost.app/ums/.config/UMS/` +Une fois installé, tous les réglages peuvent être trouvés dans `__DATA_DIR__/.config/UMS/` Les réglages sont plutôt bien documentés, vous pouvez les changer directement dans le fichier. -Le réglage par défaut utilisera le répertoire multimédia partagé (situé dans `/home/yunohost.multimedia/share`). Vous pouvez changer ce réglage dans le fichier `/home/yunohost.app/ums/.config/UMS/UMS.conf` sur le réglage "folders". +Le réglage par défaut utilisera le répertoire multimédia partagé (situé dans `/home/yunohost.multimedia/share`). Vous pouvez changer ce réglage dans le fichier `__DATA_DIR__/.config/UMS/UMS.conf` sur le réglage "folders". ### Limitations - - pas de multiinstance - - Pas d'intégration des utilisateurs avec Yunohost - - fonctionne uniquement en sous-domaine (ums.mydomain.tld, et non mydomain.tld/ums) - - pas énormément testé + - Pas d'intégration des utilisateurs avec YunoHost ### Autres infos @@ -19,6 +16,6 @@ Si vous ne trouvez pas le serveur sur vos renderer, vous pouvez essayer les truc - Attendez un petit peu : lors du premier démarrage, UMS va indexer tous vos médias et ceci peut prendre un certain temps si vous en avez beaucoup - Attendez encore un peu : le serveur s'annonce par un message ALIVE toutes les 30 sec, donc cela peut prendre tout ce temps avant qu'un renderer ne le trouve - Vérifiez bien que le service ums tourne dans l'interface d'administration de yunohost -- Vérifiez sur quel interface réseau ums s'annonce. Vous pouvez trouver l'adresse utilisée et le réseau dans `/home/yunohost.app/ums/.config/UMS/debug.log` ou `/var/log/ums/ums.log`. Cherchez une ligne ressemblant à `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)`. Le sous-réseau utilisé doit être le même que le renderer (ie : si votre TV est sur 192.168.0.X et ums sur 192.168.1.X, cela ne marchera pas) +- Vérifiez sur quel interface réseau ums s'annonce. Vous pouvez trouver l'adresse utilisée et le réseau dans `__DATA_DIR__/.config/UMS/debug.log` ou `/var/log/ums/ums.log`. Cherchez une ligne ressemblant à `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)`. Le sous-réseau utilisé doit être le même que le renderer (ie : si votre TV est sur 192.168.0.X et ums sur 192.168.1.X, cela ne marchera pas) Sur de petits appareils (par exemple un raspberry), la transco peut demander trop de puissance, n'hésitez par à utiliser des transcodeur alternatifs. diff --git a/manifest.toml b/manifest.toml index 6a06329..f98f5b6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki" code = "https://github.com/UniversalMediaServer/UniversalMediaServer" [integration] -yunohost = ">= 11.1.15" +yunohost = ">= 11.1.17" architectures = "all" multi_instance = false ldap = false @@ -77,6 +77,9 @@ ram.runtime = "50M" [resources.install_dir] + [resources.data_dir] + subdirs = ".config/UMS" + [resources.permissions] main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index 027c9d7..69c72c9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,3 +3,15 @@ #================================================= # COMMON VARIABLES #================================================= + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index e51adb6..d4006e2 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +#================================================= +# BACKUP THE DATA DIR +#================================================= + +ynh_backup --src_path="$data_dir" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= @@ -41,12 +47,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="/home/yunohost.app/$app/" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index af77f03..194c818 100755 --- a/scripts/install +++ b/scripts/install @@ -66,15 +66,12 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Setting up configuration file.." --weight=5 -#UMS read config file from .config/UMS folder -mkdir -p "$install_dir/.config/UMS" +ynh_add_config --template="UMS.conf.default" --destination="$data_dir/.config/UMS/UMS.conf" +ynh_add_config --template="WEB.conf.default" --destination="$data_dir/.config/UMS/WEB.conf" +ynh_add_config --template="VirtualFolders.conf.default" --destination="$data_dir/.config/UMS/VirtualFolders.conf" -ynh_add_config --template="UMS.conf.default" --destination="$install_dir/.config/UMS/UMS.conf" -ynh_add_config --template="WEB.conf.default" --destination="$install_dir/.config/UMS/WEB.conf" -ynh_add_config --template="VirtualFolders.conf.default" --destination="$install_dir/.config/UMS/VirtualFolders.conf" - -chown -R $app:$app "$install_dir/.config" -chmod -R 700 "$install_dir/.config" +chown -R $app:$app "$data_dir/.config" +chmod -R 700 "$data_dir/.config" #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index 514bac1..17d041f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,14 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -29,6 +21,18 @@ chmod -R o-rwx "$install_dir" chown -R root:$app "$install_dir" chown root:$app "$install_dir/UMS.sh" +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$data_dir" --not_mandatory + +# (Same as for install dir) +chown -R $app:www-data "$data_dir" +chown -R $app:$app "$data_dir/.config" +chmod -R 700 "$data_dir/.config" + #================================================= #SETTING MULTIMEDIA DIRECTORY #================================================= @@ -41,28 +45,14 @@ ynh_multimedia_addaccess $app #================================================= ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 - yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend -#================================================= -# RESTORE VARIOUS FILES -#================================================= - mkdir -p /var/log/$app -ynh_restore_file --origin_path="/home/yunohost.app/$app/" -chown -R $app:$app "/home/yunohost.app/$app/.config" -chmod -R 700 "/home/yunohost.app/$app/.config" - -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= ynh_restore_file --origin_path="/etc/logrotate.d/$app" @@ -73,13 +63,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 47fbd4e..d065485 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -80,27 +80,12 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 - yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend #=================================================