-
-
Notifications
You must be signed in to change notification settings - Fork 7
TAK Server Configuration via Environment Variables #712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chriselsen
wants to merge
7
commits into
dfpc-coe:main
Choose a base branch
from
TAK-NZ:takserver-config-env
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a66d9e4
to
f6b429c
Compare
…event schema breakage
f6b429c
to
c479e72
Compare
- Test admin creation with CLOUDTAK_ADMIN_USERNAME/PASSWORD - Test skipping admin creation when credentials missing
Added automatic admin user creation when |
- Removing the unused Config import - Removing the unused err parameter in the catch block for the schema validation test
chriselsen
referenced
this pull request
in TAK-NZ/CloudTAK
Jul 4, 2025
- Merge server environment variable configuration from upstream PR #712 - Add Lambda-based Authentik user creation during CDK deployment - Fix ECS service dependencies to wait for database readiness - Fix events Lambda TAK_ETL_API URL to include https:// protocol - Add ECR permissions for coe-ecr-etl repository access - Update branding script to replace CloudTAKLogo.svg with TAK.NZ logo - Create separate AuthentikUserCreator construct with retry logic
chriselsen
referenced
this pull request
in TAK-NZ/CloudTAK
Jul 4, 2025
- Re-apply server environment variable configuration from upstream PR #712 - Add admin user creation via CLOUDTAK_ADMIN_USERNAME/PASSWORD - Add ECR_TASKS_REPOSITORY_NAME and ECS_CLUSTER_PREFIX for PR #717 - Restore comprehensive test coverage for environment variable features - Fix server configuration to prevent /configure endpoint from showing
chriselsen
referenced
this pull request
in TAK-NZ/CloudTAK
Jul 4, 2025
- Re-apply server environment variable configuration from upstream PR #712 - Add admin user creation via CLOUDTAK_ADMIN_USERNAME/PASSWORD - Add ECR_TASKS_REPOSITORY_NAME and ECS_CLUSTER_PREFIX for PR #717 - Restore comprehensive test coverage for environment variable features - Fix server configuration to prevent /configure endpoint from showing
Works with CDK deployed CloudTAK layer.
Updated tests for working config.ts version
Updated documentation
Summary of ChangesKey additions to the original PR:
Testing status: ✅ Successfully tested and deployed - All functionality has been validated in a live deployment environment, confirming automated server configuration, admin user creation, and secrets manager access work correctly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #710
Problem
CloudTAK has a chicken-and-egg configuration problem for automated deployments:
/api/server
PATCH endpoint requires a bearer token for configurationSolution
Add support for TAK server configuration via environment variables during CloudTAK startup, bypassing the authentication requirement.
New Environment Variables
CLOUDTAK_Server_name
CLOUDTAK_Server_url
ssl://tak.example.com:8089
)CLOUDTAK_Server_api
https://tak.example.com:8443
)CLOUDTAK_Server_webtak
CLOUDTAK_Server_auth_cert
CLOUDTAK_Server_auth_key
CLOUDTAK_Server_auth_p12_secret_arn
CLOUDTAK_Server_auth_password
CLOUDTAK_ADMIN_USERNAME
CLOUDTAK_ADMIN_PASSWORD
Implementation
api/lib/config.ts
: Added server environment variable processing during startupdocs/ENVIRONMENT_VARIABLES.md
CLOUDTAK_
prefix consistent with other configuration variablesBenefits
✅ Enables automated deployment - No manual web UI configuration required
✅ Maintains security - Certificates injected via secure environment variables or AWS Secrets Manager
✅ Backward compatible - Existing functionality unchanged
✅ Container-friendly - Perfect for Docker/Kubernetes deployments
✅ Admin user automation - Automatically creates admin users with system privileges
✅ AWS integration - Supports P12 certificates from AWS Secrets Manager
Usage Example