Skip to content

Commit 230a9cd

Browse files
authored
Merge branch 'master' into webpassword
Signed-off-by: Brad Smith <[email protected]>
2 parents db94113 + 95d89ef commit 230a9cd

File tree

91 files changed

+542
-1547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+542
-1547
lines changed

.devcontainer/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
FROM node:21-alpine3.19
1+
FROM node:22-alpine3.21
2+
23
RUN apk add --no-cache \
3-
git \
4-
nano\
5-
openssh \
6-
py3-pip
4+
git \
5+
nano \
6+
openssh \
7+
py3-pip
8+
79
ENV USER node
8-
USER $USER
10+
USER ${USER}
11+
912
# python packages (as mkdocs) are installed in the user's home directory
10-
# but we need them to be accessible from $PATH
11-
ENV PATH="$PATH:/home/$USER/.local/bin"
13+
# but we need them to be accessible from ${PATH}
14+
ENV PATH="${PATH}:/home/${USER}/.local/bin"

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
env:
1212
FORCE_COLOR: 2
13-
NODE: 20
13+
NODE: 22
1414
PYTHON_VERSION: "3.11"
1515

1616
jobs:

.markdownlint.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
},
3333
"MD036": false,
3434
"MD038": false,
35-
"MD040": false,
3635
"MD041": false,
3736
"MD045": false,
3837
"MD046": {

docs/api/auth.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ To get a session ID, you will have to send a `POST` request to the `/api/auth` e
77

88
=== "bash / cURL"
99

10-
``` bash
10+
```bash
1111
curl -k -X POST "https://pi.hole/api/auth" --data '{"password":"your-password"}'
1212
```
1313

1414
=== "Python 3"
1515

16-
``` python
16+
```python
1717
import requests
1818

1919
url = "https://pi.hole/api/auth"
@@ -24,9 +24,9 @@ To get a session ID, you will have to send a `POST` request to the `/api/auth` e
2424
print(response.text)
2525
```
2626

27-
=== "Javascript (plain)"
27+
=== "JavaScript (plain)"
2828

29-
``` javascript
29+
```javascript
3030
var data = JSON.stringify({"password":"your-password"});
3131
var xhr = new XMLHttpRequest();
3232

@@ -37,9 +37,9 @@ To get a session ID, you will have to send a `POST` request to the `/api/auth` e
3737
});
3838
```
3939

40-
=== "Javascript (jQuery)"
40+
=== "JavaScript (jQuery)"
4141

42-
``` javascript
42+
```javascript
4343
$.ajax({
4444
url: "https://pi.hole/api/auth",
4545
type: "POST",
@@ -55,7 +55,7 @@ To get a session ID, you will have to send a `POST` request to the `/api/auth` e
5555

5656
=== "C"
5757

58-
``` c
58+
```c
5959
#include <stdio.h>
6060
#include <stdlib.h>
6161
#include <curl/curl.h>
@@ -144,14 +144,14 @@ Note that when using cookie-based authentication, you will also need to send a `
144144

145145
=== "bash / cURL"
146146

147-
``` bash
147+
```bash
148148
# Example: Authentication with SID in the request URI
149149
curl -k -X GET "https://pi.hole/api/dns/blocking?sid=vFA+EP4MQ5JJvJg+3Q2Jnw="
150150
```
151151

152152
=== "Python 3"
153153

154-
``` python
154+
```python
155155
# Example: Authentication with SID in the request header
156156
import requests
157157

@@ -167,9 +167,9 @@ Note that when using cookie-based authentication, you will also need to send a `
167167
print(response.text)
168168
```
169169

170-
=== "Javascript (plain)"
170+
=== "JavaScript (plain)"
171171

172-
``` javascript
172+
```javascript
173173
var data = null;
174174
var xhr = new XMLHttpRequest();
175175

@@ -184,9 +184,9 @@ Note that when using cookie-based authentication, you will also need to send a `
184184
xhr.send(data);
185185
```
186186

187-
=== "Javascript (jQuery)"
187+
=== "JavaScript (jQuery)"
188188

189-
``` javascript
189+
```javascript
190190
$.ajax({
191191
url: "https://pi.hole/api/dns/blocking",
192192
type: "GET",
@@ -220,13 +220,13 @@ If you have 2FA enabled for your Pi-hole, you will need to provide a TOTP token
220220

221221
=== "bash / cURL"
222222

223-
``` bash
223+
```bash
224224
curl -k -X POST "https://pi.hole/api/auth" --data '{"password":"your-password", "totp":"123456"}'
225225
```
226226

227227
=== "Python 3"
228228

229-
``` python
229+
```python
230230
import requests
231231

