From 0a1f3439949723426c8fd8de4e0da0a2e72b4f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:38:48 +0100 Subject: [PATCH] fix --- conf/.env | 6 +++--- conf/systemd.service | 4 ++-- manifest.toml | 15 ++++++++++----- scripts/install | 8 +++----- scripts/remove | 15 --------------- scripts/restore | 2 +- scripts/upgrade | 26 +++++++++++++------------- 7 files changed, 32 insertions(+), 44 deletions(-) diff --git a/conf/.env b/conf/.env index 3ac1ca6..d3948b7 100644 --- a/conf/.env +++ b/conf/.env @@ -2,8 +2,8 @@ NEXT_PUBLIC_BASE_URL=http://__DOMAIN__ DATABASE_URL="postgres://__DB_USER__:__DB_PWD__@127.0.0.1:5432/__DB_NAME__?sslmode=disable\&connect_timeout=10", SECRET_PASSWORD=__PASSWORD__ SUPPORT_EMAIL=__EMAIL__ -SMTP_HOST=localhost +SMTP_HOST=__MAIN_DOMAIN__ SMTP_PORT=25 SMTP_SECURE=false -SMTP_USER=your-smtp-user -SMTP_PWD=your-smtp-password +SMTP_USER=__APP__ +SMTP_PWD=__MAIL_PWD__ diff --git a/conf/systemd.service b/conf/systemd.service index 47de4ee..3a8db43 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,8 +7,8 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -Environment=NODE_ENV=production -Environment=PORT=__PORT__ +Environment="NODE_ENV=production" +Environment="PORT=__PORT__" Environment="__YNH_NODE_LOAD_PATH__" ExecStart=__YNH_NPM__ run start diff --git a/manifest.toml b/manifest.toml index 541184a..71993f6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Rallly" description.en = "Group-meeting manager" description.fr = "Group-meeting manager" -version = "1.0~ynh1" +version = "3.5.1~ynh1" maintainers = [] @@ -16,11 +16,14 @@ admindoc = "https://support.rallly.co/" code = "https://github.com/lukevella/rallly" [integration] -yunohost = ">= 11.1.19" +yunohost = ">= 11.2" architectures = "all" multi_instance = true + ldap = false + sso = false + disk = "50M" ram.build = "50M" ram.runtime = "50M" @@ -39,11 +42,13 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/lukevella/rallly/archive/d09aed10291269f99ab4477217a4cdb75835964c.tar.gz" - sha256 = "c1ff0fc9d8d7ad7d197bd67a9aa31df9d17bad0e60de25f998b35d364b164485" + url = "https://github.com/lukevella/rallly/archive/refs/tags/v3.5.1.tar.gz" + sha256 = "02d1903cc97bf559201cba98a85fd4d697611eb4eec7e22eb74f46e51773f960" + autoupdate.strategy = "latest_github_release" [resources.system_user] - + allow_email = true + [resources.install_dir] [resources.ports] diff --git a/scripts/install b/scripts/install index 013a18d..f19870d 100755 --- a/scripts/install +++ b/scripts/install @@ -23,17 +23,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=1 # Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_use_nodejs #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -50,7 +47,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" +ynh_add_config --template=".env" --destination="$install_dir/.env" chmod 650 "$install_dir/.env" chown $app:$app "$install_dir/.env" @@ -61,6 +58,7 @@ chown $app:$app "$install_dir/.env" 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 yarn install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build popd @@ -86,7 +84,7 @@ yunohost service add $app --description="Group-meeting manager" --log="/var/log/ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -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" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 1255644..62cd96b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,27 +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 - ynh_remove_nodejs #================================================= diff --git a/scripts/restore b/scripts/restore index d1193c1..f310bec 100755 --- a/scripts/restore +++ b/scripts/restore @@ -54,7 +54,7 @@ yunohost service add $app --description="Group-meeting manager" --log="/var/log/ #================================================= ynh_script_progression --message="Starting a systemd 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" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index aab4e56..4805e09 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -45,7 +45,6 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_use_nodejs #================================================= # NGINX CONFIGURATION @@ -55,27 +54,28 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Group-meeting manager" --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 yarn install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build +popd + #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd 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" #================================================= # END OF SCRIPT