From da6f4aa4d53ff9c4700f2acfa483d4d230b15fb1 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Wed, 26 Jul 2017 11:28:47 +0100 Subject: [PATCH] Add address to the conf file Former-commit-id: 488ecb2279ff420d94a8ed9c810f6020e1c647b2 [formerly e9826233ac79ce142b8b28f957f5f5c56d200470] [formerly eb78f2392602754fc6b875556f21f2db485a38e9 [formerly a521812e3ebe3a033c258783a0d14524653fecb8]] Former-commit-id: b62512a08ae990cf26799a6780d6ff261c85d932 [formerly 0e65bc1f0230cb4b1b4c9aaa315a5dd6cbb9df37] Former-commit-id: 7ec3782bb648313de423009ef4608df16883795f --- README.md | 1 + cmd/filemanager/main.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index e075313f..0517fb51 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ You can either use flags or a JSON configuration file, which should have the fol ```json { "port": 80, + "address": "127.0.0.1", "database": "/path/to/database.db", "scope": "/path/to/my/files", "allowCommands": true, diff --git a/cmd/filemanager/main.go b/cmd/filemanager/main.go index a85561c2..b15e635b 100644 --- a/cmd/filemanager/main.go +++ b/cmd/filemanager/main.go @@ -19,6 +19,7 @@ import ( type confFile struct { Database string `json:"database"` Scope string `json:"scope"` + Address string `json:"address"` Commands []string `json:"commands"` Port int `json:"port"` AllowCommands bool `json:"allowCommands"` @@ -99,6 +100,7 @@ func loadConfig() { database = conf.Database scope = conf.Scope + addr = conf.Address commands = strings.Join(conf.Commands, " ") port = strconv.Itoa(conf.Port) allowNew = conf.AllowNew