What is setupVars.conf and how do I use it?


#1

/etc/pihole/setupVars.conf is a file Pi-hole uses to source information needed to setup and configure the installation.

WEBPASSWORD=a215bae8b5ec659b0980a76dlkds09644731cd439cab41494447a8705c22b3aa41c
PIHOLE_INTERFACE=eth0
IPV4_ADDRESS=192.168.1.250/24
IPV6_ADDRESS=2601:444:8111:403:55d6:2f11:41bf:13bb
QUERY_LOGGING=true
INSTALL_WEB=true
DNSMASQ_LISTENING=single
PIHOLE_DNS_1=208.67.222.222
PIHOLE_DNS_2=208.67.220.220
PIHOLE_DNS_3=2620:0:ccc::2
PIHOLE_DNS_4=2620:0:ccd::2
DNS_FQDN_REQUIRED=true
DNS_BOGUS_PRIV=true
DNSSEC=true
TEMPERATUREUNIT=C
WEBUIBOXEDLAYOUT=traditional
API_EXCLUDE_DOMAINS=
API_EXCLUDE_CLIENTS=
API_QUERY_LOG_SHOW=all
API_PRIVACY_MODE=false

This file is basically a script that will set a bunch of variables, which Pi-hole can use when executing scripts.

If you edit this file manually and run pihole -r, it will apply the values set here. A good example of a time when you might need to edit this file is if your IPv6 address changes, preventing Pi-hole from effectively blocking IPv6 ads.


How to manually configure DNS IP list?
/etc/pihole/setupVars.conf: line 5: adjust.io: command not found
Pi-hole as part of a post-installatie script
#2

Thank you for this info… Could you please tell what kind of hash is used in WEBPASSWORD var? Can it be salted?


#3

It is double SHA256. It could be salted, but it is not atm.


#4

Do I get it right, that if I want my password say to be P@ssw0rd, then I have to do something like this:

echo -n P@ssw0rd | sha256sum | cut -d ' ' -f 1 | sha256sum

The result is:

1b94ca7848f898d49b964dfbb25c09c28ee107e2f033807b2487622a895b12a6

But when I add it to setupVars.conf and perform unattended install, then I can’t login to web interface, getting ‘Wrong password’ message… Do I miss anything?


#5

Just set the password with

pihole -a -p password

#6

I got it! the cut command also adds the \n symbol to the result so I have been suggested to use:

echo -n P@ssw0rd | sha256sum | awk '{printf "%s",$1 }' | sha256sum

And it works!