232232
url = "https://pi.hole/api/auth"
@@ -240,9 +240,9 @@ If you have 2FA enabled for your Pi-hole, you will need to provide a TOTP token
240240
print(response.text)
241241
```
242242

243-
=== "Javascript (plain)"
243+
=== "JavaScript (plain)"
244244

245-
``` javascript
245+
```javascript
246246
var data = JSON.stringify({"password":"your-password", "totp":"123456"});
247247
var xhr = new XMLHttpRequest();
248248

@@ -253,9 +253,9 @@ If you have 2FA enabled for your Pi-hole, you will need to provide a TOTP token
253253
});
254254
```
255255

256-
=== "Javascript (jQuery)"
256+
=== "JavaScript (jQuery)"
257257

258-
``` javascript
258+
```javascript
259259
$.ajax({
260260
url: "https://pi.hole/api/auth",
261261
type: "POST",
@@ -302,7 +302,7 @@ In addition to the status code, the server will also return a JSON object with m
302302

303303
or
304304

305-
``` json
305+
```json
306306
{
307307
"error": {
308308
"key": "bad_request",
@@ -325,14 +325,14 @@ To end your session before the SID expires, you can send a `DELETE` request to t
325325

326326
=== "bash / cURL"
327327

328-
``` bash
328+
```bash
329329
# Example: Logout with SID in the request URI
330330
curl -k -X DELETE "https://pi.hole/api/auth?sid=vFA+EP4MQ5JJvJg+3Q2Jnw="
331331
```
332332

333333
=== "Python 3"
334334

335-
``` python
335+
```python
336336
# Example: Logout with SID in the request header
337337
import requests
338338

@@ -347,9 +347,9 @@ To end your session before the SID expires, you can send a `DELETE` request to t
347347
print(response.text)
348348
```
349349

350-
=== "Javascript (plain)"
350+
=== "JavaScript (plain)"
351351

352-
``` javascript
352+
```javascript
353353
var data = null;
354354
var xhr = new XMLHttpRequest();
355355

@@ -363,9 +363,9 @@ To end your session before the SID expires, you can send a `DELETE` request to t
363363
xhr.send(data);
364364
```
365365

366-
=== "Javascript (jQuery)"
366+
=== "JavaScript (jQuery)"
367367

368-
``` javascript
368+
```javascript
369369
$.ajax({
370370
url: "https://pi.hole/api/auth",
371371
type: "DELETE",

docs/api/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The form of replies to successful requests strongly depends on the selected endp
2121

2222
Response code: `HTTP/1.1 200 OK`
2323

24-
``` json
24+
```json
2525
{
2626
"blocking": true
2727
}
@@ -45,7 +45,7 @@ In contrast, errors have a uniform, predictable style to ease their programmatic
4545

4646
Response code: `HTTP/1.1 401 Unauthorized`
4747

48-
``` json
48+
```json
4949
{
5050
"error": {
5151
"key": "unauthorized",
@@ -101,7 +101,7 @@ In contrast, errors have a uniform, predictable style to ease their programmatic
101101

102102
Examples for a failed request with `hint` being set is (domain is already on this list):
103103

104-
``` json
104+
```json
105105
{
106106
"error": {
107107
"key": "database_error",

docs/docker/build-image.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In case you wish to customize the image, or perhaps check out a branch after bei
44

55
In order to build the image locally, you will first need a copy of the repository on your computer. The following commands will clone the repository from Github and then put you into the directory
66

7-
```
7+
```bash
88
git clone https://github.com/pi-hole/docker-pi-hole
99
cd docker-pi-hole
1010
git checkout development #NOTE: This step is only needed until V6 is released
@@ -14,7 +14,7 @@ All other commands following assume you have at least run the above steps.
1414

1515
## Build.sh
1616

17-
```
17+
```text
1818
Usage: ./build.sh [-l] [-f <ftl_branch>] [-c <core_branch>] [-w <web_branch>] [-t <tag>] [use_cache]
1919
Options:
2020
-f, --ftlbranch <branch> Specify FTL branch (cannot be used in conjunction with -l)
@@ -37,7 +37,7 @@ When contributing, it's always a good idea to test your changes before submittin
3737

3838
There is also `./build-and-test.sh`, which can be used to verify the tests that are run on Github pass with your changes.
3939

40-
```
40+
```bash
4141
git checkout -b myNewFeatureBranch
4242
#make some changes
4343
./build.sh
@@ -51,13 +51,13 @@ Occasionally you may need to try an alternative branch of one of the components
5151

5252
- You have been asked by a developer to checkout the FTL branch `new/Sensors`. To do so
5353

54-
```
54+
```bash
5555
./build.sh -f new/Sensors
5656
```
5757

5858
- There is new docker-specific work being carried out on the branch `fix/logRotate` that you wish to test
5959

60-
```
60+
```bash
6161
git checkout fix/logRotate
6262
./build.sh
6363
```
@@ -74,6 +74,6 @@ services:
7474
...
7575
```
7676

77-
```
77+
```bash
7878
docker run [options] pihole:local
7979
```

docs/docker/configuration.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ Setting this environment variable to `1` will set `-x`, making the scripts that
8989

9090
Set the web interface password using [Docker Compose Secrets](https://docs.docker.com/compose/how-tos/use-secrets/) if using Compose or [Docker Swarm secrets](https://docs.docker.com/engine/swarm/secrets/) if using Docker Swarm. If `FTLCONF_webserver_api_password` is set, `WEBPASSWORD_FILE` is ignored. If `FTLCONF_webserver_api_password` is empty, and `WEBPASSWORD_FILE` is set to a valid readable file path, then `FTLCONF_webserver_api_password` will be set to the contents of `WEBPASSWORD_FILE`. See [Notes On Web Interface Password](#notes-on-web-interface-password) below for usage examples.
9191

92+
### Variable Formatting
93+
94+
Environment variables may be set in the format given here, or they may be entirely uppercase in the conventional manner.
95+
96+
For example, both `FTLCONF_dns_upstreams` and `FTLCONF_DNS_UPSTREAMS` are functionally equivalent when used as environment variables.
97+
9298
## Notes On Web Interface Password
9399

94100
The web interface password can be set using the `FTLCONF_webserver_api_password` environment variable as documented above or using the `WEBPASSWORD_FILE` environment variable using [Docker Compose Secrets](https://docs.docker.com/compose/how-tos/use-secrets/) or [Docker Swarm secrets](https://docs.docker.com/engine/swarm/secrets/).
@@ -173,4 +179,4 @@ secrets:
173179
pihole_webpasswd:
174180
file: ./pihole_password.txt
175181
...
176-
```
182+
```

docs/docker/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ services:
1818
- "443:443/tcp"
1919
# Uncomment the below if using Pi-hole as your DHCP Server
2020
#- "67:67/udp"
21+
# Uncomment the line below if you are using Pi-hole as your NTP server
22+
#- "123:123/udp"
2123
environment:
2224
# Set the appropriate timezone for your location from
2325
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones, e.g:
@@ -47,7 +49,7 @@ Run `docker compose up -d` to build and start Pi-hole (on older systems, the syn
4749

4850
The equivalent command for `docker run` would be:
4951

50-
```
52+
```bash
5153
docker run --name pihole -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -e TZ=Europe/London -e FTLCONF_webserver_api_password="correct horse battery staple" -e FTLCONF_dns_listeningMode=all -v ./etc-pihole:/etc/pihole -v ./etc-dnsmasq.d:/etc/dnsmasq.d --cap-add NET_ADMIN --restart unless-stopped pihole/pihole:latest
5254
```
5355

docs/docker/upgrading/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ docker rm pihole
2828
docker pull pihole/pihole:latest
2929
docker run [ ... arguments (see Getting Started) ... ]
3030
```
31-

docs/docker/upgrading/v5-v6.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Nearly all environment variables from previous versions have been removed, but f
4141

4242
Reverse server (`REV_SERVER*`) variables should be replaced with the single `FTLCONF_dns_revServers`, which accepts an array of reverse servers (delimited by `;`) in the following format:
4343

44-
```
44+
```text
4545
<enabled>,<ip-address>[/<prefix-len>],<server>[#<port>],<domain>
4646
```
4747

@@ -54,7 +54,7 @@ If, for example, you had the following old style variables:
5454

5555
You would now set:
5656

57-
```
57+
```text
5858
FTLCONF_dns_revServers: 'true,192.168.0.0/24,192.168.0.1#53,lan'
5959
```
6060

@@ -65,10 +65,8 @@ By default, Pi-hole v6 no longer reads configuration files from `/etc/dnsmasq.d/
6565
1. Mount the local folder containing the config files into `/etc/dnsmasq.d` into the container
6666
2. Set the environment variable `FTLCONF_misc_etc_dnsmasq_d: 'true'`
6767

68-
6968
If you only want to add a single/few `dnsmasq` config lines you can use the variable `FTLCONF_misc_dnsmasq_lines`. Each line should be separated with `;`
7069

71-
7270
### Removed Variables
7371

7472
The following variables can be removed without replacement, as they are no longer used:
@@ -92,5 +90,3 @@ The following variables can be removed without replacement, as they are no longe
9290
- `WEB_GID`
9391
- `WEB_UID`
9492
- `WEBLOGS_STDOUT`
95-
- `WEBPASSWORD_FILE`
96-

0 commit comments

Comments
 (0)