mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[PR #3364] Added support for ddns lookups for addresses in access lists #3687
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#3687
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/3364
Author: @vari
Created: 12/3/2023
Status: 🔄 Open
Base:
develop← Head:access-list-client-ddns-support📝 Commits (8)
5586709Initial pass at DDNS support for client addressesec9eb0dRefactor and integrate ddns resolution with nginx module972d158fix linter warnings33f41f7Fix utils.js linter error743cdd8Eliminate circular dependency7b09fefUpdate configs for active hosts only on ddns update3b0ff57doc string updatee317900Add support for '-' in ddns domain names📊 Changes
7 files changed (+338 additions, -10 deletions)
View changed files
📝
backend/index.js(+2 -0)📝
backend/internal/nginx.js(+45 -9)➕
backend/lib/ddns_resolver/ddns_resolver.js(+83 -0)➕
backend/lib/ddns_resolver/ddns_updater.js(+167 -0)📝
backend/lib/utils.js(+35 -0)📝
backend/logger.js(+2 -1)📝
backend/schema/endpoints/access-lists.json(+4 -0)📄 Description
Added support for
ddns:somedomain.whateverddns.comaddress format in the client access lists.This allows users to specify domain names instead of IP addresses for allow/deny lists, thereby allowing dynamic allow/deny lists.
This is useful if users have a service exposed to the public internet via a ddns domain, and they want to limit it so that only users from the local network can access the service on the ddns domain.
In theory, this is probably already possible by using custom DNS server to prevent any local network request to the domain name from going outside to the internet (and then setting allow list to local subnet in proxy manager), but not everyone can (or will) use a custom DNS server for their setup.
The new ddns support makes it trivially easy for anyone to limit to local network if they are using ddns without having to mess with custom DNS servers or network configuration. Also, if users want to expose their service to a fixed number of external users, then the ddns lookup can be used with the allow list provided the external users are using a ddns service. E.g. if I want to share a service on my network to 2 friends, and each friend uses a ddns that points to their public IP (friend1.domain.com, friend2.domain.com), then I can just add
ddns:friend1.domain.comandddns:friend2.domain.comto my allow list in proxy manager and they will continue to have access even if their public IP changes. I won't have to manually go an update the access list every time the IP changes.This should address #1708 and #2240 .
Compared to some of the existing solutions mentioned in the above issues, this implementation should be the simplest with minimal overhead and no other dependencies (e.g. no cron, env vars, etc needed). Can directly specify the domains in the normal allow list UI.
Usage:
ddns:e.g. If you want to add the dynamic hosts
yourdomain.ddns.comandyourdomain2.ddns.comto your allow list, do the following:DDNS_UPDATE_INTERVALenv var to the desired number of seconds (minimum 60).On start up, all used domains will be resolved and any associated hosts will be updated in nginx about 10s after the proxy manager starts (10s buffer ensures server has enough time to finish loading).
Disclaimers:
getent hosts <hostname>to look up the IP of the user defined domains - if there is a better way, please let me know and I can update the PR. I've tried to make it safe by using spawn instead of exec to prevent issues with unsanitized user inputs, however I'm not doing any custom sanitization.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.