mirror of
https://github.com/YunoHost-Apps/owncast-emojiwall_ynh.git
synced 2024-09-03 19:56:19 +02:00
cleaning
This commit is contained in:
parent
0facd5017a
commit
50f86c111c
8 changed files with 95 additions and 55 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
1
doc/DESCRIPTION_fr.md
Normal 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 !
|
|
@ -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"
|
||||||
|
@ -52,6 +53,3 @@ ram.runtime = "50M"
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
|
|
||||||
[resources.ports]
|
[resources.ports]
|
||||||
|
|
||||||
[resources.apt]
|
|
||||||
packages = ""
|
|
||||||
|
|
|
@ -14,14 +14,14 @@ 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="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# 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
|
||||||
|
|
||||||
|
|
|
@ -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="some_config_file" --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
|
||||||
|
|
|
@ -39,7 +39,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
|
||||||
|
|
||||||
|
|
|
@ -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 -t default.json -d "$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
|
||||||
|
|
Loading…
Reference in a new issue