Add hostname to config

This commit is contained in:
Torjus Håkestad 2021-12-04 04:31:19 +01:00
parent 31c3a6740a
commit 6d904c724b
3 changed files with 12 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
tmp/*
ezshare.toml
ezshare.test.toml

View File

@ -16,7 +16,6 @@ import (
)
type Config struct {
LogLevel string `toml:"LogLevel"`
Server *ServerConfig `toml:"Server"`
Client *ClientConfig `toml:"Client"`
location string
@ -27,8 +26,10 @@ type CertificatePaths struct {
}
type ServerConfig struct {
GRPC *ServerGRPCConfig `toml:"GRPC"`
HTTP *ServerHTTPConfig `toml:"HTTP"`
LogLevel string `toml:"LogLevel"`
Hostname string `toml:"Hostname"`
GRPC *ServerGRPCConfig `toml:"GRPC"`
HTTP *ServerHTTPConfig `toml:"HTTP"`
}
type ServerStoreConfig struct {
Type string `toml:"Type"`
@ -54,8 +55,8 @@ type ClientConfig struct {
func FromDefault() *Config {
cfg := &Config{
LogLevel: "INFO",
Server: &ServerConfig{
LogLevel: "INFO",
GRPC: &ServerGRPCConfig{
ListenAddr: ":50051",
CACerts: &CertificatePaths{},

View File

@ -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