Get rid of the SKIPGRAVITYONBOOT environment variable. Instead, only run gravity on a fresh volume if the gravity database does not exist. There isn't really any need for gravity to be updated on every start (current default behaviour)

This will still run the gravity migration scripts on every boot if the gravity database exists

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2023-10-29 20:42:21 +00:00
parent 69e2b598c8
commit 23fe63dff6
No known key found for this signature in database
2 changed files with 2 additions and 12 deletions

View File

@ -89,7 +89,6 @@ To explicitly set no password, set `FTLCONF_webserver_api_password: ''`
| Variable | Default | Value | Description |
| -------- | ------- | ----- | ---------- |
| `TAIL_FTL_LOG` | unset | `<unset\|1>` | Whether or not to output the FTL log when running the. Useful for debugging/watching what FTL is doing.
| `SKIPGRAVITYONBOOT` | unset | `<unset\|1>` | Use this option to skip updating the Gravity Database when booting up the container. By default this environment variable is not set so the Gravity Database will be updated when the container starts up. Setting this environment variable to 1 (or anything) will cause the Gravity Database to not be updated when container starts up.
| `FTLCONF_[SETTING]` | unset | As per documentation | Customize pihole.toml with settings described in the <!!!Add Link To New API docs here before release!!!>. Replace `.` with `_`, e.g for `dns.dnssec=true` use `FTLCONF_dns_dnssec: 'true'`<br/> Array type configs should be delimited with `;`|
| `PIHOLE_UID` | `100` | Number | Overrides image's default pihole user id to match a host user id<br/>**IMPORTANT**: id must not already be in use inside the container! |
| `PIHOLE_GID` | `101` | Number | Overrides image's default pihole group id to match a host group id<br/>**IMPORTANT**: id must not already be in use inside the container!|

View File

@ -83,23 +83,14 @@ start() {
gravityDBfile=$(getFTLConfigValue files.gravity)
if [ ! -f "${gravityDBfile}" ]; then
if [ -n "${SKIPGRAVITYONBOOT}" ]; then
echo " SKIPGRAVITYONBOOT is set, however ${gravityDBfile} does not exist (Likely due to a fresh volume). This is a required file for Pi-hole to operate."
echo " Ignoring SKIPGRAVITYONBOOT on this occasion."
unset SKIPGRAVITYONBOOT
fi
echo " [i] ${gravityDBfile} does not exist (Likely due to a fresh volume). This is a required file for Pi-hole to operate."
pihole -g
else
# TODO: Revisit this path if we move to a multistage build
source /etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh
upgrade_gravityDB "${gravityDBfile}" "/etc/pihole"
fi
if [ -n "${SKIPGRAVITYONBOOT}" ]; then
echo " [i] Skipping Gravity Database Update."
else
pihole -g
fi
pihole updatechecker
echo " [i] Docker start setup complete"