From 897c7de189a5b37feabcec4819a557d1d895d0af Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 3 May 2021 20:39:58 +0200 Subject: [PATCH] Add additionnal settings --- check_process | 3 ++- conf/UMS.conf.default | 6 +++--- manifest.json | 27 +++++++++++++++++++++------ scripts/install | 7 ++----- scripts/restore | 5 +---- scripts/upgrade | 21 --------------------- 6 files changed, 29 insertions(+), 40 deletions(-) diff --git a/check_process b/check_process index 94d22bc..7c7beb6 100644 --- a/check_process +++ b/check_process @@ -2,7 +2,8 @@ ; Manifest domain="domain.tld" (DOMAIN) is_public=1 (PUBLIC|public=1|private=0) - vlc=no + name=MyUMS + interface=eth0 ; Checks pkg_linter=1 #Only work w/ root domain diff --git a/conf/UMS.conf.default b/conf/UMS.conf.default index 880fa4e..c0ea48a 100644 --- a/conf/UMS.conf.default +++ b/conf/UMS.conf.default @@ -38,7 +38,7 @@ # ----------- # The server name is displayed in the renderer before the profile name. # Default: "Universal Media Server" -server_name = +server_name =__NAME__ # Append profile name # ------------------- @@ -143,7 +143,7 @@ single_instance = # E.g. network_interface = Intel(R) Dual Band Wireless-AC 3160 # NOTE: Do not change it directly here but use the selector in the UMS GUI. # Default: "", which means UMS will automatically select a network interface. -network_interface = +network_interface =__INTERFACE__ # Force IP of the server # ---------------------- @@ -157,7 +157,7 @@ hostname = # Sets the port UMS will listen on; usually should not need to be set unless # another service has already grabbed the port. # Default: "", which means UMS will automatically use port 5001. -port = +port =__PORT_REND__ # Use an IP filter (whitelist) # ---------------------------- diff --git a/manifest.json b/manifest.json index 777a778..8774f83 100644 --- a/manifest.json +++ b/manifest.json @@ -37,15 +37,30 @@ } }, { - "name":"vlc", - "type": "boolean", + "name":"name", + "type":"string", + "example":"MyUMS", + "default": "UniversalMediaServer", + "ask": { + "en": "By which name should UMS be identified by your renderer", + "fr": "Par quel nom UMS doit-il être identifié par vos appareils" + }, + "help": { + "en": "This has no impact on the way the server will work and is only use to identify it on the network", + "fr": "Ceci n a aucun impact sur le fonctionnement du serveur et sert uniquement à l identifier sur le réseau" + } + }, + { + "name":"interface", + "type": "string", + "default": "eth0", "ask": { - "en" : "Do you want to install vlc? It may be useful for web content streaming", - "fr" : "Voulez vous installer vlc? Cela peut etre utile pour streamer du contenu web" + "en" : "Which network interface do you want to use?", + "fr" : "Quel réseau souhaitez vous utiliser?" }, "help": { - "en": "This will use approx 600GB more and will install a LOT of dependencies - NOT RECOMMENDED", - "fr": "Cela va utiliser environ 600GB supplémentaires et installera BEAUCOUP de dépendances - NON RECOMMANDE" + "en": "On lan, the interface is usually eth0, on wifi it s usually wlan0", + "fr": "En filaire, l interface est souvent eth0, en wifi wlan0" } } ] diff --git a/scripts/install b/scripts/install index 3f4e01e..e11a488 100755 --- a/scripts/install +++ b/scripts/install @@ -27,14 +27,12 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=/ is_public=$YNH_APP_ARG_IS_PUBLIC -vlc_required=$YNH_APP_ARG_VLC +name=$YNH_APP_ARG_NAME +interface=$YNH_APP_ARG_INTERFACE app=$YNH_APP_INSTANCE_NAME -if [ "$vlc_required" -eq 1 ] ; then - pkg_dependencies="$pkg_dependencies vlc" -fi #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -55,7 +53,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url #will be used when restoring -ynh_app_setting_set --app=$app --key=vlc --value=$vlc_required #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/restore b/scripts/restore index a373a95..e933323 100755 --- a/scripts/restore +++ b/scripts/restore @@ -33,11 +33,8 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port_web=$(ynh_app_setting_get --app=$app --key=port_web) port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) -vlc_required=$(ynh_app_setting_get --app=$app --key=vlc) -if [ "$vlc_required" -eq 1 ] ; then - pkg_dependencies="$pkg_dependencies vlc" -fi + #================================================= # CHECK IF THE APP CAN BE RESTORED diff --git a/scripts/upgrade b/scripts/upgrade index 04a737e..2b14cea 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,11 +21,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port_web=$(ynh_app_setting_get --app=$app --key=port_web) port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) -vlc_required=$(ynh_app_setting_get --app=$app --key=vlc) - -if [ "$vlc_required" -eq 1 ] ; then - pkg_dependencies="$pkg_dependencies vlc" -fi #================================================= # CHECK VERSION @@ -122,22 +117,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# UPDATE A CONFIG FILE -#================================================= -ynh_script_progression --message="Setting up configuration file..." --weight=3 -### Same as during install -### -### The file will automatically be backed-up if it's found to be manually modified (because -### ynh_add_config keeps track of the file's checksum) - -mkdir -p "/home/$app/.config/UMS" -ynh_add_config --template="UMS.conf.default" --destination="/home/$app/.config/UMS/UMS.conf" -ynh_add_config --template="WEB.conf.default" --destination="/home/$app/.config/UMS/WEB.conf" -ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/$app/.config/UMS/VirtualFolders.conf" -chown -R $app:$app "/home/$app/.config" -chmod -R 700 "/home/$app/.config" - #================================================= # GENERIC FINALIZATION #=================================================