mirror of
https://github.com/vmstan/gravity-sync.git
synced 2025-07-09 02:34:06 -04:00
Created Manual Installs (markdown)
parent
fa1a0fd619
commit
252f77da5a
92
Manual-Installs.md
Normal file
92
Manual-Installs.md
Normal file
@ -0,0 +1,92 @@
|
||||
# Installation
|
||||
|
||||
If you don't want to use the automated installer, you can use git to manually clone Gravity Sync to your _secondary_ Pi-hole server.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/vmstan/gravity-sync.git
|
||||
```
|
||||
|
||||
If you don't trust `git` to install your software, or just like doing things by hand, that's fine.
|
||||
|
||||
_Keep in mind that installing via this method means you won't be able to use Gravity Sync's built-in update mechanism._
|
||||
|
||||
Download the latest release from [GitHub](https://github.com/vmstan/gravity-sync/releases) and extract the files to your _secondary_ Pi-hole server.
|
||||
|
||||
```bash
|
||||
cd ~
|
||||
wget https://github.com/vmstan/gravity-sync/archive/v3.x.x.zip
|
||||
unzip v3.x.x.zip -d gravity-sync
|
||||
cd gravity-sync
|
||||
```
|
||||
|
||||
# Configuration
|
||||
|
||||
If you don't want to use the automated configuration utility at `./gravity-sync.sh config` you can setup your configuration manually as well.
|
||||
|
||||
After you install Gravity Sync to your server there will be a file called `gravity-sync.conf.example` that you can use as the basis for your own `gravity-sync.conf` file. Make a copy of the example file and modify it with your site specific settings.
|
||||
|
||||
```bash
|
||||
cp gravity-sync.conf.example gravity-sync.conf
|
||||
vi gravity-sync.conf
|
||||
```
|
||||
|
||||
_Note: If you don't like VI or don't have VIM on your system, use NANO, or if you don't like any of those substitute for your text editor of choice. I'm not here to start a war._
|
||||
|
||||
Make sure you've set the REMOTE_HOST and REMOTE_USER variables with the IP (or DNS name) and user account to authenticate to the primary Pi. This account will need to have sudo permissions on the remote system.
|
||||
|
||||
```bash
|
||||
REMOTE_HOST='192.168.1.10'
|
||||
REMOTE_USER='pi'
|
||||
```
|
||||
|
||||
# SSH Configuration
|
||||
|
||||
Gravity Sync uses SSH to run commands on the primary Pi-hole, and sync the two systems by performing file copies.
|
||||
|
||||
## Key-Pair Authentication
|
||||
|
||||
You'll need to generate an SSH key for your secondary Pi-hole user and copy it to your primary Pi-hole. This will allow you to connect to and copy the necessary files without needing a password each time. When generating the SSH key, accept all the defaults and do not put a passphrase on your key file.
|
||||
|
||||
_Note: If you already have this setup on your systems for other purposes, you can skip this step._
|
||||
|
||||
```bash
|
||||
ssh-keygen -t rsa
|
||||
ssh-copy-id -i ~/.ssh/id_rsa.pub REMOTE_USER@REMOTE_HOST
|
||||
```
|
||||
|
||||
Substitute REMOTE_USER for the account on the primary Pi-hole with sudo permissions, and REMOTE_HOST for the IP or DNS name of the Pi-hole you have designated as the primary.
|
||||
|
||||
Make sure to leave the `REMOTE_PASS` variable set to nothing in `gravity-sync.conf` if you want to use key-pair authentication.
|
||||
|
||||
## Password Authentication
|
||||
|
||||
This option has been removed from Gravity Sync as of version 3.1.
|
||||
|
||||
# Updates
|
||||
|
||||
If you manually installed Gravity Sync via `.zip` or `.tar.gz` you will need to download and overwrite the `gravity-sync.sh` file with a newer version. If you've chosen this path, I won't lay out exactly what you'll need to do every time, but you should at least review the contents of the script bundle (specifically the example configuration file) to make sure there are no new additional files or required settings.
|
||||
|
||||
At the very least, I would recommend backing up your existing `gravity-sync` folder and then deploying a fresh copy each time you update, and then either creating a new .conf file or copying your old file over to the new folder.
|
||||
|
||||
# Automation
|
||||
|
||||
There are many automation methods available to run scripts on a regular basis of a Linux system. The one built into all of them is cron, but if you'd like to utilize something different then the principles are still the same.
|
||||
|
||||
If you prefer to still use cron but modify your settings by hand, using the entry below will cause the entry to run at the top and bottom of every hour (1:00 PM, 1:30 PM, 2:00 PM, etc) but you are free to dial this back or be more aggressive if you feel the need.
|
||||
|
||||
```bash
|
||||
crontab -e
|
||||
*/15 * * * * /bin/bash /home/USER/gravity-sync/gravity-sync.sh > /home/USER/gravity-sync/gravity-sync.cron
|
||||
0 23 * * * /bin/bash /home/USER//gravity-sync/gravity-sync.sh backup >/dev/null 2>&1
|
||||
```
|
||||
|
||||
## Automating Automation
|
||||
|
||||
To automate the deployment of automation option you can call it with 2 parameters:
|
||||
|
||||
- First interval in minutes to run sync [0-30]
|
||||
- Second the hour to run backup [0-24]
|
||||
|
||||
_Note: a value of 0 will disable the cron entry._
|
||||
|
||||
For example, `./gravity-sync.sh automate 15 23` will configure automation of the sync function every 15 minutes and of a backup at 23:00.
|
Loading…
x
Reference in New Issue
Block a user