Oblive Docs

EC2 deployment with deploblive

Independent deployment console, security boundaries, lifecycle operations, and recovery contracts.

deploblive is the separately versioned operator app in apps/deploblive. It packages its TypeScript CLI/TUI and compiled Linux x64 host helper independently of Oblive. It uses Bun 1.3.14+, while the application remains on Bun 1.2.22. Start it from the repository with bun run deploy, or install the separately published private GitHub npm package @talkshopclub/deploblive once released. The command remains deploblive. Configure the @talkshopclub scope for https://npm.pkg.github.com and authenticate with a GitHub classic token with read:packages and repository access. Package tags publish using GITHUB_TOKEN and repository-linked access; no public npm registry token is needed.

This implementation has local contract, infrastructure-template, runtime and renderer checks. Real AWS deployment and restoration acceptance is a release gate, not a result established by those checks. Consult the app README for the full command/configuration reference and current verification limits.

Default and automated deployment

deploblive --default selects noninteractive creation with managed services, Medium EC2, 400 GiB data, two workers, a new VPC, Cloudflare DNS, automatic Codex auth, Clerk staff access, SSM SSH and hourly backups retained for 30 days. Hostnames default to <deployment-name>.oblive.dev; --hostname or config can override them. Pass deployment name, pinned release, SSH public-key file and notification email through flags or --config. Set DEPLOBLIVE_DNS_ZONE_ID to the oblive.dev Cloudflare zone ID or supply --dns-zone-id. Explicit flags override config, which overrides defaults. Region falls back through AWS_REGION, AWS_DEFAULT_REGION and us-east-1. Disk/workers follow the selected preset when omitted. --print-config validates and prints the nonsecret spec without AWS access. Ordinary configuration and interactive creation retain their existing device-login default.

The Deploy Oblive workflow (.github/workflows/deploy-oblive.yaml) is dispatched manually from main. Its form overrides deployment name, region, EC2 preset, storage mode, workers, disk size, automated DNS provider/zone, alert recipient and managed database/cache classes. The workflow defaults to Cloudflare DNS and codex_auth: auto: use an optional API key when supplied, otherwise deploy with a warning and agent execution disabled. Choices api-key, device and browser override automatic selection. Explicit API-key mode still requires a key. Supply exactly one of subdomain or full hostname. staging produces https://staging.oblive.dev in the default zone, independently of the deployment name. Subdomains use one DNS label; full names must belong to DEPLOBLIVE_DNS_ZONE_NAME (the Environment variable defaults to oblive.dev). Names are trimmed and lowercased. Optional callback_hostname defaults to the application host. A separate host exposes only /oauth/google/callback and /oauth/mcp/callback; all other paths return 404. Both hostnames and DNS ownership are durable, including during lifecycle operations. Route 53 remains an explicit provider override. The interactive wizard also defaults to Cloudflare and derives the hostname when left blank. Clerk, SSM-only SSH, encrypted storage and hourly/30-day recovery remain required.

The selected GitHub Environment (default deploblive) supplies variables AWS_ACCOUNT_ID, AWS_DEPLOY_ROLE_ARN, DEPLOBLIVE_SSH_PUBLIC_KEYS, DEPLOBLIVE_DNS_ZONE_ID and DEPLOBLIVE_NOTIFICATION_EMAIL, plus optional DEPLOBLIVE_DNS_ZONE_NAME. Use the Cloudflare zone ID for that zone in DEPLOBLIVE_DNS_ZONE_ID. Add CLOUDFLARE_API_DNS_TOKEN as a repository or selected Environment Actions secret, using this token configuration:

SettingValue
PermissionZone → DNS → Edit (DNS Write in the API)
Zone resourcesInclude → Specific zone → oblive.dev

DNS Edit includes create, read, update, delete and list access. No separate DNS Read, Zone Read or account permissions are needed: deploblive calls DNS record endpoints using the supplied zone ID. See Cloudflare’s token setup and DNS API permissions. The workflow reads ${{ secrets.CLOUDFLARE_API_DNS_TOKEN }}; the token is never a dispatch input or generated config field. Add DEPLOBLIVE_SECRETS and optionally OPENAI_API_KEY (or openaiApiKey inside the secret JSON) as Actions secrets too. External mode additionally requires existing-service credentials in that JSON.

