Skip to content

feat(packaging): add RPM and Debian packages for the server - #515

Merged
M0Rf30 merged 2 commits into
openartifact:mainfrom
hgomez:feat/product-rpm-deb-packaging
Nov 23, 2026
Merged

M0Rf30 merged 2 commits into
openartifact:mainfrom
hgomez:feat/product-rpm-deb-packaging

Conversation

@hgomez

@hgomez hgomez commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add native .deb and .rpm server packages via GoReleaser nfpms (x86_64 + aarch64), next to the existing tar.gz/zip archives
  • add packaging/server/{postinstall,preremove}.sh and packaging/systemd/openartifact.service for systemd installs
  • attest/sign the new artifacts (dist/*.deb, dist/*.rpm) in release.yml
  • document native package installation in docs/getting-started/installation.md

Testing

  • built locally with GoReleaser: dist/openartifact-0.0.0~SNAPSHOT_73f6d81c-1.{x86_64,aarch64}.rpm produced
  • .deb/.rpm verified against the packaging scripts (postinstall/preremove, systemd unit)

hgomez and others added 2 commits November 22, 2026 12:20
- .goreleaser.yml: the config is config|noreplace. Plain config is %config in the rpm,
  so an upgrade shipping a changed example replaced the edited file (old one saved as
  .rpmsave) and the restart in postinstall then ran on CHANGE_ME.
- The config holds the database password and was installed 0644: ship it 0640 and
  chgrp it to openartifact in postinstall (every install and upgrade, since an upgrade
  replaces an unedited conffile).
- postinstall generates OPENARTIFACT_SECRET_KEY once into /etc/openartifact/openartifact.env
  (0640 root:openartifact, not packaged, so removal keeps it); the unit loads it with
  EnvironmentFile=-. Without it upstream passwords, webhook secrets and signing keys
  were stored unencrypted.
- Drop mise.toml: no SPDX header (REUSE check fails), unrelated to packaging and a second
  place pinning Go/bun (bun 1.4.5 vs BUN_VERSION 1.4.4 in CI).
- docs: rpm file names carry the release (-1), sudoedit instead of Debian-only editor,
  config permissions and the secret key file.

Tested: GoReleaser snapshot; dpkg -i on debian:13 and dnf/rpm on fedora 45 (rpm 6.1):
user, 0750 state dirs, 0640 root:openartifact config and env file, an edited config kept
over a reinstall with a changed example (.dpkg-dist / .rpmnew), key unchanged, verify
passes as the openartifact user, removal keeps the env file.
@M0Rf30

M0Rf30 commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks @hgomez, this is a good addition. I built it with a GoReleaser snapshot and installed the packages in debian:13 and fedora:45 (rpm 6.1). Three problems came up, and I pushed the fixes as 5bf3933 on your branch:

  1. rpm upgrades replaced an edited config. type: config becomes a plain %config in the rpm (rpm -qp --queryformat '[%{FILENAMES} %{FILEFLAGS:fflags}\n]' printed c, without n). So an upgrade that ships a changed openartifact.example.yaml overwrote /etc/openartifact/openartifact.yaml and saved the old file as .rpmsave. The restart in postinstall then ran on CHANGE_ME. It is now config|noreplace.
  2. The config was world-readable (0644 root:root), even though it holds the database password. It now ships 0640, and postinstall runs chgrp openartifact on every install and upgrade, because an upgrade replaces an unedited conffile.
  3. OPENARTIFACT_SECRET_KEY had no way into the unit, since it is env-only, so stored upstream passwords, webhook secrets and signing keys stayed unencrypted. postinstall now generates it once into /etc/openartifact/openartifact.env (0640 root:openartifact). The file is not part of the package, so removing the package keeps it. The unit loads it with EnvironmentFile=-.

Smaller changes:

  • I dropped mise.toml. It had no SPDX header (that is the REUSE compliance failure), it has nothing to do with packaging, and it pinned bun 1.4.5 while CI uses 1.4.4.
  • The docs now give the rpm file names with their release (openartifact-0.25.0-1.x86_64.rpm), use sudoedit because editor exists only on Debian, and describe the permissions and the key file.

What the container tests confirmed: the user exists, the state directories are 0750, the config and env file are 0640 root:openartifact, an edited config survives a reinstall with a changed example (.dpkg-dist / .rpmnew), the key does not change, openartifact verify passes as the openartifact user, and removal keeps the key. Containers have no systemd, so the systemctl branch did not run.

@M0Rf30 M0Rf30 closed this Nov 23, 2026
@M0Rf30 M0Rf30 reopened this Nov 23, 2026
@M0Rf30
M0Rf30 merged commit 5773893 into openartifact:main Nov 23, 2026
28 checks passed
@M0Rf30 M0Rf30 mentioned this pull request Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants