Add hostname to config
This commit is contained in:
parent
31c3a6740a
commit
6d904c724b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
tmp/*
|
||||
ezshare.toml
|
||||
ezshare.test.toml
|
@ -16,7 +16,6 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
LogLevel string `toml:"LogLevel"`
|
||||
Server *ServerConfig `toml:"Server"`
|
||||
Client *ClientConfig `toml:"Client"`
|
||||
location string
|
||||
@ -27,6 +26,8 @@ type CertificatePaths struct {
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
LogLevel string `toml:"LogLevel"`
|
||||
Hostname string `toml:"Hostname"`
|
||||
GRPC *ServerGRPCConfig `toml:"GRPC"`
|
||||
HTTP *ServerHTTPConfig `toml:"HTTP"`
|
||||
}
|
||||
@ -54,8 +55,8 @@ type ClientConfig struct {
|
||||
|
||||
func FromDefault() *Config {
|
||||
cfg := &Config{
|
||||
LogLevel: "INFO",
|
||||
Server: &ServerConfig{
|
||||
LogLevel: "INFO",
|
||||
GRPC: &ServerGRPCConfig{
|
||||
ListenAddr: ":50051",
|
||||
CACerts: &CertificatePaths{},
|
||||
|
@ -7,6 +7,11 @@
|
||||
# Default: INFO
|
||||
LogLevel = "INFO"
|
||||
|
||||
# Server hostname
|
||||
# Used for generating links
|
||||
# Required
|
||||
Hostname = "localhost"
|
||||
|
||||
# Storage configuration
|
||||
[Server.Store]
|
||||
# How server stores file
|
||||
|
Loading…
Reference in New Issue
Block a user