Skip to content

Edit feature for certification to update the DNS settings#5377

Open
lokeshkato wants to merge 2 commits intoNginxProxyManager:developfrom
lokeshkato:edit-feature-for-certificates
Open

Edit feature for certification to update the DNS settings#5377
lokeshkato wants to merge 2 commits intoNginxProxyManager:developfrom
lokeshkato:edit-feature-for-certificates

Conversation

@lokeshkato
Copy link

@lokeshkato lokeshkato commented Mar 5, 2026

Summary

Currently, the application lacks the ability to modify the DNS Provider configuration once an SSL certificate has been created. If a user’s DNS API key expires, is rotated for security, or needs to be corrected, there is no mechanism within the UI to update these credentials. This creates a significant bottleneck for maintaining automated renewals via DNS-01 challenges.

Technical Details

  1. Backend: certificate.js – update() for LE DNS: merge meta, patch DB, then use same flow as create (disable hosts → requestLetsEncryptSslWithDnsChallenge → enable hosts + reload nginx), then refresh expires_on.
  2. Frontend: "Edit DNS Settings" dropdown item for LE DNS certs.
  3. Locales: All 22 locale JSON files (en, de, fr, etc.) updated with certificates.edit-dns-settings and certificates.dns.credentials-update.

Screenshots

Screenshot 2026-03-05 at 2 50 21 PM Screenshot 2026-03-05 at 2 50 35 PM

Why this helps

  • Efficiency: Eliminates the need to manually update dozens of Proxy Hosts just to change a single API string.
  • Security: Encourages users to rotate their DNS API keys regularly, as the process would no longer be a destructive administrative task.
  • User Experience: Aligns the SSL management workflow with the rest of the application (like Proxy Hosts, Streams, Redirection Hosts), where settings are expected to be editable rather than permanent.
  • Reduced Downtime: Prevents certificates from expiring due to "unfixable" credential errors, ensuring services remain accessible and secure.

#5367

@nginxproxymanagerci
Copy link