Alerts use Amazon SNS, with CloudWatch alarms for readiness, disk/memory usage, backup age and operation failures. Set DEPLOBLIVE_NOTIFICATION_EMAIL to one or more email addresses, separated by commas or newlines. The dispatch notification_email override and CLI --notification-email accept the same format; use commas in the wizard. The configuration field notificationEmail also accepts JSON arrays, while existing single-address strings remain valid. Resolved specifications store trimmed, deduplicated, sorted arrays and reject invalid recipients. Each recipient gets a separate SNS subscription and must confirm the AWS email before receiving alerts. Status checks every subscription page and reports whether any confirmation is pending. No SMTP credentials or additional email-service secret are needed. See AWS email subscription confirmation.

AWS OIDC trust must match the repository and selected Environment, with audience sts.amazonaws.com; restrict Environment deployment branches to main. The IAM role needs the documented deployment permissions and a four-hour maximum session duration. The job requests four hours of credentials with a three-hour execution limit. Input/secret validation precedes AWS authentication. Secrets never become dispatch inputs, generated config or artifacts.

Runs for the same name/region are serialized without cancelling an active run. The workflow publishes a verified HTTPS URL, SSH command and backup age only after recovery verification. Without Codex credentials, installation, Cloudflare DNS, HTTPS checks and the existing recovery gate still run. The result includes codex.configured: false, codex.executionEnabled: false, a warning and the verified URL once recovery succeeds. Chat sends, retries and claims return 503 codex_auth_required before creating pending work; ordinary application access remains available.

Add credentials later from an authorized computer with AWS credentials, the Session Manager plugin and an authorized SSH key:

deploblive auth production --region us-east-1 --login device --identity ~/.ssh/id_ed25519

Enable device login in the intended ChatGPT account/workspace, or use --login browser for the SSH-forwarded callback. Successful authentication enables execution without rebuilding infrastructure or repeating deployment. “Configured” means credentials are installed, not that a model request has succeeded.

For unattended seeding, optionally set DEPLOBLIVE_CODEX_AUTH_JSON as a GitHub Environment secret containing the complete file-backed auth.json. It is validated, stored in Secrets Manager and materialized in restricted runtime files. Keyring-backed credentials require device/browser login or an explicitly created file-backed login. Never commit credentials or include them in dispatch inputs, logs or artifacts. See Codex authentication.

Automatic selection prefers an API key, then imported/existing credentials, otherwise disabled execution. Reruns preserve the existing authentication mode and newer host credentials; explicit credential replacement uses deploblive auth. Missing explicitly selected API keys and malformed supplied JSON are errors. Interactive login never runs in GitHub Actions.

The portable executionEnabled setting defaults to true; Deploblive derives it from credential availability. Disabled stacks exclude agent/auth-sync services, initialize their persistent volumes and set backend OBLIVE_EXECUTION_ENABLED=false. That gate is independent of maintenance and recovery. Initial backup, restore verification and hourly scheduling are unchanged. The first compatible release requires new application images and the optional-codex-auth-v1 capability.

Repeat unchanged workflow inputs to resume interrupted provisioning. Cancelling a runner does not cancel submitted AWS work. This workflow builds from the repository and remains separate from package publication.

Ownership and security

CloudFormation owns separate foundation, data and compute stacks. SSM stores nonsecret configuration and operation references; Secrets Manager stores application secrets; a private versioned recovery bucket stores locks and complete manifests. Management from another authorized computer uses the deployment name, account and region. Local drafts and SSH configuration are replaceable. No Pulumi account or indispensable local state file is required.

The host is an On-Demand Ubuntu 24.04 x86-64 instance with separate encrypted OS and persistent data disks. Small starts at m7i.large, 8 GiB RAM and 200 GiB data; Medium, Large and Extra Large provide 16/32/64 GiB RAM and 400/800/1,600 GiB data. Worker defaults are 1/2/4/8 and are bounded resource budgets, not throughput promises. Installation, Docker volumes, workspaces, Codex and certificate state live on the persistent disk.

