summaryrefslogtreecommitdiff
path: root/config
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/config.go19
-rw-r--r--config/config.local.yaml5
-rw-r--r--config/config.prod.yaml4
-rw-r--r--config/config.stage.yaml4
4 files changed, 22 insertions, 10 deletions
diff --git a/config/config.go b/config/config.go
index d5dab2d..1393dd8 100644
--- a/config/config.go
+++ b/config/config.go
@@ -62,13 +62,18 @@ type Sqlite3Config struct {
}
type MailConfig struct {
- ClientHost string `json:"ClientHost" yaml:"clientHost" validate:"required"`
- MailHost string `json:"MailHost" yaml:"mailHost" validate:"required"`
- PublicName string `json:"PublicName" yaml:"publicName" validate:"required"`
- MailAddress string `json:"MailAddress" yaml:"mailAddress" validate:"required"`
- Username string `json:"Username" yaml:"username" validate:"required"`
- Password string `json:"Password" yaml:"password" validate:"required"`
- Salt string `json:"Salt" yaml:"salt" validate:"required"`
+ ClientHost string `json:"ClientHost" yaml:"clientHost" validate:"required"`
+ MailHost string `json:"MailHost" yaml:"mailHost" validate:"required"`
+ PublicName string `json:"PublicName" yaml:"publicName" validate:"required"`
+ MailAddress string `json:"MailAddress" yaml:"mailAddress" validate:"required"`
+ Username string `json:"Username" yaml:"username" validate:"required"`
+ Password string `json:"Password" yaml:"password" validate:"required"`
+ Salt string `json:"Salt" yaml:"salt" validate:"required"`
+ Trigger TriggerConfig `json:"Trigger" yaml:"trigger" validate:"required"`
+}
+
+type TriggerConfig struct {
+ OnNewPost string `json:"OnNewPost" yaml:"onNewPost" validate:"cron,required"`
}
func LoadConfig(path string, config *Config) error {
diff --git a/config/config.local.yaml b/config/config.local.yaml
index 008fa93..e23c808 100644
--- a/config/config.local.yaml
+++ b/config/config.local.yaml
@@ -32,7 +32,8 @@ auth:
db:
type: sqlite3
config:
- dsn: 'file:/tmp/auth.db?cache=shared&mode=rwc'
+ # dsn: 'file:/tmp/auth.db?cache=shared&mode=rwc&_journal_mode=WAL'
+ dsn: 'file:/tmp/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2&_journal_mode=WAL'
salt: '123'
mail:
clientHost: '127.0.0.1:3000'
@@ -42,3 +43,5 @@ mail:
username: '${MAIL_USERNAME}'
password: '${MAIL_PASSWORD}'
salt: '${MAIL_SALT}'
+ trigger:
+ onNewPost: "* * * * *"
diff --git a/config/config.prod.yaml b/config/config.prod.yaml
index 4c0f425..0bee79d 100644
--- a/config/config.prod.yaml
+++ b/config/config.prod.yaml
@@ -32,7 +32,7 @@ auth:
db:
type: sqlite3
config:
- dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2'
+ dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2&_journal_mode=WAL'
salt: '${AUTH_SALT}'
mail:
clientHost: '${FQDN}'
@@ -42,3 +42,5 @@ mail:
username: '${MAIL_USERNAME}'
password: '${MAIL_PASSWORD}'
salt: '${MAIL_SALT}'
+ trigger:
+ onNewPost: "0/5 * * * *"
diff --git a/config/config.stage.yaml b/config/config.stage.yaml
index 003ec05..1c15dae 100644
--- a/config/config.stage.yaml
+++ b/config/config.stage.yaml
@@ -32,7 +32,7 @@ auth:
db:
type: sqlite3
config:
- dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2'
+ dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2&_journal_mode=WAL'
salt: '${AUTH_SALT}'
mail:
clientHost: '${FQDN}'
@@ -42,3 +42,5 @@ mail:
username: '${MAIL_USERNAME}'
password: '${MAIL_PASSWORD}'
salt: '${MAIL_SALT}'
+ trigger:
+ onNewPost: "0/3 * * * *"