From c1a78f5d3d59fb195b98d18671d33a21940894be Mon Sep 17 00:00:00 2001 From: Sammy Libre Date: Wed, 7 Dec 2016 11:47:15 +0500 Subject: [PATCH] Add option to disable Web-UI --- config.example.json | 1 + go-pool/pool/pool.go | 1 + main.go | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.example.json b/config.example.json index f3cb569..86e0aca 100644 --- a/config.example.json +++ b/config.example.json @@ -37,6 +37,7 @@ }, "frontend": { + "enabled": true, "listen": "0.0.0.0:8082", "login": "admin", "password": "", diff --git a/go-pool/pool/pool.go b/go-pool/pool/pool.go index 33b5be6..80d226b 100644 --- a/go-pool/pool/pool.go +++ b/go-pool/pool/pool.go @@ -39,6 +39,7 @@ type Upstream struct { } type Frontend struct { + Enabled bool `json:"enabled"` Listen string `json:"listen"` Login string `json:"login"` Password string `json:"password"` diff --git a/main.go b/main.go index 452b5ba..5ad5161 100644 --- a/main.go +++ b/main.go @@ -31,7 +31,9 @@ func startStratum() { } s := stratum.NewStratum(&cfg) - go startFrontend(&cfg, s) + if cfg.Frontend.Enabled { + startFrontend(&cfg, s) + } s.Listen() }