diff --git a/manifest.toml b/manifest.toml index ec06aec..174567f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Streama" description.en = "streaming media server" description.fr = "Serveur de streaming" -version = "1.10.5~ynh1" +version = "1.10.5~ynh2" maintainers = [""] @@ -31,8 +31,8 @@ ram.runtime = "50M" type = "domain" [install.init_main_permission] - help.en = "If enabled, Streama will be accessible by people who do not have an account. This can be changed later via the webadmin." - help.fr = "Si cette case est cochée, Streama sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + help.en = "If 'visitors', Streama will be accessible by people who do not have an account. This can be changed later via the webadmin." + help.fr = "Si 'Visiteurs', Streama sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." type = "group" default = "visitors" diff --git a/scripts/_common.sh b/scripts/_common.sh index 6005c6a..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="openjdk-17-jre-headless ffmpeg" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 9a0c9c5..6d557ee 100644 --- a/scripts/install +++ b/scripts/install @@ -22,50 +22,28 @@ chown -R $app:www-data "$install_dir" chmod +x $install_dir/streama.jar #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGNX web server..." --weight=3 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Streama media system" --log="/var/log/$app/$app.log" + #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/application.yaml" --destination="$install_dir/application.yaml" +ynh_add_config --template="application.yaml" --destination="$install_dir/application.yaml" chmod 400 "$install_dir/application.yaml" chown $app:$app "$install_dir/application.yaml" -#================================================= -# ADD A CONFIGURATION -#================================================= -#ynh_script_progression --message="Adding a configuration file..." - -# Set permissions to app files -#ln -s $data_dir $install_dir/data/streama -#ynh_add_config --template="../conf/convert.sh" --destination="/usr/bin/convert_movies" -#chmod +x "/usr/bin/convert_movies" - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 - -yunohost service add $app --description="Streama media system" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 57324bf..4c29204 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,11 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null diff --git a/scripts/restore b/scripts/restore index cf23e0b..a31c3d9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,7 @@ chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." +ynh_script_progression --message="Restoring the data directory..." --weight=2 ynh_restore_file --origin_path="$data_dir" --not_mandatory @@ -32,33 +32,13 @@ chown -R $app:www-data "$data_dir" #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=2 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# ADD A CONFIGURATION -#================================================= -#ynh_script_progression --message="Adding a configuration file..." - -# Set permissions to app files -#ln -s $data_dir $install_dir/data/streama -#ynh_add_config --template="../conf/convert.sh" --destination="/usr/bin/convert_movies" -#chmod +x "/usr/bin/convert_movies" - -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=2 - 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=3 - yunohost service add $app --description="Streama media system" --log="/var/log/$app/$app.log" #================================================= @@ -68,13 +48,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Grails application running at" -#================================================= -# 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 15b03f1..b1dec81 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,39 +41,16 @@ chown -R $app:www-data "$install_dir" chmod +x $install_dir/streama.jar #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=24 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE -#================================================= -# UPDATE A CONFIG FILE -#================================================= -#ynh_script_progression --message="Updating a configuration file..." - -# Set permissions to app files -#ynh_add_config --template="../conf/convert.sh" --destination="/usr/bin/convert_movies" -#chmod +x "/usr/bin/convert_movies" - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=3 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 - yunohost service add $app --description="Streama media system" --log="/var/log/$app/$app.log" #=================================================