Skip to content

feat: one-line installer with Podman, HTTPS, backups and a management command - #3

Open
najuna-brian wants to merge 5 commits into
mainfrom
feat/one-line-installer
Open

najuna-brian wants to merge 5 commits into
mainfrom
feat/one-line-installer

Conversation

@najuna-brian

Copy link
Copy Markdown
Member

Description

Adds get.sh, a one-line installer that takes a fresh Ubuntu 24.04 or Debian 12 server to a working Synkronus with HTTPS, so people without a developer background can run their own server.

curl -fsSL https://raw.githubusercontent.com/OpenDataEnsemble/synkronus-quickstart/main/get.sh | sudo bash

Three routes, all using the same script:

Route For How
A. Paste one line (recommended) Anyone who can open the server console The command above; it asks only for an optional domain
B. No terminal People who have never used a command line Paste cloud-init.sh into the provider's "User data" box when creating the server
C. Cloudflare Tunnel No public IP, or already on Cloudflare Same command with --tunnel-token

What the installer does:

  • Installs Podman by default (Docker if it is already installed, or when Podman is too old, e.g. Ubuntu 22.04).
  • Checks memory, disk, free ports 80/443 and the domain's DNS record first, and explains problems in plain words.
  • Generates all secrets (letters and digits only, safe in URLs and YAML) into /opt/synkronus/.env, saves the login to CREDENTIALS.txt.
  • Runs PostgreSQL, Synkronus and Caddy. Only Caddy is published. Caddy passes the real client IP, and SYNKRONUS_AUTH_TRUSTED_PROXY_CIDRS is set to the internal network, so login rate limits apply per client instead of to everyone at once.
  • Free HTTPS address https://<ip>.sslip.io when there is no domain.
  • Adds swap on 1 GB servers, a systemd unit so everything starts after a reboot (Podman does not do this on its own), and a nightly backup kept 7 days.
  • Installs a synkronus command: status, credentials, backup, restore, update (backs up first, rolls back if the new version does not start), reset-admin-password (uses the recovery variables and removes them again), logs, start/stop/restart, uninstall.
  • Running it again changes nothing on an installed server; if an earlier attempt stopped halfway, it continues with the same secrets.

Also fixes two bugs in the existing quickstart (see the linked issue):

  • install.sh stops on a second run instead of printing passwords that are never applied.
  • docker-compose.yml publishes 8080 on 127.0.0.1 only, so the API is no longer reachable over plain HTTP around Caddy (the override's ports: [] does not remove it).

create_sync_db.sh is left alone because #1 rewrites it.

Type of Change

  • Bug Fix
  • New Feature / Enhancement
  • Documentation Update

Related Issue(s)

Closes: #2

Testing

  • Manually tested
  • Tested on multiple platforms (if applicable)

On Ubuntu 24.04 with Podman 4.9.3 / podman-compose 1.0.6, and with Docker 29 / Compose v5:

  • Fresh install, admin login through Caddy, port 8080 not reachable from outside
  • A password containing ', : and #
  • Second run (no changes), and continuing after a failed first attempt
  • backup then restore (database rows and attachment files come back)
  • reset-admin-password (new password works, recovery variables removed afterwards)
  • stop then start again as on boot
  • Generated compose files for the domain/sslip and tunnel modes validated with podman-compose config
  • shellcheck clean

Breaking Changes

  • This PR does NOT introduce breaking changes

…ment command

Add get.sh, a single command that sets up a complete Synkronus server
(PostgreSQL, Synkronus and Caddy) on a fresh Ubuntu 24.04 or Debian 12
server. It supports three routes: paste one line, paste cloud-init.sh at
server creation (no terminal), or run behind a Cloudflare Tunnel.

- Podman by default, Docker when already installed or Podman is too old
- Generated secrets kept in /opt/synkronus/.env, credentials saved to
  CREDENTIALS.txt
- Pre-flight checks for memory, disk, ports 80/443 and the domain's DNS
- Synkronus and Postgres are not published; only Caddy listens publicly
- Real client IPs passed to Synkronus so login rate limits are per user
- Starts again after reboot, nightly backups kept 7 days
- synkronus command: status, credentials, backup, restore, update with
  rollback, reset-admin-password, logs, uninstall
- Running it again changes nothing

Also fix two quickstart issues:
- install.sh refuses to run a second time instead of printing new
  passwords that are never applied
- docker-compose.yml publishes port 8080 on 127.0.0.1 only, so the
  server is not reachable over plain HTTP around Caddy
@najuna-brian najuna-brian self-assigned this Nov 12, 2026
najuna-brian and others added 4 commits November 12, 2026 14:35
…eate

--quick-tunnel gives a free temporary https://*.trycloudflare.com address with no domain, account or open ports, for trying Synkronus on a laptop or a server behind a router. The installer now stops before starting if containers named synkronus, synkronus-db, synkronus-caddy or synkronus-tunnel already exist and belong to something else.
cloudflared defaults to QUIC, which needs outbound UDP. Many office and mobile networks block it, and the tunnel then never connects. HTTP/2 over TCP 443 works on those networks. Existing installs pick this up on their next synkronus restart or update.
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.

1 participant