Skip to content

SSH server access

Current source of truth

Ansible phase 2 moved deployment configuration to:

  • main.yml
  • ansible/inventory/group_vars/production/vault.yml.example
  • local gitignored ansible/inventory/group_vars/production/vault.yml

See ANSIBLE.md for the operational workflow.

Use Ansible-backed make targets for normal operations:

make ansible-ping
make ansible-ssh
make ansible-deploy
make ansible-verify

Notes

For deployment, verification, SSH access, and tunnels, the source of truth is the Ansible inventory plus Vault.

The host watchdog's Telegram credentials and Waitcher heartbeat token also come from Vault-backed Ansible vars.

Monitoring

Production runs no metrics stack (lean monitoring phase C, December 2026). The host watchdog (awesome-watchdog.timer) reports container, OOM, disk, memory and backup problems to the owner's Telegram chat; inspect it with systemctl list-timers awesome-watchdog.timer, journalctl -u awesome-watchdog, /usr/local/sbin/awesome-watchdog run --dry-run and /usr/local/sbin/awesome-watchdog diagnose. Waitcher checks the public sites from outside and receives the watchdog's heartbeat, so a dead VPS is noticed too (see docs-site/docs/operations/monitoring.md).

When Waitcher reports a site down:

  1. Check the site from a separate network or phone.
  2. Check docker compose -f docker-compose.server.yml ps and the edge, gateway and backend logs.
  3. Compare the direct http://127.0.0.1 route with the public HTTPS route to isolate application, proxy, DNS and TLS failures.

On the current LXC host provider-level swap is unavailable; treat sustained low MemAvailable (the watchdog reports below 300 MiB) as a memory-exhaustion incident: identify the growing container with docker stats --no-stream, preserve logs, and never stop PostgreSQL or the main backend automatically.

SSH tunnel for the Mailpit UI

The server profile binds the Mailpit UI only to 127.0.0.1 on the VPS; it is not public on the internet.

make ansible-tunnel-mailpit

Then open http://localhost:8025. Stop it with Ctrl-C or make ansible-tunnel-kill-mailpit.

Backend logs on the server

For the deployed server stack in /opt/awesome-localstack, use docker compose on the host.

Open a shell on the server:

make ansible-ssh

Then follow backend logs live:

cd /opt/awesome-localstack
docker compose -f docker-compose.server.yml logs -f backend

Useful variants:

# Last 200 backend log lines, then keep following
docker compose -f docker-compose.server.yml logs --tail=200 -f backend

# Follow gateway logs
docker compose -f docker-compose.server.yml logs --tail=200 -f gateway

# Follow consumer logs
docker compose -f docker-compose.server.yml logs --tail=200 -f consumer

# Show service status
docker compose -f docker-compose.server.yml ps

swapon --show
sysctl vm.swappiness

Fast production checks

Run these on the server:

cd /opt/awesome-localstack

# Backend through gateway
curl -sS http://127.0.0.1/v3/api-docs | jq '.servers'

# Backend direct inside Docker network
docker compose -f docker-compose.server.yml exec gateway curl -sS http://backend:4001/actuator/health

# Mailpit API directly on the VPS loopback
curl -sS http://127.0.0.1:8025/api/v1/messages

Run these from your local machine:

curl -sS https://awesome.byst.re/v3/api-docs | jq '.servers'
curl -i https://awesome.byst.re/mailpit/api/v1/messages

For an authenticated public-safe email visibility check, sign in first and then call:

curl -sS https://awesome.byst.re/api/v1/users/me/email-events \
  -H "Authorization: Bearer <TOKEN>" | jq

Debugging tips

  • If the public domain returns 502, check docker compose -f docker-compose.server.yml ps first. Most often the backend is still starting or was recreated during deploy.
  • If backend is healthy but the public domain still fails, tail both backend and gateway logs together in two terminals. Gateway errors usually show connect() failed (111: Connection refused) when the backend is not ready yet.
  • If nginx config changes do not seem to apply, recreate the gateway container. This repo bind-mounts a single nginx config file, and a plain up -d may leave the old mounted inode in place.
  • If Swagger UI tries http:// instead of https://, inspect https://awesome.byst.re/v3/api-docs and verify .servers[0].url.
  • Public Mailpit routes are intentionally blocked. Inspect Mailpit through the VPS loopback 127.0.0.1:8025 or through the SSH tunnel targets instead.
  • Postgres is intentionally not published on a host port in the server compose. Check it through Docker network access, not by expecting localhost:5432 on the VPS.
  • make ansible-reset-demo-state is destructive for the server Postgres volume. It recreates the bootstrap admin and public product catalog, but it clears orders, email events, and any ad hoc demo users.