Commit Graph

4 Commits

Author SHA1 Message Date
octoturge b548dfed3e cli-setup-wizard: explain why SSH/GPG key setup got skipped
The SSH/GPG key-generation question only fires when gh/tea are actually
logged in (DID_GITHUB/DID_GITEA), which is correct - but if login was
declined, failed, or never completed, the section was skipped with zero
explanation. From the user's side that looked like a missing feature
rather than an unfinished login.

Confirmed on a live workspace: gh was never installed, and tea was
installed but `tea login add` never actually completed (no
~/.config/tea/config.yml), so the gate correctly stayed closed - the
user just had no way to know why. Now prints a one-line hint (only when
gh or tea is installed at all) pointing at the login command and the
--force re-run.
2026-08-26 23:58:46 +02:00
octoturge 013567f02a feat: base git/gnupg install + auto SSH/GPG key setup for external git
Provision Coder Templates / provision (push) Successful in 2m11s
- Every template's coder_agent startup script now unconditionally
  installs git and gnupg as base packages (guarded on `command -v`, so
  it's a fast no-op where already present, e.g. templates/web's baked
  image). Not every base image ships gnupg by default.

- cli-setup-wizard.sh (all 6 templates) now tracks whether the user
  actually ended up authenticated against GitHub and/or Gitea via the
  existing gh/tea install-and-login prompts. If at least one succeeded,
  it asks once more whether to auto-generate an SSH key (ed25519) and a
  GPG signing key (ed25519, quick-gen) and register them with whichever
  host(s) are in play - stays completely silent for "local git only"
  (neither gh nor tea set up).

  - GitHub: `gh ssh-key add` / `gh gpg-key add` (official gh CLI
    subcommands).
  - Gitea: direct calls against `/api/v1/user/keys` and
    `/api/v1/user/gpg_keys`, reusing the token `tea login add` already
    stored in tea's config.yml (parsed with a small awk extractor).
  - Either upload failing (already added, API shape mismatch, etc.)
    just prints the manual command/URL and moves on - never blocks the
    rest of the wizard, consistent with every other step's style.
  - git is configured to sign commits with the new key
    (user.signingkey + commit.gpgsign) once a GPG key exists, whether
    freshly generated or already present from a prior run.

README updated to document both additions.
2026-08-26 23:16:25 +02:00
octoturge 0c53bb6554 Add gh/tea to the CLI wizard, drop the JetBrains module from all templates
Provision Coder Templates / provision (push) Successful in 2m7s
- cli-setup-wizard.sh (identical across all 6 templates): add GitHub CLI
  (gh, installed via the official apt repo) and Gitea CLI (tea, official
  binary release to ~/.local/bin) as two more opt-in install-then-login
  prompts, alongside the existing Copilot/Antigravity/Claude Code CLI
  entries. Same pattern: skip if already installed, ask before installing,
  attempt login, never hard-fail the wizard.
- main.tf (all 6 templates): remove the `module "jetbrains"` block - not
  used, dropped per request.
- README.md: update the "Layout" blurb and CLI setup wizard tool list to
  match.
2026-08-26 14:58:51 +02:00
octoturge 22429aa4e3 Make each Coder template self-contained (fix coder templates push failure)
Provision Coder Templates / provision (push) Successful in 2m10s
coder templates push -d templates/<env> only uploads that directory to the
Coder server, so main.tf's file() references reaching outside it via
../../profile-templates and ../../scripts failed at push/apply time
("Invalid function argument ... this function works only with files that
are distributed as part of the configuration source code"). Confirmed via
an actual failed run of coder-templates.yml once the runner network fix let
it get that far.

Fix: duplicate profile.code-profile, cli-setup-wizard.sh, and
install-skills.sh into each templates/<env>/ directory and drop the old
shared scripts/ and profile-templates/ directories.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 16:52:12 +02:00