pivpn icon indicating copy to clipboard operation
pivpn copied to clipboard

[Install Failed]: /etc/pihole/versions: Permission denied for PiHole Version 6

Open HawkingJan opened this issue 9 months ago • 3 comments

In raising this issue I confirm that

Describe the issue

During installation via curl -L https://raw.githubusercontent.com/pivpn/pivpn/master/auto_install/install.sh | bash the identificaction of pihole version fails and therefore the wrong branch in the if/else-statment is choosen

Processing triggers for man-db (2.11.2-2) ...
:::    Package wireguard-tools successfully installed!
:::    Package qrencode successfully installed!
main: line 2363: /etc/pihole/versions: Permission denied
Usage: pihole [options]
Example: 'pihole allow -h'
Add '-h' after specific commands for more information on usage

The command in line 2363 is CORE_VERSION="$(source "$piholeVersions" && echo "${CORE_VERSION}")" with $piholeVersions set to /etc/pihole/versions"

Expected behavior

Identify PiHole version 6 and follow if/else-statment accordingly

Please describe the steps to replicate the issue

Install PiHole version 6 (v6.0.5) Start installation of PiVPN via curl -L https://raw.githubusercontent.com/pivpn/pivpn/master/auto_install/install.sh | bash Accept all the defaults

Have you taken any steps towards solving your issue?

Changing the line 2363 in install.sh to

CORE_VERSION="$(source <(${SUDO} cat "$piholeVersions") && echo "${CORE_VERSION}")"

Screenshots

No response

Where did you run pivpn?

RaspberryPi

Please provide your output from uname -a

6.6.51+rpt-rpi-v6 #1 Raspbian 1:6.6.51-1+rpt3 (2024-10-08) armv6l GNU/Linux

Details about Operative System

PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)" NAME="Raspbian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

HawkingJan avatar Mar 09 '25 16:03 HawkingJan

That's weird, what's the output of ls -l /etc/pihole/versions ?

orazioedoardo avatar Mar 09 '25 17:03 orazioedoardo

-rw-r--r-- 1 pihole pihole

Whit this permissions I could now successful install pivpn without my workaround. I was already questioning myself, why I couldn’t read the file before. Then I found https://github.com/pi-hole/pi-hole/issues/5987 and https://github.com/pi-hole/pi-hole/pull/6002

There seems to be one process setting it to 644 (rw-r--r--) and an other setting it to 640 (rw-r-----), which should be become the new default. As my default user is not in the pihole group I coudnd't read the file, when the process setting it to 640 was the last one.

HawkingJan avatar Mar 09 '25 18:03 HawkingJan

On my fresh installation ls -l /etc/pihole/versions returns -rw-r----- 1 pihole pihole 309 Apr 21 16:37 /etc/pihole/versions

this is the contect of the version file: CORE_VERSION=v6.0.6 CORE_BRANCH=master CORE_HASH=0f7803b7 GITHUB_CORE_VERSION= GITHUB_CORE_HASH=0f7803b7 WEB_VERSION=v6.1 WEB_BRANCH=master WEB_HASH=1eaddca8 GITHUB_WEB_VERSION=v6.1 GITHUB_WEB_HASH=1eaddca8 FTL_VERSION=v6.1 FTL_BRANCH=master FTL_HASH=a3313229 GITHUB_FTL_VERSION=v6.1 GITHUB_FTL_HASH=a3313229

MaDill avatar Apr 21 '25 14:04 MaDill