diff --git a/widgets/nginx-proxy-manager/README.md b/widgets/nginx-proxy-manager/README.md new file mode 100644 index 0000000..7b51fe4 --- /dev/null +++ b/widgets/nginx-proxy-manager/README.md @@ -0,0 +1,221 @@ +# Nginx Proxy Manager + +A Widget to show current Nginx Proxy Configration, click the subdomain name or the host ip to land into corrospnding pages + +| Horizontal Widget | Verical Widget | +| ------------------------------- | :-----------------------------------------: | +|  |  | + +#### Configuration + +```yaml +- type: custom-api + title: Nginx Proxy Manager + cache: 12h + url: ${NGINX_PROXY_URL}/api/tokens + method: POST + body-type: json + body: + identity: ${NGINX_EMAIL_ID} + secret: ${NGINX_PASSWORD} + options: + collapse-after: 6 + show-icons: true + domain-name: ".example.com" # this is your top level DNS domain name + tooltip-enabled: true + # if you want custom icons add here [either simple icon id or full url] + code: coder + paperless: paperlessngx + docker: docker + glance: https://cdn.jsdelivr.net/gh/selfhst/icons/svg/glance-dark.svg + portainer: portainer + + template: | + + + {{ $defaultIconUrl := "https://cdn.jsdelivr.net/gh/selfhst/icons/svg/nginx-proxy-manager.svg" }} + + {{ if eq .Response.StatusCode 200 }} + {{ $accessToken := .JSON.String "token" }} + {{ + $proxyHosts := newRequest (concat "${NGINX_PROXY_URL}" "/api/nginx/proxy-hosts") + | withHeader "Authorization" (print "Bearer " $accessToken) + | getResponse + }} +
Failed to get token: {{ .JSON.String "error.message" }} ({{ $.Response.Status }})
+ {{ end }} +``` + +#### Options + +##### Explantion of avalable Options: + +- **collapse-after** : Number of proxies to show when page loads [Int] +- **show-icons** : Hide or show Icons [Booelan] +- **domain-name** : Top level DNS domain name, eg: In `https://homeassistant.example.com`; Here `.example.com` would be the domain name +- **tooltip-enabled** : Hide or show tooltip on subdomain name + +For custom icon your need to enter in the following way : + +- Key: Value [where Key is you sub domain ] & value is either Simple Icon ID from https://simpleicons.org/ or a full URL +- Provide dark url by default [check example below] based on the theme it would auto switch with light or dark + +for coloured icon provide urls and remove the following css lines `:root[data-scheme="dark"] .widget-ngix-proxy-icon` [this disables auto invert] + +To change the default icon update the $defaultIconUrl + +##### Useage: + +| Configration Type | +Preview | +
| + +`Default [minimal config]` + +```yaml +options: + collapse-after: 6 + show-icons: false + domain-name: ".example.com" # this is your top level DNS domain name + tooltip-enabled: true +``` + + | ++ + + + | +
| + +`Default Icons` + +```yaml +options: + collapse-after: 6 + show-icons: true + domain-name: ".example.com" # this is your top level DNS domain name + tooltip-enabled: true +``` + + | ++ + + + | +
| + +`Custom Icons` + +```yaml +options: + collapse-after: 6 + show-icons: true + domain-name: ".example.com" # this is your top level DNS domain name + tooltip-enabled: true + # if you want custom icons add here [either simple icon id from [https://simpleicons.org/] or full url] + code: coder + paperless: paperlessngx + home: homeassistant + cup: buymeacoffee + docker: docker + glance: https://cdn.jsdelivr.net/gh/selfhst/icons/svg/glance-dark.svg + portainer: portainer + proxy: nginxproxymanager + pve: proxmox + speedtest: speedtest + logs: https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dozzle-dark.svg +``` + + | ++ + + + | +