{"id":30436985,"url":"https://github.com/deepspace2/plugnpin","last_synced_at":"2026-05-03T15:35:10.036Z","repository":{"id":310178967,"uuid":"1038768187","full_name":"DeepSpace2/PlugNPiN","owner":"DeepSpace2","description":"Automatically scrapes containers with specific labels and creates local DNS entries in Pi-Hole and proxy hosts in Nginx Proxy Manager","archived":false,"fork":false,"pushed_at":"2025-08-16T10:02:15.000Z","size":598,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-16T10:14:11.824Z","etag":null,"topics":["container","docker","labels","nginx-proxy-manager","npm","pi-hole"],"latest_commit_sha":null,"homepage":"https://deepspace2.github.io/PlugNPiN/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeepSpace2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-15T19:29:29.000Z","updated_at":"2025-08-16T10:04:21.000Z","dependencies_parsed_at":"2025-08-16T17:01:59.257Z","dependency_job_id":null,"html_url":"https://github.com/DeepSpace2/PlugNPiN","commit_stats":null,"previous_names":["deepspace2/plugnpin"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/DeepSpace2/PlugNPiN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2FPlugNPiN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2FPlugNPiN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2FPlugNPiN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2FPlugNPiN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeepSpace2","download_url":"https://codeload.github.com/DeepSpace2/PlugNPiN/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepSpace2%2FPlugNPiN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271736642,"owners_count":24812006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","docker","labels","nginx-proxy-manager","npm","pi-hole"],"created_at":"2025-08-23T03:00:50.759Z","updated_at":"2026-05-03T15:35:10.027Z","avatar_url":"https://github.com/DeepSpace2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/DeepSpace2/PlugNPiN)](https://goreportcard.com/report/github.com/DeepSpace2/PlugNPiN)\n![Build Status](https://github.com/DeepSpace2/PlugNPiN/actions/workflows/release.yml/badge.svg)\n[![Release](https://img.shields.io/github/v/release/DeepSpace2/PlugNPiN)](https://github.com/DeepSpace2/PlugNPiN/releases)\n![Pulls](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fghcr-badge.elias.eu.org%2Fapi%2Fdeepspace2%2Fdeepspace2%2Fplugnpin\u0026query=downloadCount\u0026style=flat\u0026logo=docker\u0026label=Docker%20Pulls\u0026color=2496ed)\n\n# 🔌 PlugNPiN\n\n**Plug and play your docker containers into Pi-Hole/AdGuard Home \u0026 Nginx Proxy Manager**\n\nAutomatically detect running Docker containers based on labels, add them\nas local DNS/CNAME records in **Pi-Hole** (or DNS Rewrites in **AdGuard Home**) and create matching proxy hosts in\n**Nginx Proxy Manager**.\n\n## Key Features\n\n- Automatic Docker container detection (monitoring multiple hosts is supported)\n- Local DNS/CNAME record creation/deletion in Pi-hole\n- DNS Rewrites creation/deletion in AdGuard Home\n- Nginx Proxy Manager host creation\n- Support for Docker socket proxy\n\n**Pi-Hole's and AdGuard Home's functionality can be toggled individually. By default Pi-Hole is enabled and AdGuard Home is disabled.**\n\n**[See the documentation site for full setup and configuration.](https://deepspace2.github.io/PlugNPiN)**\n\n## How it Works\n\nPlugNPiN discovers services by scanning for Docker containers that have the following labels:\n\n- `plugNPiN.ip` - The IP address and port of the container (e.g., `192.168.1.100:8080`).\n- `plugNPiN.url` - The desired URL for the service (e.g., `my-service.local`).\n\nThe application operates in two complementary modes to keep your services synchronized:\n\n1. **Real-Time Event Listening**: The application actively listens for Docker container events. When a container with the required labels is **started**, **stopped**, or **killed**, the tool immediately adds or removes the corresponding DNS and proxy host entries. This ensures that your services are updated in real-time as containers change state.\n\n2. **Periodic Synchronization**: In addition to real-time events, the tool performs a full synchronization at a regular interval, defined by the `RUN_INTERVAL` environment variable. During this periodic run, it scans all running containers and ensures that their DNS and proxy configurations are correct. This acts as a self-healing mechanism, correcting any entries that might have been missed or become inconsistent.\n\nWhen a container is processed in either mode, PlugNPiN will:\n\n1. Create a DNS record pointing the specified `url` to the `ip` address on **Pi-Hole/AdGuard Home** (or a CNAME record pointing to a configurable target domain).\n2. Create a proxy host to route traffic from the `url` to the container's `ip` and `port` on **Nginx Proxy Manager**.\n\n## Usage\n\n### Docker Compose\n\nIt is **highly recommended** to use a Docker socket proxy to avoid giving the container direct access to the Docker daemon. This improves security by limiting the container's privileges.\n\n#### Recommended: Using a Docker Socket Proxy\n\n```yaml\nservices:\n  socket-proxy:\n    image: lscr.io/linuxserver/socket-proxy:latest\n    container_name: socket-proxy\n    environment:\n      # Allow access to the container list\n      - CONTAINERS=1\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock:ro\n    read_only: true\n    tmpfs:\n      - /run\n\n  plugnpin:\n    image: ghcr.io/deepspace2/plugnpin:latest\n    container_name: plugnpin\n    depends_on:\n      - socket-proxy\n    environment:\n      - DOCKER_HOST=tcp://socket-proxy:2375\n      - NGINX_PROXY_MANAGER_HOST=...\n      - NGINX_PROXY_MANAGER_USERNAME=...\n      - NGINX_PROXY_MANAGER_PASSWORD=...\n      - PIHOLE_HOST=...\n      - PIHOLE_PASSWORD=...\n    restart: unless-stopped\n```\n\n#### Not Recommended: Directly mounting the Docker Socket\n\n```yaml\nservices:\n  plugnpin:\n    image: ghcr.io/deepspace2/plugnpin:latest\n    container_name: plugnpin\n    environment:\n      - NGINX_PROXY_MANAGER_HOST=...\n      - NGINX_PROXY_MANAGER_USERNAME=...\n      - NGINX_PROXY_MANAGER_PASSWORD=...\n      - PIHOLE_HOST=...\n      - PIHOLE_PASSWORD=...\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock:ro\n    restart: unless-stopped\n```\n\n## Contributing\n\nContributions are very welcome! If you have a feature request, bug report, or want to contribute yourself, please feel free to open an issue or submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepspace2%2Fplugnpin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepspace2%2Fplugnpin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepspace2%2Fplugnpin/lists"}