From fc2a6fc28f1f1fc7f2ac39f8d520429d49fca6ab Mon Sep 17 00:00:00 2001 From: Nurlan Turkpenbay <51225765+n-turkpenbay@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:39:58 +0500 Subject: [PATCH] Add a Chocolatey package for the Windows installer nelsar-axia downloads the x64 MSI of its version from the release, refuses it unless its SHA-256 matches, and installs it unattended. Its parameters stand for the MSI's properties, and one left out is not passed, so an upgrade keeps the settings an earlier install wrote. The bind password is not a parameter, for the same reason it is not an MSI property. The release steps gain one: bring the package to the new version and push it to the community repository once the installers are attached. --- .gitignore | 3 ++ CHANGELOG.md | 9 ++++ CONTRIBUTING.md | 13 ++++++ deploy/chocolatey/nelsar-axia.nuspec | 46 +++++++++++++++++++ deploy/chocolatey/tools/chocolateyinstall.ps1 | 37 +++++++++++++++ docs/installation-windows.md | 30 ++++++++++++ 6 files changed, 138 insertions(+) create mode 100644 deploy/chocolatey/nelsar-axia.nuspec create mode 100644 deploy/chocolatey/tools/chocolateyinstall.ps1 diff --git a/.gitignore b/.gitignore index 15af14b..343eee2 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,9 @@ Nelsar.Axia.Api/appsettings*.json *.userprefs artifacts/ +# The Chocolatey package, built by `choco pack` in deploy/chocolatey. +*.nupkg + # Node / Vite node_modules/ dist/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 53d4f39..12623a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ configuration or the API in ways that need action on upgrade; its entry says wha How a release is cut is in [CONTRIBUTING.md](CONTRIBUTING.md#releasing). +## [Unreleased] + +### Added + +- A Chocolatey package, `nelsar-axia`, in `deploy/chocolatey`: it installs the x64 MSI of its + version, checked against its SHA-256, with the MSI's properties as package parameters. See + [Windows installer → Through Chocolatey](docs/installation-windows.md#through-chocolatey). + ## [0.3.0] - 2026-10-23 PostgreSQL for the API's own state, Samba AD, and a Windows installer. Accounts and groups created @@ -240,6 +248,7 @@ Read before deploying: [SECURITY.md](SECURITY.md#known-limitations) and [Not in scope yet](README.md#not-in-scope-yet). Above all, a session cannot be ended before its token expires, and directory certificates are not checked for revocation. +[Unreleased]: https://github.com/Nelsar/Axia/compare/v0.3.0...HEAD [0.3.0]: https://github.com/Nelsar/Axia/releases/tag/v0.3.0 [0.2.1]: https://github.com/Nelsar/Axia/releases/tag/v0.2.1 [0.2.0]: https://github.com/Nelsar/Axia/releases/tag/v0.2.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2bfc81..535f266 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -173,3 +173,16 @@ inherits, `frontend/package.json`, and the image tags the quick start runs in `d section to the release notes: the edit is also what makes SourceForge, which copied the release when it was published, copy the installers too. Should it fail, run it again from the Actions tab with the tag as its input; the section is added once. + +6. Once the installers are attached, bring the Chocolatey package in `deploy/chocolatey` to the + release in a pull request: the version in `nelsar-axia.nuspec` and its `releaseNotes` link, and + in `tools/chocolateyinstall.ps1` the version and the x64 installer's SHA-256, which + `gh release view vx.y.z --json assets` prints as its `digest`. Then build and push it from that + folder: + + ```bash + choco pack + choco push nelsar-axia.x.y.z.nupkg --source https://push.chocolatey.org/ + ``` + + The community repository holds each version for moderation before it is listed. diff --git a/deploy/chocolatey/nelsar-axia.nuspec b/deploy/chocolatey/nelsar-axia.nuspec new file mode 100644 index 0000000..c702c61 --- /dev/null +++ b/deploy/chocolatey/nelsar-axia.nuspec @@ -0,0 +1,46 @@ + + + + nelsar-axia + 0.3.0 + Nelsar.Axia + Nelsar + Nelsar + https://github.com/Nelsar/Axia + https://github.com/Nelsar/Axia/tree/main/deploy/chocolatey + https://nelsar.github.io/Axia/ + https://github.com/Nelsar/Axia/issues + https://github.com/Nelsar/Axia + https://github.com/Nelsar/Axia/blob/main/LICENSE + false + https://raw.githubusercontent.com/Nelsar/Axia/v0.3.0/docs/brand/avatar.png + Nelsar + active-directory ldap openldap samba admin web-interface rest-api helpdesk foss + Self-hosted web interface and REST API for Active Directory and OpenLDAP. + + https://github.com/Nelsar/Axia/releases/tag/v0.3.0 + + + + + diff --git a/deploy/chocolatey/tools/chocolateyinstall.ps1 b/deploy/chocolatey/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000..ba89f9a --- /dev/null +++ b/deploy/chocolatey/tools/chocolateyinstall.ps1 @@ -0,0 +1,37 @@ +$ErrorActionPreference = 'Stop' + +$version = '0.3.0' +$pp = Get-PackageParameters + +# Package parameters map to the MSI's own properties. One that is not given is not passed, so an +# upgrade without parameters keeps the settings an earlier install wrote. +$properties = [ordered]@{ + Port = 'PORT' + LdapServer = 'LDAP_SERVER' + LdapBaseDn = 'LDAP_BASEDN' + LdapUsername = 'LDAP_USERNAME' + AdminGroup = 'ADMIN_GROUP' + DatabaseProvider = 'DATABASE_PROVIDER' +} + +$silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($env:ChocolateyPackageName).$($version).MsiInstall.log`"" +foreach ($name in $properties.Keys) { + if ($pp[$name]) { + $silentArgs += " $($properties[$name])=`"$($pp[$name])`"" + } +} +if ($pp['StartService']) { + $silentArgs += ' START_SERVICE=1' +} + +$packageArgs = @{ + packageName = $env:ChocolateyPackageName + fileType = 'msi' + url64bit = "https://github.com/Nelsar/Axia/releases/download/v$version/Nelsar.Axia-$version-x64.msi" + checksum64 = '76d9730fdc2b7e0154b81dcf56e9168db4af1cf1d382b3f11683d9e5bfcd7b36' + checksumType64 = 'sha256' + silentArgs = $silentArgs + validExitCodes = @(0, 3010, 1641) +} + +Install-ChocolateyPackage @packageArgs diff --git a/docs/installation-windows.md b/docs/installation-windows.md index 951075a..cc64c55 100644 --- a/docs/installation-windows.md +++ b/docs/installation-windows.md @@ -26,6 +26,36 @@ the release's tag. With the [GitHub CLI](https://cli.github.com/): gh attestation verify Nelsar.Axia-x.y.z-x64.msi --repo Nelsar/Axia ``` +### Through Chocolatey + +[`deploy/chocolatey`](https://github.com/Nelsar/Axia/tree/main/deploy/chocolatey) holds a +[Chocolatey](https://chocolatey.org/) package, `nelsar-axia`, for 64-bit Intel and AMD. It +downloads the x64 MSI of its version from the release, refuses it unless its SHA-256 matches, and +installs it the [unattended](#unattended) way. Package parameters stand for the MSI's properties: + +| Parameter | Property | +| --- | --- | +| `/Port:` | `PORT` | +| `/LdapServer:` | `LDAP_SERVER` | +| `/LdapBaseDn:` | `LDAP_BASEDN` | +| `/LdapUsername:` | `LDAP_USERNAME` | +| `/AdminGroup:` | `ADMIN_GROUP` | +| `/DatabaseProvider:` | `DATABASE_PROVIDER` | +| `/StartService` | `START_SERVICE=1` | + +Until it is published to the Chocolatey community repository, build it from a checkout, in an +elevated PowerShell: + +```powershell +cd deploy\chocolatey +choco pack +choco install nelsar-axia --source . -y --params "'/LdapServer:dc01.corp.example.com /LdapBaseDn:DC=corp,DC=example,DC=com /StartService'" +``` + +As with the MSI, the bind password is not a parameter: [finish the +configuration](#finishing-the-configuration) afterwards. `choco upgrade` installs the newer MSI over +the older one, and `choco uninstall nelsar-axia` removes it like an [uninstall](#uninstalling) does. + ## What goes where | Where | What | On upgrade | On uninstall |