Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit 4dedc33

Browse files
authored
Merge pull request #66 from open-AIMS/feat/change-env-name
feat: improved env variable specificity
2 parents 4b627f4 + 3e46884 commit 4dedc33

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.env.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
API_ENDPOINT='https://web-api.reefguide.example.com'
22
AWS_REGION='ap-southeast-2'
33
JOB_TYPES=SUITABILITY_ASSESSMENT,TEST
4-
USERNAME=worker@service.com
5-
PASSWORD=<password>
4+
WORKER_USERNAME=worker@service.com
5+
WORKER_PASSWORD=<password>
66
POLL_INTERVAL_MS=5000
77
IDLE_TIMEOUT_MS=600000
88
JULIA_DEBUG=ReefGuideAPI
9-
CONFIG_PATH=config.toml
9+
CONFIG_PATH=config.toml

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ The worker requires the following environment variables to be set:
301301
| ------------------------------- | ---------------------------------------------------------- | ----------------------------------------- |
302302
| `API_ENDPOINT` | Base URL of the ReefGuide API | `"https://api.reefguide.example.com/api"` |
303303
| `JOB_TYPES` | Comma-separated list of job types the worker should handle | `"SUITABILITY_ASSESSMENT,TEST"` |
304-
| `USERNAME` | API authentication username | `"worker-service"` |
305-
| `PASSWORD` | API authentication password | `"secure-password"` |
304+
| `WORKER_USERNAME` | API authentication username | `"worker-service"` |
305+
| `WORKER_PASSWORD` | API authentication password | `"secure-password"` |
306306
| `POLL_INTERVAL_MS` | (Optional) Polling interval in milliseconds | `2000` (default) |
307307
| `IDLE_TIMEOUT_MS` | (Optional) Idle timeout in milliseconds | `300000` (default) |
308308
| `AWS_REGION` | AWS region for S3 operations | `"ap-southeast-2"` |
@@ -328,8 +328,8 @@ Example `.env` file:
328328
```
329329
API_ENDPOINT=http://localhost:8000
330330
JOB_TYPES=SUITABILITY_ASSESSMENT,TEST
331-
USERNAME=local-dev
332-
PASSWORD=local-password
331+
WORKER_USERNAME=local-dev
332+
WORKER_PASSWORD=local-password
333333
POLL_INTERVAL_MS=5000
334334
IDLE_TIMEOUT_MS=600000
335335
AWS_REGION=ap-southeast-2
@@ -432,8 +432,8 @@ e.g.
432432
# Set environment variables
433433
export API_ENDPOINT=https://api.reefguide.example.com
434434
export JOB_TYPES=SUITABILITY_ASSESSMENT,TEST
435-
export USERNAME=worker-service
436-
export PASSWORD=secure-password
435+
export WORKER_USERNAME=worker-service
436+
export WORKER_PASSWORD=secure-password
437437

438438
# Start the Julia REPL with the ReefGuide module
439439
cd sandbox

src/job_worker/Config.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ function load_config_from_env()::WorkerConfig
125125
end
126126

127127
# Username and password
128-
username = get_env("USERNAME")
128+
username = get_env("WORKER_USERNAME")
129129
if isempty(username)
130-
throw(ConfigValidationError("USERNAME", "Username cannot be empty"))
130+
throw(ConfigValidationError("WORKER_USERNAME", "Username cannot be empty"))
131131
end
132-
password = get_env("PASSWORD")
132+
password = get_env("WORKER_PASSWORD")
133133
if isempty(password)
134-
throw(ConfigValidationError("PASSWORD", "Password cannot be empty"))
134+
throw(ConfigValidationError("WORKER_PASSWORD", "Password cannot be empty"))
135135
end
136136

137137
# Config file path

0 commit comments

Comments
 (0)