1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gamja_ynh.git synced 2024-09-03 18:36:34 +02:00

Merge branch 'testing' into upgrade_full_replace

This commit is contained in:
eric_G 2024-04-25 17:13:04 +02:00 committed by GitHub
commit e6ecebf878
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 21 additions and 86 deletions

View file

@ -1,23 +1,10 @@
{ {
// IRC server settings.
"server": { "server": {
// WebSocket URL or path to connect to (string).
"url": "/?server=/webirc/websocket/", "url": "/?server=/webirc/websocket/",
// Channel(s) to auto-join (string or array of strings).
"autojoin": "#yunohost", "autojoin": "#yunohost",
// Controls how the password UI is presented to the user. Set to
// "mandatory" to require a password, "optional" to accept one but not
// require it, "disabled" to never ask for a password, or "external" to
// use SASL EXTERNAL. Defaults to "optional".
"auth": "optional", "auth": "optional",
// Default nickname (string).
"nick": "asdf", "nick": "asdf",
// Don't display the login UI, immediately connect to the server
// (boolean).
"autoconnect": true, "autoconnect": true,
// Interval in seconds to send PING commands (number). Set to 0 to
// disable. Enabling PINGs can have an impact on client power usage and
// should only be enabled if necessary.
"ping": 60 "ping": 60
} }
} }

View file

@ -19,8 +19,11 @@ code = "https://sr.ht/~emersion/gamja/"
yunohost = ">= 11.2" yunohost = ">= 11.2"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true
ldap = false ldap = false
sso = true sso = true
disk = "50M" disk = "50M"
ram.build = "50M" ram.build = "50M"
ram.runtime = "50M" ram.runtime = "50M"

View file

@ -4,8 +4,8 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
# dependencies used by the app
nodejs_version=20 nodejs_version=20
go_version=1.20 go_version=1.20
#================================================= #=================================================

View file

@ -27,16 +27,8 @@ ynh_backup --src_path="$install_dir"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="$webircgateway_path" ynh_backup --src_path="$webircgateway_path"
#================================================= #=================================================

View file

@ -14,14 +14,14 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_change_url_nginx_config ynh_change_url_nginx_config
@ -30,7 +30,7 @@ ynh_change_url_nginx_config
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config"
@ -38,4 +38,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for $app" --time --last ynh_script_progression --message="Change of URL completed for $app" --last

View file

@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=7 ynh_script_progression --message="Installing dependencies..." --weight=7
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_exec_warn_less ynh_install_go --go_version=$go_version ynh_exec_warn_less ynh_install_go --go_version=$go_version
@ -23,7 +23,6 @@ ynh_exec_warn_less ynh_install_go --go_version=$go_version
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=5 ynh_script_progression --message="Setting up source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
@ -46,8 +45,8 @@ ynh_script_progression --message="Building app... (this will take some time and
pushd "$install_dir" pushd "$install_dir"
ynh_use_nodejs ynh_use_nodejs
ynh_exec_warn_less npm i -g npm ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm i -g npm
ynh_exec_warn_less npm install --production ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --production
popd popd
#================================================= #=================================================
@ -55,7 +54,7 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=2 ynh_script_progression --message="Adding a configuration file..." --weight=2
ynh_add_config --template="../conf/config.json" --destination="$install_dir/config.json" ynh_add_config --template="config.json" --destination="$install_dir/config.json"
chmod 744 "$install_dir/config.json" chmod 744 "$install_dir/config.json"
chown $app:www-data "$install_dir/config.json" chown $app:www-data "$install_dir/config.json"
@ -108,7 +107,7 @@ ynh_add_systemd_config
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Simple IRC web client" yunohost service add $app --description="Simple IRC web client" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE

View file

@ -22,37 +22,12 @@ then
yunohost service remove $app yunohost service remove $app
fi fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
# Remove the dedicated systemd config
ynh_remove_systemd_config ynh_remove_systemd_config
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_nodejs ynh_remove_nodejs
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
ynh_secure_remove --file="$webircgateway_path" ynh_secure_remove --file="$webircgateway_path"
#================================================= #=================================================

View file

@ -23,7 +23,7 @@ chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=7 ynh_script_progression --message="Reinstalling dependencies..." --weight=7
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
@ -34,27 +34,12 @@ ynh_script_progression --message="Restoring the NGINX web server configuration..
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring various files..."
ynh_restore_file --origin_path="$webircgateway_path" ynh_restore_file --origin_path="$webircgateway_path"
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
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="Simple IRC web client" --log="/var/log/$app/$app.log"
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Simple IRC web client"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -63,13 +48,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
ynh_script_progression --message="Reloading NGINX web server.." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================

View file

@ -28,6 +28,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=3
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
@ -65,8 +66,8 @@ ynh_script_progression --message="Building app... (this will take some time and
pushd "$install_dir" pushd "$install_dir"
ynh_use_nodejs ynh_use_nodejs
ynh_exec_warn_less npm i -g npm ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm i -g npm
ynh_exec_warn_less npm install --production ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --production
popd popd
#================================================= #=================================================
@ -74,7 +75,7 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_script_progression --message="Updating a configuration file..." --weight=1
ynh_add_config --template="../conf/config.json" --destination="$install_dir/config.json" ynh_add_config --template="config.json" --destination="$install_dir/config.json"
chmod 744 "$install_dir/config.json" chmod 744 "$install_dir/config.json"
chown $app:www-data "$install_dir/config.json" chown $app:www-data "$install_dir/config.json"
@ -105,7 +106,7 @@ chmod -R o-rwx "$webircgateway_path"
chown -R $app:www-data "$webircgateway_path" chown -R $app:www-data "$webircgateway_path"
chmod +x "$webircgateway_path/webircgateway" chmod +x "$webircgateway_path/webircgateway"
ynh_add_config --template="../conf/config.conf" --destination="$webircgateway_path/config.conf" ynh_add_config --template="config.conf" --destination="$webircgateway_path/config.conf"
chmod 755 "$webircgateway_path/config.conf" chmod 755 "$webircgateway_path/config.conf"
chown $app:www-data "$webircgateway_path/config.conf" chown $app:www-data "$webircgateway_path/config.conf"
@ -125,7 +126,7 @@ ynh_add_systemd_config
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Simple IRC web client" yunohost service add $app --description="Simple IRC web client" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE