From a73d0fb13be6df16e5874bc62b746de14f9960a7 Mon Sep 17 00:00:00 2001 From: Sascha Weller Date: Fri, 20 Mar 2026 08:45:18 +0100 Subject: [PATCH 1/4] Add hide_api_docs config option to toggle API documentation on the website Co-Authored-By: Claude Sonnet 4.6 --- config.json | 3 ++- index.html | 4 ++++ pages.go | 18 ++++++++++-------- types.go | 3 ++- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/config.json b/config.json index db6aecd..b55fe06 100644 --- a/config.json +++ b/config.json @@ -3,5 +3,6 @@ "port": 8089, "vdir": "/wolweb", "bcastip": "192.168.1.255:9", - "read_only": false + "read_only": true, + "hide_api_docs": true } diff --git a/index.html b/index.html index 4b02f23..5187609 100644 --- a/index.html +++ b/index.html @@ -48,6 +48,7 @@

Devices

+ {{ if not .HideAPIDocs }}

Wake-up directly using HTTP Requests

@@ -99,6 +100,7 @@

+ {{ end }}

Project Page: https://github.com/sameerdhoot/wolweb @@ -116,11 +118,13 @@

window.vDir = "{{$.VDir}}" window.bCastIP = "{{$.BCastIP}}" + {{ if not .HideAPIDocs }} $( "#code-element" ).load( "static/api-sample.txt" , function() { hljs.highlightAll(); }); document.getElementById("app-vdir").innerHTML = window.vDir + "/wake/" + {{ end }} Toast.setMaxCount(3); Toast.enableQueue(true); diff --git a/pages.go b/pages.go index 09250bd..d789367 100644 --- a/pages.go +++ b/pages.go @@ -14,15 +14,17 @@ var indexHtml string func renderHomePage(w http.ResponseWriter, r *http.Request) { pageData := struct { - Devices []Device - VDir string - BCastIP string - ReadOnly bool + Devices []Device + VDir string + BCastIP string + ReadOnly bool + HideAPIDocs bool }{ - Devices: appData.Devices, - VDir: appConfig.VDir, - BCastIP: appConfig.BCastIP, - ReadOnly: appConfig.ReadOnly, + Devices: appData.Devices, + VDir: appConfig.VDir, + BCastIP: appConfig.BCastIP, + ReadOnly: appConfig.ReadOnly, + HideAPIDocs: appConfig.HideAPIDocs, } if appConfig.VDir == "/" { pageData.VDir = "" diff --git a/types.go b/types.go index 50b0a72..c0f1af4 100644 --- a/types.go +++ b/types.go @@ -26,5 +26,6 @@ type AppConfig struct { Port int `json:"port" env:"WOLWEBPORT" env-default:"8089"` VDir string `json:"vdir" env:"WOLWEBVDIR" env-default:"/wolweb"` BCastIP string `json:"bcastip" env:"WOLWEBBCASTIP" env-default:"192.168.1.255:9"` - ReadOnly bool `json:"read_only" env:"WOLWEBREADONLY" env-default:"false"` + ReadOnly bool `json:"read_only" env:"WOLWEBREADONLY" env-default:"false"` + HideAPIDocs bool `json:"hide_api_docs" env:"WOLWEBHIDEAPIDOCS" env-default:"false"` } From 4f19202a9981693edc910c015c7062a13718cce1 Mon Sep 17 00:00:00 2001 From: Sascha Weller Date: Fri, 20 Mar 2026 09:37:33 +0100 Subject: [PATCH 2/4] Add WOLWEBHIDEAPIDOCS env var to Dockerfiles and docker-compose Co-Authored-By: Claude Sonnet 4.6 --- Debian_Dockerfile | 2 ++ Dockerfile | 2 ++ docker-compose.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/Debian_Dockerfile b/Debian_Dockerfile index af97503..e110321 100644 --- a/Debian_Dockerfile +++ b/Debian_Dockerfile @@ -31,8 +31,10 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ ARG WOLWEBPORT=8089 ARG WOLWEBVDIR=/wolweb +ARG WOLWEBHIDEAPIDOCS=false ENV WOLWEBPORT=${WOLWEBPORT} ENV WOLWEBVDIR=${WOLWEBVDIR} +ENV WOLWEBHIDEAPIDOCS=${WOLWEBHIDEAPIDOCS} CMD ["/wolweb/wolweb"] diff --git a/Dockerfile b/Dockerfile index c92f3c4..decfd31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,10 @@ RUN apk add --no-cache curl ARG WOLWEBPORT=8089 ARG WOLWEBVDIR=/wolweb +ARG WOLWEBHIDEAPIDOCS=false ENV WOLWEBPORT=${WOLWEBPORT} ENV WOLWEBVDIR=${WOLWEBVDIR} +ENV WOLWEBHIDEAPIDOCS=${WOLWEBHIDEAPIDOCS} CMD ["/wolweb/wolweb"] diff --git a/docker-compose.yml b/docker-compose.yml index 33c3782..cdcccc5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,3 +22,4 @@ services: WOLWEBPORT: "8089" #WOLWEBVDIR: "/wolweb" WOLWEBBCASTIP: "192.168.1.255:9" + #WOLWEBHIDEAPIDOCS: "false" From f0f93c742ed9828ba35fa7b6635046fb0446faad Mon Sep 17 00:00:00 2001 From: Sascha Weller Date: Fri, 20 Mar 2026 09:52:11 +0100 Subject: [PATCH 3/4] updates the default config values for read_only and hide_api_docs to false --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index b55fe06..91cc329 100644 --- a/config.json +++ b/config.json @@ -3,6 +3,6 @@ "port": 8089, "vdir": "/wolweb", "bcastip": "192.168.1.255:9", - "read_only": true, - "hide_api_docs": true + "read_only": false, + "hide_api_docs": false } From 97f396d753fb86ad0bf1d689b9d0d34bb703b048 Mon Sep 17 00:00:00 2001 From: Sascha Weller Date: Fri, 20 Mar 2026 09:56:48 +0100 Subject: [PATCH 4/4] Document hide_api_docs config option in README Co-Authored-By: Claude Sonnet 4.6 --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a54de8f..52e668a 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ The application will use the following default values if they are not explicitly | Virtual Directory | A virtual directory to mount this application under | **/wolweb** | Broadcast IP and Port | This is broadcast IP address and port for the local network. *Please include the port :9* | **192.168.1.255:9** | Read Only | If set to true, the UI will be read only | **false** +| Hide API Docs | If set to true, the API documentation section is hidden on the web UI | **false** You can override the default application configuration by using a config file or by setting environment variables. The application will first load values from config file and look for environment variables and overwrites values from the file with the values which were found in the environment. @@ -62,7 +63,8 @@ You can override the default application configuration by using a config file or "port": 8089, "vdir":"/wolweb", "bcastip":"192.168.1.255:9", - "read_only":false + "read_only":false, + "hide_api_docs":false } ``` **Using Environment Variables:** @@ -76,6 +78,7 @@ You can override the default application configuration by using a config file or | WOLWEBVDIR | Override for default virtual directory | WOLWEBBCASTIP | Override for broadcast IP address and port | WOLWEBREADONLY | Override for read only mode of UI +| WOLWEBHIDEAPIDOCS | Override for hiding the API documentation section on the web UI ## Devices (targets) - devices.json format ```json