Skip to content

[Infrastructure] - Install Script#304

Merged
LOTaher merged 22 commits into
mainfrom
187/install-script
May 27, 2026
Merged

[Infrastructure] - Install Script#304
LOTaher merged 22 commits into
mainfrom
187/install-script

Conversation

@LOTaher
Copy link
Copy Markdown
Collaborator

@LOTaher LOTaher commented May 27, 2026

[Infrastructure] - Install Script

Changes

Sarge is now self-hostable!

  • Wrote a TUI and CLI tool in Go that installs Sarge! This lives in src/install/:
    • install.sh: the one-line entrypoint users curl | sudo sh. It does the following:
      • Check the system's architecture, operating system, and if it has the necessary dependencies required to run Sarge
      • Download the installer binary from our releases page and execute it
    • The installer binary itself: a TUI written in the bubble tea framework (quite the name, ik) that walks the user through:
      • System requirements check (Linux, amd64/arm64)
      • Root permission check
      • Dependency install. This is currently just Docker via the official get.docker.com script
      • Hostname input (the domain Caddy will serve)
      • Bootstrap step. This writes /opt/sarge/{docker-compose.yaml, Caddyfile, .env} and runs docker compose up -d
    • Templates for the compose file, Caddyfile, and .env live under src/install/internal/command/templates/ and are embedded into the binary via go:embed. The hostname and randomized secrets
      (DB password, BETTER_AUTH_SECRET, JWT_SECRET) are all created and inserted at install time
  • Two new CI workflows:
    • release-installer.yml: auto-bumps the patch tag and cuts a release of the Go binary when src/install/** changes on main
    • publish-images.yml: rebuilds and pushes web/ws images to GHCR on every merge to main

Notes

Go is in our stack now! Maybe this was inevitable before I left lol. It may seem daunting to include a new language in our stack, but this will not affect Sarge development, it is simply the language used for this installation flow. A large separation of concerns! Why Go is best for the job:

  • We need a binary for our installation completion, and Go is a compiled language.
  • Go can easily embed template files for us to dynamically update at runtime of our program.
  • Large language support for building TUIs and CLI tools.

Recording

Here is a full end-to-end flow on how to self host Sarge. This will be properly explained in the onboarding docs I create later.

(attached in slack channel)


Checklist

Please go through all items before requesting reviewers:

  • All commits are tagged with the ticket number
  • No linting errors / newline warnings
  • All code follows repository-configured formatting
  • No merge conflicts
  • All checks passing
  • Screenshots included for UI changes
  • Remove non-applicable sections of this template
  • PR assigned to yourself
  • Reviewers requested & Slack ping sent
  • PR linked to the issue (fill in 'Closes #')
  • If design-related, notify the designer in Slack

Closes

Closes #187

@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sarge Ready Ready Preview, Comment May 27, 2026 6:30pm

Request Review

@LOTaher LOTaher force-pushed the 187/install-script branch from 4d85bae to 218998b Compare May 27, 2026 01:51
@LOTaher LOTaher self-assigned this May 27, 2026
@LOTaher LOTaher marked this pull request as ready for review May 27, 2026 18:23
@LOTaher LOTaher changed the title [CRM/OA][Infra] - Install Script [Infrastructure] - Install Script May 27, 2026
@LOTaher LOTaher added the RFR Ready for Review label May 27, 2026
@LOTaher LOTaher merged commit 08e72ca into main May 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready for Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CRM/OA][Infra] - Install Script

1 participant