1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/owncast-emojiwall_ynh.git synced 2024-09-03 19:56:19 +02:00

Merge pull request #1 from YunoHost-Apps/testing

cleaning
This commit is contained in:
eric_G 2023-10-06 17:01:32 +02:00 committed by GitHub
commit 4a8a7b68f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 122 additions and 79 deletions

View file

@ -16,7 +16,7 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
## Vue densemble ## Vue densemble
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 **Version incluse :** 1.1.2~ynh1

View file

@ -1,7 +1,7 @@
{ {
"webhooks": { "webhooks": {
"host": "__DOMAIN__", "host": "__DOMAIN__",
"prefix": "__CONF_PATH__", "prefix": "__PATH__",
"port": __PORT__, "port": __PORT__,
"public_port": 443, "public_port": 443,
"schema": "https" "schema": "https"

View file

@ -1,13 +1,13 @@
location __PATH__ { #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
# Standard nginx configuration location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:__PORT__/;
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }

View file

@ -1,12 +1,13 @@
[Unit] [Unit]
Description=Emojiwall for Owncast Description=Emojiwall: on-screen emotes overlay
After=network.target After=network.target
[Service] [Service]
Type=simple Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__INSTALL_DIR__ WorkingDirectory=__INSTALL_DIR__/
Environment="__YNH_NODE_LOAD_PATH__"
ExecStart=__YNH_NODE__ index.js ExecStart=__YNH_NODE__ index.js
# Sandboxing options to harden security # Sandboxing options to harden security

1
doc/DESCRIPTION_fr.md Normal file
View file

@ -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 !

View file

@ -3,6 +3,7 @@ packaging_format = 2
id = "owncast-emojiwall" id = "owncast-emojiwall"
name = "Emojiwall for Owncast" name = "Emojiwall for Owncast"
description.en = "Emojiwall (on-screen emotes overlay) 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" description.id = "Dinding emoji (tayangan emoji dalam layar) untuk Owncast"
version = "1.1.2~ynh1" version = "1.1.2~ynh1"
@ -11,8 +12,8 @@ maintainers = ["the7thNightmare"]
[upstream] [upstream]
license = "MIT" license = "MIT"
code = "https://framagit.org/owncast-things/owncast-emojiwall"
website = "https://smol.stream/emojiwall" website = "https://smol.stream/emojiwall"
code = "https://framagit.org/owncast-things/owncast-emojiwall"
[integration] [integration]
yunohost = ">= 11.2" yunohost = ">= 11.2"
@ -21,7 +22,7 @@ multi_instance = true
ldap = false ldap = false
sso = false sso = false
disk = "50M" disk = "50M"
ram.build = "50M" ram.build = "200M"
ram.runtime = "50M" ram.runtime = "50M"
[install] [install]
@ -52,6 +53,3 @@ ram.runtime = "50M"
main.url = "/" main.url = "/"
[resources.ports] [resources.ports]
[resources.apt]
packages = ""

View file

@ -14,50 +14,38 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# STOP SYSTEMD SERVICE # 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 # 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 ynh_change_url_nginx_config
#================================================= #=================================================
# MODIFY CONFIGURATION # MODIFY CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
if [ $change_path -eq 1 ] ynh_add_config --template="../conf/default.json" --destination="$install_dir/config/default.json"
then
if [ "$new_path" = "/" ]; then
conf_path=""
else
conf_path=$new_path
fi
else
conf_path=$path
fi
if [ $change_domain -eq 1 ] chmod 400 "$install_dir/config/default.json"
then chown $app:$app "$install_dir/config/default.json"
domain=$new_domain
fi
ynh_add_config -t default.json -d "$install_dir/config/default.json"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
#================================================= #=================================================
# START SYSTEMD SERVICE # 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 # 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

View file

@ -9,56 +9,74 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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) # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # 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" chown -R $app:www-data "$install_dir"
if [ "$path" = "/" ]; then # if [ "$path" = "/" ]; then
conf_path="" # conf_path=""
else # else
conf_path=$path # conf_path=$path
fi # 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"
#================================================= #=================================================
# SYSTEM CONFIGURATION # 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_nginx_config
ynh_add_systemd_config ynh_add_systemd_config
#================================================= yunohost service add $app --description="Emojiwall for Owncast" --log="/var/log/$app/$app.log"
# APP INITIAL CONFIGURATION
#=================================================
# CONFIGURATION FOR SUBPATH
#=================================================
ynh_script_progression -m "Configuring the app..." -w 1
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 # GENERIC FINALIZATION
#================================================= #=================================================
# START SYSTEMD SERVICE # 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 # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression -m "Installation of $app completed" -l
ynh_script_progression --message="Installation of $app completed" --last

View file

@ -9,6 +9,14 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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 # 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" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet 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 # 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_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 ynh_systemd_action --service_name=nginx --action=reload

View file

@ -11,14 +11,22 @@ source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed) 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 # STANDARD UPGRADE STEPS
#================================================= #=================================================
# STOP SYSTEMD SERVICE # 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...) # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
@ -28,50 +36,64 @@ ynh_systemd_action -a stop
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then 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 fi
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
ynh_use_nodejs
npm --prefix "$install_dir" install
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # 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 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...) # RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...)
#================================================= #=================================================
# CONFIGURATION FOR SUBPATH # 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 #ynh_add_config --template="../conf/default.json" --destination="$install_dir/config/default.json"
conf_path=""
else
conf_path=$path
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"
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 # 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 # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression -m "Upgrade of $app completed" -l ynh_script_progression --message="Upgrade of $app completed" --last

7
tests.toml Normal file
View file

@ -0,0 +1,7 @@
test_format = 1.0
[default]
# ------------
# Tests to run
# ------------