Environment templates
.env.harbour is the only file Harbour templates. Setup resolves its placeholders and renders .env; arbitrary file templating is intentionally out of scope.
Syntax
APP_URL=${APP_URL}
DB_DATABASE=${DB_DATABASE}
Only ${VARIABLE} is supported. Shell defaults and assignments are not interpreted. Every unresolved placeholder raises UNRESOLVED_VARIABLE; it never silently becomes an empty string.
Resolution order
From lowest to highest precedence:
- persisted non-secret workspace values;
- template-referenced values from the pre-Harbour
.env; - template-referenced process environment;
- Harbour identity, namespace, port, URL, and database values;
- project values under
variables; and - resolver classes in their configured order.
This lets Harbour replace APP_URL, DB_DATABASE, prefixes, and allocated ports while retaining project credentials through placeholders.
Static project variables
'variables' => [
'AWS_PROFILE' => 'development',
'LOCAL_API_TOKEN' => [
'value' => env('LOCAL_API_TOKEN'),
'secret' => true,
],
],
Custom resolvers
Classes implementing WorkspaceVariableResolver return ResolvedVariable values and are resolved through Laravel's container:
'resolvers' => [App\Harbour\TenantVariableResolver::class],
Secrets
Explicit secret: true metadata is primary. Conservative credential-name detection is a second defence. Secret values are excluded from persisted state and normal environment output and are redacted from debug output.
workspace:env --show-secrets is an explicit opt-in for process launchers. Table and debug views remain redacted.
Preserving .env
Before rendering, Harbour stores the exact original bytes in a private mode-0600 backup and records checksums. Ordinary teardown stops if the generated .env was edited. Forced teardown archives the modified copy before restoring the original; force does not discard it.