CI Error:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
certbot-node: Pulling from nginxproxymanager/nginx-full
Digest: sha256:aebca10f754dd4e1f745fa613bb7a685cfa3d0b1f21c8515e134548b7187084b
Status: Image is up to date for nginxproxymanager/nginx-full:certbot-node
docker.io/nginxproxymanager/nginx-full:certbot-node
�[1;34m❯ �[1;36mBuilding Frontend ...�[0m
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @uiw/react-textarea-code-editor@3.1.1" has unmet peer dependency "@babel/runtime@>=7.10.0".
[4/4] Building fresh packages...
Done in 28.91s.
yarn run v1.22.22
$ biome lint
src/components/Form/DNSProviderFields.tsx:46:2 lint/correctness/useExhaustiveDependencies ━━━━━━━━━━

  × This hook specifies a dependency more specific than its captures: selectedOption?.value
  
    45 │ 	// When a provider is selected and credentials are empty, use the template from dns-plugins.json as the value
  > 46 │ 	useEffect(() => {
       │ 	^^^^^^^^^
    47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
  
  i This capture is more generic than...
  
    45 │ 	// When a provider is selected and credentials are empty, use the template from dns-plugins.json as the value
    46 │ 	useEffect(() => {
  > 47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
       │ 		    ^^^^^^^^^^^^^^
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
    49 │ 		}
  
  i ...this dependency.
  
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
    49 │ 		}
  > 50 │ 	}, [selectedOption?.value]);
       │ 	    ^^^^^^^^^^^^^^^^^^^^^
    51 │ 
    52 │ 	return (
  

src/components/Form/DNSProviderFields.tsx:46:2 lint/correctness/useExhaustiveDependencies  FIXABLE  ━━━━━━━━━━

  × This hook does not specify its dependency on selectedOption.credentials.
  
    45 │ 	// When a provider is selected and credentials are empty, use the template from dns-plugins.json as the value
  > 46 │ 	useEffect(() => {
       │ 	^^^^^^^^^
    47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
  
  i This dependency is being used here, but is not specified in the hook dependency list.
  
    46 │ 	useEffect(() => {
    47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
  > 48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
       │ 			                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    49 │ 		}
    50 │ 	}, [selectedOption?.value]);
  
  i React relies on hook dependencies to determine when to re-compute Effects.
    Failing to specify dependencies can result in Effects not updating correctly when state changes.
    These "stale closures" are a common source of surprising bugs.
  
  i Unsafe fix: Add the missing dependency selectedOption.credentials to the list.
  
    50 │ → },·[selectedOption?.value,·selectedOption.credentials]);
       │                            ++++++++++++++++++++++++++++   

src/components/Form/DNSProviderFields.tsx:46:2 lint/correctness/useExhaustiveDependencies  FIXABLE  ━━━━━━━━━━

  × This hook does not specify its dependency on v.meta?.dnsProviderCredentials.
  
    45 │ 	// When a provider is selected and credentials are empty, use the template from dns-plugins.json as the value
  > 46 │ 	useEffect(() => {
       │ 	^^^^^^^^^
    47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
  
  i This dependency is being used here, but is not specified in the hook dependency list.
  
    45 │ 	// When a provider is selected and credentials are empty, use the template from dns-plugins.json as the value
    46 │ 	useEffect(() => {
  > 47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
       │ 		                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
    49 │ 		}
  
  i React relies on hook dependencies to determine when to re-compute Effects.
    Failing to specify dependencies can result in Effects not updating correctly when state changes.
    These "stale closures" are a common source of surprising bugs.
  
  i Unsafe fix: Add the missing dependency v.meta?.dnsProviderCredentials to the list.
  
    50 │ → },·[selectedOption?.value,·v.meta?.dnsProviderCredentials]);
       │                            ++++++++++++++++++++++++++++++++   

src/components/Form/DNSProviderFields.tsx:46:2 lint/correctness/useExhaustiveDependencies  FIXABLE  ━━━━━━━━━━

  × This hook does not specify its dependency on selectedOption.
  
    45 │ 	// When a provider is selected and credentials are empty, use the template from dns-plugins.json as the value
  > 46 │ 	useEffect(() => {
       │ 	^^^^^^^^^
    47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
  
  i This dependency is being used here, but is not specified in the hook dependency list.
  
    45 │ 	// When a provider is selected and credentials are empty, use the template from dns-plugins.json as the value
    46 │ 	useEffect(() => {
  > 47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
       │ 		    ^^^^^^^^^^^^^^
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
    49 │ 		}
  
  i React relies on hook dependencies to determine when to re-compute Effects.
    Failing to specify dependencies can result in Effects not updating correctly when state changes.
    These "stale closures" are a common source of surprising bugs.
  
  i Unsafe fix: Add the missing dependency selectedOption to the list.
  
    50 │ → },·[selectedOption?.value,·selectedOption]);
       │                            ++++++++++++++++   

src/components/Form/DNSProviderFields.tsx:46:2 lint/correctness/useExhaustiveDependencies  FIXABLE  ━━━━━━━━━━

  × This hook does not specify its dependency on setFieldValue.
  
    45 │ 	// When a provider is selected and credentials are empty, use the template from dns-plugins.json as the value
  > 46 │ 	useEffect(() => {
       │ 	^^^^^^^^^
    47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
    48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
  
  i This dependency is being used here, but is not specified in the hook dependency list.
  
    46 │ 	useEffect(() => {
    47 │ 		if (selectedOption && (v.meta?.dnsProviderCredentials ?? "") === "") {
  > 48 │ 			setFieldValue("meta.dnsProviderCredentials", selectedOption.credentials);
       │ 			^^^^^^^^^^^^^
    49 │ 		}
    50 │ 	}, [selectedOption?.value]);
  
  i React relies on hook dependencies to determine when to re-compute Effects.
    Failing to specify dependencies can result in Effects not updating correctly when state changes.
    These "stale closures" are a common source of surprising bugs.
  
  i Unsafe fix: Add the missing dependency setFieldValue to the list.
  
    50 │ → },·[selectedOption?.value,·setFieldValue]);
       │                            +++++++++++++++   

Checked 227 files in 115ms. No fixes applied.
Found 5 errors.
lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × Some errors were emitted while running checks.
  

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant