Skip to content

Conversation

@tomoyan596
Copy link

@tomoyan596 tomoyan596 commented Dec 25, 2025

Summary

This PR introduces a dedicated build profile and Debian packaging setup to support low-resource devices, specifically tested on Raspberry Pi Zero WH (ARMv6).

Key Changes

  • New Cargo Profile (dietpi): Optimized for binary size (opt-level = 'z', LTO, strip = true). Reduces the server binary size from ~66MB to ~45MB (-31%).
  • Debian Packaging: Added package.metadata.deb configuration for both atomic-server and atomic-cli.
  • Cross-build Support: Updated Cross.toml for Node.js/pnpm environments.
  • Systemd Integration: Included a service unit and an environment file (/etc/atomic-server/atomic-server.env) for professional service management.
  • Security: The server now runs under a dedicated atomic-server system user (created via postinst).
  • Dynamic Configuration: The postinst script automatically sets ATOMIC_DOMAIN to the system's hostname upon installation.

Motivation

Standard release builds are somewhat heavy for older SBCs with limited RAM (e.g., 512MB). This PR makes Atomic Data more accessible for edge computing and lightweight server use cases.
Related to #151.

Verified on: Fedora 42 (Cross-build) -> DietPi (Raspberry Pi Zero WH)
The instructions are written in Japanese, but more detailed information is available on the following website, so please refer to it if you wish.
https://www.tomoyan.net/rust/cross-compilation_for_dietpi

cli/Cargo.toml Outdated
[package.metadata.deb]
extended-description = "Atomic CLI - A command-line interface for headless CMS and real-time databases."
maintainer = "tomoyan <https://www.tomoyan.net/>"
copyright = "2025, tomoyan"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this is not how copyright works :P I wrote pretty much the entire repo, you can't claim ownership with one PR that adds some metadata.

@joepio
Copy link
Member

joepio commented Dec 26, 2025

Hey @tomoyan596 thanks for the PR! Looks like this helps in making it more accessible indeed. And while I do want to credit you where credit is due, I don't think it makes sense for you to be listed as copyright owner & maintainer ;)

@tomoyan596
Copy link
Author

Hi @joepio,

My apologies for the metadata blunder—I've just pushed a fix!

  • Metadata: Updated the maintainer and copyright to your official info (joep@ontola.io) across all packages.

  • Systemd Service: Cleaned up the service unit by moving all environment variables to the .env file for better consistency.

I've re-tested the Debian package on a Raspberry Pi Zero WH (DietPi), and it's working perfectly. Thanks for the feedback!

@tomoyan596
Copy link
Author

I noticed atomic-cli was missing the homepage field, so I added it to keep the Debian metadata consistent with atomic-server.

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