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

Add additionnal settings

This commit is contained in:
Krakinou 2021-05-03 20:39:58 +02:00
parent 66492d4b5b
commit 897c7de189
6 changed files with 29 additions and 40 deletions

View file

@ -2,7 +2,8 @@
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld" (DOMAIN)
is_public=1 (PUBLIC|public=1|private=0) is_public=1 (PUBLIC|public=1|private=0)
vlc=no name=MyUMS
interface=eth0
; Checks ; Checks
pkg_linter=1 pkg_linter=1
#Only work w/ root domain #Only work w/ root domain

View file

@ -38,7 +38,7 @@
# ----------- # -----------
# The server name is displayed in the renderer before the profile name. # The server name is displayed in the renderer before the profile name.
# Default: "Universal Media Server" # Default: "Universal Media Server"
server_name = server_name =__NAME__
# Append profile name # Append profile name
# ------------------- # -------------------
@ -143,7 +143,7 @@ single_instance =
# E.g. network_interface = Intel(R) Dual Band Wireless-AC 3160 # 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. # 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. # Default: "", which means UMS will automatically select a network interface.
network_interface = network_interface =__INTERFACE__
# Force IP of the server # 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 # Sets the port UMS will listen on; usually should not need to be set unless
# another service has already grabbed the port. # another service has already grabbed the port.
# Default: "", which means UMS will automatically use port 5001. # Default: "", which means UMS will automatically use port 5001.
port = port =__PORT_REND__
# Use an IP filter (whitelist) # Use an IP filter (whitelist)
# ---------------------------- # ----------------------------

View file

@ -37,15 +37,30 @@
} }
}, },
{ {
"name":"vlc", "name":"name",
"type": "boolean", "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": { "ask": {
"en" : "Do you want to install vlc? It may be useful for web content streaming", "en" : "Which network interface do you want to use?",
"fr" : "Voulez vous installer vlc? Cela peut etre utile pour streamer du contenu web" "fr" : "Quel réseau souhaitez vous utiliser?"
}, },
"help": { "help": {
"en": "This will use approx 600GB more and will install a LOT of dependencies - NOT RECOMMENDED", "en": "On lan, the interface is usually eth0, on wifi it s usually wlan0",
"fr": "Cela va utiliser environ 600GB supplémentaires et installera BEAUCOUP de dépendances - NON RECOMMANDE" "fr": "En filaire, l interface est souvent eth0, en wifi wlan0"
} }
} }
] ]

View file

@ -27,14 +27,12 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=/ path_url=/
is_public=$YNH_APP_ARG_IS_PUBLIC 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 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 # 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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
#will be used when restoring #will be used when restoring
ynh_app_setting_set --app=$app --key=vlc --value=$vlc_required
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS

View file

@ -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) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port_web=$(ynh_app_setting_get --app=$app --key=port_web) port_web=$(ynh_app_setting_get --app=$app --key=port_web)
port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) 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 # CHECK IF THE APP CAN BE RESTORED

View file

@ -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) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port_web=$(ynh_app_setting_get --app=$app --key=port_web) port_web=$(ynh_app_setting_get --app=$app --key=port_web)
port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) 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 # CHECK VERSION
@ -122,22 +117,6 @@ 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
#=================================================
# 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 # GENERIC FINALIZATION
#================================================= #=================================================