Skip to content

Automate / notify running init_gitea.py #121

Description

@tseaver

Noted in review of work toward #85:

  init_gitea.py is never invoked automatically — it's a manual step you run
  after the stack is up. The generator only references it twice, and neither
  runs it:
  - a comment in DEFAULTS (line 101),
  - the render skip-list (line 512) — the script is copied into the project only
  when include_gitea=True, then left for you to run.

  Where it falls in the end-to-end sequence:

  1. Generate the project (generate_soliplex_project.py). This scaffolds the
  stack and, by default, runs generate_secrets in-process. Gitea is untouched
  here.
  2. docker compose build → docker compose up -d (the generator's printed "Next
  steps"; these mention secrets but not gitea).
  3. Wait until postgres + gitea are healthy (docker compose ps).
  4. Then you run uv run scripts/init_gitea.py yourself — it waits for Gitea,
  creates the admin user (via docker compose exec), mints the token, creates the
  tracking repo, and writes GITEA_HOST / GITEA_ACCESS_TOKEN into .env.
  5. Restart the backend so it picks up the new .env (docker compose up -d
  backend) — the shim's summary prints this reminder.

  Two reasons it must be manual rather than part of generation: it requires a
  running, healthy Gitea container (so it can't happen at scaffold time), and
  it's idempotent (re-running resets the admin password and reuses the repo), so
  it's safe to run whenever the stack is up.

  One gap worth noting: the generator's "Next steps" output doesn't mention step
  4 at all, even when include_gitea=True. The instruction to run it lives only
  in the docs (CLAUDE.md, PARAMETERS.md) and the script's own docstring. If
  you'd like, I could make the generator append uv run scripts/init_gitea.py
  (after up) to the printed next-steps when gitea is enabled — but that's a
  behavior addition beyond #85's scope, so I'll leave it unless you want it.

Since the script is idempotent, ponder the idea of a one-shot compose service which runs each time the stack comes up, after gitea is healthy.

The other option is to remind the user to run the script during the initial setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions