Commit Graph

776 Commits

Author SHA1 Message Date
Michael Stanclift
54ddeb6666
Final commit 2024-07-26 13:45:33 -05:00
Michael Stanclift
50c786eb9d
4.0.7 (#433)
* fix: typo in dns cname permission change (#431)

This typo prevents gravity-sync from continuing and calculating hashes resulting in always considering there are changes to sync

* Update VERSION

* Branding and typos

* 4.0.7

---------

Co-authored-by: Alexandre Perrault <alexperrault@users.noreply.github.com>
2024-01-15 09:21:24 -06:00
Michael Stanclift
ccb89624f7
v4.0.6 (#424)
* Updates to respect configured options (#413)

- remote pihole detection uses configured docker/podman binaries
- file permission updates use configured local/remote file owners

Also fixes https://github.com/vmstan/gravity-sync/issues/392

---------

Co-authored-by: Eric Roch <emroch@users.noreply.github.com>
2024-01-07 12:32:39 -06:00
Sam Mingo
4402ff0d73
Update README.md (#403) 2023-10-13 22:14:14 -05:00
Michael Stanclift
ad783f1385
4.0.5 (#400)
* Simple fix for podman to work; whitespace clean up (#396)

* Fix set_pihole_exec to match full container names (#390)

Fix set_pihole_exec to match full container names, rather
than their substrings, by adding begin and end anchors to
the 'docker ps -qf name=PATTERN' being used.

Signed-off-by: William Blew <william@kulian.org>

* Fix the detect_xxx_pihole routines. (#389)

Fix the detect_xxx_pihole routines to respect the configurable
PIHOLE_CONTAINER_IMAGE variable.

The ghcr.io/pi-hole/pihole image is also released by the Pi-hole
project, just as the pihole/pihole image.

This commit enables ghcr.io image usage by adding the following
to the /etc/gravity-sync.conf file:

PIHOLE_CONTAINER_IMAGE='ghcr.io/pi-hole/pihole'

Signed-off-by: William Blew <william@kulian.org>
Co-authored-by: Michael Stanclift <mx@vmstan.com>

* Make check for sudo privileges more accurate (#375)

* Make check for sudo privileges more accurate

The existing method of checking if the Gravity Sync user has sudo rights is flawed, in that it will break if the user is not in the `sudo` group (on Debian based distros) or the `wheel` group (on CentOS/RHEL distros).

A more accurate way of checking if a user has sudo privileges is using `sudo --validate` or `sudo -n true`; both of which return `0` if the user has sudo privileges.

This commit updates the `validate_sudo_status` function to use `sudo --validate` so that Gravity Sync is actually checking if a user has sudo privileges, rather than just checking group memberships.

* Fix bug in patch

---------

Co-authored-by: llamalump <29816026+llamalump@users.noreply.github.com>

* Fix: GS_SSH_PORT can be changed now via  'gravity-sync config <NEW_PORT>' when already set in gravity-sync.conf. Fix: Initial sync of static DHCP and CNAME to 'empty pihole' now works. Enhancement: Various settings now settable via ENV vars (for Docker) (#384)

* SSH custom port: Fixed bug, where GS_SSH_PORT is overwritten by gravity-sync.conf (if set) when calling 'gravity-sync config NEW_SSH_PORT'. Docker enhancements: Made many config-variables settable via ENV vars

* Fixing initial push of CNAME and Static DHCP entries to an 'empty' remote (fixes https://github.com/vmstan/gravity-sync/issues/377)

* Removing unecessary 'export' keyword

* Fixed 'md5_recheck' for the bug https://github.com/vmstan/gravity-sync/issues/377

* Adding ENV documentation

* Fixing typo

* Fixed type and nicely formatted tables with emacs

---------

Co-authored-by: Michael Stanclift <mx@vmstan.com>

* Update VERSION

* Update gravity-sync

---------

Signed-off-by: William Blew <william@kulian.org>
Co-authored-by: Matt Woodson <mwoodson@gmail.com>
Co-authored-by: William Blew <william@kulian.org>
Co-authored-by: Seb Thomson <29816026+rst-ack@users.noreply.github.com>
Co-authored-by: llamalump <29816026+llamalump@users.noreply.github.com>
Co-authored-by: Klaus Zipfel <30482165+systemofapwne@users.noreply.github.com>
2023-07-10 11:46:11 -05:00
Michael Stanclift
183190e4bb
Update VERSION 2023-07-10 11:43:35 -05:00
Michael Stanclift
9fc48413fe
Update VERSION 2023-07-10 11:43:18 -05:00
Michael Stanclift
15867c0378
4.0.4 (#343)
* Start 4.0.4

* SDHCP replication

* Fix typo of SDHCP

* another SDHCP reference

* Update readme
2022-05-03 10:50:05 -05:00
Michael Stanclift
53bc721c50
4.0.3 (#341)
* fix hard coded pkif file on import

* 4.0.3 proper

* rename cname log

* added messages for blank values during config
2022-04-29 09:56:28 -05:00
Michael Stanclift
d3bc40e549
Create FUNDING.yml 2022-04-14 12:39:47 -05:00
Michael Stanclift
c952a427c7
Update README.md 2022-04-13 12:41:08 -05:00
Michael Stanclift
eec49c9c2a
4.0.2 (#330)
* Start 4.0.2

* automate with options

* change random range

* Use tmp to stash service timers

* make redirect silent

* sed not tee

* space

* simple

* Add ssh migration

* shuf not random

* quad

* 4.0.2 Signoff
2022-04-13 09:37:34 -05:00
Michael Stanclift
7f509fabb6
Update README.md 2022-04-12 14:48:43 -05:00
Michael Stanclift
73a6e00d8a
4.0.1 (#328)
* attempt to add custom ssh function

* sudo touch

* set port range

* $2

* maybe

* $1

* comment out last line

* $2x2

* $2x3

* $3

* i don't even know

* $2x4

* 22

* ""

* how does this work

* total rewrite of case stack

* [[ ]]

* if two is a number

* INPUT_SSH

* blank

* Add remote target port

* 4.0.1

* Fix version output

* greater than version

* test "downgrade"

* 4.0.1 Ready
2022-04-12 14:26:36 -05:00
Michael Stanclift
3720a91eeb 4.0.0(4) 2022-04-12 10:44:04 -05:00
Michael Stanclift
56650f4281 4.0.0(3) 2022-04-12 10:42:19 -05:00
Michael Stanclift
f9a0179e62
4.0.0(2) 2022-04-12 08:05:35 -05:00
Michael Stanclift
bc635e14e9 4.0.0.1 2022-04-11 19:57:28 -05:00
Michael Stanclift
41ecce4b5a
4.0.0 (#317)
* 4.0.0

* drop .sh

* chmod +x

* change pull locations

* push

* change folders

* cleanup extensions

* error with cname push

* backup purge redone

* back to the CORE!

* remove references to backup folder

* rename pihole container image variable

* rename pihole binary variables

* rename docker binary variables

* rename pihole dir variables

* data names

* remote and local

* DNSMASQ folders

* remove dnsmasq

* more variable renames

* fix config location

* fix import path

* validate gs folder fix

* remove references to LOCAL_FOLDR

* updater moving into place

* create update script

* "

* change context?

* remove git check

* add ( back

* Fix automation path

* replace standalone SQLite with FTL

* remote

* adjust docker folder locations

* fix remote location

* remove sqlite validation

* remove all references to cron

* config rewrite

* soruce config file

* remote file not dir

* hidden figures

* config file

* remove references to dropbear

* remove backup cleanup from most tasks

* remove gs folder validation

* remove ssh detection

* static set ssh

* id_rsa

* extra line

* echo lines

* retain previous config file

* isolinear

* ∞

* rearrange info

* remove bash path

* check replication status

* check timer instead

* dev mode against new repo location

* rewrite purge

* path

* add default file owner back

* simpler

* /usr/bin/bash

* fix ftl binary location

* whoami

* remote FTL

* don't delete from remote

* purge it

* remove path not name

* sudo tee

* tee off instead of echo out

* sudo sudo sudo

* sudo all the things

* Even more sudo

* how much more can you sudo

* change keyfile permissions

* remote/local

* all the sudo

* sudo in your rsync

* pull to tmp

* sudo copied

* silence tee

* New keyfile creation method

* send hash to the other side

* saving hashes

* directions are hard

* reverse hash for the other side

* remote ping test from config

* further randomize replication times

* rerandom

* fix bash call to update.sh

* Remove now-unused UI code

* remove legacy distro check code

* UI FILE PERMISSION spelling

* read -r

* GS_INTENT_VALIDATE

* remove intent validation from push

* cleanup tasks

* remove cname opt-out

* remove DNS options

* rename validation and set functions

* import_gs

* replace primary/local

* relocate file owner variables

* set variable for /tmp

* just set file permissions don't bother checking

* set file permissions

* remove extra message

* md5 variable renames

* replacing pri/sec variable names in smart sync

* .gsbackup replaced

* cleanup then

* removing compensation

* More primary and secondary references removed

* README update

* Update README.md

* new md5 variable

* multiple md5 hash logs

* gravity db listed twice

* md52 deletion at remote

* rename on sync

* move after send

* try try again

* this should work

* force it

* now for something completely different

* remove ;

* KISS

* KISS2

* fix hashing lookups

* set remote hash permissions

* vary info output

* remove unused functions

* new docs uploaded for publishing to wiki

* new system requirements

* words

* host

* rewrite install instructions

* rewrite install instructions

* rewrite all the thing

* massive variable renames

* building out dockerfile

* switch to photon

* change all if then style to single line

* cd || exit

* reformat math

* ${SSHPASSWORD} references removed

* OS_SSH_CMD set in variables

* cleanup function calls

* remove old root_check function

* cleaning up more variables

* more variable cleanup

* Line

* rewrite all of pihole detection

* echo_good

* >/dev/null 2>&1

* detecting local message

* sed?

* | sed 's/\s.*$//'

* fix sed

* no more whiches

* 2>/dev/null some more

* massive config rewrite for advanced workflow

* fix prompt

* output remote images

* echo again

* remote again

* cats?

* detect container locations

* fix space

* rewrite remote detection

* remote not local

* don't delete remote

* exec then rsync

* move lines

* enclose

* dont var

* daft

* quotes

* remove variable

* run you booger

* REMOTE

* remove echo_lines

* no config for more commands

* no config again

* shellcheck

* comment cleanup

* spell check is wonderful

* change docker container name output

* escape more quotes

* simpler command for remote side

* scape that?

* maybe less, i dunno

* try both lists again

* change spacing and line breaks

* streamline status icons for configuration

* retrieving remote settings

* error_validate

* disable task

* fix disable task

* detect_gs_peer

* task_purge doesn't use config

* remote message

* fallback

* " "

* comments

* add monitor mode

* Adds .sh script back as upgrader

* upgrader in old script

* reverse logic

* pretty upgrade script

* migration complete

* change template directory

* check for crontab hash

* user not host

* silence hash for crontab check

* warn

* warning

* reword config ending

* missing "

* os-release

* blue

* disable automation doesn't require config

* move stop

* signing off on 4.0
2022-04-11 17:06:09 -05:00
Michael Stanclift
ff32465625
3.7.0 (#315)
* add path removal to clear_cron

* 3.6.4

* add local folder to path

* templates for systemd timers

* Wantedby

* user root

* Gonna be 3.7

* Remove legacy cron code from automate function

* Core for moving replication jobs into place

* Move stop before copy

* Add Gravity Sync messages

* Service file customization

* Line break

* 10 minutes to sudo

* if active else

* Do things quietly

* Custom exec path

* clear exec start

* warning about cron

* no longer exists
2022-03-29 16:11:00 -05:00
Michael Stanclift
087550742a
3.6.3 (#313)
* remove full dns restart

* change conditions for ftl restart

* run reload for non-smart tasks

* 3.6.3

* add user path to crontab

* ""

* include path

* $

* PATH=$PATH

* add Path_Fix
2022-03-28 14:18:16 -05:00
Michael Stanclift
ac62915b5b
3.6.2 (#304)
* 3.6.2

* 3.6.2

* 3.6.2 revert
2022-03-02 10:22:59 -06:00
Michael Stanclift
7d8bde529c
3.6.1 (#302)
* 3.6.1 Start

* Remove prep directory
2022-03-02 09:40:04 -06:00
Michael Stanclift
c7a825970a
3.6.0 (#299)
* start 3.6

* Remove backup retention reference

* dbclient_warning removed

* remove extra linebreaks

* remove backup task

* Increased backup and integrity timeouts to 240

* Remove brackets from message codes

* Arrow for info

* Different arrow

* Ain't gonna restore no more

* Abortion aborted

* format change for config test

* All kinds of yes and no

* echo_grav

* Move advanced to the end

* removed custom ssh, ping check and port options from wizard

* primary address changes

* rework user input

* good clean fun

* smaller version text

* less info

* Set push commands to default 240 second timeout

* Remove reference to backup and restore tasks from log output

* Remove backup refs

* Move UI elements over to gs-ui

* Move ICMP to UI

* More UI

* More UI

* UI changes

* Add end config

* Spaces and such

* MOre UI

* UI

* UI UI UI

* UI UI

* echo_blue

* echo_blue too

* switch

* fip flop

* Too blue

* Fix path being run

* =

* Remove ()

* continued cleaning

* Almost done rewriting config

* switch CNAME defaults

* Add CNAME function
2022-03-01 09:47:22 -06:00
Michael Stanclift
3a125a2e30
3.5.0 (#296)
* Fixed typo (#269)

* Fix cache wipe (#282)

* Update gs-pull.sh

`restartdns          Full restart Pi-hole subsystems
                        Add 'reload' to update the lists and flush the cache without restarting the DNS server
                        Add 'reload-lists' to only update the lists WITHOUT flushing the cache or restarting the DNS server`
fixing typo

* Update gs-push.sh

fixing typo

* Update VERSION

* Update gravity-sync.sh

* new version

* Clear backup directory

* Cleanup after updating

* remove backup functions

* Remove reference to backup and restore functions

* Change backup references to copy

* Host

* Remove reference to backup retention

* Remove reference to backup retention

Co-authored-by: Philippe Ouellette <philippeouellette@protonmail.com>
Co-authored-by: djschnei21 <32646250+djschnei21@users.noreply.github.com>
2022-02-25 12:25:57 -06:00
Michael Stanclift
93656c29ea
3.4.8 (#283)
* Fixed typo (#269)

* Fix cache wipe (#282)

* Update gs-pull.sh

`restartdns          Full restart Pi-hole subsystems
                        Add 'reload' to update the lists and flush the cache without restarting the DNS server
                        Add 'reload-lists' to only update the lists WITHOUT flushing the cache or restarting the DNS server`
fixing typo

* Update gs-push.sh

fixing typo

* Update VERSION

* Update gravity-sync.sh

Co-authored-by: Philippe Ouellette <philippeouellette@protonmail.com>
Co-authored-by: djschnei21 <32646250+djschnei21@users.noreply.github.com>
2022-01-12 12:23:53 -06:00
Michael Stanclift
6c247dff81
3.4.7 (#249)
* Remove depricated code

* Move compare task to core, delete compare file

* Move compare task to core, delete compare file

* Cleanup SSH UI
2021-09-08 13:56:48 -05:00
Michael Stanclift
73ffc9eef1
3.4.6 (#244)
* Delete all backups

* Remove push/pull files

* Maybe rusty on my Bash

* Don't delete backups if running a backup job

* AND THEN

* different if style

* Just don't delete anything

* Change messages

* BACKUP

* exempt cleanup from backup task

* deactivate sameline

* remove sameline

* Cleanup samelines

* More cleanup

* More sameline cleanup

* Increase timeout

* 3.4.6

* Variables not marked

* MATH

* MATH?

* more math in more places

* NEW MATH

* MAAAAATH

* I don't even know

* Keep trying

* PLEASE

* PLEASE

* Too many tested variables finally worked

* Add backup integrity wait

* silent_error_validate

* silent_error_validate removal
2021-09-07 12:24:36 -05:00
Michael Stanclift
295b237da9
3.4.5 (#224)
* Add the addition of an Environment Path variable in Crontab (#212)

* Add detection of missing path components and addition of path to crontab

* Fix bug where \n is inserted literally

* Fix `find` command invoke (Issue #220) (#223)

* 3.4.5

Co-authored-by: Michael Thompson <25192401+nh-mike@users.noreply.github.com>
Co-authored-by: benjaminfd <psyko_chewbacca@hotmail.com>
Co-authored-by: Michael Stanclift <vmstan@ms-macbook.local>
2021-07-18 22:09:55 -05:00
Michael Stanclift
b19eaf8e22
3.4.4 (#201)
Co-authored-by: Michael Stanclift <vmstan@ms-constitution.local>
2021-04-26 11:38:19 -05:00
Michael Stanclift
d07e492a97
3.4.2 (#187)
* Add backup timeout customization

* Different variable

* remote integrity check

* 3.4.2

* AND THEN

* words

* more words

* Add local backup integrity

* check local backup integrity

* Clarify duplicate backup verbage

* pulling

Co-authored-by: Michael Stanclift <vmstan@ms-constitution.local>
2021-04-06 13:38:19 -05:00
Michael Stanclift
71fdb016bd
3.4.1 (#186)
* Add backup timeout customization

* Different variable

Co-authored-by: Michael Stanclift <vmstan@ms-constitution.local>
2021-04-05 17:16:29 -05:00
Michael Stanclift
d97f92ccea
3.3.3 is 3.4.0 (#185)
* new first line of script

* no requested

* Abort!

* Test silent folder validation

* sameline

* echo newline

* echo_sameline

* what happened?

* sameline for ssh

* sqlite sameline

* Lower case

* Reset line

* clear line

* Flip the line

* version update

* Backup lowercase

* More lowercase

* Remove file names from standard messages

* Breakout backup message

* Output backup folder size

* Just H

* Invalid replication settings

* Compare updated

* Colors and updates

* Lower case for version output

* For Pihole

* Cron cleanup

* Sudo, or no sudo.

* Branch!

* Silent error validate

* Silent error validate

* Clearing up status messages

* Records

* Primary and secondary

* Gravity database

* Domain Database

* Backup output cleanup

* Move file permission validation into new functions

* Change restart

* UI variables test

* Breakout UI variables into new file

* Unified validation functions

* Replace text strings with variables

* Replace text strings with variables

* Replace logging with variables

* Convert backup to UI variables

* Switch restore to UI variables

* Fix bug where gravity database did not restore

* App validation checks

* Rev to 3.4.0

* Convert Push functions to new strings

* Completing push UI changes

* remove added line

* Move purge to UI strings

* Move automation to UI strings

* Move core strings into UI

* Exit strings

* First pass at hashing UI

* Escape the remote system query (#179)

* hashing committed

Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local>
Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 15:16:20 -05:00
Michael Stanclift
6466e5a384
3.3.2 (#170)
* Fix crash when using remote docker instance (#169)

When trying to compare / sync and where the remote host is based on Docker, an error will be displayed as per below:
invalid argument "pihole1" for "-f, --filter" flag: bad format of filter (expected name=value)
See 'docker ps --help'.

* 3.3.2

Co-authored-by: Michael Thompson <25192401+nh-mike@users.noreply.github.com>
Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local>
2021-02-15 15:18:36 -06:00
Michael Stanclift
f32a0e2ab4
3.3.1 (#164)
* 3.3.1

* Delete changelog files

* No SVG

* Ignore year.

* A great many things.

* Add CONTAIMAGE variable.

* “

Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local>
2021-02-13 21:11:43 -06:00
Michael Stanclift
064dbf7ae1 3.0.0(1) 2021-02-10 15:27:47 +00:00
Michael Stanclift
d5ec83639b Swap 2021-02-10 15:26:39 +00:00
Michael Stanclift
97735f19f1
3.3.0 (#161)
* Catch up 3.3 (#142)

* 3.2.5 (#140)

Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.vmware.com>

* Adds backup cleanup back to process

* Add backup cleanup to compare script when no changes are detected.

* Trek reference

* Redundant

* 3.2.6

* 3.2.6

Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.vmware.com>
Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local>

* Beginning 3.3.0 work

* Podman support

* Support for pihole running in a podman container (#138)

* add support for pihole running in a podman container

* revert renaming of DOCKER_CON to CON_NAME to avoid breaking existing installations

Co-authored-by: Michael Stanclift <mstanclift@vmware.com>

* Add sudo to call of Pihole container version

* Use dev branch pipe

* Without origin

* ascii

* rotate logo

* Move config files to settings folder

* MIssed an important one

* Relocate logs files

* Filling empty directory

* Regression of sudo fix

* Logs

* More words

* Change sync frequency options

* Remove backup automation

* Bold questions

* name

* elif

* BACKUP_RETAIN=3

* Remove automation flag

* == not !=

* Rearrange

* IF

* Default to 0

* 15 default

* More words!

* ELSE

* tighter columns

* Instance type

* Y/N

Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.vmware.com>
Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local>
Co-authored-by: Martin F. Schumann <mfs@mfs.name>
2021-02-09 16:05:17 -06:00
Michael Stanclift
21893687e2
Update bug_report.md 2021-02-05 22:24:20 -06:00
Michael Stanclift
f6f69201b4
3.2.6 (#141)
* Adds backup cleanup back to process

* Add backup cleanup to compare script when no changes are detected.

* Trek reference

* Redundant

* 3.2.6

* 3.2.6

Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local>
2021-02-04 10:47:40 -06:00
Michael Stanclift
13dfc7d2d0
3.2.5 (#140)
Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.vmware.com>
2021-02-02 13:23:29 -06:00
Michael Stanclift
d0d2ae97d2 3.2.4 2021-01-12 22:57:32 +00:00
Michael Stanclift
947d805b5b BOLD 2021-01-12 22:54:56 +00:00
Michael Stanclift
6d11d0db13
Update README.md 2021-01-12 14:18:42 -06:00
Michael Stanclift
22024616f1
Update README.md 2021-01-12 14:18:05 -06:00
Michael Stanclift
5b125e0776
3.2.3 (#133)
* Add info to error output

* Tabs

* Lines

* Words

* ``

* Wrods

* Clean up spacing for tasktype

* Checkbox

* 3.2.3

* Changes

* THEN
2021-01-12 10:38:40 -06:00
Michael Stanclift
abf841ae53 .sh 2021-01-10 20:00:48 -06:00
Michael Stanclift
b912f74ebb
3.2.2 (#132)
* start 3.2.2

* -z

* !=

* “”

* headers

* Change to new PH_EXEC run

* Empty list detection for CNAME

* IGNORE list

* Skip Gravity logic

* oops

* Two == to be super serious

* variables are hard

* change colors

* the colors

* I’m getting rusty

* echo_lines

* 3.2.2

Co-authored-by: Michael Stanclift <vmstan@sovereign.local>
2021-01-10 10:37:35 -06:00
Michael Stanclift
1c033ef1f6
3.2.1 (#129)
* 3.2.1

* Change FILE_OWNER & RILE_OWNER to use UID:GID (#128)

Adressing #99 - use UID:GID instead names to support pihole docker user.

* Cleanup tabs on main script

* Add pihole version output

* Output version based on Docker type

* AND THEN

* AND THEN AND THEN

* bash version

* add DNSMASQ to output

* Add GS version

* No color

* Custom settings

* VERIFY_PASS

* Reformat Remote info

* Info screen

* ssh v

* rsync

* -e

* no echo, duh

* header

* sqlite3 version output

* sudo git docker versions

* move spacer

* uname

* remove duplicate docs

Co-authored-by: Michael Stanclift <vmstan@sovereign.local>
Co-authored-by: Krzysiek Kurek <kk50657@sgh.waw.pl>
2021-01-05 09:57:38 -06:00
Michael Stanclift
755a10e55b
Update feature_request.md 2021-01-05 09:52:37 -06:00