magos-dominus

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MIT

README ยถ

Magos Dominus Logo

๐Ÿง™ Magos Dominus (A.K.A Magos)

A self-hosted GitOps daemon for homelabs โ€” automating container deployments with mystical precision.

โ€œThe Machine does not err. The flesh errs. The Code is truth, and I am its voice.โ€
โ€” Credus del Adeptus Mechanicus


๐Ÿ“œ About

Magos Dominus is a lightweight GitOps agent forged in the spirit of the Adeptus Mechanicus.
Its purpose: to enforce the declared state from your sacred Git repository and reconcile it with the material world of your homelab.

Unlike the bloated rites of Kubernetes and its labyrinthine CRDs, Magos acts directly on a simple Linux host using Podman Compose โ€” pure, direct, and efficient.
No unnecessary ceremony. No wasted bureaucracy. Only obedience to the written manifest.

Each reconciliation loop is a ritual. Each deployment, a litany.
Where drift appears, corruption is purged. Where the manifest and the machine diverge, Magos enforces the will of the Code.


โš™๏ธ Core Features (implemented)

โœ… Daemonized GitOps loop

  • Runs continuously via systemd as a rootless or privileged service.
  • Pulls from a GitHub App-authenticated repo.

โœ… Image watcher

  • Monitors container registries (currently GHCR).
  • Evaluates semantic versions and filters valid tags.

โœ… Reconciler

  • Detects updated image versions matching defined policies.
  • Rewrites Compose files with immutable @sha256 digests.
  • Commits and pushes via GitHub App credentials.

โœ… Secrets integration

  • Automatically decrypts SOPS-encrypted files using local age keys.
  • Supports environment variable injection and runtime secret expansion.

โœ… Applier

  • Executes podman compose pull && up -d to deploy updated stacks.
  • Supports rootless environments (with Pasta networking fallback).

โœ… System integration

  • Managed via systemd --user or as a root service.
  • Logs and metrics available via journalctl -fu magos-dominus.

โœ… Cross-platform binaries

  • Released for Linux, macOS, and Windows through GitHub Actions.

๐Ÿš€ Installation

Quick Install (Linux/macOS)

# Download latest release (Linux amd64)
curl -L -o /usr/local/bin/magos-dominus \
  https://github.com/jpvargasdev/magos-dominus/releases/latest/download/magos-dominus-linux-amd64

# Make executable
chmod +x /usr/local/bin/magos-dominus

# Verify installation
magos-dominus version

Other platforms

Platform Architecture Binary
Linux amd64 magos-dominus-linux-amd64
Linux arm64 magos-dominus-linux-arm64
macOS amd64 magos-dominus-darwin-amd64
macOS arm64 (M1/M2) magos-dominus-darwin-arm64
Windows amd64 magos-dominus-windows-amd64.exe

From source

git clone https://github.com/jpvargasdev/magos-dominus.git
cd magos-dominus
go build -o magos-dominus ./cmd/server

Systemd service

Copy the service file and enable:

cp scripts/magos-dominus.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now magos-dominus

๐Ÿงฉ Repository Layout

  • cmd/server/ # Entrypoint and CLI
  • internal/cli/ # Command-line interface
  • internal/watcher/ # Registry watcher & event loop
  • internal/daemon/ # Core reconciliation engine
  • scripts/ # Reconcile + secrets decryption helpers
  • configs/ # Default YAML configuration

๐Ÿ”ง Configuration

.env essentials

MD_REPO=https://github.com/yourname/your-gitops-repo
MD_RUNTIME=podman/docker
SOPS_AGE_KEY_FILE=/home/user/.config/sops/age/keys.txt
GITHUB_APP_ID=123456
GITHUB_APP_PRIVATE_KEY=/home/user/.local/share/magos/github_app.pem

Compose Policy Annotation

Magos recognizes image policies through comments in your docker-compose.yml:

services:
  lexcodex:
    image: ghcr.io/jpvargasdev/lexcodex:0.0.1 # {"magos": {"policy": "semver", "repo": "ghcr.io/jpvargasdev/lexcodex"}}

Supported policies:

  • semver โ€” Enforce semantic version updates (e.g., >=1.2.0 <2.0.0)
  • latest โ€” Always reconcile to the latest tag
  • digest โ€” Enforce a specific immutable digest

๐Ÿ› ๏ธ Future Augmentations (planned)

  • ๐Ÿ”ฎ Multi-registry support: DockerHub, Quay.io
  • ๐Ÿ•ต๏ธโ€โ™‚๏ธ Vulnerability scanning via Trivy
  • ๐Ÿ” Image signature verification (cosign)
  • ๐Ÿงฉ Health & metrics endpoints (/healthz, /metrics)
  • ๐Ÿง  Rule-based policies (e.g. minAge, arch constraints)
  • ๐Ÿ“จ Webhook-driven reconciliations (GitHub Events)
  • ๐Ÿงฌ PR-based workflows instead of direct commits
  • ๐Ÿงฐ Podman network auto-healing and diagnostics

Directories ยถ

Path Synopsis
cmd
server command
internal
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL