рабочий вариант, но скороть 10 МБит
This commit is contained in:
@@ -10,17 +10,18 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
App AppConfig
|
||||
HTTP HTTPConfig
|
||||
Postgres PostgresConfig
|
||||
Redis RedisConfig
|
||||
Auth AuthConfig
|
||||
Installation InstallationConfig
|
||||
DataPlane DataPlaneConfig
|
||||
Secret SecretConfig
|
||||
Session SessionConfig
|
||||
Worker WorkerConfig
|
||||
WebSocket WebSocketConfig
|
||||
App AppConfig
|
||||
HTTP HTTPConfig
|
||||
FabricControl FabricControlConfig
|
||||
Postgres PostgresConfig
|
||||
Redis RedisConfig
|
||||
Auth AuthConfig
|
||||
Installation InstallationConfig
|
||||
DataPlane DataPlaneConfig
|
||||
Secret SecretConfig
|
||||
Session SessionConfig
|
||||
Worker WorkerConfig
|
||||
WebSocket WebSocketConfig
|
||||
}
|
||||
|
||||
type AppConfig struct {
|
||||
@@ -37,6 +38,11 @@ type HTTPConfig struct {
|
||||
ShutdownTimeout time.Duration
|
||||
}
|
||||
|
||||
type FabricControlConfig struct {
|
||||
Enabled bool
|
||||
ListenAddr string
|
||||
}
|
||||
|
||||
type PostgresConfig struct {
|
||||
DSN string
|
||||
MaxConns int32
|
||||
@@ -118,6 +124,10 @@ func Load() (Config, error) {
|
||||
IdleTimeout: getDuration("HTTP_IDLE_TIMEOUT", 60*time.Second),
|
||||
ShutdownTimeout: getDuration("HTTP_SHUTDOWN_TIMEOUT", 10*time.Second),
|
||||
},
|
||||
FabricControl: FabricControlConfig{
|
||||
Enabled: getBool("FABRIC_CONTROL_QUIC_ENABLED", false),
|
||||
ListenAddr: getEnv("FABRIC_CONTROL_QUIC_LISTEN_ADDR", ":19191"),
|
||||
},
|
||||
Postgres: PostgresConfig{
|
||||
DSN: getEnv("POSTGRES_DSN", ""),
|
||||
MaxConns: int32(getInt("POSTGRES_MAX_CONNS", 20)),
|
||||
@@ -235,13 +245,13 @@ func Load() (Config, error) {
|
||||
func normalizeInstallationAuthorityMode(mode string, rootPublicKey string) string {
|
||||
mode = strings.ToLower(strings.TrimSpace(mode))
|
||||
switch mode {
|
||||
case "strict", "legacy":
|
||||
case "strict", "compat":
|
||||
return mode
|
||||
case "":
|
||||
if strings.TrimSpace(rootPublicKey) != "" {
|
||||
return "strict"
|
||||
}
|
||||
return "legacy"
|
||||
return "compat"
|
||||
default:
|
||||
return mode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user