Skip to content

Deploy config: Caddy site block, systemd timer and publish script #63

Closed

Description

@JacobStephens2

Parent

#61

What to build

Add the configuration that serves thirdshift.app from the owner's server and keeps it up to date. It lives in a deploy directory inside the site directory, which is never served. Installing it on the server is a separate human ticket.

  • Caddy site block for thirdshift.app:
    • file_server from the published web root, with automatic TLS;
    • www.thirdshift.app permanently redirects to https://thirdshift.app;
    • /install.sh returns a 302 (temporary) redirect to https://github.com/JacobStephens2/thirdshift/releases/latest/download/thirdshift-installer.sh.
  • Publish script (shell, no dependencies beyond git and coreutils):
    • it fetches main in a checkout dedicated to deploying;
    • when the site directory has changed since the last deploy, it copies it into the web root atomically (for example, a new directory and a symlink swap), leaving out the deploy directory;
    • it records the deployed commit where the site can read it (the Prompts and skills page will show it);
    • it's safe to re-run, and does nothing when nothing changed.
  • A systemd service and timer that run the script every few minutes as an unprivileged user.
  • A short README in the deploy directory with the install steps a human follows.

No analytics, and no credentials stored in GitHub: the deploy only ever pulls.

Acceptance criteria

  • The Caddy block passes caddy validate (or caddy adapt), and contains the site, the www redirect and the /install.sh 302.
  • Running the publish script against a local clone and a temporary web root publishes the site, records the commit, and doesn't copy the deploy directory.
  • Running it again with no new commits changes nothing. After a new commit that touches the site, it swaps the site atomically.
  • The systemd units pass systemd-analyze verify.
  • The deploy directory is never served.
  • The deploy README lists the manual install steps.

Blocked by

None (can start immediately)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions