summary refs log tree commit diff stats
path: root/svc/conf.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2020-03-16 02:42:35 -0400
committerBen Morrison <ben@gbmor.dev>2020-03-16 02:42:35 -0400
commit31c992e6eaa8f4afe90ec95c5c778412fb887146 (patch)
treedfbbc9651772c51fa4bb74bef03ea37de9d27380 /svc/conf.go
parent271ba7ca8dc513ba240c0b0290efd0957a16125a (diff)
downloadgetwtxt-31c992e6eaa8f4afe90ec95c5c778412fb887146.tar.gz
removed experimental host matching and tls support
Diffstat (limited to 'svc/conf.go')
-rw-r--r--svc/conf.go31
1 files changed, 0 insertions, 31 deletions
diff --git a/svc/conf.go b/svc/conf.go
index f3797c6..ae52219 100644
--- a/svc/conf.go
+++ b/svc/conf.go
@@ -36,7 +36,6 @@ var reqLog *log.Logger
 // this struct.
 type Configuration struct {
 	Mu            sync.RWMutex
-	IsProxied     bool          `yaml:"BehindProxy"`
 	Port          int           `yaml:"ListenPort"`
 	MsgLog        string        `yaml:"MessageLog"`
 	ReqLog        string        `yaml:"RequestLog"`
@@ -47,7 +46,6 @@ type Configuration struct {
 	CacheInterval time.Duration `yaml:"StatusFetchInterval"`
 	DBInterval    time.Duration `yaml:"DatabasePushInterval"`
 	Instance      `yaml:"Instance"`
-	TLS
 }
 
 // Instance refers to meta data about
@@ -61,14 +59,6 @@ type Instance struct {
 	Desc  string `yaml:"Instance.Description"`
 }
 
-// TLS holds the tls config from the
-// config file
-type TLS struct {
-	Use  bool   `yaml:"UseTLS"`
-	Cert string `yaml:"TLSCert"`
-	Key  string `yaml:"TLSKey"`
-}
-
 // Called on start-up. Initializes everything
 // related to configuration values.
 func initConfig() {
@@ -125,10 +115,6 @@ func initLogging() {
 // Default values should a config file
 // not be available.
 func setConfigDefaults() {
-	viper.SetDefault("BehindProxy", true)
-	viper.SetDefault("UseTLS", false)
-	viper.SetDefault("TLSCert", "cert.pem")
-	viper.SetDefault("TLSKey", "key.pem")
 	viper.SetDefault("ListenPort", 9001)
 	viper.SetDefault("MessageLog", "logs/message.log")
 	viper.SetDefault("RequestLog", "logs/request.log")
@@ -175,7 +161,6 @@ func parseConfigFlag() {
 func bindConfig() {
 	confObj.Mu.Lock()
 
-	confObj.IsProxied = viper.GetBool("BehindProxy")
 	confObj.Port = viper.GetInt("ListenPort")
 	confObj.MsgLog = viper.GetString("MessageLog")
 	confObj.ReqLog = viper.GetString("RequestLog")
@@ -193,12 +178,6 @@ func bindConfig() {
 	confObj.Instance.Mail = viper.GetString("Instance.Email")
 	confObj.Instance.Desc = viper.GetString("Instance.Description")
 
-	confObj.TLS.Use = viper.GetBool("UseTLS")
-	if confObj.TLS.Use {
-		confObj.TLS.Cert = viper.GetString("TLSCert")
-		confObj.TLS.Key = viper.GetString("TLSKey")
-	}
-
 	if *flagDBType != "" {
 		confObj.DBType = *flagDBType
 	}
@@ -219,16 +198,6 @@ func announceConfig() {
 	confObj.Mu.RLock()
 	defer confObj.Mu.RUnlock()
 
-	if confObj.IsProxied {
-		log.Printf("Behind reverse proxy, not using host matching\n")
-	} else {
-		log.Printf("Matching host: %v\n", confObj.Instance.URL)
-	}
-	if confObj.TLS.Use {
-		log.Printf("Using TLS\n")
-		log.Printf("Cert: %v\n", confObj.TLS.Cert)
-		log.Printf("Key: %v\n", confObj.TLS.Key)
-	}
 	if confObj.StdoutLogging {
 		log.Printf("Logging to: stdout\n")
 	} else {