https://github.com/c00ldude1oo/npm2pihole
A shell script to add domains from nginx proxy manager to pihole local dns records
https://github.com/c00ldude1oo/npm2pihole
bash-script docker docker-compose nginx-proxy nginx-proxy-manager npm npm2pihole pihole
Last synced: 4 months ago
JSON representation
A shell script to add domains from nginx proxy manager to pihole local dns records
- Host: GitHub
- URL: https://github.com/c00ldude1oo/npm2pihole
- Owner: c00ldude1oo
- License: gpl-3.0
- Created: 2023-08-21T07:41:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-29T06:32:09.000Z (5 months ago)
- Last Synced: 2025-01-30T22:42:22.194Z (5 months ago)
- Topics: bash-script, docker, docker-compose, nginx-proxy, nginx-proxy-manager, npm, npm2pihole, pihole
- Language: Shell
- Homepage:
- Size: 77.1 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NPM2Pihole
A bash script in a docker container that will check nginx proxy manager for configured domains and will add them to pihole's local DNS automatically
## PREREQUISITES
Nginx Proxy Manager (NPM) *\*NPM2Pihole must be on same host as NPM*
pihole *remote or local host is supported
## INSTALL
1 Setup docker-compose.yml
```yaml
services:
npm2pihole:
image: ghcr.io/c00ldude1oo/npm2pihole:latest
env_file: config.env
restart: unless-stopped
volumes:
# Path to Nginx Proxy Mangers data/nginx/proxy_host folder.
- /path/to/npm/data/nginx/proxy_host/:/app/npm/:ro
# PiHole's /etc/pihole/custom.list file. comment if remote pihole
# - /path/to/piholes/data/custom.list:/app/custom.list
# SSH key(s) for sftp. comment if unused
- ./ssh/:/root/.ssh/```
2 Setup configs `config.env`
Check below and set up the configs
3 Start docker
```sh
docker compose up
```After first run you can quit and add the -d flag
## CONFIGS
### config.env
`NPM_IP=192.168.0.0`
This is set to the IP of the nginx proxy manager`USE_SFTP=true/false`
This is to enable/disable use of SFTP to use a remote pihole`SFTP_IP=192.168.0.0`
This is set to the IP of the remote pihole### docker-compose.yml
The docker volumes need to be configured
#### `/app/data:ro`
This needs to be set to the full path of NPMs proxy_hosts folder
E.g. `path/to/npm/data/nignx/proxy_host:/app/data:ro`#### `/app/custom.list`
This needs to be set to the full path of pihole's custom DNS list file. *\*only if pihole is on same host*
E.g. `path/to/pihole/etc-pihole/custom.list:/app/custom.list`
#### `/root/.ssh`
If you're not using a remote pihole this can be committed out
E.g. `/home/docker_user/.ssh:/root/.ssh`