Host bootstrap installs pinned AWS CLI 2.41.0 from AWS’s official x86-64 archive and checks its recorded SHA-256 before extraction. The archive’s AWS CLI Team signature was verified when the checksum was pinned. Ubuntu’s package repositories are not used for awscli; the CLI fetches the deployment helper and supports SSH access changes. Download or integrity failures stop setup and clean up temporary files.

Only 80/443 are public. Caddy serves HTTPS through the Clerk-protected frontend and proxies only /oauth/google/callback and /oauth/mcp/callback directly to the backend. The verified @skyfall.ai access policy remains mandatory. DNS automation requires exact ownership, uses Cloudflare DNS-only records or Route 53, and rejects unrelated records. Manual DNS is resumable.

SSH uses OpenSSH through SSM; public port 22 remains closed. The local private key stays local, the host key is retrieved over authenticated SSM and pinned, password/root login and agent forwarding are disabled. Connection metadata can be audited, but SSM cannot record encrypted SSH command transcripts. Native SSM shell access is also available.

Add or revoke an operator after deployment

deploblive access --region us-east-1 opens a separate menu with a live deployment picker. From the app workspace, the equivalent script is bun run access --region us-east-1. The recipient supplies an Ed25519 or RSA (3072–8192 bit) public key; their private key stays local. RSA authentication uses SHA-2 signatures; legacy SHA-1 remains disabled. Key validation rejects undersized or malformed keys and authorized_keys options. Use -i ~/.ssh/id_rsa with the generated SSH configuration when that is the matching private key. This grants host administrator access as oblive with passwordless sudo, independently of Clerk application access.

deploblive access grant production --region us-east-1 --public-key-file person.pub --output-dir ./person-access
deploblive access grant --all --region us-east-1 --public-key-file person.pub --output-dir ./fleet-access
deploblive access list --all --region us-east-1 --json
deploblive access revoke production --region us-east-1 --public-key-file person.pub

Revocation also accepts --fingerprint SHA256:... instead of a public-key file. Existing keys are preserved, duplicate key material is ignored, the limit is 20 distinct keys and the last key cannot be removed. --all means current deploblive deployments in the selected account/region, excluding unrelated EC2 instances. Future deployments still use DEPLOBLIVE_SSH_PUBLIC_KEYS; update that variable separately when appropriate. --expected-account enforces an account ID.

Key changes persist in AWS and atomically update the host under the deployment and lifecycle locks, without restarting applications or changing application secrets. Stopped/offline hosts fail individually without changing keys; start them and repeat. Partial batches return a nonzero exit code and retain successful targets. Interrupted access operations must be reconciled by repeating the access command before other lifecycle work. Submitted SSM operations may continue after cancellation. Listing reports configured fingerprints and operation status, not a live login test. Lifecycle configurations must retain the current SSH key list; auth handles application credentials, and key changes use access.

