Update server configuration to disable serving frontend
This commit is contained in:
parent
5cfb906a4f
commit
a88946bb7f
7 changed files with 57 additions and 42 deletions
|
@ -48,6 +48,7 @@ type ServerConfig struct {
|
|||
ReadTimeout time.Duration `mapstructure:"read_timeout" yaml:"read_timeout"`
|
||||
WriteTimeout time.Duration `mapstructure:"write_timeout" yaml:"write_timeout"`
|
||||
CorsAllowOrigins []string `mapstructure:"cors_allow_origins" yaml:"cors_allow_origins"`
|
||||
ServeFrontend bool `mapstructure:"serve_frontend" yaml:"serve_frontend"`
|
||||
}
|
||||
|
||||
type SchedulerConfig struct {
|
||||
|
@ -105,6 +106,8 @@ func LoadConfig() *Config {
|
|||
viper.SetConfigName("local")
|
||||
} else if os.Getenv("CA_ENV") == "prod" {
|
||||
viper.SetConfigName("prod")
|
||||
} else if os.Getenv("CA_ENV") == "selfhosted" {
|
||||
viper.SetConfigName("selfhosted")
|
||||
} else {
|
||||
viper.SetConfigName("local")
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ server:
|
|||
cors_allow_origins:
|
||||
- "http://localhost:5173"
|
||||
- "http://localhost:7926"
|
||||
serve_frontend: false
|
||||
scheduler_jobs:
|
||||
due_job: 30m
|
||||
overdue_job: 3h
|
||||
|
|
31
config/selfhosted.yaml
Normal file
31
config/selfhosted.yaml
Normal file
|
@ -0,0 +1,31 @@
|
|||
name: "local"
|
||||
is_done_tick_dot_com: false
|
||||
telegram:
|
||||
token: ""
|
||||
database:
|
||||
type: "sqlite"
|
||||
migration: true
|
||||
jwt:
|
||||
secret: "secret"
|
||||
session_time: 168h
|
||||
max_refresh: 168h
|
||||
server:
|
||||
port: 2021
|
||||
read_timeout: 2s
|
||||
write_timeout: 1s
|
||||
rate_period: 60s
|
||||
rate_limit: 300
|
||||
cors_allow_origins:
|
||||
- "http://localhost:5173"
|
||||
- "http://localhost:7926"
|
||||
serve_frontend: true
|
||||
scheduler_jobs:
|
||||
due_job: 30m
|
||||
overdue_job: 3h
|
||||
pre_due_job: 3h
|
||||
email:
|
||||
host:
|
||||
port:
|
||||
key:
|
||||
email:
|
||||
appHost:
|
Loading…
Add table
Add a link
Reference in a new issue