1
0
mirror of https://github.com/pi-hole/pi-hole.git synced 2025-09-15 13:21:15 +08:00
Commit Graph

1486 Commits

Author SHA1 Message Date
978694f262 Improve update/fresh install detection (#6034) 2025-03-03 12:23:29 +00:00
f207385269 Removing kernel check based on discussion in Pi-Hole PR pi-hole#5957. (#6020) 2025-02-28 20:00:00 -08:00
ce73691082 Juggle some code around:
- Move random password generation block inside final "fresh install" if block, ensure password is ONLY generated on fresh installs.
 - Add additional check for fresh install around setting of PIHOLE_DNS1/2, QUERY_LOGGING, and PRIVACY_LEVEL
 - Remove dedicated displayFinalMessage function.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-02-28 23:06:52 +00:00
8874757958 Start by renaming useUpdateVars to fresh_install and flipping the logic, the old name is not relevant any more
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-02-28 21:29:33 +00:00
821c953216 Remove 'reconfigure' option (#5887) 2025-02-28 21:14:18 +00:00
7282aada25 Don't show a warning before the repair is done
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-28 11:51:09 +01:00
869411a514 Fixing whitespaces after removing lines.
Signed-off-by: UltChowsk <ult@chowsk.net>
2025-02-27 06:24:13 -05:00
d1b5f95aa7 Removing kernel check based on discussion in Pi-Hole PR pi-hole#5957.
Signed-off-by: UltChowsk <ult@chowsk.net>
2025-02-26 20:37:20 -05:00
729a44f82a Do not hide error messages when dealing with services
If service start/stop/restart/enable/disable fails, it help to debug the issue, if STDERR is not hidden, hence the error message can be seen. systemctl furthermore has the `-q` option to suppress non-error output. It works as well for "is-enabled", but until a certain systemd version still throws an error, if the checked service does not exist at all. Once Debian Bullseye support is dropped by Pi-hole, also STDERR form systemctl is-enabled does not need to be suppressed anymore.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-23 15:48:32 +01:00
8e706e4a16 Assure that Lighttpd conf-enabled symlink is removed
`/etc/lighttpd/conf-enabled` usually contains symlinks to the actual files in `/etc/lighttpd/conf-available`, at least `lighty-enable-mod` does exactly this. If `/etc/lighttpd/conf-available/15-pihole-admin.conf` is removed first, `/etc/lighttpd/conf-enabled/15-pihole-admin.conf` hence points to nowhere, which makes the `-f` check return false. The orphaned symlink is hence not removed, if `lighty-disable-mod` is not available.

This PR changes the order, to remove the symlink first, and to be failsafe also if it is orphaned already, and the actual config afterwards.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-22 23:27:05 +01:00
8f5296536e Fix dnsmasq v5 to v6 config migration
The dnsmasq config files were removed in `remove_old_dnsmasq_ftl_configs()`, before they were tried to be migrated via `migrate_dnsmasq_configs()`, and hence most settings were lost during v5 to v6 update.

This commit renames and adjussts `remove_old_dnsmasq_ftl_configs()` to move dnsmasq config files into the migration directory instead, to be picked up by `migrate_dnsmasq_configs()` later.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-22 21:43:49 +01:00
1764f99333 decide migration based on existence of setupVars rather than pihole.toml
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-02-22 15:35:05 +00:00
bd3a0f4891 Don't set a random password on v5 -> v6 updates
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-22 07:16:28 +01:00
cd4efc3141 Fix empty password detection
The CLI skips double quotes in config output, hence the output is completely empty, if no password was applied yet, e.g. on a fresh install. This leads to an unprotected web interface. The check is corrected, to have a random password applied as intended.

Additionally, the logic to show an unchanged or unset password on the completion dialog is inverted to correctly show "unchanged" resp. "NOT SET" if the password has not been changed resp. is empty.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-20 19:12:59 +01:00
49bb6dc0da Apply chosen upstream DNS on fresh install
While the dialog is shown to choose or enter an upstream DNS for Pi-hole, it is never applied. Hence fresh Pi-hole installs have no upstream DNS and cannot resolve queries.

It is now checked for the two generated variables PIHOLE_DNS_1 and PIHOLE_DNS_2, a TOML array generated and applied via pihole-FTL CLI.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-20 18:28:38 +01:00
f7403e2ee6 Fix binary name in 32 bit x86 fallback case
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-19 08:42:32 +01:00
dfc2b32248 Use better function name
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-06 21:57:17 +01:00
49cf5bb221 Remove 'reconfigure' option
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-06 21:57:05 +01:00
9d53ad7668 installer: use a drop-in to disable systemd-resolved stub listener (#5885) 2025-02-06 18:47:49 +01:00
8fb3ccc147 installer: use a drop-in to disable systemd-resolved stub listener
systemd-resolved supports drop-in config snippets, e.g. by placing .conf
files in /etc/systemd/resolved.conf.d. During install, use a drop-in
config to set DNSStubListener=no, instead of modifying the main config.

This is generally better practice, and also prevents conflicts when
distribution packages are upgraded, which may include new versions of
/etc/systemd/resolved.conf.

Signed-off-by: Nick Rosbrook <enr0n@ubuntu.com>
2025-02-04 16:18:04 -05:00
0da97e762f Remove outdated dns-servers.conf
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-03 08:31:33 +01:00
4be130971e Update automated install/basic-install.sh
Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2025-01-09 18:32:04 +01:00
211a881888 Apply suggestions from code review
Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2025-01-08 19:28:15 +01:00
4d23187f86 Add missing newline
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-07 17:49:57 +01:00
b544b74f7a Merge branch 'development' into fix/migration 2025-01-06 16:43:18 +01:00
6e633e4cfd Improve lighttpd disabling (#5849) 2025-01-02 15:05:00 +01:00
364281354c Check if service is currently enabled when checking if lighttpd may need to be disabled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-02 13:43:32 +01:00
79087fb252 SHow lighttpd disable dialog only once during v6 migration and when lighttpd is actually installed
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-01 18:55:49 +01:00
4fd77f57fa Remove now unused function test_dpkg_lock()
Signed-off-by: Christian König <github@yubiuser.dev>
2025-01-01 12:20:50 +01:00
b0e0bdc436 Disable lighttpd if found (#5835) 2024-12-30 17:01:04 +01:00
1835827371 Ensure Yes to keeping lighttpd doesn't trigger set -e during the upgrade
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-30 15:35:41 +01:00
50645c2924 Apply suggestions from code review
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2024-12-24 02:19:37 +01:00
d14273f958 Add comment where setupVars.conf goes when v6 migration is done
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-24 02:17:50 +01:00
47d5a08565 Ask the user if they want to disable lighttpd
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 19:12:47 +01:00
e08f65d1c4 Disable lighttpd if found
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 09:30:37 +01:00
a2a22c4e13 Exit early when neither service nor systemctl commands are available
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 09:13:34 +01:00
8faa28d8a0 Explicitly log migration process
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 08:57:34 +01:00
92a3c73f80 Fix v5 -> v6 update
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-22 21:46:32 +01:00
4f268ed193 Explicitly migrate from v5 to v6
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-21 07:10:46 +01:00
d80259ee8f Improve dependency package output (#5828) 2024-12-16 17:22:12 +01:00
83224e7729 Improve dependency package output
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 15:55:34 +01:00
b2a5564685 FTL allows non-numieric port notation - we need to strip this
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 13:06:25 +01:00
7dc542f3c2 Get WEBPORT from pihole.toml
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 12:54:39 +01:00
4d55bc1ae3 pihole -a is gone
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 12:08:16 +01:00
26ef0be9d6 One check less
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 11:56:04 +01:00
cc01c110f1 Also check during installlation of the dependency package
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-14 22:31:02 +01:00
fdda40994b Fix rare case when apt and rpm package managers are found
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-14 22:26:05 +01:00
8f1fce8f4b move the sourcing of utils.sh outside of installPihole
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-12-10 19:01:58 +00:00
4137275f24 Merge branch 'development' into packages
Signed-off-by: Christian König <github@yubiuser.dev>
2024-11-17 21:13:16 +01:00
62b63f87e0 Use rpm instead of dnf to check for installed package. dnf changed to returning success even for not-installed packages wit Fedora 41
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 12:46:43 +01:00