diff --git a/README_fr.md b/README_fr.md index 24aa20b..a900b10 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,7 +16,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -The emoji wall (also known as a "on-screen emotes overlay") takes the emojis and custom emotes sent in the chat of Owncast streamers and displays them bubbling up the screen! +Emojiwall (également connu sous le nom de « superposition d'émoticônes à l'écran ») prend les émojis et les émoticônes personnalisées envoyés dans le chat des streamers Owncast et les affiche en bouillonnant sur l'écran ! **Version incluse :** 1.1.2~ynh1 diff --git a/conf/default.json b/conf/default.json index 8741895..9d29ebb 100644 --- a/conf/default.json +++ b/conf/default.json @@ -1,7 +1,7 @@ { "webhooks": { "host": "__DOMAIN__", - "prefix": "__CONF_PATH__", + "prefix": "__PATH__", "port": __PORT__, "public_port": 443, "schema": "https" diff --git a/conf/nginx.conf b/conf/nginx.conf index 237b8e9..0e3b018 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,13 +1,13 @@ -location __PATH__ { - # Standard nginx configuration +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { + + proxy_pass http://127.0.0.1:__PORT__/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_pass http://localhost:__PORT__/; - # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } diff --git a/conf/systemd.service b/conf/systemd.service index fad5d1a..eb55328 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,12 +1,13 @@ [Unit] -Description=Emojiwall for Owncast +Description=Emojiwall: on-screen emotes overlay After=network.target [Service] Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__INSTALL_DIR__ +WorkingDirectory=__INSTALL_DIR__/ +Environment="__YNH_NODE_LOAD_PATH__" ExecStart=__YNH_NODE__ index.js # Sandboxing options to harden security diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..54b813c --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Emojiwall (également connu sous le nom de « superposition d'émoticônes à l'écran ») prend les émojis et les émoticônes personnalisées envoyés dans le chat des streamers Owncast et les affiche en bouillonnant sur l'écran ! diff --git a/manifest.toml b/manifest.toml index 8aaa931..70afcce 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,6 +3,7 @@ packaging_format = 2 id = "owncast-emojiwall" name = "Emojiwall for Owncast" description.en = "Emojiwall (on-screen emotes overlay) for Owncast" +description.fr = "Emojiwall (superposition d'émoticônes à l'écran) pour Owncast" description.id = "Dinding emoji (tayangan emoji dalam layar) untuk Owncast" version = "1.1.2~ynh1" @@ -11,8 +12,8 @@ maintainers = ["the7thNightmare"] [upstream] license = "MIT" -code = "https://framagit.org/owncast-things/owncast-emojiwall" website = "https://smol.stream/emojiwall" +code = "https://framagit.org/owncast-things/owncast-emojiwall" [integration] yunohost = ">= 11.2" @@ -21,7 +22,7 @@ multi_instance = true ldap = false sso = false disk = "50M" -ram.build = "50M" +ram.build = "200M" ram.runtime = "50M" [install] @@ -52,6 +53,3 @@ ram.runtime = "50M" main.url = "/" [resources.ports] - - [resources.apt] - packages = "" diff --git a/scripts/change_url b/scripts/change_url index 1a0640b..4e1eb88 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,50 +14,38 @@ source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression -m "Stopping the systemd service..." -w 1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action -a stop +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression -m "Updating NGINX web server configuration..." -w 1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_change_url_nginx_config #================================================= # MODIFY CONFIGURATION #================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 -if [ $change_path -eq 1 ] -then - if [ "$new_path" = "/" ]; then - conf_path="" - else - conf_path=$new_path - fi -else - conf_path=$path -fi +ynh_add_config --template="../conf/default.json" --destination="$install_dir/config/default.json" -if [ $change_domain -eq 1 ] -then - domain=$new_domain -fi - -ynh_add_config -t default.json -d "$install_dir/config/default.json" +chmod 400 "$install_dir/config/default.json" +chown $app:$app "$install_dir/config/default.json" #================================================= # GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression -m "Starting the systemd service..." -w 1 +ynh_script_progression --message="Starting the systemd service..." --weight=1 -ynh_systemd_action -a start +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression -m "Change of URL completed for $app" -l +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index f26de1f..b05575b 100755 --- a/scripts/install +++ b/scripts/install @@ -9,56 +9,74 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=10 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression -m "Setting up source files..." -w 1 +ynh_script_progression --message="Setting up source files..." --weight=1 -ynh_setup_source -d "$install_dir" +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" chown -R $app:www-data "$install_dir" -if [ "$path" = "/" ]; then - conf_path="" - else - conf_path=$path -fi - -ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_use_nodejs -npm --prefix "$install_dir" install -ynh_add_config -t default.json -d "$install_dir/config/default.json" +# if [ "$path" = "/" ]; then +# conf_path="" +# else +# conf_path=$path +# fi #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression -m "Adding system configurations related to $app..." -w 1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 ynh_add_nginx_config ynh_add_systemd_config -#================================================= -# APP INITIAL CONFIGURATION -#================================================= -# CONFIGURATION FOR SUBPATH -#================================================= -ynh_script_progression -m "Configuring the app..." -w 1 +yunohost service add $app --description="Emojiwall for Owncast" --log="/var/log/$app/$app.log" -yunohost service add $app -d "Emojiwall for Owncast" -l "/var/log/$app/$app.log" +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="../conf/default.json" --destination="$install_dir/config/default.json" + +chmod 400 "$install_dir/config/default.json" +chown $app:$app "$install_dir/config/default.json" + +#================================================= +# CONFIGURE THE APP +#================================================= +ynh_script_progression --message="Configuring the app..." --weight=15 + +pushd $install_dir + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install +popd #================================================= # GENERIC FINALIZATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression -m "Starting a systemd service..." -w 1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action -a start +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression -m "Installation of $app completed" -l + +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/restore b/scripts/restore index a2cbff6..c922018 100755 --- a/scripts/restore +++ b/scripts/restore @@ -9,6 +9,14 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=10 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -30,7 +38,7 @@ 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 -yunohost service add $app --description="Web interface for Urban Dictionary" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Emojiwall for Owncast" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION @@ -39,7 +47,7 @@ yunohost service add $app --description="Web interface for Urban Dictionary" --l #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 610093b..6db4ce4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,14 +11,22 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=10 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression -m "Stopping a systemd service..." -w 1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action -a stop +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) @@ -28,50 +36,64 @@ ynh_systemd_action -a stop if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression -m "Upgrading source files..." -w 1 + ynh_script_progression --message="Upgrading source files..." --weight=1 - ynh_setup_source -d "$install_dir" + ynh_setup_source -d "$install_dir" --keep="config/default.json" fi chown -R $app:www-data "$install_dir" -ynh_use_nodejs -npm --prefix "$install_dir" install - #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression -m "Upgrading system configurations related to $app..." -w 1 +ynh_script_progression --message="Upgrading 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="Emojiwall for Owncast" --log="/var/log/$app/$app.log" + #================================================= # RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) #================================================= # CONFIGURATION FOR SUBPATH #================================================= +# ynh_script_progression --message="Updating the configuration..." --weight=1 -ynh_script_progression -m "Updating the configuration..." -w 1 +# if [ "$path" = "/" ]; then +# conf_path="" +# else +# conf_path=$path +# fi -if [ "$path" = "/" ]; then - conf_path="" - else - conf_path=$path -fi +#ynh_add_config --template="../conf/default.json" --destination="$install_dir/config/default.json" -ynh_add_config -t default.json -d "$install_dir/config/default.json" +#chmod 400 "$install_dir/config/default.json" +#chown $app:$app "$install_dir/config/default.json" -yunohost service add $app --description="Web frontend for Urban Dictionary" --log="/var/log/$app/$app.log" +#================================================= +# CONFIGURE THE APP +#================================================= +ynh_script_progression --message="Configuring the app..." --weight=15 + +pushd $install_dir + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install +popd #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression -m "Starting the systemd service..." -w 1 +ynh_script_progression --message="Starting the systemd service..." --weight=1 -ynh_systemd_action -a start +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression -m "Upgrade of $app completed" -l +ynh_script_progression --message="Upgrade of $app completed" --last diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..91daf17 --- /dev/null +++ b/tests.toml @@ -0,0 +1,7 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ \ No newline at end of file