summaryrefslogtreecommitdiff
path: root/config
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <145215889+SayaAndy@users.noreply.github.com> 2025-08-30 16:04:50 +0700
committerGravatar GitHub <noreply@github.com> 2025-08-30 16:04:50 +0700
commitd695dc09f44236be33fecc7a5ab9a326823170d9 (patch)
treec71c2c8f37a7609d6c8a7b558b71a1a1b4c9ec1c /config
parenta3d04476daa507cf941a5b82355c744c6622246c (diff)
parent1c14a4088b068fefe425cad1acdde2d603bd27a9 (diff)
downloadweb-0.7.0.tar.gz
web-0.7.0.zip
v0.7.0 (#6)v0.7.0
feat: like button with persistent storage and like count feat: show like count on blog search feat: update galleries on resize (with smooth animations) feat: add decor for night & ram themes feat: show search buttons in catalogue separately without overflow feat: add overflow to search tags in catalogue in mobile mode feat: update go (1.24.5 > 1.24.6) feat: add favicon refactor: shorten logs of blog search
Diffstat (limited to 'config')
-rw-r--r--config/config.go15
-rw-r--r--config/config.local.yaml26
-rw-r--r--config/config.prod.yaml6
-rw-r--r--config/config.stage.yaml6
4 files changed, 53 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
index 8c0321e..7438fe1 100644
--- a/config/config.go
+++ b/config/config.go
@@ -13,6 +13,7 @@ type Config struct {
BlogPages BlogPagesConfig `json:"BlogPages" yaml:"blogPages" validate:"required"`
LocalePath string `json:"LocalePath" yaml:"localePath" validate:"required,filepath"`
AvailableLanguages []AvailableLanguageConfig `json:"AvailableLanguages" yaml:"availableLanguages" validate:"required"`
+ Auth AuthConfig `json:"Auth" yaml:"auth" validate:"required"`
}
type BlogPagesConfig struct {
@@ -39,6 +40,20 @@ type AvailableLanguageConfig struct {
LocFile string `json:"LocFile" yaml:"locFile" validate:"required,filepath"`
}
+type AuthConfig struct {
+ Salt string `json:"Salt" yaml:"salt" validate:"required"`
+ Db DbConfig `json:"Db" yaml:"db" validate:"required"`
+}
+
+type DbConfig struct {
+ Type string `json:"Type" yaml:"type" validate:"required,oneof=sqlite3"`
+ Cfg Sqlite3Config `json:"Config" yaml:"config"`
+}
+
+type Sqlite3Config struct {
+ DSN string `json:"DSN" yaml:"dsn" validate:"required"`
+}
+
func LoadConfig(path string, config *Config) error {
fileBytes, err := os.ReadFile(path)
if err != nil {
diff --git a/config/config.local.yaml b/config/config.local.yaml
new file mode 100644
index 0000000..0b48e47
--- /dev/null
+++ b/config/config.local.yaml
@@ -0,0 +1,26 @@
+logLevel: debug
+blogPages:
+ storage:
+ type: b2
+ config:
+ bucketName: sayana-pages
+ region: eu-central-003
+ prefix: 'stage-'
+ keyID: '${B2_KEY_ID}'
+ applicationKey: '${B2_APPLICATION_KEY}'
+localePath: ./locale/
+availableLanguages:
+ - name: ru
+ alt: Русский
+ flag: https://f003.backblazeb2.com/file/sayana-static/flags/ru.svg
+ locFile: localization.ru.yaml
+ - name: en
+ alt: English
+ flag: https://f003.backblazeb2.com/file/sayana-static/flags/gb.svg
+ locFile: localization.en.yaml
+auth:
+ db:
+ type: sqlite3
+ config:
+ dsn: 'file:/tmp/auth.db?cache=shared&mode=rwc'
+ salt: '123'
diff --git a/config/config.prod.yaml b/config/config.prod.yaml
index 2d050bf..e1294c0 100644
--- a/config/config.prod.yaml
+++ b/config/config.prod.yaml
@@ -18,3 +18,9 @@ availableLanguages:
alt: English
flag: https://f003.backblazeb2.com/file/sayana-static/flags/gb.svg
locFile: localization.en.yaml
+auth:
+ db:
+ type: sqlite3
+ config:
+ dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2'
+ salt: '${AUTH_SALT}'
diff --git a/config/config.stage.yaml b/config/config.stage.yaml
index a34a33e..30233c1 100644
--- a/config/config.stage.yaml
+++ b/config/config.stage.yaml
@@ -18,3 +18,9 @@ availableLanguages:
alt: English
flag: https://f003.backblazeb2.com/file/sayana-static/flags/gb.svg
locFile: localization.en.yaml
+auth:
+ db:
+ type: sqlite3
+ config:
+ dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2'
+ salt: '${AUTH_SALT}'