diff --git a/manifest.toml b/manifest.toml index ee93fa731..72cdfb323 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,7 +15,7 @@ website = "https://github.com/ericc-ch/copilot-api" code = "https://github.com/ericc-ch/copilot-api" [integration] -yunohost = ">= 11.2" +yunohost = ">= 12.0" architectures = "all" multi_instance = true ldap = false diff --git a/scripts/change_url b/scripts/change_url index 29998a65c..572d49c6c 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,7 +14,7 @@ ynh_systemctl --service="$app" --action="stop" --log_path="/var/log/$app/$app.lo #================================================= ynh_script_progression "Updating NGINX web server configuration..." -ynh_config_change_url_nginx +ynh_change_url_nginx_config #================================================= # START SYSTEMD SERVICE diff --git a/scripts/install b/scripts/install index 3e3e9e1b5..193bc302a 100755 --- a/scripts/install +++ b/scripts/install @@ -11,6 +11,7 @@ ynh_script_progression "Installing Bun runtime..." # This is the recommended installation method per https://bun.sh/docs/installation if ! command -v bun &> /dev/null; then export BUN_INSTALL="$install_dir/.bun" + export HOME="$data_dir" curl -fsSL https://bun.sh/install | bash export PATH="$BUN_INSTALL/bin:$PATH" fi @@ -33,8 +34,8 @@ chmod -R 750 "$install_dir" ynh_script_progression "Building application..." pushd "$install_dir" - ynh_hide_warnings "$install_dir/.bun/bin/bun" install --frozen-lockfile - ynh_hide_warnings "$install_dir/.bun/bin/bun" run build + sudo -u "$app" env PATH="$PATH" "$install_dir/.bun/bin/bun" install --frozen-lockfile + sudo -u "$app" env PATH="$PATH" "$install_dir/.bun/bin/bun" run build popd #================================================= @@ -43,13 +44,13 @@ popd ynh_script_progression "Adding system configurations related to $app..." # Create a dedicated NGINX config using the conf/nginx.conf template -ynh_config_add_nginx +ynh_add_nginx_config # Create a dedicated systemd config -ynh_config_add_systemd +ynh_add_systemd_config # Use logrotate to manage application logfile(s) -ynh_config_add_logrotate +ynh_use_logrotate yunohost service add "$app" --description="Copilot API Proxy" --log="/var/log/$app/$app.log" diff --git a/scripts/remove b/scripts/remove index 11f71e0f4..340eed19a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -13,7 +13,7 @@ if yunohost service status "$app" >/dev/null 2>&1; then fi # Remove the dedicated systemd config -ynh_config_remove_systemd +ynh_remove_systemd_config #================================================= # REMOVE LOGROTATE CONFIGURATION @@ -21,7 +21,7 @@ ynh_config_remove_systemd ynh_script_progression "Removing logrotate configuration..." # Remove the app-specific logrotate config -ynh_config_remove_logrotate +ynh_remove_logrotate #================================================= # REMOVE NGINX CONFIGURATION @@ -29,7 +29,7 @@ ynh_config_remove_logrotate ynh_script_progression "Removing NGINX web server configuration..." # Remove the dedicated NGINX config -ynh_config_remove_nginx +ynh_remove_nginx_config #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index f9512c2b2..a63f1251f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ ynh_script_progression "Reinstalling Bun runtime..." # This is the recommended installation method per https://bun.sh/docs/installation if ! command -v bun &> /dev/null; then export BUN_INSTALL="$install_dir/.bun" + export HOME="$data_dir" curl -fsSL https://bun.sh/install | bash export PATH="$BUN_INSTALL/bin:$PATH" fi diff --git a/scripts/upgrade b/scripts/upgrade index dd7071d02..47b67f04f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,6 +18,7 @@ ynh_script_progression "Upgrading Bun runtime..." # This is the recommended installation method per https://bun.sh/docs/installation if ! command -v bun &> /dev/null; then export BUN_INSTALL="$install_dir/.bun" + export HOME="$data_dir" curl -fsSL https://bun.sh/install | bash export PATH="$BUN_INSTALL/bin:$PATH" fi @@ -40,8 +41,8 @@ chmod -R 750 "$install_dir" ynh_script_progression "Building application..." pushd "$install_dir" - ynh_hide_warnings "$install_dir/.bun/bin/bun" install --frozen-lockfile - ynh_hide_warnings "$install_dir/.bun/bin/bun" run build + sudo -u "$app" env PATH="$PATH" "$install_dir/.bun/bin/bun" install --frozen-lockfile + sudo -u "$app" env PATH="$PATH" "$install_dir/.bun/bin/bun" run build popd #================================================= @@ -50,13 +51,13 @@ popd ynh_script_progression "Updating configuration..." # Update NGINX configuration -ynh_config_add_nginx +ynh_add_nginx_config # Update systemd configuration -ynh_config_add_systemd +ynh_add_systemd_config # Update logrotate configuration -ynh_config_add_logrotate +ynh_use_logrotate #================================================= # START SYSTEMD SERVICE