mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Dedicated configuration file
This commit is contained in:
parent
f376c2fdd1
commit
0f11991693
28
README.md
28
README.md
@ -4,6 +4,15 @@ For more information visit [https://vmstan.com/gravity-sync/](https://vmstan.com
|
||||
|
||||
The scripts assumes you have one "master" Pihole as the primary place you make all your configuration changes, such as whitelist, blacklist, group management, and blocklist settings. After the script executes it will copy the gravity.db from the master to any secondary nodes you configure it to run on.
|
||||
|
||||
### Prereqs
|
||||
|
||||
You will need to make sure your secondary Pihole is setup to authenticate to your primary Pihole via certificates.
|
||||
|
||||
```
|
||||
ssh-keygen -t rsa
|
||||
ssh-copy-id -i ~/.ssh/id_rsa.pub USERNAME@PRIMARYPI
|
||||
```
|
||||
|
||||
### Installation
|
||||
|
||||
From your *secondary* Pi, login via SSH and copy the gravity-sync.sh script to your user. In this example we will use git to keep the latest copy of the script on your server.
|
||||
@ -18,24 +27,25 @@ Please note the script **must** be run from a folder in your user home directory
|
||||
|
||||
### Configuration
|
||||
|
||||
You will need to make sure your secondary Pihole is setup to authenticate to your primary Pihole via certificates.
|
||||
After you clone the base configuration, you will need to create a configuration file called `gravity-sync.conf` in the same folder.
|
||||
|
||||
```
|
||||
ssh-keygen -t rsa
|
||||
ssh-copy-id -i ~/.ssh/id_rsa.pub USERNAME@PRIMARYPI
|
||||
```
|
||||
|
||||
Modify your copy of the script to specify the username and address of the primary Pi.
|
||||
|
||||
```
|
||||
vim gravity-sync.sh
|
||||
vim gravity-sync.conf
|
||||
```
|
||||
|
||||
If you don't like VIM, use NANO or your text editor of choice.
|
||||
|
||||
Paste the following into your file, making sure to change the IP (or DNS name) and user account to authenticate to the master Pi.
|
||||
|
||||
```
|
||||
REMOTE_HOST='192.168.7.5'
|
||||
REMOTE_USER='pi'
|
||||
```
|
||||
|
||||
Now test the script. I suggest making a subtle change to a whitelist/blacklist on your primary Pihole, such as a description field, and then seeing if the change propagates to your secondary.
|
||||
|
||||
```
|
||||
./gravity-sync.sh pull
|
||||
```
|
||||
|
||||
If you do a `git pull` while in this directory you should update to the latest copy of the script. Your changes to the .conf file, logs and backups should be uneffected by this.
|
Loading…
Reference in New Issue
Block a user