diff --git a/conf/config.json b/conf/config.json index cfc7162..392a834 100644 --- a/conf/config.json +++ b/conf/config.json @@ -1,23 +1,10 @@ { - // IRC server settings. "server": { - // WebSocket URL or path to connect to (string). "url": "/?server=/webirc/websocket/", - // Channel(s) to auto-join (string or array of strings). "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", - // Default nickname (string). "nick": "asdf", - // Don't display the login UI, immediately connect to the server - // (boolean). "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 } } \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 52c1172..5360338 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,8 +19,11 @@ code = "https://sr.ht/~emersion/gamja/" yunohost = ">= 11.2" architectures = "all" multi_instance = true + ldap = false + sso = true + disk = "50M" ram.build = "50M" ram.runtime = "50M" diff --git a/scripts/_common.sh b/scripts/_common.sh index 9ecc68b..80c93db 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,8 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app nodejs_version=20 + go_version=1.20 #================================================= diff --git a/scripts/backup b/scripts/backup index 0ae9c52..6d2e59e 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,16 +27,8 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - ynh_backup --src_path="$webircgateway_path" #================================================= diff --git a/scripts/change_url b/scripts/change_url index 2c672a1..bac16b2 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,14 +14,14 @@ source /usr/share/yunohost/helpers #================================================= # 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" #================================================= # 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 @@ -30,7 +30,7 @@ ynh_change_url_nginx_config #================================================= # 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" @@ -38,4 +38,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l # 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 diff --git a/scripts/install b/scripts/install index 67b0427..91f8b3a 100755 --- a/scripts/install +++ b/scripts/install @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # 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_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 -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$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" ynh_use_nodejs - ynh_exec_warn_less 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 i -g npm + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --production popd #================================================= @@ -55,7 +54,7 @@ popd #================================================= 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" 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 -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 diff --git a/scripts/remove b/scripts/remove index 187ea4e..65033e5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,37 +22,12 @@ then yunohost service remove $app 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 -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - -# Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies ynh_remove_nodejs -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." - ynh_secure_remove --file="$webircgateway_path" #================================================= diff --git a/scripts/restore b/scripts/restore index 7c563e0..7ebdba1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,7 @@ chown -R $app:www-data "$install_dir" #================================================= # 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 @@ -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" -#================================================= -# RESTORE VARIOUS FILES -#================================================= -ynh_script_progression --message="Restoring various files..." - 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" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -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 @@ -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" -#================================================= -# 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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b34e21c..65726c8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,6 +28,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=3 if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -65,8 +66,8 @@ ynh_script_progression --message="Building app... (this will take some time and pushd "$install_dir" ynh_use_nodejs - ynh_exec_warn_less 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 i -g npm + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --production popd #================================================= @@ -74,7 +75,7 @@ popd #================================================= 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" 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" 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" 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 -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