Compare commits

1 Commits

Author SHA1 Message Date
Pablu23
0fa96af3d1 Add kdl config, but not runnable 2025-10-01 09:49:14 +02:00
2 changed files with 90 additions and 20 deletions

View File

@@ -1,29 +1,28 @@
package domainrouter package domainrouter
type Location struct {
}
type Config struct { type Config struct {
Server struct { Server struct {
Port int `yaml:"port"` Port int `yaml:"port" kdl:"port"`
Ssl struct { Ssl struct {
Enabled bool `yaml:"enabled"` Enabled bool `yaml:"enabled" kdl:"enabled"`
CertFile string `yaml:"certFile"` CertFile string `yaml:"certFile" kdl:"cert-file"`
KeyFile string `yaml:"keyFile"` KeyFile string `yaml:"keyFile" kdl:"key-file"`
Acme struct { Acme struct {
Enabled bool `yaml:"enabled"` Enabled bool `yaml:"enabled" kdl:"enabled"`
Email string `yaml:"email"` Email string `yaml:"email" kdl:"email"`
KeyFile string `yaml:"keyFile"` KeyFile string `yaml:"keyFile" kdl:"key-file"`
CADirURL string `yaml:"caDirUrl"` CADirURL string `yaml:"caDirUrl" kdl:"ca-dir-url"`
Http01Port string `yaml:"http01Port"` Http01Port string `yaml:"http01Port" kdl:"http-01-port"`
TlsAlpn01Port string `yaml:"tlsAlpn01Port"` TlsAlpn01Port string `yaml:"tlsAlpn01Port" kdl:"tls-apln01-port"`
RenewTime string `yaml:"renewTime"` RenewTime string `yaml:"renewTime" kdl:"renew-time"`
} `yaml:"acme"` } `yaml:"acme" kdl:"acme"`
} `yaml:"ssl"` } `yaml:"ssl" kdl:"ssl"`
} `yaml:"server"` } `yaml:"server" kdl:"server"`
Hosts []struct {
Port int `yaml:"port"`
Remotes []string `yaml:"remotes"`
Domains []string `yaml:"domains"`
Secure bool `yaml:"secure"`
} `yaml:"hosts"`
RateLimit struct { RateLimit struct {
Enabled bool `yaml:"enabled"` Enabled bool `yaml:"enabled"`
BucketSize int `yaml:"bucketSize"` BucketSize int `yaml:"bucketSize"`

71
config.kdl Normal file
View File

@@ -0,0 +1,71 @@
server {
port 443
ssl {
enabled true
cert-file "server.crt"
key-file "server.key"
acme {
email "me@pablu.de"
key-file "userKey.key"
ca-dir-url "https://192.168.2.154:14000/dir"
tls-alpn01-port 5001
http-01-port 5002
renew-time "30s"
}
}
}
logging {
level "trace"
pretty true
requests true
file {
enabled false
max-age 14
max-backups 10
path "~/logs/router"
}
}
rate-limit {
enabled false
bucket-size 50
refill-size 50
refill-time "30s"
cleanup-time "45s"
}
location "test.localhost" "localhost" {
port 8181
remote "localhost"
}
location "private.localhost" {
port 8282
remote "localhost"
}
location "api.hitstar.localhost" {
port 9090
remote "localhost"
}
location "hitstar.localhost" "hipstar.localhost" {
port 5173
remote "localhost"
rewrite "/api" {
location "api.hitstar.localhost"
}
rewrite "/public" {
port 9090
remote "localhost"
keep-sub true
}
}
location "chat.localhost" {
port 46009
secure true
remote "localhost" "chat.pablu.de"
}