summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--getwtxt.json2
-rw-r--r--init.go10
-rw-r--r--types.go9
3 files changed, 18 insertions, 3 deletions
diff --git a/getwtxt.json b/getwtxt.json
index c11c8e5..66c725e 100644
--- a/getwtxt.json
+++ b/getwtxt.json
@@ -6,6 +6,6 @@
     "name": "getwtxt",
     "url": "https://twtxt.example.com",
     "owner": "gbmor",
-    "ownermail": "ben@gbmor.dev"
+    "mail": "ben@gbmor.dev"
   }
 }
diff --git a/init.go b/init.go
index 2069ceb..f871a72 100644
--- a/init.go
+++ b/init.go
@@ -73,8 +73,11 @@ func initConfig() {
 
 	confObj.port = viper.GetInt("port")
 	confObj.logfile = viper.GetString("logfile")
-	confObj.twtxtfile = viper.GetString("twtxtfile")
 	confObj.stdoutLogging = viper.GetBool("stdoutLogging")
+	confObj.instance.name = viper.GetString("instance.name")
+	confObj.instance.url = viper.GetString("instance.url")
+	confObj.instance.owner = viper.GetString("instance.owner")
+	confObj.instance.mail = viper.GetString("instance.mail")
 }
 
 func initLogging() {
@@ -117,8 +120,11 @@ func rebindConfig() {
 	// reassign values to the config object
 	confObj.port = viper.GetInt("port")
 	confObj.logfile = viper.GetString("logfile")
-	confObj.twtxtfile = viper.GetString("twtxtfile")
 	confObj.stdoutLogging = viper.GetBool("stdoutLogging")
+	confObj.instance.name = viper.GetString("instance.name")
+	confObj.instance.url = viper.GetString("instance.url")
+	confObj.instance.owner = viper.GetString("instance.owner")
+	confObj.instance.mail = viper.GetString("instance.mail")
 
 	// reinitialize logging
 	initLogging()
diff --git a/types.go b/types.go
index e25e066..8e924ca 100644
--- a/types.go
+++ b/types.go
@@ -9,4 +9,13 @@ type configuration struct {
 	port          int
 	logfile       string
 	stdoutLogging bool
+	instance
 }
+type instance struct {
+	name  string
+	url   string
+	owner string
+	mail  string
+}
+
+// index of users