From a83c7789419738ca1ee7ee183b864969920bc5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Mar 2023 07:50:27 +0100 Subject: [PATCH 01/25] v2 --- conf/amd64.src | 6 ---- conf/arm64.src | 6 ---- conf/armhf.src | 6 ---- conf/i386.src | 6 ---- conf/systemd.service | 4 +-- manifest.toml | 79 ++++++++++++++++++++++++++++++++++++++++++++ scripts/_common.sh | 2 +- scripts/backup | 14 ++++---- scripts/change_url | 64 ++++++++++++++++++----------------- scripts/install | 74 ++++++++++++++++++++--------------------- scripts/remove | 24 +++++++------- scripts/restore | 42 +++++++++++------------ scripts/upgrade | 46 +++++++++++++------------- 13 files changed, 215 insertions(+), 158 deletions(-) delete mode 100644 conf/amd64.src delete mode 100644 conf/arm64.src delete mode 100644 conf/armhf.src delete mode 100644 conf/i386.src create mode 100644 manifest.toml diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index 6c75956..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-x86_64.tgz -SOURCE_SUM=1b009c7deb737641e173a0a82c0b105d8e33a4392de661562e156e4434a4ed17 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_EXTRACT=true -SOURCE_IN_SUBDIR=true diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index 7d1aa9a..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-arm64.tgz -SOURCE_SUM=f2b05cec5fa6e51b9b5e1884b1ecdb99ca4e11bc0793a5cbea66c0f5c7e03a1a -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_EXTRACT=true -SOURCE_IN_SUBDIR=true diff --git a/conf/armhf.src b/conf/armhf.src deleted file mode 100644 index 4d22ff6..0000000 --- a/conf/armhf.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-armhf.tgz -SOURCE_SUM=5e478d40336600517a6f765c49c45bb81c627b76113b571d3ae09e9457429b3e -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_EXTRACT=true -SOURCE_IN_SUBDIR=true diff --git a/conf/i386.src b/conf/i386.src deleted file mode 100644 index e91f82b..0000000 --- a/conf/i386.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-x86.tgz -SOURCE_SUM=91a5c534664441064c772dcace5bcef02edac82d8d3c67155ddd803deabeb52c -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_EXTRACT=true -SOURCE_IN_SUBDIR=true diff --git a/conf/systemd.service b/conf/systemd.service index 9ffb0c3..cf49cd8 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,8 +6,8 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/UMS.sh headless +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=__INSTALL_DIR__/UMS.sh headless StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..1d3e257 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,79 @@ +packaging_format = 2 + +id = "ums" +name = "Universal Media Server" +description.en = "A DLNA, UPnP and HTTP(S) Media Server" +description.fr = "Un Serveur Multimedia DLNA, UPnP et HTTP(S)" + +version = "13.2.0~ynh3" + +maintainers = ["Krakinou"] + +[upstream] +version = "13.2.0" +license = "GPL-2.0-or-later" +website = "www.universalmediaserver.com" +admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki" +code = "https://github.com/UniversalMediaServer/UniversalMediaServer" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = false +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + help.en = "UMS require its own subdomain" + help.fr = "UMS a besoin de son propre sous-domaine" + type = "domain" + full_domain = true + + [install.init_main_permission] + help.en = "Everybody will be able to access your media on the internet without connecting to Yunohost" + help.fr = "Tout le monde pourra voir vos media sans se connecter à Yunohost" + type = "group" + default = "visitors" + + [install.server_name] + ask.en = "By which name should UMS be identified by your renderer" + ask.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" + help.fr = "Ceci n a aucun impact sur le fonctionnement du serveur et sert uniquement à l identifier sur le réseau" + type = "string" + example = "MyUMS" + default = "UniversalMediaServer" + + [install.interface] + ask.en = "Which network interface do you want to use?" + ask.fr = "Quel réseau souhaitez vous utiliser?" + help.en = "On lan, the interface is usually eth0, on wifi it s usually wlan0" + help.fr = "En filaire, l interface est souvent eth0, en wifi wlan0" + type = "string" + default = "eth0" + +[resources] + [resources.sources.main] + arm64.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-arm64.tgz" + arm64.sha256 = "f2b05cec5fa6e51b9b5e1884b1ecdb99ca4e11bc0793a5cbea66c0f5c7e03a1a" + amd64.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-x86_64.tgz" + amd64.sha256 = "1b009c7deb737641e173a0a82c0b105d8e33a4392de661562e156e4434a4ed17" + armhf.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-armhf.tgz" + armhf.sha256 = "5e478d40336600517a6f765c49c45bb81c627b76113b571d3ae09e9457429b3e" + i386.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-x86.tgz" + i386.sha256 = "91a5c534664441064c772dcace5bcef02edac82d8d3c67155ddd803deabeb52c" + + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index a6136d5..50268d3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="mediainfo dcraw p7zip" +#REMOVEME? pkg_dependencies="mediainfo dcraw p7zip" if [[ "$YNH_ARCH" == "armhf" ]] || [[ "$YNH_ARCH" == "arm64" ]] then diff --git a/scripts/backup b/scripts/backup index 5b86015..437363c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,12 +14,12 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors ynh_print_warn --message="This script will only backup the app, no media will be saved" ynh_print_warn --message="To save your media, please use a backup tool such as borg" @@ -27,12 +27,12 @@ ynh_print_warn --message="To save your media, please use a backup tool such as b #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -43,7 +43,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 12a5611..e3207a3 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,54 +14,54 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH +#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN +#REMOVEME? old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN +#REMOVEME? new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port_web=$(ynh_app_setting_get --app=$app --key=port_web) +#REMOVEME? # Needed for helper "ynh_add_nginx_config" +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port_web=$(ynh_app_setting_get --app=$app --key=port_web) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=7 +#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=7 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= -change_domain=0 -if [ "$old_domain" != "$new_domain" ] +#REMOVEME? change_domain=0 +#REMOVEME? if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + #REMOVEME? change_domain=1 fi -change_path=0 -if [ "$old_path" != "$new_path" ] +#REMOVEME? change_path=0 +#REMOVEME? if [ "$old_path" != "$new_path" ] then - change_path=1 + #REMOVEME? change_path=1 fi #================================================= @@ -78,28 +78,30 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +ynh_change_url_nginx_config + +#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # Change the path in the NGINX config file if [ $change_path -eq 1 ] then # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" +#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" +#REMOVEME? domain="$old_domain" +#REMOVEME? path="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config "port_web" +#REMOVEME? ynh_add_nginx_config "port_web" fi # Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf +#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" +#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi #================================================= @@ -114,9 +116,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=2 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index ecf9788..ea652f6 100755 --- a/scripts/install +++ b/scripts/install @@ -13,45 +13,45 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=/ -is_public=$YNH_APP_ARG_IS_PUBLIC -server_name=$YNH_APP_ARG_SERVER_NAME -interface=$YNH_APP_ARG_INTERFACE +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +path=/ +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? server_name=$YNH_APP_ARG_SERVER_NAME +#REMOVEME? interface=$YNH_APP_ARG_INTERFACE #upstream_version=$YNH_APP_MANIFEST_VERSION upstream_version=$(ynh_app_upstream_version) -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/opt/yunohost/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/opt/yunohost/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +#REMOVEME? 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 +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path #will be used when restoring #================================================= @@ -59,14 +59,14 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port #port_web is used for the web interface while port_rend is used by video renderer -port_web=$(ynh_find_port --port=9001) -ynh_app_setting_set --app=$app --key=port_web --value=$port_web -port_rend=$(ynh_find_port --port=5001) -ynh_app_setting_set --app=$app --key=port_rend --value=$port_rend +#REMOVEME? port_web=$(ynh_find_port --port=9001) +#REMOVEME? ynh_app_setting_set --app=$app --key=port_web --value=$port_web +#REMOVEME? port_rend=$(ynh_find_port --port=5001) +#REMOVEME? ynh_app_setting_set --app=$app --key=port_rend --value=$port_rend # Open the port -- TO BE CHECKED IF REQUIRED ynh_script_progression --message="Configuring firewall..." --weight=3 @@ -75,18 +75,18 @@ ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=30 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=30 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user #UMS require a home path for the user as config files are stored in there -ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app +#REMOVEME? ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app #================================================= #SETTING MULTIMEDIA DIRECTORY @@ -101,14 +101,14 @@ ynh_multimedia_addaccess $app #================================================= ynh_script_progression --message="Setting up source files..." --weight=12 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" -chown root:$app "$final_path/UMS.sh" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R root:$app "$install_dir" +chown root:$app "$install_dir/UMS.sh" #================================================= # NGINX CONFIGURATION @@ -181,33 +181,33 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi ### N.B. : the following extra permissions only make sense if your app ### does have for example an admin interface or an api. # Only the admin can access the admin panel of the app (if the app has an admin panel) -#ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin +#REMOVEME? #ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin # Everyone can access to the api part # We don't want to display the tile in the sso so we put --show_tile="false" # And we don't want that the YunoHost Admin can remove visitors group to this permission, so we put --protected="true" -#ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" +#REMOVEME? #ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 4156943..acb9ebd 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,14 +12,14 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -port_web=$(ynh_app_setting_get --app=$app --key=port_web) -port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? port_web=$(ynh_app_setting_get --app=$app --key=port_web) +#REMOVEME? port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # STANDARD REMOVE @@ -45,18 +45,18 @@ ynh_remove_systemd_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=5 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=5 # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE NGINX CONFIGURATION @@ -104,10 +104,10 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app ynh_secure_remove --file="/home/yunohost.app/$app" #================================================= diff --git a/scripts/restore b/scripts/restore index 2c77c03..1668613 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,33 +14,33 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { #### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -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) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port_web=$(ynh_app_setting_get --app=$app --key=port_web) +#REMOVEME? port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS @@ -55,7 +55,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=5 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" # Open the port -- TO BE CHECKED IF REQUIRED ynh_script_progression --message="Configuring firewall..." --weight=3 @@ -64,11 +64,11 @@ ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 # Create the dedicated user (if not existing) #UMS require a home path for the user as config files are stored in there -ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app +#REMOVEME? ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app #================================================= #SETTING MULTIMEDIA DIRECTORY @@ -82,10 +82,10 @@ ynh_multimedia_addaccess $app #================================================= # Restore permissions on app files -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" -chown root:$app "$final_path/UMS.sh" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R root:$app "$install_dir" +chown root:$app "$install_dir/UMS.sh" #================================================= # RESTORE FAIL2BAN CONFIGURATION @@ -101,10 +101,10 @@ chown root:$app "$final_path/UMS.sh" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=15 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=15 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 8fa0aa3..e3068d6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -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) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port_web=$(ynh_app_setting_get --app=$app --key=port_web) +#REMOVEME? port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) upstream_version=$(ynh_app_upstream_version) #================================================= @@ -32,16 +32,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -87,7 +87,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 - ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" + ynh_setup_source --dest_dir="$install_dir" fi #================================================= @@ -101,17 +101,17 @@ ynh_add_nginx_config "port_web" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=4 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=4 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app +#REMOVEME? ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app #================================================= # SPECIFIC UPGRADE @@ -141,10 +141,10 @@ ynh_add_systemd_config #================================================= # Set permissions on app files -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" -chown root:$app "$final_path/UMS.sh" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R root:$app "$install_dir" +chown root:$app "$install_dir/UMS.sh" #================================================= # SETUP LOGROTATE @@ -179,9 +179,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From a2ea6472cef840da3db46b399f813e95be14cee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Mar 2023 08:02:58 +0100 Subject: [PATCH 02/25] v2 --- conf/UMS.conf.default | 2 +- conf/nginx.conf | 2 +- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 doc/DESCRIPTION.md | 1 - manifest.toml | 23 ++++-- scripts/_common.sh | 8 -- scripts/backup | 31 ------- scripts/change_url | 85 ------------------- scripts/install | 115 ++------------------------ scripts/remove | 55 ------------ scripts/restore | 77 +---------------- scripts/upgrade | 81 +----------------- tests.toml | 4 + 14 files changed, 33 insertions(+), 451 deletions(-) rename doc/{DISCLAIMER.md => ADMIN.md} (100%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (100%) create mode 100644 tests.toml diff --git a/conf/UMS.conf.default b/conf/UMS.conf.default index 55c526e..4043bdd 100644 --- a/conf/UMS.conf.default +++ b/conf/UMS.conf.default @@ -1341,7 +1341,7 @@ upnp_enable = # is assigned dynamically. # Example: 7000, which means the web interface is at localhost:7000 # Default: 9001 -web_port =__PORT_WEB__ +web_port =__PORT__ # Web enable # ---------- diff --git a/conf/nginx.conf b/conf/nginx.conf index c0399a3..554dc8d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,7 +10,7 @@ location __PATH__/ { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; more_set_headers "X-Frame-Options: SAMEORIGIN"; - proxy_pass http://localhost:__PORT_WEB__/; + proxy_pass http://localhost:__PORT__/; proxy_set_header Host $host; diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index b33367a..c7d8e81 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,3 +1,2 @@ Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices. - The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats. \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 1d3e257..6a06329 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,18 +15,16 @@ license = "GPL-2.0-or-later" website = "www.universalmediaserver.com" admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki" code = "https://github.com/UniversalMediaServer/UniversalMediaServer" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1.15" +architectures = "all" multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = false +sso = false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] @@ -70,6 +68,10 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen i386.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-x86.tgz" i386.sha256 = "91a5c534664441064c772dcace5bcef02edac82d8d3c67155ddd803deabeb52c" + [resources.ports] + main.default = 9001 + end.default = 5001 + rend.exposed = "TCP" [resources.system_user] @@ -77,3 +79,6 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.permissions] main.url = "/" + + [resources.apt] + packages = "mediainfo dcraw p7zip" diff --git a/scripts/_common.sh b/scripts/_common.sh index 50268d3..027c9d7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,11 +3,3 @@ #================================================= # COMMON VARIABLES #================================================= - -# dependencies used by the app -#REMOVEME? pkg_dependencies="mediainfo dcraw p7zip" - -if [[ "$YNH_ARCH" == "armhf" ]] || [[ "$YNH_ARCH" == "arm64" ]] -then - pkg_dependencies+="openjdk-17-jre" -fi diff --git a/scripts/backup b/scripts/backup index 437363c..e51adb6 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,30 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -ynh_print_warn --message="This script will only backup the app, no media will be saved" -ynh_print_warn --message="To save your media, please use a backup tool such as borg" - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -51,13 +27,6 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP FAIL2BAN CONFIGURATION -#================================================= - -#ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -#ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" - #================================================= # SPECIFIC BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index e3207a3..55d1a1a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -10,60 +10,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN -#REMOVEME? old_path=$YNH_APP_OLD_PATH - -#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN -#REMOVEME? new_path=$YNH_APP_NEW_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? # Needed for helper "ynh_add_nginx_config" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port_web=$(ynh_app_setting_get --app=$app --key=port_web) - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=7 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. -#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -#REMOVEME? change_domain=0 -#REMOVEME? if [ "$old_domain" != "$new_domain" ] -then - #REMOVEME? change_domain=1 -fi - -#REMOVEME? change_path=0 -#REMOVEME? if [ "$old_path" != "$new_path" ] -then - #REMOVEME? change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -80,30 +26,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified -#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper -#REMOVEME? domain="$old_domain" -#REMOVEME? path="$new_path" - # Create a dedicated NGINX config -#REMOVEME? ynh_add_nginx_config "port_web" -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location -#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" -#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location -#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - #================================================= # GENERIC FINALISATION #================================================= @@ -113,13 +35,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=2 - -#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index ea652f6..145dddc 100755 --- a/scripts/install +++ b/scripts/install @@ -9,84 +9,22 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -path=/ -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -#REMOVEME? server_name=$YNH_APP_ARG_SERVER_NAME -#REMOVEME? interface=$YNH_APP_ARG_INTERFACE #upstream_version=$YNH_APP_MANIFEST_VERSION upstream_version=$(ynh_app_upstream_version) -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/opt/yunohost/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -#will be used when restoring - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#port_web is used for the web interface while port_rend is used by video renderer -#REMOVEME? port_web=$(ynh_find_port --port=9001) -#REMOVEME? ynh_app_setting_set --app=$app --key=port_web --value=$port_web -#REMOVEME? port_rend=$(ynh_find_port --port=5001) -#REMOVEME? ynh_app_setting_set --app=$app --key=port_rend --value=$port_rend - -# Open the port -- TO BE CHECKED IF REQUIRED -ynh_script_progression --message="Configuring firewall..." --weight=3 -ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend - #================================================= # INSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=30 +ynh_script_progression --message="Installing dependencies..." --weight=30 -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#UMS require a home path for the user as config files are stored in there -#REMOVEME? ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app +if [[ "$YNH_ARCH" == "armhf" ]] || [[ "$YNH_ARCH" == "arm64" ]] +then + pkg_dependencies+="openjdk-17-jre" +fi #================================================= #SETTING MULTIMEDIA DIRECTORY @@ -101,11 +39,9 @@ ynh_multimedia_addaccess $app #================================================= ynh_script_progression --message="Setting up source files..." --weight=12 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R root:$app "$install_dir" chown root:$app "$install_dir/UMS.sh" @@ -115,8 +51,6 @@ chown root:$app "$install_dir/UMS.sh" #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=4 -### `ynh_add_nginx_config` will use the file conf/nginx.conf - # Create a dedicated NGINX config ynh_add_nginx_config "port_web" @@ -170,45 +104,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# SETUP FAIL2BAN -#================================================= -#ynh_script_progression --message="Configuring Fail2Ban..." --time --weight=1 - -# Create a dedicated Fail2Ban config -#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" - -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -### N.B. : the following extra permissions only make sense if your app -### does have for example an admin interface or an api. - -# Only the admin can access the admin panel of the app (if the app has an admin panel) -#REMOVEME? #ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin - -# Everyone can access to the api part -# We don't want to display the tile in the sso so we put --show_tile="false" -# And we don't want that the YunoHost Admin can remove visitors group to this permission, so we put --protected="true" -#REMOVEME? #ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index acb9ebd..78bd1db 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,18 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? port_web=$(ynh_app_setting_get --app=$app --key=port_web) -#REMOVEME? port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -42,22 +30,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=5 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -74,22 +46,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# CLOSE PORTS -#================================================= - -if yunohost firewall list | grep -q "\- $port_web$" -then - ynh_script_progression --message="Closing port $port_web..." --weight=2 - ynh_exec_warn_less yunohost firewall disallow TCP $port_web -fi - -if yunohost firewall list | grep -q "\- $port_rend$" -then - ynh_script_progression --message="Closing port $port_rend..." --weight=2 - ynh_exec_warn_less yunohost firewall disallow TCP $port_rend -fi - #================================================= # SPECIFIC REMOVE #================================================= @@ -99,17 +55,6 @@ fi # Remove the log files ynh_secure_remove --file="/var/log/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app -ynh_secure_remove --file="/home/yunohost.app/$app" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 1668613..514bac1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,38 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port_web=$(ynh_app_setting_get --app=$app --key=port_web) -#REMOVEME? port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -57,18 +25,9 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -# Open the port -- TO BE CHECKED IF REQUIRED -ynh_script_progression --message="Configuring firewall..." --weight=3 -ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend - -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 - -# Create the dedicated user (if not existing) -#UMS require a home path for the user as config files are stored in there -#REMOVEME? ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app +chmod -R o-rwx "$install_dir" +chown -R root:$app "$install_dir" +chown root:$app "$install_dir/UMS.sh" #================================================= #SETTING MULTIMEDIA DIRECTORY @@ -77,35 +36,6 @@ ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend ynh_multimedia_build_main_dir ynh_multimedia_addaccess $app -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# Restore permissions on app files -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R root:$app "$install_dir" -chown root:$app "$install_dir/UMS.sh" - -#================================================= -# RESTORE FAIL2BAN CONFIGURATION -#================================================= -#ynh_script_progression --message="Restoring the Fail2Ban configuration..." --time --weight=1 - -#ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" -#ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" -#ynh_systemd_action --action=restart --service_name=fail2ban - -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=15 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE SYSTEMD #================================================= @@ -124,6 +54,7 @@ yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." #================================================= # 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" diff --git a/scripts/upgrade b/scripts/upgrade index e3068d6..c320df4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,15 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port_web=$(ynh_app_setting_get --app=$app --key=port_web) -#REMOVEME? port_rend=$(ynh_app_setting_get --app=$app --key=port_rend) upstream_version=$(ynh_app_upstream_version) #================================================= @@ -29,20 +21,6 @@ upstream_version=$(ynh_app_upstream_version) upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -90,6 +68,10 @@ then ynh_setup_source --dest_dir="$install_dir" fi +chmod -R o-rwx "$install_dir" +chown -R root:$app "$install_dir" +chown root:$app "$install_dir/UMS.sh" + #================================================= # NGINX CONFIGURATION #================================================= @@ -98,34 +80,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config "port_web" -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=4 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app - -#================================================= -# SPECIFIC UPGRADE -#================================================= -# ... -#================================================= - -#Close unwanted open port in firewall -if yunohost firewall list | grep -q "\- $port_web$" -then - ynh_script_progression --message="Closing port $port_web as it shouldn't be open..." - yunohost firewall disallow TCP $port_web 2>&1 -fi - #================================================= # SETUP SYSTEMD #================================================= @@ -134,18 +88,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions on app files -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R root:$app "$install_dir" -chown root:$app "$install_dir/UMS.sh" - #================================================= # SETUP LOGROTATE #================================================= @@ -168,21 +110,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# UPGRADE FAIL2BAN -#================================================= -#ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=1 - -# Create a dedicated Fail2Ban config -#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..dba2938 --- /dev/null +++ b/tests.toml @@ -0,0 +1,4 @@ +test_format = 1.0 + +[default] + From 62c7720ec71d1e2677a8710c0b82fa3c4a5b9b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Mar 2023 08:03:22 +0100 Subject: [PATCH 03/25] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 554dc8d..f33794d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,7 +10,7 @@ location __PATH__/ { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; more_set_headers "X-Frame-Options: SAMEORIGIN"; - proxy_pass http://localhost:__PORT__/; + proxy_pass http://127.0.0.1:__PORT__/; proxy_set_header Host $host; From 3fbf983ff1d7a5b019e61e7d258666eddd4e70c0 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 14 Mar 2023 07:03:29 +0000 Subject: [PATCH 04/25] Auto-update README --- README.md | 29 ----------------------------- README_fr.md | 27 --------------------------- 2 files changed, 56 deletions(-) diff --git a/README.md b/README.md index 7882d36..d821604 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices. - The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats. **Shipped version:** 13.2.0 @@ -25,34 +24,6 @@ The program streams or transcodes many different media formats with little or no ![Screenshot of Universal Media Server](./doc/screenshots/screenshot.png) -## Disclaimers / important information - -### Configuration - -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/` - -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" - -### 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 - -If you can't find the server on a renderer, you may try the following trouble shooting : -- 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)` -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. - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 739809d..0c4576a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,33 +24,6 @@ Le programme stream ou transcode de nombreux formats média différents avec peu ![Capture d’écran de Universal Media Server](./doc/screenshots/screenshot.png) -## Avertissements / informations importantes - -### Configuration - -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/` -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". - -### 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é - -### Autres infos - -Si vous ne trouvez pas le serveur sur vos renderer, vous pouvez essayer les trucs suivants : -- 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) - -Sur de petits appareils (par exemple un raspberry), la transco peut demander trop de puissance, n'hésitez par à utiliser des transcodeur alternatifs. - ## Documentations et ressources * Site officiel de l’app : From 2e2aeffb637966c4b13763636e0307e7307f3566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Mar 2023 08:04:08 +0100 Subject: [PATCH 05/25] Delete manifest.json --- manifest.json | 78 --------------------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 manifest.json diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 544646d..0000000 --- a/manifest.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "Universal Media Server", - "id": "ums", - "packaging_format": 1, - "description": { - "en": "A DLNA, UPnP and HTTP(S) Media Server", - "fr": "Un Serveur Multimedia DLNA, UPnP et HTTP(S)" - }, - "version": "13.2.0~ynh3", - "url": "www.universalmediaserver.com", - "upstream": { - "version": "13.2.0", - "license": "GPL-2.0-or-later", - "website": "www.universalmediaserver.com", - "admindoc": "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki", - "code": "https://github.com/UniversalMediaServer/UniversalMediaServer" - }, - "license": "GPL-2.0-or-later", - "maintainer": { - "name": "Krakinou", - "email": "misterl56@hotmail.com" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain", - "help": { - "en": "UMS require its own subdomain", - "fr": "UMS a besoin de son propre sous-domaine" - } - }, - { - "name": "is_public", - "type": "boolean", - "default": true, - "help": { - "en": "Everybody will be able to access your media on the internet without connecting to Yunohost", - "fr": "Tout le monde pourra voir vos media sans se connecter à Yunohost" - } - }, - { - "name": "server_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": "Which network interface do you want to use?", - "fr": "Quel réseau souhaitez vous utiliser?" - }, - "help": { - "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" - } - } - ] - } -} From 0c79bac16f44635b5289e02f77f0e63c02e38cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Mar 2023 08:43:55 +0100 Subject: [PATCH 06/25] Update install --- scripts/install | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 145dddc..e1213e4 100755 --- a/scripts/install +++ b/scripts/install @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#upstream_version=$YNH_APP_MANIFEST_VERSION upstream_version=$(ynh_app_upstream_version) #================================================= @@ -52,7 +51,7 @@ chown root:$app "$install_dir/UMS.sh" ynh_script_progression --message="Configuring NGINX web server..." --weight=4 # Create a dedicated NGINX config -ynh_add_nginx_config "port_web" +ynh_add_nginx_config #================================================= # SETUP SYSTEMD @@ -68,20 +67,18 @@ ynh_add_systemd_config ynh_script_progression --message="Setting up configuration file.." --weight=5 #UMS read config file from .config/UMS folder -mkdir -p "/home/yunohost.app/$app/.config/UMS" -ynh_add_config --template="UMS.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/UMS.conf" -ynh_add_config --template="WEB.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/WEB.conf" -ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/VirtualFolders.conf" -chown -R $app:$app "/home/yunohost.app/$app/.config" -chmod -R 700 "/home/yunohost.app/$app/.config" -#chmod 600 "/home/yunohost.app/$app/.config/UMS/*" +mkdir -p "$install_dir/.config/UMS" +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" #================================================= # GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= - ynh_script_progression --message="Configuring log rotation..." --weight=1 #TO BE CHECKED : debug.log file in ~/.config/UMS/ From f3b2c9ef9964d786f5d3772595f90ef1a617b12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Mar 2023 08:46:19 +0100 Subject: [PATCH 07/25] Update upgrade --- scripts/upgrade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c320df4..47fbd4e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,7 +31,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 if [ ! $(getent passwd $app | cut -d: -f6 | grep yunohost.app) ] then ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" - usermod -m -d /home/yunohost.app/$app $app + usermod -m -d $install_dir $app fi #10.17.0, 10.17.1 & 10.16.0 had a bug that overwrite the media path at startup of the service. @@ -41,10 +41,10 @@ current_version=$(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$app/m if [ $current_version == "10.17.0" ] || [ $current_version == "10.16.0" ] then ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" - ynh_replace_string --match_string="folders =/opt/yunohost/$app,/home/yunohost.app/$app" \ + ynh_replace_string --match_string="folders =/opt/yunohost/$app,$install_dir" \ --replace_string="folders=/home/yunohost.multimedia/share" \ --target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf" - ynh_replace_string --match_string="folders_monitored =/opt/yunohost/$app,/home/yunohost.app/$app" \ + ynh_replace_string --match_string="folders_monitored =/opt/yunohost/$app,$install_dir" \ --replace_string="folders_monitored=/home/yunohost.multimedia/share" \ --target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf" fi @@ -78,7 +78,7 @@ chown root:$app "$install_dir/UMS.sh" ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 # Create a dedicated NGINX config -ynh_add_nginx_config "port_web" +ynh_add_nginx_config #================================================= # SETUP SYSTEMD From f40b5051b3d1545c1244e0defc06787ff423e0a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Mar 2023 08:48:51 +0100 Subject: [PATCH 08/25] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index e1213e4..af77f03 100755 --- a/scripts/install +++ b/scripts/install @@ -68,9 +68,11 @@ 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="$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" From ab1c91940b271026507317d74cddea0bfd60eb80 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 22 Apr 2023 17:43:26 +0200 Subject: [PATCH 09/25] Fix Updater + adapt to V2 --- .github/workflows/updater.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index a8336e0..266b9cd 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -4,9 +4,14 @@ # FETCHING LATEST RELEASE AND ITS ASSETS #================================================= +#Installing tomlq +python3 -m venv venv +source venv/bin/activate +pip3 install tomlq + # Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +current_version=$(cat manifest.toml | tomlq -j '.version|split("~")[0]') +repo=$(cat manifest.toml | tomlq -j '.upstream.code|split("https://github.com/")[1]') # Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) @@ -28,10 +33,12 @@ echo "PROCEED=false" >> $GITHUB_ENV # Proceed only if the retrieved version is greater than the current one if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then echo "::warning ::No new version available" + rm -rf ./venv exit 0 # Proceed only if a PR for this new version does not already exist elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then echo "::warning ::A branch already exists for this update" + rm -rf ./venv exit 0 fi @@ -97,8 +104,9 @@ cat < conf/$src.src SOURCE_URL=$asset_url SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=$extension -SOURCE_EXTRACT=false +SOURCE_FORMAT=tar.gz +SOURCE_EXTRACT=true +SOURCE_IN_SUBDIR=true EOT echo "... conf/$src.src updated" @@ -120,11 +128,13 @@ done #================================================= # Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json -echo "$(jq -s --indent 4 ".[] | .upstream.version = \"$version\"" manifest.json)" > manifest.json +sed -i "s/^version\s*=.*/version = \"$version~ynh1\"/" manifest.toml # No need to update the README, yunohost-bot takes care of it +#remove the venv folder +rm -rf ./venv + # The Action will proceed only if the PROCEED environment variable is set to true echo "PROCEED=true" >> $GITHUB_ENV exit 0 From 91c21f5305256583075c98cdc5db2cc592cf996a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 22 Apr 2023 18:57:42 +0200 Subject: [PATCH 10/25] add data_dir --- doc/ADMIN.md | 10 ++++------ doc/ADMIN_fr.md | 11 ++++------- manifest.toml | 5 ++++- scripts/_common.sh | 12 ++++++++++++ scripts/backup | 12 ++++++------ scripts/install | 13 +++++-------- scripts/restore | 45 ++++++++++++++------------------------------- scripts/upgrade | 15 --------------- 8 files changed, 49 insertions(+), 74 deletions(-) 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 #================================================= From 1a329c49317f65e6059cf1f115ddc0bdaf46e641 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sun, 30 Apr 2023 13:42:57 +0200 Subject: [PATCH 11/25] source in manifest.toml --- .github/workflows/updater.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 266b9cd..f73821c 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -99,16 +99,11 @@ else extension=${filename##*.} fi -# Rewrite source file -cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_EXTRACT=true -SOURCE_IN_SUBDIR=true -EOT -echo "... conf/$src.src updated" +#update manifest +sed -i "s/\A$src.url =.*/$src.url = \"$asset_url\"/" manifest.toml +sed -i "s/\A$src.sha256 =*./$src.sha256 = \"$checksum\"/" manifest.toml + +echo "... Source updated in manifest.toml" else echo "... asset ignored" From 71c6b88f7d0eb46ff27c226da173ae1510c66765 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sun, 30 Apr 2023 13:53:27 +0200 Subject: [PATCH 12/25] delimiter for sed --- .github/workflows/updater.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index f73821c..d31df1d 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -100,8 +100,8 @@ else fi #update manifest -sed -i "s/\A$src.url =.*/$src.url = \"$asset_url\"/" manifest.toml -sed -i "s/\A$src.sha256 =*./$src.sha256 = \"$checksum\"/" manifest.toml +sed -i "s|$src.url =.*|$src.url = \"$asset_url\"|" manifest.toml +sed -i "s/$src.sha256 =*./$src.sha256 = \"$checksum\"/" manifest.toml echo "... Source updated in manifest.toml" From 2a84d36977059f01aad099723634e7f588767a98 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 30 Apr 2023 14:10:43 +0000 Subject: [PATCH 13/25] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f638a6f..d821604 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices. The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats. -**Shipped version:** 13.3.0 +**Shipped version:** 13.2.0 ## Screenshots ![Screenshot of Universal Media Server](./doc/screenshots/screenshot.png) diff --git a/README_fr.md b/README_fr.md index 343c563..0c4576a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Universal Media Server est un serveur multimédia UPnP compatible DLNA. Il peut partager des vidéos, de l'audio et des images avec la pluparts des équipements modernes. Le programme stream ou transcode de nombreux formats média différents avec peu ou pas de configuration. Il utilise par FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC et d'autres, qui se combinent pour offrir une grande variété de formats. -**Version incluse :** 13.3.0 +**Version incluse :** 13.2.0 ## Captures d’écran ![Capture d’écran de Universal Media Server](./doc/screenshots/screenshot.png) From fe76f5544517c8bffef142ec5651f0e3bbc3dda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 16:15:17 +0200 Subject: [PATCH 14/25] Update manifest.toml --- manifest.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index f98f5b6..fa99f69 100644 --- a/manifest.toml +++ b/manifest.toml @@ -28,7 +28,6 @@ ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core help.en = "UMS require its own subdomain" help.fr = "UMS a besoin de son propre sous-domaine" type = "domain" @@ -68,6 +67,13 @@ ram.runtime = "50M" i386.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-x86.tgz" i386.sha256 = "91a5c534664441064c772dcace5bcef02edac82d8d3c67155ddd803deabeb52c" + autoupdate.strategy = "latest_github_release" + + autoupdate.asset.arm64 = "*-arm64.tgz" + autoupdate.asset.amd64 = "*-x86_64.tgz" + autoupdate.asset.armhf = "*-armhf.tgz" + autoupdate.asset.i386 = "*-x86.tgz" + [resources.ports] main.default = 9001 end.default = 5001 From 2f7a2deff21e51e0c384cbf99e9fcf965af2838e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 16:17:28 +0200 Subject: [PATCH 15/25] cleaning --- check_process | 26 -------------------------- conf/nginx.conf | 1 - manifest.toml | 2 +- 3 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 check_process diff --git a/check_process b/check_process deleted file mode 100644 index 30daa8a..0000000 --- a/check_process +++ /dev/null @@ -1,26 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - is_public=1 - name=MyUMS - interface=eth0 - ; Checks - pkg_linter=1 -#Only work w/ root domain - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - upgrade=1 from_commit=3ceb411ac9affdffba7108b3e6e1f1057ef8ba7c - backup_restore=1 - multi_instance=0 - port_already_use=1 - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=3ceb411ac9affdffba7108b3e6e1f1057ef8ba7c - name=13.2.0 diff --git a/conf/nginx.conf b/conf/nginx.conf index f33794d..ac946f9 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -13,7 +13,6 @@ location __PATH__/ { proxy_pass http://127.0.0.1:__PORT__/; proxy_set_header Host $host; - # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } diff --git a/manifest.toml b/manifest.toml index fa99f69..e4cd5bb 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.17" +yunohost = ">= 11.1.18" architectures = "all" multi_instance = false ldap = false From 0db6a281f822a4d86149843506e8d3043ad792ff Mon Sep 17 00:00:00 2001 From: Krakinou Date: Tue, 15 Aug 2023 10:28:24 +0200 Subject: [PATCH 16/25] package version 2 --- .github/workflows/updater.sh | 135 ---------------------------------- .github/workflows/updater.yml | 50 ------------- manifest.toml | 22 +++--- scripts/_common.sh | 5 +- scripts/install | 10 --- 5 files changed, 15 insertions(+), 207 deletions(-) delete mode 100644 .github/workflows/updater.sh delete mode 100644 .github/workflows/updater.yml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100644 index d31df1d..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/bash - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -#Installing tomlq -python3 -m venv venv -source venv/bin/activate -pip3 install tomlq - -# Fetching information -current_version=$(cat manifest.toml | tomlq -j '.version|split("~")[0]') -repo=$(cat manifest.toml | tomlq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - rm -rf ./venv - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - rm -rf ./venv - exit 0 -fi - -# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) -echo "${#assets[@]} available asset(s)" - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -# Here we use the $assets variable to get the resources published in the upstream release. -# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. - -# Let's loop over the array of assets URLs -for asset_url in ${assets[@]}; do - -echo "Handling asset at $asset_url" - -# Assign the asset to a source file in conf/ directory -# Here we base the source file name upon a unique keyword in the assets url -# Leave $src empty to ignore the asset -case $asset_url in - *"arm64.tgz"*) - src="arm64" - ;; - *"armhf.tgz"*) - src="armhf" - ;; - *"x86_64.tgz"*) - src="amd64" - ;; - *"x86.tgz"*) - src="i386" - ;; - *) - src="" - ;; -esac - -# If $src is not empty, let's process the asset -if [ ! -z "$src" ]; then - -# Create the temporary directory -tempdir="$(mktemp -d)" - -# Download sources and calculate checksum -filename=${asset_url##*/} -curl --silent -4 -L $asset_url -o "$tempdir/$filename" -checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - -# Delete temporary directory -rm -rf $tempdir - -# Get extension -if [[ $filename == *.tgz ]]; then - extension=tgz -else - extension=${filename##*.} -fi - -#update manifest -sed -i "s|$src.url =.*|$src.url = \"$asset_url\"|" manifest.toml -sed -i "s/$src.sha256 =*./$src.sha256 = \"$checksum\"/" manifest.toml - -echo "... Source updated in manifest.toml" - -else -echo "... asset ignored" -fi - -done - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -sed -i "s/^version\s*=.*/version = \"$version~ynh1\"/" manifest.toml - -# No need to update the README, yunohost-bot takes care of it - -#remove the venv folder -rm -rf ./venv - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml deleted file mode 100644 index 4a866ff..0000000 --- a/.github/workflows/updater.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. -# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. -# This file should be enough by itself, but feel free to tune it to your needs. -# It calls updater.sh, which is where you should put the app-specific update steps. -name: Check for new upstream releases -on: - # Allow to manually trigger the workflow - workflow_dispatch: - # Run it every day at 6:00 UTC - schedule: - - cron: '0 6 * * *' -jobs: - updater: - runs-on: ubuntu-latest - steps: - - name: Fetch the source code - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run the updater script - id: run_updater - run: | - # Setting up Git user - git config --global user.name 'yunohost-bot' - git config --global user.email 'yunohost-bot@users.noreply.github.com' - # Run the updater script - /bin/bash .github/workflows/updater.sh - - name: Commit changes - id: commit - if: ${{ env.PROCEED == 'true' }} - run: | - git commit -am "Upgrade to v$VERSION" - - name: Create Pull Request - id: cpr - if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update to version ${{ env.VERSION }} - committer: 'yunohost-bot ' - author: 'yunohost-bot ' - signoff: false - base: testing - branch: ci-auto-update-v${{ env.VERSION }} - delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }}' - body: | - Upgrade to v${{ env.VERSION }} - [See upstream release page](https://github.com/${{ env.REPO }}/releases/tag/v${{ env.VERSION }}) - draft: false diff --git a/manifest.toml b/manifest.toml index e4cd5bb..d29c646 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,12 +5,12 @@ name = "Universal Media Server" description.en = "A DLNA, UPnP and HTTP(S) Media Server" description.fr = "Un Serveur Multimedia DLNA, UPnP et HTTP(S)" -version = "13.2.0~ynh3" +version = "13.5.0~ynh2" maintainers = ["Krakinou"] [upstream] -version = "13.2.0" +version = "13.5.0" license = "GPL-2.0-or-later" website = "www.universalmediaserver.com" admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki" @@ -58,14 +58,14 @@ ram.runtime = "50M" [resources] [resources.sources.main] - arm64.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-arm64.tgz" - arm64.sha256 = "f2b05cec5fa6e51b9b5e1884b1ecdb99ca4e11bc0793a5cbea66c0f5c7e03a1a" - amd64.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-x86_64.tgz" - amd64.sha256 = "1b009c7deb737641e173a0a82c0b105d8e33a4392de661562e156e4434a4ed17" - armhf.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-armhf.tgz" - armhf.sha256 = "5e478d40336600517a6f765c49c45bb81c627b76113b571d3ae09e9457429b3e" - i386.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.2.0/UMS-13.2.0-x86.tgz" - i386.sha256 = "91a5c534664441064c772dcace5bcef02edac82d8d3c67155ddd803deabeb52c" + arm64.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-arm64.tgz" + arm64.sha256 = "b916a56a24e70d5454cbffdbd6140e4d20837f1187e6f6f437574c0244b100de" + amd64.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-x86_64.tgz" + amd64.sha256 = "1243c598fa2b3c4790399e7a13656b85fefefbe76c6332a38c7ae6bf15355c7b" + armhf.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-armhf.tgz" + armhf.sha256 = "ac00cf598c0e1b572416c289ec36bb1578993fdf45348faf70558be2ecedb12b" + i386.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-x86.tgz" + i386.sha256 = "4535f500d19916aaf4c4d88d8448e8363898fbec81fac250db95b585f9542b8d" autoupdate.strategy = "latest_github_release" @@ -90,4 +90,4 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "mediainfo dcraw p7zip" + packages = "mediainfo dcraw" diff --git a/scripts/_common.sh b/scripts/_common.sh index 69c72c9..2f239f9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,7 +3,10 @@ #================================================= # COMMON VARIABLES #================================================= - +if [[ "$YNH_ARCH" == "armhf" ]] || [[ "$YNH_ARCH" == "arm64" ]] +then + pkg_dependencies+=" openjdk-17-jre" +fi #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 194c818..74fd018 100755 --- a/scripts/install +++ b/scripts/install @@ -15,16 +15,6 @@ source /usr/share/yunohost/helpers upstream_version=$(ynh_app_upstream_version) -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=30 - -if [[ "$YNH_ARCH" == "armhf" ]] || [[ "$YNH_ARCH" == "arm64" ]] -then - pkg_dependencies+="openjdk-17-jre" -fi - #================================================= #SETTING MULTIMEDIA DIRECTORY #================================================= From bbb1e3da691011f385067d01a47bf89cd04e18a2 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 15 Aug 2023 08:28:42 +0000 Subject: [PATCH 17/25] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d821604..6b68b2e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices. The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats. -**Shipped version:** 13.2.0 +**Shipped version:** 13.5.0 ## Screenshots ![Screenshot of Universal Media Server](./doc/screenshots/screenshot.png) diff --git a/README_fr.md b/README_fr.md index 0c4576a..98a1145 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Universal Media Server est un serveur multimédia UPnP compatible DLNA. Il peut partager des vidéos, de l'audio et des images avec la pluparts des équipements modernes. Le programme stream ou transcode de nombreux formats média différents avec peu ou pas de configuration. Il utilise par FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC et d'autres, qui se combinent pour offrir une grande variété de formats. -**Version incluse :** 13.2.0 +**Version incluse :** 13.5.0 ## Captures d’écran ![Capture d’écran de Universal Media Server](./doc/screenshots/screenshot.png) From 05a2703c7df16982f02a8923b1585b3cde4594ee Mon Sep 17 00:00:00 2001 From: Krakinou Date: Wed, 16 Aug 2023 22:33:57 +0200 Subject: [PATCH 18/25] Change file access --- manifest.toml | 13 ++++++------- scripts/install | 6 ++++-- scripts/remove | 3 +++ scripts/restore | 7 ++++--- scripts/upgrade | 5 +++-- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/manifest.toml b/manifest.toml index d29c646..e105641 100644 --- a/manifest.toml +++ b/manifest.toml @@ -10,7 +10,6 @@ version = "13.5.0~ynh2" maintainers = ["Krakinou"] [upstream] -version = "13.5.0" license = "GPL-2.0-or-later" website = "www.universalmediaserver.com" admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki" @@ -22,16 +21,15 @@ architectures = "all" multi_instance = false ldap = false sso = false -disk = "50M" -ram.build = "50M" -ram.runtime = "50M" +disk = "270M" +ram.build = "350M" +ram.runtime = "350M" [install] [install.domain] help.en = "UMS require its own subdomain" help.fr = "UMS a besoin de son propre sous-domaine" type = "domain" - full_domain = true [install.init_main_permission] help.en = "Everybody will be able to access your media on the internet without connecting to Yunohost" @@ -76,7 +74,7 @@ ram.runtime = "50M" [resources.ports] main.default = 9001 - end.default = 5001 + rend.default = 5001 rend.exposed = "TCP" [resources.system_user] @@ -84,7 +82,8 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] - subdirs = ".config/UMS" + dir = "/home/yunohost.app/__APP__" + subdirs = [ '.config', '.config/UMS' ] [resources.permissions] main.url = "/" diff --git a/scripts/install b/scripts/install index 74fd018..c77b680 100755 --- a/scripts/install +++ b/scripts/install @@ -31,9 +31,10 @@ ynh_script_progression --message="Setting up source files..." --weight=12 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" +chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R root:$app "$install_dir" -chown root:$app "$install_dir/UMS.sh" +chown -R $app:$app "$install_dir" +chown $app:$app "$install_dir/UMS.sh" #================================================= # NGINX CONFIGURATION @@ -56,6 +57,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Setting up configuration file.." --weight=5 +mkdir -p "$data_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" diff --git a/scripts/remove b/scripts/remove index 78bd1db..0532694 100755 --- a/scripts/remove +++ b/scripts/remove @@ -55,6 +55,9 @@ ynh_remove_logrotate # Remove the log files ynh_secure_remove --file="/var/log/$app" +# remove the home folder +ynh_secure_remove --file="$data_dir" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 17d041f..7675f4b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,9 +17,10 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" +chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R root:$app "$install_dir" -chown root:$app "$install_dir/UMS.sh" +chown -R $app:$app "$install_dir" +chown $app:$app "$install_dir/UMS.sh" #================================================= # RESTORE THE DATA DIRECTORY @@ -29,7 +30,7 @@ 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" chown -R $app:$app "$data_dir/.config" chmod -R 700 "$data_dir/.config" diff --git a/scripts/upgrade b/scripts/upgrade index d065485..992fcf7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,9 +68,10 @@ then ynh_setup_source --dest_dir="$install_dir" fi +chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R root:$app "$install_dir" -chown root:$app "$install_dir/UMS.sh" +chown -R $app:$app "$install_dir" +chown $app:$app "$install_dir/UMS.sh" #================================================= # NGINX CONFIGURATION From ff0368dca99e036777d96398e4e87adac702c6f3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 16 Aug 2023 20:34:38 +0000 Subject: [PATCH 19/25] Auto-update README --- README.md | 3 ++- README_fr.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b68b2e..9095444 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices. The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats. -**Shipped version:** 13.5.0 +**Shipped version:** 13.5.0~ynh2 + ## Screenshots ![Screenshot of Universal Media Server](./doc/screenshots/screenshot.png) diff --git a/README_fr.md b/README_fr.md index 98a1145..5d758de 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,8 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Universal Media Server est un serveur multimédia UPnP compatible DLNA. Il peut partager des vidéos, de l'audio et des images avec la pluparts des équipements modernes. Le programme stream ou transcode de nombreux formats média différents avec peu ou pas de configuration. Il utilise par FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC et d'autres, qui se combinent pour offrir une grande variété de formats. -**Version incluse :** 13.5.0 +**Version incluse :** 13.5.0~ynh2 + ## Captures d’écran ![Capture d’écran de Universal Media Server](./doc/screenshots/screenshot.png) From 57c5fe2b8240d39b6b272d495f3059cd8d61ab96 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Wed, 16 Aug 2023 22:36:46 +0200 Subject: [PATCH 20/25] Orthographe --- doc/ADMIN_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 75b1004..fc85ab1 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -18,4 +18,4 @@ Si vous ne trouvez pas le serveur sur vos renderer, vous pouvez essayer les truc - 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 `__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 pas à utiliser des transcodeurs alternatifs. From 41663527d918c2ee05839bc610aeeba6ed14c0d8 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Wed, 16 Aug 2023 22:40:26 +0200 Subject: [PATCH 21/25] add upgrade tests --- tests.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index dba2938..17ee633 100644 --- a/tests.toml +++ b/tests.toml @@ -1,4 +1,5 @@ test_format = 1.0 [default] - + test_upgrade_from.fb78609.name = "13.5.0~ynh1" + test_upgrade_from.8e8e839.name = "13.4.1~ynh1" From 40d94092a9735db762aa3484c7b5a39055aba96f Mon Sep 17 00:00:00 2001 From: Krakinou Date: Thu, 17 Aug 2023 22:38:18 +0200 Subject: [PATCH 22/25] move from port_web to port --- scripts/upgrade | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 992fcf7..457e983 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,6 +49,14 @@ then --target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf" fi +#From packaging v1 to packaging v2 : "port_web" become "port". We need to handle this manually or +#the core go for a new port. +if [ ! -z $(ynh_app_setting_get --app=$app --key=port_web) ]; then + port=$port_web + ynh_app_setting_delete --app=$app --key=port_web + ynh_app_setting_set --app=$app --key=port --value=$port +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= From 743b942146d04c0ced59e332b163ee6bd38d8be8 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Fri, 18 Aug 2023 23:05:03 +0200 Subject: [PATCH 23/25] fix home folder --- manifest.toml | 5 +++-- scripts/install | 13 +++++++------ scripts/restore | 21 ++++++++++----------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/manifest.toml b/manifest.toml index e105641..f4a166a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -78,15 +78,16 @@ ram.runtime = "350M" rend.exposed = "TCP" [resources.system_user] + #UMS require a home path for the user as config files are stored in there + home = '/home/yunohost.app/__APP__' [resources.install_dir] [resources.data_dir] - dir = "/home/yunohost.app/__APP__" - subdirs = [ '.config', '.config/UMS' ] [resources.permissions] main.url = "/" + main.auth_header=false [resources.apt] packages = "mediainfo dcraw" diff --git a/scripts/install b/scripts/install index c77b680..d44bb6b 100755 --- a/scripts/install +++ b/scripts/install @@ -57,13 +57,14 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Setting up configuration file.." --weight=5 -mkdir -p "$data_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" +#UMS read config file from .config/UMS folder +mkdir -p "/home/yunohost.app/$app/.config/UMS" +ynh_add_config --template="UMS.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/UMS.conf" +ynh_add_config --template="WEB.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/WEB.conf" +ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/VirtualFolders.conf" -chown -R $app:$app "$data_dir/.config" -chmod -R 700 "$data_dir/.config" +chown -R $app:$app "/home/yunohost.app/$app/.config" +chmod -R 700 "/home/yunohost.app/$app/.config" #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index 7675f4b..7198e5a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -22,17 +22,6 @@ chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" chown $app:$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:$app "$data_dir" -chown -R $app:$app "$data_dir/.config" -chmod -R 700 "$data_dir/.config" #================================================= #SETTING MULTIMEDIA DIRECTORY @@ -53,10 +42,20 @@ systemctl enable $app.service --quiet yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend + mkdir -p /var/log/$app ynh_restore_file --origin_path="/etc/logrotate.d/$app" +#================================================= +# 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" + + #================================================= # START SYSTEMD SERVICE #================================================= From 840aa0a1892d241cc08cc562b905bc8ab4c56eea Mon Sep 17 00:00:00 2001 From: Krakinou Date: Fri, 18 Aug 2023 23:05:16 +0200 Subject: [PATCH 24/25] update documentation --- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- doc/PRE_UPGRADE.d/13.5.0~ynh2 | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 doc/PRE_UPGRADE.d/13.5.0~ynh2 diff --git a/doc/ADMIN.md b/doc/ADMIN.md index c1bab3f..4adf8a5 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -18,6 +18,6 @@ If you can't find the server on a renderer, you may try the following trouble sh - 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 `__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). You may check the network interface for you system with `ip address` 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 fc85ab1..3e8b5c8 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -16,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 `__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) +- 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). Vous pouvez vérifier les réseaux de votre système avec `ip address` Sur de petits appareils (par exemple un raspberry), la transco peut demander trop de puissance, n'hésitez pas à utiliser des transcodeurs alternatifs. diff --git a/doc/PRE_UPGRADE.d/13.5.0~ynh2 b/doc/PRE_UPGRADE.d/13.5.0~ynh2 new file mode 100644 index 0000000..78e44e1 --- /dev/null +++ b/doc/PRE_UPGRADE.d/13.5.0~ynh2 @@ -0,0 +1,7 @@ +Changelog: + +News: +- Package is now in v2 + +Fixes: +- it is now possible to log into the UMS webserver in case authentication is activated \ No newline at end of file From d5037377c52e26a683d0718ede29af08d7973547 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Fri, 18 Aug 2023 23:34:05 +0200 Subject: [PATCH 25/25] wrong file name --- doc/PRE_UPGRADE.d/{13.5.0~ynh2 => 13.5.0~ynh2.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/PRE_UPGRADE.d/{13.5.0~ynh2 => 13.5.0~ynh2.md} (100%) diff --git a/doc/PRE_UPGRADE.d/13.5.0~ynh2 b/doc/PRE_UPGRADE.d/13.5.0~ynh2.md similarity index 100% rename from doc/PRE_UPGRADE.d/13.5.0~ynh2 rename to doc/PRE_UPGRADE.d/13.5.0~ynh2.md