diff options
| author | 2025-08-30 16:04:50 +0700 | |
|---|---|---|
| committer | 2025-08-30 16:04:50 +0700 | |
| commit | d695dc09f44236be33fecc7a5ab9a326823170d9 (patch) | |
| tree | c71c2c8f37a7609d6c8a7b558b71a1a1b4c9ec1c /config/config.go | |
| parent | a3d04476daa507cf941a5b82355c744c6622246c (diff) | |
| parent | 1c14a4088b068fefe425cad1acdde2d603bd27a9 (diff) | |
| download | web-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/config.go')
| -rw-r--r-- | config/config.go | 15 |
1 files changed, 15 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 { |