Configuration
Secrets Management
Both the GitHub token and database credentials are considered sensitive information. You can manage these secrets using environment variables or .env files for local development. Here’s a unified guide on handling these secrets:
Environment Variables
Set secrets as environment variables directly in your shell or environment configuration. For example:
-
Database Secrets:
DB_HOST: Database hostDB_USER: Database userDB_PASSWORD: User passwordDB_NAME: Database nameDB_SSL: Enable SSL (optional, defaults tofalseif not set).
-
GitHub Token:
GITHUB_TOKEN: Token with at leastrepo:readpermissions (oradmin:readfor enhanced functionality).
Using a .env File
For local development, you can use a .env file to centralize secrets management. The .env file stores environment variables in a key-value format, making them easy to load into your application.
Here’s an example .env file:
DB_HOST=localhost
DB_USER=postgres
DB_PASSWORD=securepassword
DB_NAME=visionboard
DB_SSL=false
GITHUB_TOKEN=your_github_token
Load this file into your application using the following command:
node --env-file=.env visionboard.js workflow run --name <workflowName>
Avoid storing sensitive data like passwords in plaintext .env files in production. Instead, consider using tools like HashiCorp Vault or AWS Secrets Manager for secure management.
Docker Secrets Injection
When using Docker, inject secrets via the -e flag or use a .env file with --env-file. Examples:
-
Injecting manually:
docker run --rm \
-e DB_HOST=localhost \
-e DB_USER=postgres \
-e DB_PASSWORD=securepassword \
-e GITHUB_TOKEN=mytoken \
ghcr.io/openpathfinder/visionboard:latest workflow run --name <workflowName> -
Using a
.envfile:docker run --rm --env-file=.env \
ghcr.io/openpathfinder/visionboard:latest workflow run --name <workflowName>