The image includes a Worker configuration with safe defaults such as the service port, Kubernetes context name, and allowed GitHub roles. Use it as the starting point for a portable deployment configuration.
worker.yaml uses the standard UDX Worker configuration format.
The Worker handles generic configuration: config.env provides defaults,
deployment environment variables take precedence, and config.secrets can
refer to runtime-resolved secrets. This document covers only docker-sftp
settings.
For example, this image's built-in configuration supplies service defaults:
config:
env:
NODE_PORT: "8080"
ALLOW_SSH_ACCESS_ROLES: "admin,maintain,write"Copy the default file, change the settings for the deployment, and mount that same file wherever the image runs:
cp etc/configs/worker/worker.yaml ./worker.yaml
# Edit ./worker.yaml, then mount it at the Worker configuration path.
docker run -d \
--volume "$PWD/worker.yaml:/home/udx/.config/worker/worker.yaml:ro" \
usabilitydynamics/docker-sftp:latestIn Kubernetes, mount the file from a ConfigMap at
/home/udx/.config/worker/worker.yaml. Deployment environment variables still
override its config.env values, so secrets and per-environment values can stay
in Kubernetes Secrets or the deployment system.
For custom worker.yaml files, secret references, mount locations, and
precedence, use the Worker configuration reference.
Configuration is applied in this order:
- The Worker reads
$HOME/.config/worker/worker.yaml: the image default unless a deployment mounts its own file there. - Deployment environment variables override
config.envvalues. - Secrets such as
ACCESS_TOKENare injected by Docker, Kubernetes Secrets, or the deployment system.
Mounting worker.yaml is optional: deployments can use the image defaults and
set only environment overrides. Change
etc/configs/worker/worker.yaml and rebuild
only when the image's defaults should change for every deployment. Never store
credentials in that file or in deployment manifests.
For a local Docker run, export the required secrets and cluster values in your
host shell, then pass their names to docker run:
docker run -d \
--name sftp-gateway \
-p 2222:22 \
--env ACCESS_TOKEN \
--env KUBERNETES_CLUSTER_ENDPOINT \
--env KUBERNETES_CLUSTER_USER_TOKEN \
usabilitydynamics/docker-sftp:latestVariables for connecting to your Kubernetes cluster:
| Variable | Description | Required | Default |
|---|---|---|---|
KUBERNETES_CLUSTER_ENDPOINT |
API server address (e.g. https://your-cluster) | Yes | - |
KUBERNETES_CLUSTER_USER_TOKEN |
Service account token for authentication | Yes | - |
KUBERNETES_CLUSTER_NAME |
Name for kubectl cluster context | No | default |
KUBERNETES_CLUSTER_SERVICEACCOUNT |
Service account name for kubectl config | No | "default" |
See Deployment Guide for instructions on setting up service accounts and getting credentials.
| Variable | Description | Required | Default |
|---|---|---|---|
ACCESS_TOKEN |
GitHub access token | Yes | - |
ALLOW_SSH_ACCESS_ROLES |
Allowed GitHub roles | No | admin,maintain,write |
The system uses Firebase Realtime Database to maintain container state and enable real-time tracking. This allows for:
- Automatic cleanup of terminated containers
- Real-time state synchronization
- Container lifecycle management
The Firebase consumer is configured with a service-account JSON file. The
legacy server-side Firebase paths also read the individual FIREBASE_* service
account values below, so provide those values when SERVICE_ENABLE_FIREBASE=true.
| Variable | Description | Firebase consumer | Legacy server state¹ |
|---|---|---|---|
GOOGLE_APPLICATION_CREDENTIALS |
Path to service account JSON file downloaded from Firebase console | Required | - |
FIREBASE_DATABASE_URL |
Firebase Realtime Database URL (e.g. https://your-db.firebaseio.com) | Required | Required |
FIREBASE_PROJECT_ID |
Firebase service-account project ID | - | Required |
FIREBASE_PRIVATE_KEY |
Firebase service-account private key | - | Required |
FIREBASE_CLIENT_EMAIL |
Firebase service-account email | - | Required |
FIREBASE_PRIVATE_KEY_ID |
Firebase service-account private-key ID | - | Optional |
FIREBASE_CLIENT_ID |
Firebase service-account client ID | - | Optional |
FIREBASE_CLIENT_CERT_URL |
Firebase service-account client certificate URL | - | Optional |
¹ The legacy server state path is enabled with SERVICE_ENABLE_FIREBASE=true.
- Go to Firebase Console > Project Settings > Service Accounts
- Click "Generate New Private Key" to download the JSON file
- Set
GOOGLE_APPLICATION_CREDENTIALSto the path of this file - Set
FIREBASE_DATABASE_URLto your database URL
The service maintains the following collections:
{
"deployment": {
"[pod-id]": {
"status": "active|terminated",
"lastSeen": "timestamp",
"metadata": {
"namespace": "string",
"name": "string"
}
}
}
}See Architecture Details for more information about state management.
| Variable | Description | Required |
|---|---|---|
NODE_PORT |
API server port (default: 8080) | No |
SSH_KEY_REFRESH_TIMEOUT_MS |
Key-refresh timeout in milliseconds (default: 60000) | No |
The Worker always starts the Firebase consumer process. It initializes Firebase
and listens for deployment changes only when both
GOOGLE_APPLICATION_CREDENTIALS and FIREBASE_DATABASE_URL are present;
otherwise the process remains idle. Set SERVICE_ENABLE_FIREBASE=true only
when the server's legacy Firebase container-state integration is also required.
For Kubernetes deployment configuration, including health checks and resource limits, see the Deployment Guide.
Each deployment includes metadata labels:
git.name: docker-sftp
git.owner: [organization]
git.branch: [branch-name]Use these labels to identify the gateway deployment and service.