AWS IAM must allow ssm:GetParametersByPath on the parent resource arn:aws:ssm:REGION:ACCOUNT:parameter/deploblive for discovery. Allowing only the child pattern parameter/deploblive/* is insufficient. Add this scoped read permission to the deployment role’s permissions in AWS IAM, preserving its existing policies and OIDC trust. It is not a GitHub setting.

Grant bundles contain ssh.conf, a host key retrieved through authenticated SSM, a narrowly scoped iam-policy.json and connection instructions. Share them through a trusted channel. Existing bundle directories are not overwritten. An AWS administrator separately assigns the included policy to the recipient’s dedicated role or SSO permission set; the tool does not create identities or attach IAM permissions. The policy scopes SSH access to the exact instance and session ownership, without Run Command, deployment APIs or a native SSM shell. Existing broader permissions still apply. The recipient needs AWS CLI, the Session Manager plugin, their own AWS authentication and their private key. From the bundle directory:

AWS_PROFILE=person ssh -F ./ssh.conf -i ~/.ssh/id_ed25519 deploblive-production

The operator-facing deploblive ssh additionally needs discovery/Run Command privileges; recipients use ordinary SSH/SCP with the bundle. Replacement instances need a new pin and IAM policy. See AWS SSH-over-SSM setup. For offboarding, also revoke AWS permissions and terminate existing sessions. Key removal only blocks new SSH authentications. Operators share an administrative OS account; SSM does not log the encrypted SSH command contents.

The Manage Oblive access GitHub workflow (.github/workflows/oblive-access.yaml) runs on main. Choose an Environment, action, region and existing deployment name, or * for all current deployments. Paste one public key for grant; revoke accepts a public key or fingerprint; list accepts neither. The workflow uses the existing AWS_ACCOUNT_ID and AWS_DEPLOY_ROLE_ARN variables and OIDC with the deployment operator permissions. No new Actions secrets, Cloudflare token or private key are needed. Each target’s outcome appears in the summary; nonsecret connection bundles/results are downloadable for seven days. The local menu provides live selection; GitHub dispatch takes a name. Recipient IAM assignment remains separate. Local tests cover the access contracts and host installer; live AWS connection and recipient-role IAM acceptance require a separate authorized smoke run. Deploblive workflows use bun run check:ci, which omits TUI renderer tests while retaining typecheck, lint and non-UI tests. Run bun run test:ui or the full bun run check locally for renderer coverage. Browser journeys also run locally; CI retains frontend build, asset, unit and integration checks.

AWS credentials use profiles, SSO/login sessions, environment/session credentials and configured roles, or masked process-local TUI input. Deployment and Cloudflare credentials never reach EC2. Codex supports API keys, device login, browser login forwarded through SSH, and selected file-backed auth.json import. The existing deployment-scoped synchronizer and isolated Codex volume remain authoritative for agent authentication.

Data configuration

Choose one fixed storage mode:

  • local: PostgreSQL, Redis and Garage volumes on EC2.
  • external: dedicated supplied PostgreSQL, nonclustered Redis/Valkey and versioned S3-compatible targets. An existing compatible VPC/subnet may be selected without modifying borrowed routes.
  • managed (default): PostgreSQL 17, Valkey 8 and a private encrypted versioned S3 bucket. The workflow’s managed_profile: minimal uses db.t4g.micro, Single-AZ, encrypted 20 GiB gp3 and one cache.t4g.micro without a replica. Maintenance/failure downtime is accepted. high-availability uses the previous db.m7g.large, Multi-AZ, 200 GiB and primary/replica cache.m7g.large settings. Class overrides remain independent of profile storage/redundancy. Both retain TLS, private networking, encryption, RDS deletion protection, 1 TiB storage autoscaling and existing retention. Supported PostgreSQL 17/Valkey 8 versions are resolved during preflight and recorded. EC2 resizing does not resize data services.

The minimal PostgreSQL instance has 1 GiB RAM; validate sustained database memory and recovery events for migrated workloads, not only an HTTP smoke check. The database_class override accepts db.t4g.small (2 GiB) and db.t4g.medium (4 GiB) without changing profile storage or redundancy. Changing an existing database class needs an explicitly reviewed infrastructure update and restart downtime. Routine workflow reruns do not silently resize saved deployments.

Older saved JSON without databaseStorageGiB, databaseMultiAz or cacheReplicas retains 200 GiB, Multi-AZ and one replica. CLI/config defaults also remain compatible. Repeat legacy workflow deployments with high-availability; differing inputs fail rather than resizing data. External PostgreSQL application/migration URLs, Redis and S3 settings stay in the Environment’s DEPLOBLIVE_SECRETS.external. Occupied databases, caches and buckets are rejected for creation. The workflow provisions fresh installations; it does not import or adopt business data. See the one-off Socialkit migration procedure for cross-architecture transfer and its separate acceptance gates.

The portable stack generator accepts optional services.database, services.redis, and services.objectStore configuration. It emits a matching service overlay that disables bundled services, resets migration dependencies and mounts only the appropriate certificate/credential files. Database URLs require sslmode=verify-full, Redis requires rediss://, and external object endpoints require HTTPS. Application and migration database credentials are separate; optional postgres.application provides that separation for bundled PostgreSQL too.

Managed S3 access uses a host helper that assumes a scoped data role and atomically refreshes a read-only credential directory. OBJECT_STORE_CREDENTIALS_FILE makes the object-store boundary reload credentials before operations, including previously created file handles. Expired or unreadable credentials fail closed; presigned URLs cannot outlive the credentials. Containers cannot reach IMDS or access the Docker socket, operator keys or deployment secrets.

The first compatible release must update application images as well as the portable bundle. The deploblive.json release sidecar declares protocol/capabilities; incompatible releases fail before provisioning. Bundle-only releases cannot introduce missing application capabilities.

Operations and recovery

The TUI and headless commands share the same engine. JSON results exclude credentials and separate infrastructure, application and recovery-verified readiness. status combines capacity, installed release, disk/memory usage, backup age, pending operation and notification confirmation. doctor adds AWS, ingress and DNS diagnostics. Costs are a compute subtotal with explicit additional storage, IP, snapshot, request, log and transfer charges.

One durable deployment lock and one host lifecycle lock serialize mutations. Interrupted operations preserve resources and expose their stage; closing a terminal stops new scheduling, not already submitted AWS work. Resumption checks active CloudFormation/SSM/host operations before reclaiming a failed lock. Rollback states require explicit CloudFormation repair.

Updates stage a checked release, drain work, capture recovery, migrate, restart and verify. Failed migrations never trigger an image-only downgrade. Resizes preserve disk/AZ/IP, permit only disk growth, and reject resource replacement. Stop/start is graceful; retained resources and managed services can continue billing. Ordinary auth edits cannot change data endpoints or integration-encryption material. No new backend API or agent-facing oblivectl command is added.

Hourly recovery reuses the maintenance lease, conditional dispatch-pause ownership and inactive recovery contracts. Local capture stops data services and snapshots a frozen filesystem with an independent thaw watchdog. Managed/external capture coordinates an exported PostgreSQL snapshot, exact S3 versions, independent object copies and workspace EBS. Publication waits for every artifact to complete. Completed points have 30-day retention; the latest valid point and points pinned by restores remain protected. Failed captures never count as a successful hourly backup; backup age alarms start after 75 minutes.

Restore creates a separate inactive deployment at the captured release. Cloned Docker restart metadata is removed before Docker starts; workers, schedules, public ingress and migrations stay disabled. Database reads, object integrity, keys and workspace volumes are checked. Activation stops and fences the source before target execution or DNS cutover. Fresh-cache reconciliation and prevention of duplicate external effects require real integration acceptance before release. The existing portable backup format remains supported separately.

Ordinary destroy --confirm NAME removes compute and retains recoverable resources. A separate destroy --purge-data previews owned resources; --confirm purge:NAME irreversibly removes owned data and recovery points after compute removal, and schedules KMS deletion. Borrowed data services are excluded. Active restore pins block purge, and owned DNS must be removed before the IP is released. Purge changes explicit retention policies and RDS deletion protection while preserving networking resources that already delete normally. CloudFormation replacement checks remain enabled.

The Remove Oblive deployment Actions workflow defaults to a read-only preview of one named deployment. Review its resource inventory artifact, then select purge with the exact purge:NAME confirmation to remove compute followed by owned data. It reuses AWS OIDC and the existing CLOUDFLARE_API_DNS_TOKEN Actions secret for matching owned DNS. An interrupted purge can be resumed with the same selection. The workflow shares the deployment concurrency group and retains nonsecret inventory/results for seven days; it never accepts a wildcard target.

This version supports one host with maintenance downtime. Existing-machine adoption, horizontal scaling, cross-region recovery and implicit storage-mode migrations are outside the contract.

Verification evidence

The 2026-11-19 managed deployment of v0.0.59 and its unchanged rerun succeeded without Codex credentials. Live checks verified Cloudflare DNS, HTTPS login redirection, SSM SSH/SCP with public SSH closed, disabled agent execution with 503 codex_auth_required, and the unchanged initial-backup, isolated-restore-verification and scheduling gate. CLI and Actions results included the authentication warning and later-login command while reporting recovery readiness. The access workflow applied and verified an additional public key. Graceful stop/start preserved HTTPS, SSH/SCP and disabled execution; the same work-endpoint rejection checks passed after restart. The cleanup run records teardown. The existing Actions IAM deny on ec2:DisassociateAddress required a scoped local retry of compute deletion before resuming purge; IAM and backup/cleanup code were unchanged.

These results cover the credential-free AWS-managed path. Credentialed model execution, live reauthentication paths and the other storage modes still require their own acceptance evidence.