Skip to content

Commit cb62541

Browse files
author
Gabriel Baker
committed
Add Nebula-Sync LXC container script
- Host script (ct/nebula-sync.sh) and install script for nebula-sync - Prompts for primary/replica Pi-hole URL and API password, sync options, cron - .env with PRIMARY/REPLICAS in url|password format, wrapper and systemd service - Frontend JSON and header; notes on Pi-hole API and app_sudo requirement
1 parent fca044f commit cb62541

4 files changed

Lines changed: 453 additions & 0 deletions

File tree

ct/headers/nebula-sync

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_ __ _ _ _____
2+
/ | / /_ __(_)___ (_)___ ___ / ___/___ ______ _____
3+
/ |/ / / / / / __ \/ / __ \/ _ \ \__ \/ _ \/ ___/ | / / _ \
4+
/ /| / /_/ / / / / / / / / / __/ ___/ / __/ / | |/ / __/
5+
/_/ |_/\__,_/_/_/ /_/_/_/ /_/\___/ /____/\___/_/ |___/\___/
6+

ct/nebula-sync.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: gabriel403
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/lovelaze/nebula-sync
7+
8+
APP="Nebula-Sync"
9+
var_tags="${var_tags:-dns;sync}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-512}"
12+
var_disk="${var_disk:-2}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /opt/nebula-sync/nebula-sync ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
RELEASE=$(curl -fsSL https://api.github.com/repos/lovelaze/nebula-sync/releases/latest | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p')
31+
if [[ ! -f /opt/nebula-sync_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/nebula-sync_version.txt)" ]]; then
32+
msg_info "Updating Nebula-Sync to v${RELEASE}"
33+
if [[ -f /usr/local/bin/update_nebula-sync ]]; then
34+
/usr/local/bin/update_nebula-sync
35+
else
36+
msg_error "Update script not found!"
37+
exit
38+
fi
39+
msg_ok "Updated Nebula-Sync"
40+
else
41+
msg_ok "No update required. Nebula-Sync is already at v${RELEASE}."
42+
fi
43+
msg_ok "Updated successfully!"
44+
exit
45+
}
46+
47+
start
48+
build_container
49+
description
50+
51+
msg_ok "Completed successfully!\n"
52+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
53+
echo -e "${INFO}${YW} Nebula-Sync runs as a service and will sync your Pi-hole instances.${CL}"
54+
echo -e "${INFO}${YW} Configuration:${CL}"
55+
echo -e "${TAB}${GATEWAY}${BGN}/opt/nebula-sync/.env${CL}"
56+
echo -e "${INFO}${YW} View logs:${CL}"
57+
echo -e "${TAB}${GATEWAY}${BGN}journalctl -u nebula-sync -f${CL}"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "Nebula-Sync",
3+
"slug": "nebula-sync",
4+
"categories": [
5+
5
6+
],
7+
"date_created": "2025-01-27",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": null,
12+
"documentation": "https://github.com/lovelaze/nebula-sync",
13+
"website": "https://github.com/lovelaze/nebula-sync",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/pi-hole.webp",
15+
"config_path": "/opt/nebula-sync/.env",
16+
"description": "Nebula-Sync is a tool that synchronizes configuration of multiple Pi-hole v6.x instances. It allows you to keep multiple Pi-hole instances in sync by replicating settings, blocklists, whitelists, custom DNS entries, and other configurations from a primary instance to one or more replica instances. This is particularly useful for maintaining consistency across multiple Pi-hole servers in a network or ensuring redundancy with synchronized configurations.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/nebula-sync.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 512,
24+
"hdd": 2,
25+
"os": "debian",
26+
"version": "13"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "Requires Pi-hole v6.x instances with API access enabled",
37+
"type": "info"
38+
},
39+
{
40+
"text": "You will be prompted for primary and replica Pi-hole IP addresses and API passwords during installation",
41+
"type": "info"
42+
},
43+
{
44+
"text": "IMPORTANT: Pi-hole API must have sudo permissions enabled. Set 'app_sudo = true' in /etc/pihole/pihole.toml under [webserver.api] section on all Pi-hole instances, then restart pihole-FTL service",
45+
"type": "warning"
46+
},
47+
{
48+
"text": "The API password is the Pi-hole web interface password (not an API token). Ensure API access is enabled in Pi-hole Settings → API/Web interface",
49+
"type": "info"
50+
},
51+
{
52+
"text": "By default, all settings are synchronized. You can choose custom sync options during setup",
53+
"type": "info"
54+
},
55+
{
56+
"text": "Update with: update_nebula-sync",
57+
"type": "info"
58+
},
59+
{
60+
"text": "Configuration file: /opt/nebula-sync/.env",
61+
"type": "info"
62+
}
63+
]
64+
}

0 commit comments

Comments
 (0)