From 2f9df6404a484e28e8243f9825a5f8daba48acca Mon Sep 17 00:00:00 2001
From: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
Date: Sun, 29 Sep 2024 09:39:27 -0600
Subject: [PATCH] fix: email settings was missing from the config setup
Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
---
config/.env.example | 4 ++++
config/config.example.yaml | 9 +++++----
config/configmap.yaml | 4 ++++
configgen/api-docs.md | 10 ++++++++++
configgen/riverboat.config.json | 12 +++++++++++-
pkg/jobs/email.go | 2 +-
6 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/config/.env.example b/config/.env.example
index a75c67a..e7b1b5d 100644
--- a/config/.env.example
+++ b/config/.env.example
@@ -1,6 +1,10 @@
RIVERBOAT_REFRESHINTERVAL="10m"
RIVERBOAT_JOBQUEUE_DATABASEHOST="postgres://postgres:password@0.0.0.0:5432/jobs?sslmode=disable"
RIVERBOAT_JOBQUEUE_QUEUES=""
+RIVERBOAT_JOBQUEUE_WORKERS_EMAILWORKER_DEVMODE="true"
+RIVERBOAT_JOBQUEUE_WORKERS_EMAILWORKER_TESTDIR="fixtures/email"
+RIVERBOAT_JOBQUEUE_WORKERS_EMAILWORKER_TOKEN=""
+RIVERBOAT_JOBQUEUE_WORKERS_EMAILWORKER_FROMEMAIL="no-reply@example.com"
RIVERBOAT_JOBQUEUE_WORKERS_DATABASEWORKER_CONFIG_ENABLED="true"
RIVERBOAT_JOBQUEUE_WORKERS_DATABASEWORKER_CONFIG_BASEURL="http://localhost:1337"
RIVERBOAT_JOBQUEUE_WORKERS_DATABASEWORKER_CONFIG_ENDPOINT="query"
diff --git a/config/config.example.yaml b/config/config.example.yaml
index e19d6de..bcb8170 100644
--- a/config/config.example.yaml
+++ b/config/config.example.yaml
@@ -9,8 +9,9 @@ jobQueue:
enabled: true
endpoint: query
emailWorker:
- devMode: true
- fromEmail: no-reply@example.com
- testDir: fixtures/email
- token: ""
+ email:
+ devMode: true
+ fromEmail: no-reply@example.com
+ testDir: fixtures/email
+ token: ""
refreshInterval: 600000000000
diff --git a/config/configmap.yaml b/config/configmap.yaml
index d994e44..37d33eb 100644
--- a/config/configmap.yaml
+++ b/config/configmap.yaml
@@ -13,6 +13,10 @@ data:
RIVERBOAT_REFRESHINTERVAL: {{ .Values.riverboat.refreshInterval | default "10m" }}
RIVERBOAT_JOBQUEUE_DATABASEHOST: {{ .Values.riverboat.jobQueue.databaseHost | default "postgres://postgres:password@0.0.0.0:5432/jobs?sslmode=disable" }}
RIVERBOAT_JOBQUEUE_QUEUES: {{ .Values.riverboat.jobQueue.queues }}
+ RIVERBOAT_JOBQUEUE_WORKERS_EMAILWORKER_DEVMODE: {{ .Values.riverboat.jobQueue.workers.emailWorker.devMode | default true }}
+ RIVERBOAT_JOBQUEUE_WORKERS_EMAILWORKER_TESTDIR: {{ .Values.riverboat.jobQueue.workers.emailWorker.testDir | default "fixtures/email" }}
+ RIVERBOAT_JOBQUEUE_WORKERS_EMAILWORKER_TOKEN: {{ .Values.riverboat.jobQueue.workers.emailWorker.token }}
+ RIVERBOAT_JOBQUEUE_WORKERS_EMAILWORKER_FROMEMAIL: {{ .Values.riverboat.jobQueue.workers.emailWorker.fromEmail | default "no-reply@example.com" }}
RIVERBOAT_JOBQUEUE_WORKERS_DATABASEWORKER_CONFIG_ENABLED: {{ .Values.riverboat.jobQueue.workers.databaseWorker.config.enabled | default true }}
RIVERBOAT_JOBQUEUE_WORKERS_DATABASEWORKER_CONFIG_BASEURL: {{ .Values.riverboat.jobQueue.workers.databaseWorker.config.baseUrl | default "http://localhost:1337" }}
RIVERBOAT_JOBQUEUE_WORKERS_DATABASEWORKER_CONFIG_ENDPOINT: {{ .Values.riverboat.jobQueue.workers.databaseWorker.config.endpoint | default "query" }}
diff --git a/configgen/api-docs.md b/configgen/api-docs.md
index 30f2413..aaa9a85 100644
--- a/configgen/api-docs.md
+++ b/configgen/api-docs.md
@@ -47,6 +47,16 @@ Workers that will be enabled on the server
**Properties**
+|Name|Type|Description|Required|
+|----|----|-----------|--------|
+|[**email**](#jobqueueworkersemailworkeremail)|`object`|||
+
+**Additional Properties:** not allowed
+
+##### jobQueue\.workers\.emailWorker\.email: object
+
+**Properties**
+
|Name|Type|Description|Required|
|----|----|-----------|--------|
|**devMode**|`boolean`|enable dev mode
||
diff --git a/configgen/riverboat.config.json b/configgen/riverboat.config.json
index 850da5e..e140cbe 100644
--- a/configgen/riverboat.config.json
+++ b/configgen/riverboat.config.json
@@ -40,7 +40,7 @@
"additionalProperties": false,
"type": "object"
},
- "jobs.EmailWorker": {
+ "jobs.EmailConfig": {
"properties": {
"devMode": {
"type": "boolean",
@@ -61,6 +61,16 @@
"additionalProperties": false,
"type": "object"
},
+ "jobs.EmailWorker": {
+ "properties": {
+ "email": {
+ "$ref": "#/$defs/jobs.EmailConfig",
+ "description": "the email configuration"
+ }
+ },
+ "additionalProperties": false,
+ "type": "object"
+ },
"river.Config": {
"properties": {
"databaseHost": {
diff --git a/pkg/jobs/email.go b/pkg/jobs/email.go
index 887a027..ff643c7 100644
--- a/pkg/jobs/email.go
+++ b/pkg/jobs/email.go
@@ -24,7 +24,7 @@ func (EmailArgs) Kind() string { return "email" }
type EmailWorker struct {
river.WorkerDefaults[EmailArgs]
- EmailConfig
+ EmailConfig `koanf:"email" json:"email" jsonschema:"description=the email configuration"`
}
// EmailConfig contains the configuration for the email worker