From c8c09bce8c4d8855fc468100cc2de01d77ff78f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Wed, 22 Aug 2018 00:31:29 +0200 Subject: [PATCH] Add option to choose which address to listen on, closes #31 --- assets/bindata.go | 8 ++++---- config.default.toml | 2 ++ server/server.go | 9 +++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/assets/bindata.go b/assets/bindata.go index 4eab3ce2..05e12f5d 100644 --- a/assets/bindata.go +++ b/assets/bindata.go @@ -85,7 +85,7 @@ func bundleCssBr() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "bundle.css.br", size: 2369, mode: os.FileMode(436), modTime: time.Unix(1534108559, 0)} + info := bindataFileInfo{name: "bundle.css.br", size: 2369, mode: os.FileMode(436), modTime: time.Unix(1534890642, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -105,12 +105,12 @@ func bundleJsBr() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "bundle.js.br", size: 104814, mode: os.FileMode(436), modTime: time.Unix(1534108559, 0)} + info := bindataFileInfo{name: "bundle.js.br", size: 104814, mode: os.FileMode(436), modTime: time.Unix(1534890642, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _configDefaultToml = "\x70\x6f\x72\x74\x20\x3d\x20\x38\x30\x0a\x23\x20\x48\x65\x78\x20\x65\x6e\x63\x6f\x64\x65\x20\x74\x68\x65\x20\x75\x73\x65\x72\x73\x20\x49\x50\x20\x61\x6e\x64\x20\x75\x73\x65\x20\x69\x74\x20\x61\x73\x20\x74\x68\x65\x20\x69\x64\x65\x6e\x74\x0a\x68\x65\x78\x49\x50\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x76\x65\x72\x69\x66\x79\x5f\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x73\x20\x3d\x20\x74\x72\x75\x65\x0a\x0a\x23\x20\x44\x65\x66\x61\x75\x6c\x74\x73\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x63\x6c\x69\x65\x6e\x74\x20\x63\x6f\x6e\x6e\x65\x63\x74\x20\x66\x6f\x72\x6d\x0a\x5b\x64\x65\x66\x61\x75\x6c\x74\x73\x5d\x0a\x6e\x61\x6d\x65\x20\x3d\x20\x22\x46\x72\x65\x65\x6e\x6f\x64\x65\x22\x0a\x68\x6f\x73\x74\x20\x3d\x20\x22\x63\x68\x61\x74\x2e\x66\x72\x65\x65\x6e\x6f\x64\x65\x2e\x6e\x65\x74\x22\x0a\x70\x6f\x72\x74\x20\x3d\x20\x36\x36\x39\x37\x0a\x63\x68\x61\x6e\x6e\x65\x6c\x73\x20\x3d\x20\x5b\x0a\x20\x20\x22\x23\x64\x69\x73\x70\x61\x74\x63\x68\x22\x2c\x0a\x20\x20\x22\x23\x67\x6f\x2d\x6e\x75\x74\x73\x22\x0a\x5d\x0a\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x3d\x20\x22\x22\x0a\x73\x73\x6c\x20\x3d\x20\x74\x72\x75\x65\x0a\x23\x20\x4f\x6e\x6c\x79\x20\x61\x6c\x6c\x6f\x77\x20\x61\x20\x6e\x69\x63\x6b\x20\x74\x6f\x20\x62\x65\x20\x66\x69\x6c\x6c\x65\x64\x20\x69\x6e\x0a\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x23\x20\x53\x68\x6f\x77\x20\x73\x65\x72\x76\x65\x72\x20\x61\x6e\x64\x20\x63\x68\x61\x6e\x6e\x65\x6c\x20\x69\x6e\x66\x6f\x20\x77\x68\x65\x6e\x20\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x69\x73\x20\x65\x6e\x61\x62\x6c\x65\x64\x0a\x73\x68\x6f\x77\x5f\x64\x65\x74\x61\x69\x6c\x73\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x0a\x5b\x68\x74\x74\x70\x73\x5d\x0a\x65\x6e\x61\x62\x6c\x65\x64\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x70\x6f\x72\x74\x20\x3d\x20\x34\x34\x33\x0a\x23\x20\x52\x65\x64\x69\x72\x65\x63\x74\x20\x61\x6c\x6c\x20\x68\x74\x74\x70\x20\x74\x72\x61\x66\x66\x69\x63\x20\x74\x6f\x20\x68\x74\x74\x70\x73\x0a\x72\x65\x64\x69\x72\x65\x63\x74\x20\x3d\x20\x74\x72\x75\x65\x0a\x23\x20\x50\x61\x74\x68\x20\x74\x6f\x20\x79\x6f\x75\x72\x20\x63\x65\x72\x74\x20\x61\x6e\x64\x20\x70\x72\x69\x76\x61\x74\x65\x20\x6b\x65\x79\x20\x69\x66\x20\x79\x6f\x75\x20\x61\x72\x65\x20\x6e\x6f\x74\x20\x75\x73\x69\x6e\x67\x0a\x23\x20\x74\x68\x65\x20\x4c\x65\x74\x27\x73\x20\x45\x6e\x63\x72\x79\x70\x74\x20\x69\x6e\x74\x65\x67\x72\x61\x74\x69\x6f\x6e\x0a\x63\x65\x72\x74\x20\x3d\x20\x22\x22\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x0a\x5b\x6c\x65\x74\x73\x65\x6e\x63\x72\x79\x70\x74\x5d\x0a\x23\x20\x59\x6f\x75\x72\x20\x64\x6f\x6d\x61\x69\x6e\x20\x6f\x72\x20\x73\x75\x62\x64\x6f\x6d\x61\x69\x6e\x0a\x64\x6f\x6d\x61\x69\x6e\x20\x3d\x20\x22\x22\x0a\x23\x20\x41\x6e\x20\x65\x6d\x61\x69\x6c\x20\x61\x64\x64\x72\x65\x73\x73\x20\x6c\x65\x74\x73\x20\x79\x6f\x75\x20\x72\x65\x63\x6f\x76\x65\x72\x20\x79\x6f\x75\x72\x20\x61\x63\x63\x6f\x75\x6e\x74\x73\x20\x70\x72\x69\x76\x61\x74\x65\x20\x6b\x65\x79\x0a\x65\x6d\x61\x69\x6c\x20\x3d\x20\x22\x22\x0a\x23\x20\x54\x68\x65\x20\x70\x6f\x72\x74\x20\x4c\x65\x74\x27\x73\x20\x45\x6e\x63\x72\x79\x70\x74\x20\x6c\x69\x73\x74\x65\x6e\x73\x20\x6f\x6e\x2c\x20\x63\x6f\x6d\x6d\x65\x6e\x74\x20\x74\x68\x69\x73\x20\x6f\x75\x74\x20\x74\x6f\x20\x6c\x65\x74\x20\x69\x74\x20\x62\x69\x6e\x64\x0a\x23\x20\x74\x6f\x20\x70\x6f\x72\x74\x20\x38\x30\x20\x61\x73\x20\x6e\x65\x65\x64\x65\x64\x2c\x20\x64\x6f\x69\x6e\x67\x20\x73\x6f\x20\x6d\x65\x61\x6e\x73\x20\x64\x69\x73\x70\x61\x74\x63\x68\x20\x69\x74\x73\x65\x6c\x66\x20\x63\x61\x6e\x6e\x6f\x74\x20\x75\x73\x65\x20\x70\x6f\x72\x74\x20\x38\x30\x0a\x70\x6f\x72\x74\x20\x3d\x20\x35\x30\x30\x31\x0a\x23\x20\x48\x61\x76\x65\x20\x64\x69\x73\x70\x61\x74\x63\x68\x20\x70\x72\x6f\x78\x79\x20\x74\x72\x61\x66\x66\x69\x63\x20\x66\x72\x6f\x6d\x20\x70\x6f\x72\x74\x20\x38\x30\x20\x74\x6f\x20\x74\x68\x65\x20\x4c\x65\x74\x27\x73\x20\x45\x6e\x63\x72\x79\x70\x74\x20\x70\x6f\x72\x74\x0a\x70\x72\x6f\x78\x79\x20\x3d\x20\x74\x72\x75\x65\x0a\x0a\x23\x20\x4e\x6f\x74\x20\x69\x6d\x70\x6c\x65\x6d\x65\x6e\x74\x65\x64\x0a\x5b\x61\x75\x74\x68\x5d\x0a\x23\x20\x41\x6c\x6c\x6f\x77\x20\x75\x73\x61\x67\x65\x20\x77\x69\x74\x68\x6f\x75\x74\x20\x62\x65\x69\x6e\x67\x20\x6c\x6f\x67\x67\x65\x64\x20\x69\x6e\x2c\x20\x61\x6c\x6c\x20\x63\x68\x61\x6e\x6e\x65\x6c\x73\x20\x61\x6e\x64\x20\x73\x65\x74\x74\x69\x6e\x67\x73\x20\x67\x65\x74\x0a\x23\x20\x74\x72\x61\x6e\x73\x66\x65\x72\x72\x65\x64\x20\x77\x68\x65\x6e\x20\x6c\x6f\x67\x67\x69\x6e\x67\x20\x69\x6e\x20\x6f\x72\x20\x72\x65\x67\x69\x73\x74\x65\x72\x69\x6e\x67\x0a\x61\x6e\x6f\x6e\x79\x6d\x6f\x75\x73\x20\x3d\x20\x74\x72\x75\x65\x0a\x23\x20\x45\x6e\x61\x62\x6c\x65\x20\x75\x73\x65\x72\x6e\x61\x6d\x65\x2f\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x6c\x6f\x67\x69\x6e\x0a\x6c\x6f\x67\x69\x6e\x20\x3d\x20\x74\x72\x75\x65\x0a\x23\x20\x45\x6e\x61\x62\x6c\x65\x20\x75\x73\x65\x72\x6e\x61\x6d\x65\x2f\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x72\x65\x67\x69\x73\x74\x72\x61\x74\x69\x6f\x6e\x0a\x72\x65\x67\x69\x73\x74\x72\x61\x74\x69\x6f\x6e\x20\x3d\x20\x74\x72\x75\x65\x0a\x0a\x5b\x61\x75\x74\x68\x2e\x67\x69\x74\x68\x75\x62\x5d\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x73\x65\x63\x72\x65\x74\x20\x3d\x20\x22\x22\x0a\x0a\x5b\x61\x75\x74\x68\x2e\x66\x61\x63\x65\x62\x6f\x6f\x6b\x5d\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x73\x65\x63\x72\x65\x74\x20\x3d\x20\x22\x22\x0a\x0a\x5b\x61\x75\x74\x68\x2e\x67\x6f\x6f\x67\x6c\x65\x5d\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x73\x65\x63\x72\x65\x74\x20\x3d\x20\x22\x22\x0a\x0a\x5b\x61\x75\x74\x68\x2e\x74\x77\x69\x74\x74\x65\x72\x5d\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x73\x65\x63\x72\x65\x74\x20\x3d\x20\x22\x22\x0a\x0a\x23\x20\x53\x74\x72\x69\x63\x74\x2d\x54\x72\x61\x6e\x73\x70\x6f\x72\x74\x2d\x53\x65\x63\x75\x72\x69\x74\x79\x0a\x5b\x68\x74\x74\x70\x73\x2e\x68\x73\x74\x73\x5d\x0a\x65\x6e\x61\x62\x6c\x65\x64\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x6d\x61\x78\x5f\x61\x67\x65\x20\x3d\x20\x33\x31\x35\x33\x36\x30\x30\x30\x0a\x69\x6e\x63\x6c\x75\x64\x65\x5f\x73\x75\x62\x64\x6f\x6d\x61\x69\x6e\x73\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x70\x72\x65\x6c\x6f\x61\x64\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a" +var _configDefaultToml = "\x23\x20\x49\x50\x20\x61\x64\x64\x72\x65\x73\x73\x20\x74\x6f\x20\x6c\x69\x73\x74\x65\x6e\x20\x6f\x6e\x2c\x20\x6c\x65\x61\x76\x65\x20\x65\x6d\x70\x74\x79\x20\x74\x6f\x20\x6c\x69\x73\x74\x65\x6e\x20\x6f\x6e\x20\x61\x6e\x79\x74\x68\x69\x6e\x67\x0a\x61\x64\x64\x72\x65\x73\x73\x20\x3d\x20\x22\x22\x0a\x70\x6f\x72\x74\x20\x3d\x20\x38\x30\x0a\x23\x20\x48\x65\x78\x20\x65\x6e\x63\x6f\x64\x65\x20\x74\x68\x65\x20\x75\x73\x65\x72\x73\x20\x49\x50\x20\x61\x6e\x64\x20\x75\x73\x65\x20\x69\x74\x20\x61\x73\x20\x74\x68\x65\x20\x69\x64\x65\x6e\x74\x0a\x68\x65\x78\x49\x50\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x76\x65\x72\x69\x66\x79\x5f\x63\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x73\x20\x3d\x20\x74\x72\x75\x65\x0a\x0a\x23\x20\x44\x65\x66\x61\x75\x6c\x74\x73\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x63\x6c\x69\x65\x6e\x74\x20\x63\x6f\x6e\x6e\x65\x63\x74\x20\x66\x6f\x72\x6d\x0a\x5b\x64\x65\x66\x61\x75\x6c\x74\x73\x5d\x0a\x6e\x61\x6d\x65\x20\x3d\x20\x22\x46\x72\x65\x65\x6e\x6f\x64\x65\x22\x0a\x68\x6f\x73\x74\x20\x3d\x20\x22\x63\x68\x61\x74\x2e\x66\x72\x65\x65\x6e\x6f\x64\x65\x2e\x6e\x65\x74\x22\x0a\x70\x6f\x72\x74\x20\x3d\x20\x36\x36\x39\x37\x0a\x63\x68\x61\x6e\x6e\x65\x6c\x73\x20\x3d\x20\x5b\x0a\x20\x20\x22\x23\x64\x69\x73\x70\x61\x74\x63\x68\x22\x2c\x0a\x20\x20\x22\x23\x67\x6f\x2d\x6e\x75\x74\x73\x22\x0a\x5d\x0a\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x3d\x20\x22\x22\x0a\x73\x73\x6c\x20\x3d\x20\x74\x72\x75\x65\x0a\x23\x20\x4f\x6e\x6c\x79\x20\x61\x6c\x6c\x6f\x77\x20\x61\x20\x6e\x69\x63\x6b\x20\x74\x6f\x20\x62\x65\x20\x66\x69\x6c\x6c\x65\x64\x20\x69\x6e\x0a\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x23\x20\x53\x68\x6f\x77\x20\x73\x65\x72\x76\x65\x72\x20\x61\x6e\x64\x20\x63\x68\x61\x6e\x6e\x65\x6c\x20\x69\x6e\x66\x6f\x20\x77\x68\x65\x6e\x20\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x69\x73\x20\x65\x6e\x61\x62\x6c\x65\x64\x0a\x73\x68\x6f\x77\x5f\x64\x65\x74\x61\x69\x6c\x73\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x0a\x5b\x68\x74\x74\x70\x73\x5d\x0a\x65\x6e\x61\x62\x6c\x65\x64\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x70\x6f\x72\x74\x20\x3d\x20\x34\x34\x33\x0a\x23\x20\x52\x65\x64\x69\x72\x65\x63\x74\x20\x61\x6c\x6c\x20\x68\x74\x74\x70\x20\x74\x72\x61\x66\x66\x69\x63\x20\x74\x6f\x20\x68\x74\x74\x70\x73\x0a\x72\x65\x64\x69\x72\x65\x63\x74\x20\x3d\x20\x74\x72\x75\x65\x0a\x23\x20\x50\x61\x74\x68\x20\x74\x6f\x20\x79\x6f\x75\x72\x20\x63\x65\x72\x74\x20\x61\x6e\x64\x20\x70\x72\x69\x76\x61\x74\x65\x20\x6b\x65\x79\x20\x69\x66\x20\x79\x6f\x75\x20\x61\x72\x65\x20\x6e\x6f\x74\x20\x75\x73\x69\x6e\x67\x0a\x23\x20\x74\x68\x65\x20\x4c\x65\x74\x27\x73\x20\x45\x6e\x63\x72\x79\x70\x74\x20\x69\x6e\x74\x65\x67\x72\x61\x74\x69\x6f\x6e\x0a\x63\x65\x72\x74\x20\x3d\x20\x22\x22\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x0a\x5b\x6c\x65\x74\x73\x65\x6e\x63\x72\x79\x70\x74\x5d\x0a\x23\x20\x59\x6f\x75\x72\x20\x64\x6f\x6d\x61\x69\x6e\x20\x6f\x72\x20\x73\x75\x62\x64\x6f\x6d\x61\x69\x6e\x0a\x64\x6f\x6d\x61\x69\x6e\x20\x3d\x20\x22\x22\x0a\x23\x20\x41\x6e\x20\x65\x6d\x61\x69\x6c\x20\x61\x64\x64\x72\x65\x73\x73\x20\x6c\x65\x74\x73\x20\x79\x6f\x75\x20\x72\x65\x63\x6f\x76\x65\x72\x20\x79\x6f\x75\x72\x20\x61\x63\x63\x6f\x75\x6e\x74\x73\x20\x70\x72\x69\x76\x61\x74\x65\x20\x6b\x65\x79\x0a\x65\x6d\x61\x69\x6c\x20\x3d\x20\x22\x22\x0a\x23\x20\x54\x68\x65\x20\x70\x6f\x72\x74\x20\x4c\x65\x74\x27\x73\x20\x45\x6e\x63\x72\x79\x70\x74\x20\x6c\x69\x73\x74\x65\x6e\x73\x20\x6f\x6e\x2c\x20\x63\x6f\x6d\x6d\x65\x6e\x74\x20\x74\x68\x69\x73\x20\x6f\x75\x74\x20\x74\x6f\x20\x6c\x65\x74\x20\x69\x74\x20\x62\x69\x6e\x64\x0a\x23\x20\x74\x6f\x20\x70\x6f\x72\x74\x20\x38\x30\x20\x61\x73\x20\x6e\x65\x65\x64\x65\x64\x2c\x20\x64\x6f\x69\x6e\x67\x20\x73\x6f\x20\x6d\x65\x61\x6e\x73\x20\x64\x69\x73\x70\x61\x74\x63\x68\x20\x69\x74\x73\x65\x6c\x66\x20\x63\x61\x6e\x6e\x6f\x74\x20\x75\x73\x65\x20\x70\x6f\x72\x74\x20\x38\x30\x0a\x70\x6f\x72\x74\x20\x3d\x20\x35\x30\x30\x31\x0a\x23\x20\x48\x61\x76\x65\x20\x64\x69\x73\x70\x61\x74\x63\x68\x20\x70\x72\x6f\x78\x79\x20\x74\x72\x61\x66\x66\x69\x63\x20\x66\x72\x6f\x6d\x20\x70\x6f\x72\x74\x20\x38\x30\x20\x74\x6f\x20\x74\x68\x65\x20\x4c\x65\x74\x27\x73\x20\x45\x6e\x63\x72\x79\x70\x74\x20\x70\x6f\x72\x74\x0a\x70\x72\x6f\x78\x79\x20\x3d\x20\x74\x72\x75\x65\x0a\x0a\x23\x20\x4e\x6f\x74\x20\x69\x6d\x70\x6c\x65\x6d\x65\x6e\x74\x65\x64\x0a\x5b\x61\x75\x74\x68\x5d\x0a\x23\x20\x41\x6c\x6c\x6f\x77\x20\x75\x73\x61\x67\x65\x20\x77\x69\x74\x68\x6f\x75\x74\x20\x62\x65\x69\x6e\x67\x20\x6c\x6f\x67\x67\x65\x64\x20\x69\x6e\x2c\x20\x61\x6c\x6c\x20\x63\x68\x61\x6e\x6e\x65\x6c\x73\x20\x61\x6e\x64\x20\x73\x65\x74\x74\x69\x6e\x67\x73\x20\x67\x65\x74\x0a\x23\x20\x74\x72\x61\x6e\x73\x66\x65\x72\x72\x65\x64\x20\x77\x68\x65\x6e\x20\x6c\x6f\x67\x67\x69\x6e\x67\x20\x69\x6e\x20\x6f\x72\x20\x72\x65\x67\x69\x73\x74\x65\x72\x69\x6e\x67\x0a\x61\x6e\x6f\x6e\x79\x6d\x6f\x75\x73\x20\x3d\x20\x74\x72\x75\x65\x0a\x23\x20\x45\x6e\x61\x62\x6c\x65\x20\x75\x73\x65\x72\x6e\x61\x6d\x65\x2f\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x6c\x6f\x67\x69\x6e\x0a\x6c\x6f\x67\x69\x6e\x20\x3d\x20\x74\x72\x75\x65\x0a\x23\x20\x45\x6e\x61\x62\x6c\x65\x20\x75\x73\x65\x72\x6e\x61\x6d\x65\x2f\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x72\x65\x67\x69\x73\x74\x72\x61\x74\x69\x6f\x6e\x0a\x72\x65\x67\x69\x73\x74\x72\x61\x74\x69\x6f\x6e\x20\x3d\x20\x74\x72\x75\x65\x0a\x0a\x5b\x61\x75\x74\x68\x2e\x67\x69\x74\x68\x75\x62\x5d\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x73\x65\x63\x72\x65\x74\x20\x3d\x20\x22\x22\x0a\x0a\x5b\x61\x75\x74\x68\x2e\x66\x61\x63\x65\x62\x6f\x6f\x6b\x5d\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x73\x65\x63\x72\x65\x74\x20\x3d\x20\x22\x22\x0a\x0a\x5b\x61\x75\x74\x68\x2e\x67\x6f\x6f\x67\x6c\x65\x5d\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x73\x65\x63\x72\x65\x74\x20\x3d\x20\x22\x22\x0a\x0a\x5b\x61\x75\x74\x68\x2e\x74\x77\x69\x74\x74\x65\x72\x5d\x0a\x6b\x65\x79\x20\x3d\x20\x22\x22\x0a\x73\x65\x63\x72\x65\x74\x20\x3d\x20\x22\x22\x0a\x0a\x23\x20\x53\x74\x72\x69\x63\x74\x2d\x54\x72\x61\x6e\x73\x70\x6f\x72\x74\x2d\x53\x65\x63\x75\x72\x69\x74\x79\x0a\x5b\x68\x74\x74\x70\x73\x2e\x68\x73\x74\x73\x5d\x0a\x65\x6e\x61\x62\x6c\x65\x64\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x6d\x61\x78\x5f\x61\x67\x65\x20\x3d\x20\x33\x31\x35\x33\x36\x30\x30\x30\x0a\x69\x6e\x63\x6c\x75\x64\x65\x5f\x73\x75\x62\x64\x6f\x6d\x61\x69\x6e\x73\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a\x70\x72\x65\x6c\x6f\x61\x64\x20\x3d\x20\x66\x61\x6c\x73\x65\x0a" func configDefaultTomlBytes() ([]byte, error) { return bindataRead( @@ -125,7 +125,7 @@ func configDefaultToml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config.default.toml", size: 1498, mode: os.FileMode(436), modTime: time.Unix(1533925483, 0)} + info := bindataFileInfo{name: "config.default.toml", size: 1572, mode: os.FileMode(436), modTime: time.Unix(1534890194, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/config.default.toml b/config.default.toml index 4145764f..a4e657d6 100644 --- a/config.default.toml +++ b/config.default.toml @@ -1,3 +1,5 @@ +# IP address to listen on, leave empty to listen on anything +address = "" port = 80 # Hex encode the users IP and use it as the ident hexIP = false diff --git a/server/server.go b/server/server.go index aafb8261..dac405ce 100644 --- a/server/server.go +++ b/server/server.go @@ -106,6 +106,7 @@ func (d *Dispatch) loadUser(user *storage.User) { } func (d *Dispatch) startHTTP() { + addr := viper.GetString("address") port := viper.GetString("port") if viper.GetBool("https.enabled") { @@ -114,11 +115,11 @@ func (d *Dispatch) startHTTP() { if redirect { log.Println("[HTTP] Listening on port", port, "(HTTPS Redirect)") - go http.ListenAndServe(":"+port, createHTTPSRedirect(portHTTPS)) + go http.ListenAndServe(net.JoinHostPort(addr, port), createHTTPSRedirect(portHTTPS)) } server := &http.Server{ - Addr: ":" + portHTTPS, + Addr: net.JoinHostPort(addr, portHTTPS), Handler: http.HandlerFunc(d.serve), } @@ -132,7 +133,7 @@ func (d *Dispatch) startHTTP() { if viper.GetBool("letsencrypt.proxy") && lePort != "" && (port != "80" || !redirect) { log.Println("[HTTP] Listening on port 80 (Let's Encrypt Proxy))") - go http.ListenAndServe(":80", http.HandlerFunc(letsEncryptProxy)) + go http.ListenAndServe(net.JoinHostPort(addr, "80"), http.HandlerFunc(letsEncryptProxy)) } le, err := letsencrypt.Run(dir, domain, email, ":"+lePort) @@ -156,7 +157,7 @@ func (d *Dispatch) startHTTP() { port = "1337" } log.Println("[HTTP] Listening on port", port) - log.Fatal(http.ListenAndServe(":"+port, http.HandlerFunc(d.serve))) + log.Fatal(http.ListenAndServe(net.JoinHostPort(addr, port), http.HandlerFunc(d.serve))) } }