Skip to Content
LYNKORIADocs

Step 1: Workstation

Install the tools, validate the checkout and the OpenTofu code offline, and make sure the container registry can hold Lynkoria's images.

Goal: a machine with the tools from prerequisites, a checkout where the code and the OpenTofu stacks pass their checks, and a container registry ready for two more repositories.

Use a private workstation. Do not turn on shell tracing (set -x) while handling secrets.

1.1 Clone and validate the code

git clone YOUR_REPOSITORY_URL lynkoria
cd lynkoria
pnpm install --frozen-lockfile
pnpm infra:validate
pnpm build

pnpm infra:validate runs the infrastructure tests in scripts/*.test.mjs, checks the shell scripts and validates the local Compose file.

1.2 Check the OpenTofu code offline

tofu version
cat infra/opentofu/.opentofu-version
pnpm infra:tofu

pnpm infra:tofu (scripts/tofu-check.sh) checks formatting, validates both stacks and runs infra/opentofu/platform/tests/plan.tftest.hcl. That test plans the whole platform against mocked providers and checks, for example, that the migration job uses the migration role, that LiveKit cannot auto-create rooms and that SSH, metrics and the scanner are never public. It needs no credentials; the first run downloads the providers.

The full application check (pnpm check) also needs the local services; see run locally. CI runs everything on every push.

1.3 Container registry: reuse or create

Log in to doctl (doctl auth init asks for a DigitalOcean token; you create a long-lived one in step 2, a short-lived personal one is fine here), then check the registry:

doctl registry get
doctl registry repository list-v2

If a registry is listed, reuse it. Lynkoria's images go into their own repositories inside it (lynkoria-api and lynkoria-scanner). Its name becomes the DOCR_REGISTRY variable in step 4. doctl registry create fails with 422 Unprocessable Entity: invalid subscription plan on an account that already has a registry. Check two things:

  • Repository limit. Plans cap the number of repositories (doctl registry options subscription-tiers: Starter 1, Basic 5, Professional unlimited). Lynkoria adds two. Upgrade the plan in Container Registry → Settings if needed.
  • Region. sgp1 is best because App Platform in Singapore pulls from it. Another region still works; pulls are slower.

If no registry exists, create one in Singapore:

doctl registry create YOUR_REGISTRY_NAME --region sgp1 --subscription-tier basic

The registry is not managed by OpenTofu on purpose: it is account-wide and may hold other products' images.

Verify

pnpm infra:validate and pnpm infra:tofu pass, and doctl registry get shows the registry you will use.

Next: Step 2: Bootstrap.

On this page