Skip to content

v0.2.0: Project CRUD, Docker Stack, and instance→server rename#7

Merged
theolujay merged 8 commits into
mainfrom
refactor/deployments
Jun 23, 2026
Merged

v0.2.0: Project CRUD, Docker Stack, and instance→server rename#7
theolujay merged 8 commits into
mainfrom
refactor/deployments

Conversation

@theolujay

Copy link
Copy Markdown
Owner

Added

  • Project management — create, list, update, and delete projects via API. Each deployment now belongs to a project. If you start a deploy for a project that doesn't exist yet, it's created automatically.
  • New API endpoints — check a deployment's status, stop or restart it.
  • Docker Stack — services now run in Swarm mode with health checks, resource limits, and automatic rollbacks if something goes wrong. Separate stacks for app and database.
  • appa server — all server commands (init, setup, preflight, apply, status, logs, restart, upgrade) are now grouped under appa server instead of sitting at the top level.
  • Project commandsappa project logs (live log viewer), stop, restart, env.
  • Spinner mode — commands show a brief spinner by default. Add --verbose or -v to see full Ansible output.
  • Non-interactive preflight--no-tty flag lets you run preflight checks without prompts.
  • Custom API port--port flag on appa server set-host for setups like Vagrant that forward a non-standard port.
  • CI/CD — automatically builds and pushes API and UI images on every push to main.
  • Deploy secretsappa deploy now prompts for environment variables interactively.
  • Configuration improvements — renaming a config file also renames its folder. Ansible now uses a separate SSH key when configured.

Changed

  • instanceserver — this is the big rename. Every command, config file, folder, and internal name now says "server" instead of "instance" (appa instance * becomes appa server *). Configs that were in ~/.appa/instances/ are now in ~/.appa/servers/.
  • base_api_urlapi_base_url — the config field has a new name.
  • Docker Compose → Docker Stack — the old docker compose up -d approach is replaced by docker stack deploy (Swarm mode). If an old Compose stack is running, it's detected and stopped automatically.
  • Ansible roles — roles are re-extracted every run so stale playbooks aren't a problem. The Docker role was upgraded to fix a handler naming bug.
  • Vagrant — port forwarding added (access the server at localhost:8080 instead of the default port).
  • CLI styling — terminal output has a fresh look with dark-theme colors (Dracula palette).
  • Installer — now automatically installs uv and Ansible in a managed virtual environment.
  • API route change — the cancel endpoint moved from PATCH /v1/deployments/:id to PUT /v1/deployments/:id/stop.

Removed

  • Old migration and dead code (getPort, renderHeader, renderSummary, logViewerTitle, verbose error messages).
  • Old Docker Compose templates (no longer needed).
  • appa instance * command file (replaced by appa server *).

Fixed

  • A bug where DeploymentModel.Create() reported an error even on success.
  • Ansible password generation failing when the shell had pipefail set.
  • Docker role handler name mismatch (Apt updateapt update).

Breaking

  • appa instance * commands no longer work — use appa server * instead.
  • Config moved~/.appa/instances/~/.appa/servers/. You'll need to move configs manually or recreate them.
  • Config field renamedbase_api_urlapi_base_url in your TOML files.
  • Cancel endpoint changedPATCH /v1/deployments/:idPUT /v1/deployments/:id/stop.
  • Docker Compose configs are replaced — the old compose.yml is detected and stopped, replaced by Docker Stack.

- Add project_name to deployments table and wire through API/CLI
- Implement `project logs`, `project stop`, `project restart` with WebSocket TUI
- Rename `instance list` → `instance ls`, add dimmed row styling for pending instances
- Add interactive prompts (huh) for instance init, set-host, and project init/edit
- Move preflight/setup/apply/status/logs/restart/upgrade under `instance` subcommand
- Overhaul CLI output with lipgloss styling and table rendering
- Replace cancelDeploymentHandler with stop + restart handlers
- Pass project_name in deploy POST body
…eation, and instance→server rename

- Add full projects CRUD (Gett/POST /v1/projects, GET/PUT/DELETE /v1/projects/:id)
- Auto-create projects on deploy & upload when project_name is provided
- Replace project_name string on deployments with project_id FK to projects table
- Refactor deployments model: ProjectName → ProjectID, GetAllForUser uses int64 filter
- Add shared isUniqueViolation helper; deduplicate pq error handling from users.go
- Add ErrDuplicateProject and pqProjectsNameKey to models.go
- Replace migration 000006 (add_project_name) with 000006 (create_projects_table) + 000007 (add_project_id)
- Rename CLI instance→server throughout: InstanceConfig→ServerConfig, InstanceCmd→ServerCmd, etc.
- Rename config directory from instances/ to servers/
- Add rename-on-edit support for server and project configs
- Auto-provision Ansible via uv venv (ensureVenv/installUV) instead of requiring system install
- Include SSHIdentityFile in Ansible inventory template
- Always re-extract embedded Ansible assets (remove marker check)
- Pass --no-tty to preflight during setup for non-interactive CI runs
- Add runChecksPlain for non-TUI preflight output
- Switch Ansible extra vars from vcs.Version() to vcs.DockerTag() (+→-)
- Restructure deploy_user and operator_user ansible vars with groups, sudo, ssh_authorized_keys
- Add apiClient.ensureProject() helper; deploy sends project_id alongside project_name
- Install uv + Ansible in installer script (install.sh)
- Fix typo: connetion→connection
…ndency updates

- Swap Docker Compose → Docker Stack in the Ansible deploy playbook
- Split compose.yml into stack.data.yml (PostgreSQL, appa_data stack)
  and stack.base.yml (API/BuildKit/Caddy/UI, appa stack)
- Initialize Docker Swarm; detect and clean up legacy Compose
- Add resource limits, health checks, start-first update with rollback,
  and host-mode port publishing
- Add CI build workflow (push API + UI images to GHCR on main)
- Pin release workflow to ubuntu-24.04; enable BuildKit zstd compression
- Add ansible-dev-tools to dev dependencies; update uv.lock
- Add Vagrant port forwarding for local testing
- Refresh installer colors to match Go TUI palette
style: resolve lint issues and reformat files
refactor: rename  BaseAPIURL→APIBaseURL
chore: remove unused code
- Rename ServerConfig.BaseAPIURL→APIBaseURL (TOML field renamed)
- Add APIPort field + --port flag on server set-host; extract apiBaseURL() helper
- Fix --host flag on server init (StringVarP→StringVar, avoids -h conflict)
- Remove unused: errAnsibleMissing verbose message, logViewerTitle, renderHeader,
  renderSummary(), getPort(), trailing newlines; fix style chaining & indent
@theolujay
theolujay merged commit 6da837a into main Jun 23, 2026
1 check failed
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