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 | +| ------------------------------- | :-----------------------------------------: | +| ![2 column widget](preview.png) | ![Single column Widget](preview-single.png) | + +#### 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 + }} + + + {{ else }} +

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 TypePreview
+ +`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 +``` + + + +![No Icons ](preview-no-icon.png) + +
+ +`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 +``` + + + +![Default Icon Preview](preview-default-icon.png) + +
+ +`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 +``` + + + +![Custom Icon Prevewie ](preview-custom-icon.png) + +
+ +#### Environment Variables + +- `NGINX_PROXY_URL` : Nginx Proxy Url of the hosted intance either the IP or domain name like https://proxy.example.com + +- `NGINX_EMAIL_ID` : Nginx Console login email id + +- `NGINX_PASSWORD` : Nginx Console password diff --git a/widgets/nginx-proxy-manager/meta.yml b/widgets/nginx-proxy-manager/meta.yml new file mode 100644 index 0000000..df1ac42 --- /dev/null +++ b/widgets/nginx-proxy-manager/meta.yml @@ -0,0 +1,3 @@ +title: Nginx Proxy Manager +description: Shows a summary of Nginx Proxy Configration and host links +author: saif191020 diff --git a/widgets/nginx-proxy-manager/preview-custom-icon.png b/widgets/nginx-proxy-manager/preview-custom-icon.png new file mode 100644 index 0000000..b2443b7 Binary files /dev/null and b/widgets/nginx-proxy-manager/preview-custom-icon.png differ diff --git a/widgets/nginx-proxy-manager/preview-default-icon.png b/widgets/nginx-proxy-manager/preview-default-icon.png new file mode 100644 index 0000000..e9b9fa5 Binary files /dev/null and b/widgets/nginx-proxy-manager/preview-default-icon.png differ diff --git a/widgets/nginx-proxy-manager/preview-no-icon.png b/widgets/nginx-proxy-manager/preview-no-icon.png new file mode 100644 index 0000000..e49380f Binary files /dev/null and b/widgets/nginx-proxy-manager/preview-no-icon.png differ diff --git a/widgets/nginx-proxy-manager/preview-single.png b/widgets/nginx-proxy-manager/preview-single.png new file mode 100644 index 0000000..858f291 Binary files /dev/null and b/widgets/nginx-proxy-manager/preview-single.png differ diff --git a/widgets/nginx-proxy-manager/preview.png b/widgets/nginx-proxy-manager/preview.png new file mode 100644 index 0000000..7dec75a Binary files /dev/null and b/widgets/nginx-proxy-manager/preview.png differ