Categorygithub.com/lovelaze/nebula-sync
repositorypackage
0.2.5
Repository: https://github.com/lovelaze/nebula-sync.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

nebula-sync

Release version Tests Go version Docker image size

Synchronize Pi-hole v6.x configuration to replicas.

This project is not a part of the official Pi-hole project, but uses the api provided by Pi-hole instances to perform the synchronization actions.

Features

  • Full sync: Use Pi-hole Teleporter for full synchronization.
  • Manual sync: Selective feature synchronization.
  • Cron schedule: Run on chron schedule.

Installation

Linux/OSX binary

Download binary from the latest release or build from source:

go install github.com/lovelaze/nebula-sync@latest

Run binary:

# run
nebula-sync run

# read envs from file
nebula-sync run --env-file .env

Docker Compose (recommended)

---
services:
  nebula-sync:
    image: ghcr.io/lovelaze/nebula-sync:latest
    container_name: nebula-sync
    environment:
    - PRIMARY=http://ph1.example.com|password
    - REPLICAS=http://ph2.example.com|password,http://ph3.example.com|password
    - FULL_SYNC=true
    - CRON=0 * * * *

Docker CLI

docker run --rm \
  --name nebula-sync \
  -e PRIMARY="http://ph1.example.com|password" \
  -e REPLICAS="http://ph2.example.com|password" \
  -e FULL_SYNC=true \
  ghcr.io/lovelaze/nebula-sync:latest

Examples

Env and docker-compose examples can be found here

Configuration

The following environment variables can be specified:

Required Environment Variables

NameDefaultExampleDescription
PRIMARYn/ahttp://ph1.example.com|passwordSpecifies the primary Pi-hole configuration
REPLICASn/ahttp://ph2.example.com|password,http://ph3.example.com|passwordSpecifies the list of replica Pi-hole configurations
FULL_SYNCn/atrueSpecifies whether to perform a full synchronization

Note: When FULL_SYNC=true, the system will perform a full Teleporter import/export from the primary Pi-hole to the replicas. This will synchronize all settings and configurations.

Optional Environment Variables

NameDefaultExampleDescription
CRONn/a0 * * * *Specifies the cron schedule for synchronization
TZn/aEurope/LondonSpecifies the timezone for logs and cron

Note: The following optional settings apply only if FULL_SYNC=false. They allow for granular control of synchronization if a full sync is not wanted.

NameDefaultDescription
SYNC_CONFIG_DNSfalseSynchronize DNS settings
SYNC_CONFIG_DHCPfalseSynchronize DHCP settings
SYNC_CONFIG_NTPfalseSynchronize NTP settings
SYNC_CONFIG_RESOLVERfalseSynchronize resolver settings
SYNC_CONFIG_DATABASEfalseSynchronize database settings
SYNC_CONFIG_MISCfalseSynchronize miscellaneous settings
SYNC_CONFIG_DEBUGfalseSynchronize debug settings
SYNC_GRAVITY_DHCP_LEASESfalseSynchronize DHCP leases
SYNC_GRAVITY_GROUPfalseSynchronize groups
SYNC_GRAVITY_AD_LISTfalseSynchronize ad lists
SYNC_GRAVITY_AD_LIST_BY_GROUPfalseSynchronize ad lists by group
SYNC_GRAVITY_DOMAIN_LISTfalseSynchronize domain lists
SYNC_GRAVITY_DOMAIN_LIST_BY_GROUPfalseSynchronize domain lists by group
SYNC_GRAVITY_CLIENTfalseSynchronize clients
SYNC_GRAVITY_CLIENT_BY_GROUPfalseSynchronize clients by group

Disclaimer

This project is an unofficial, community-maintained project and is not affiliated with the official Pi-hole project. It aims to add sync/replication features not available in the core Pi-hole product but operates independently of Pi-hole LLC. Although tested across various environments, using any software from the Internet involves inherent risks. See the license for more details.

Pi-hole and the Pi-hole logo are registered trademarks of Pi-hole LLC.