mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-28 01:37:50 -05:00
[PR #1811] [CLOSED] Prevent database corruption from duplicate Docker label resource names across sites #2718
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/1811
Author: @Copilot
Created: 11/4/2025
Status: ❌ Closed
Base:
dev← Head:copilot/fix-duplicate-docker-labels📝 Commits (4)
51d87c8Initial plan542abb7Add duplicate resource name detection across sites8884f52Add detailed comments and debug logging for duplicate detection75595d1Address code review feedback: simplify logic and improve performance📊 Changes
2 files changed (+104 additions, -1 deletions)
View changed files
📝
server/lib/blueprints/clientResources.ts(+40 -0)📝
server/lib/blueprints/proxyResources.ts(+64 -1)📄 Description
When multiple Newt instances use identical resource names in Docker labels (e.g.,
pangolin.proxy-resources.syncthingon host1 and host2), they overwrite the same database record, nulling fields and causing service outages.Changes
Duplicate detection in blueprint application
niceIdexists with targets/config on differentsiteIdbefore updateError handling
syncthing-host1)Implementation details
proxyResources.ts: Query existing targets bysiteId, validate against update sourceclientResources.ts: ValidateexistingResource.siteId !== site.siteIdbefore updateinArrayfor efficient multi-site lookupsExample error
Previously this scenario corrupted the database silently. Now it fails fast with clear remediation.
Original prompt
This section details on the original issue you should resolve
<issue_title>Duplicate docker labels breaking Pangolin</issue_title>
<issue_description>### Describe the Bug
I'm trying out Pangolin and want to get away from the hidden database-method of configuring things, I want everything with docker labels - enter blueprints.
Unfortunately when you do a configuration mistake and create duplicate names, all docker labels configured resources are deleted in the database, more specifically:
subDomainis nulled andfullDomainis set to the base domain.Environment
OS Type & Version: Debian & Ubuntu
Pangolin Version: 1.11.0
Gerbil Version: 1.2.1
Traefik Version: v3.5.3
Newt Version: 1.5.2
To Reproduce
The infinite redirect may be my specific use case as the base domain
domain.example.orgis the domain where Pangolin lives. Checking the database, I see that that several entries are nulled and I have to manually fix them in the database(I anonymized the base domain in the above screenshot - so syncthing in this example has set the base domain of
domain.example.orginstead of the example ofsyncthing-host1.domain.example.org). Since there are now multiple entries in traefik with the same base domain, I assume that is why I get infinite redirects.Given the above example from the screenshot, I need to set the subdomain for n8n, as well as the
fullDomain(i.e.n8n.domain.example.org) in the database and...💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.