Add kdl config, but not runnable
This commit is contained in:
39
config.go
39
config.go
@@ -1,29 +1,28 @@
|
||||
package domainrouter
|
||||
|
||||
type Location struct {
|
||||
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Server struct {
|
||||
Port int `yaml:"port"`
|
||||
Port int `yaml:"port" kdl:"port"`
|
||||
Ssl struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
CertFile string `yaml:"certFile"`
|
||||
KeyFile string `yaml:"keyFile"`
|
||||
Enabled bool `yaml:"enabled" kdl:"enabled"`
|
||||
CertFile string `yaml:"certFile" kdl:"cert-file"`
|
||||
KeyFile string `yaml:"keyFile" kdl:"key-file"`
|
||||
Acme struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Email string `yaml:"email"`
|
||||
KeyFile string `yaml:"keyFile"`
|
||||
CADirURL string `yaml:"caDirUrl"`
|
||||
Http01Port string `yaml:"http01Port"`
|
||||
TlsAlpn01Port string `yaml:"tlsAlpn01Port"`
|
||||
RenewTime string `yaml:"renewTime"`
|
||||
} `yaml:"acme"`
|
||||
} `yaml:"ssl"`
|
||||
} `yaml:"server"`
|
||||
Hosts []struct {
|
||||
Port int `yaml:"port"`
|
||||
Remotes []string `yaml:"remotes"`
|
||||
Domains []string `yaml:"domains"`
|
||||
Secure bool `yaml:"secure"`
|
||||
} `yaml:"hosts"`
|
||||
Enabled bool `yaml:"enabled" kdl:"enabled"`
|
||||
Email string `yaml:"email" kdl:"email"`
|
||||
KeyFile string `yaml:"keyFile" kdl:"key-file"`
|
||||
CADirURL string `yaml:"caDirUrl" kdl:"ca-dir-url"`
|
||||
Http01Port string `yaml:"http01Port" kdl:"http-01-port"`
|
||||
TlsAlpn01Port string `yaml:"tlsAlpn01Port" kdl:"tls-apln01-port"`
|
||||
RenewTime string `yaml:"renewTime" kdl:"renew-time"`
|
||||
} `yaml:"acme" kdl:"acme"`
|
||||
} `yaml:"ssl" kdl:"ssl"`
|
||||
} `yaml:"server" kdl:"server"`
|
||||
|
||||
RateLimit struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
BucketSize int `yaml:"bucketSize"`
|
||||
|
||||
71
config.kdl
Normal file
71
config.kdl
Normal 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"
|
||||
}
|
||||
Reference in New Issue
Block a user