1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/UMS_ynh.git synced 2024-10-01 13:35:01 +02:00

add data_dir

This commit is contained in:
ericgaspar 2023-04-22 18:57:42 +02:00
parent ab1c91940b
commit 91c21f5305
8 changed files with 49 additions and 74 deletions

View file

@ -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 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. 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 ### Limitations
- No multi-instance
- No User integration with Yunohost - No User integration with Yunohost
- work only on its own subdomain (ums.mydomain.tld, not on mydomain.tld/ums)
### Other infos ### 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 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 - 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 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) 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.

View file

@ -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. 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. 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 ### Limitations
- pas de multiinstance - Pas d'intégration des utilisateurs avec YunoHost
- 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é
### Autres infos ### 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 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 - 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 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. Sur de petits appareils (par exemple un raspberry), la transco peut demander trop de puissance, n'hésitez par à utiliser des transcodeur alternatifs.

View file

@ -17,7 +17,7 @@ admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki"
code = "https://github.com/UniversalMediaServer/UniversalMediaServer" code = "https://github.com/UniversalMediaServer/UniversalMediaServer"
[integration] [integration]
yunohost = ">= 11.1.15" yunohost = ">= 11.1.17"
architectures = "all" architectures = "all"
multi_instance = false multi_instance = false
ldap = false ldap = false
@ -77,6 +77,9 @@ ram.runtime = "50M"
[resources.install_dir] [resources.install_dir]
[resources.data_dir]
subdirs = ".config/UMS"
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"

View file

@ -3,3 +3,15 @@
#================================================= #=================================================
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -21,6 +21,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$install_dir" ynh_backup --src_path="$install_dir"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$data_dir" --is_big
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # 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" ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/home/yunohost.app/$app/"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -66,15 +66,12 @@ ynh_add_systemd_config
#================================================= #=================================================
ynh_script_progression --message="Setting up configuration file.." --weight=5 ynh_script_progression --message="Setting up configuration file.." --weight=5
#UMS read config file from .config/UMS folder ynh_add_config --template="UMS.conf.default" --destination="$data_dir/.config/UMS/UMS.conf"
mkdir -p "$install_dir/.config/UMS" 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" chown -R $app:$app "$data_dir/.config"
ynh_add_config --template="WEB.conf.default" --destination="$install_dir/.config/UMS/WEB.conf" chmod -R 700 "$data_dir/.config"
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"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -10,14 +10,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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 # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -29,6 +21,18 @@ chmod -R o-rwx "$install_dir"
chown -R root:$app "$install_dir" chown -R root:$app "$install_dir"
chown root:$app "$install_dir/UMS.sh" 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 #SETTING MULTIMEDIA DIRECTORY
#================================================= #=================================================
@ -41,28 +45,14 @@ ynh_multimedia_addaccess $app
#================================================= #=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 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" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet 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 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 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" 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" 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 ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================

View file

@ -80,27 +80,12 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_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) # Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append 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 yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
#================================================= #=================================================