diff --git a/main.go b/main.go index 6b74c4c..9fe3b23 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,7 @@ import ( type Configuration struct { hostname string // Displayed Hostname + cmd_hostname string // Displayed Hostname for CMD section host string // Listened Host port string // HTTP Port proxy_listener string // Proxy Protocol Listener @@ -31,6 +32,9 @@ var configuration = Configuration{} func init() { hostname := getEnvWithDefault("HOSTNAME", "ifconfig.io") + protocol := getEnvWithDefault("CMD_PROTOCOL", "") + + cmd_hostname := protocol + hostname host := getEnvWithDefault("HOST", "") port := getEnvWithDefault("PORT", "8080") @@ -48,6 +52,7 @@ func init() { configuration = Configuration{ hostname: hostname, + cmd_hostname: cmd_hostname, host: host, port: port, proxy_listener: proxy_listener, @@ -110,6 +115,7 @@ func mainHandler(c *gin.Context) { //} c.Set("ifconfig_hostname", configuration.hostname) + c.Set("ifconfig_cmd_hostname", configuration.cmd_hostname) ua := c.Request.UserAgent() diff --git a/templates/index.html b/templates/index.html index bdccfad..ba3b1e2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,11 +16,29 @@ -moz-user-select: none; -ms-user-select: none; user-select: none; + color: #555555 + } + + .popup { + display: none; + position: fixed; + background-color: rgba(0, 0, 0, 0.8); + color: #fff; + padding: 5px; + border-radius: 5px; + font-size: 14px; + text-align: center; + z-index: 9999; + width: 70px; + height: 34px; } {{ .ifconfig_hostname }} +