Skip to content

Commit

Permalink
Merge branch 'master' into webpassword
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Smith <[email protected]>
  • Loading branch information
buckaroogeek authored Mar 9, 2025
2 parents db94113 + 95d89ef commit 230a9cd
Show file tree
Hide file tree
Showing 91 changed files with 542 additions and 1,547 deletions.
19 changes: 11 additions & 8 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM node:21-alpine3.19
FROM node:22-alpine3.21

RUN apk add --no-cache \
git \
nano\
openssh \
py3-pip
git \
nano \
openssh \
py3-pip

ENV USER node
USER $USER
USER ${USER}

# python packages (as mkdocs) are installed in the user's home directory
# but we need them to be accessible from $PATH
ENV PATH="$PATH:/home/$USER/.local/bin"
# but we need them to be accessible from ${PATH}
ENV PATH="${PATH}:/home/${USER}/.local/bin"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
FORCE_COLOR: 2
NODE: 20
NODE: 22
PYTHON_VERSION: "3.11"

jobs:
Expand Down
1 change: 0 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
},
"MD036": false,
"MD038": false,
"MD040": false,
"MD041": false,
"MD045": false,
"MD046": {
Expand Down
52 changes: 26 additions & 26 deletions docs/api/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ To get a session ID, you will have to send a `POST` request to the `/api/auth` e

=== "bash / cURL"

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

=== "Python 3"

``` python
```python
import requests

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

=== "Javascript (plain)"
=== "JavaScript (plain)"

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

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

=== "Javascript (jQuery)"
=== "JavaScript (jQuery)"

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

=== "C"

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

=== "bash / cURL"

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

=== "Python 3"

``` python
```python
# Example: Authentication with SID in the request header
import requests

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

=== "Javascript (plain)"
=== "JavaScript (plain)"

``` javascript
```javascript
var data = null;
var xhr = new XMLHttpRequest();

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

=== "Javascript (jQuery)"
=== "JavaScript (jQuery)"

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

=== "bash / cURL"

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

=== "Python 3"

``` python
```python
import requests

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

=== "Javascript (plain)"
=== "JavaScript (plain)"

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

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

=== "Javascript (jQuery)"
=== "JavaScript (jQuery)"

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

or

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

=== "bash / cURL"

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

=== "Python 3"

``` python
```python
# Example: Logout with SID in the request header
import requests

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

=== "Javascript (plain)"
=== "JavaScript (plain)"

``` javascript
```javascript
var data = null;
var xhr = new XMLHttpRequest();

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

=== "Javascript (jQuery)"
=== "JavaScript (jQuery)"

``` javascript
```javascript
$.ajax({
url: "https://pi.hole/api/auth",
type: "DELETE",
Expand Down
6 changes: 3 additions & 3 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The form of replies to successful requests strongly depends on the selected endp

Response code: `HTTP/1.1 200 OK`

``` json
```json
{
"blocking": true
}
Expand All @@ -45,7 +45,7 @@ In contrast, errors have a uniform, predictable style to ease their programmatic

Response code: `HTTP/1.1 401 Unauthorized`

``` json
```json
{
"error": {
"key": "unauthorized",
Expand Down Expand Up @@ -101,7 +101,7 @@ In contrast, errors have a uniform, predictable style to ease their programmatic

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

``` json
```json
{
"error": {
"key": "database_error",
Expand Down
12 changes: 6 additions & 6 deletions docs/docker/build-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ In case you wish to customize the image, or perhaps check out a branch after bei

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

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

## Build.sh

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

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

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

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

```
```bash
./build.sh -f new/Sensors
```

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

```
```bash
git checkout fix/logRotate
./build.sh
```
Expand All @@ -74,6 +74,6 @@ services:
...
```

```
```bash
docker run [options] pihole:local
```
8 changes: 7 additions & 1 deletion docs/docker/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ Setting this environment variable to `1` will set `-x`, making the scripts that

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.

### Variable Formatting

Environment variables may be set in the format given here, or they may be entirely uppercase in the conventional manner.

For example, both `FTLCONF_dns_upstreams` and `FTLCONF_DNS_UPSTREAMS` are functionally equivalent when used as environment variables.

## Notes On Web Interface Password

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/).
Expand Down Expand Up @@ -173,4 +179,4 @@ secrets:
pihole_webpasswd:
file: ./pihole_password.txt
...
```
```
4 changes: 3 additions & 1 deletion docs/docker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ services:
- "443:443/tcp"
# Uncomment the below if using Pi-hole as your DHCP Server
#- "67:67/udp"
# Uncomment the line below if you are using Pi-hole as your NTP server
#- "123:123/udp"
environment:
# Set the appropriate timezone for your location from
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones, e.g:
Expand Down Expand Up @@ -47,7 +49,7 @@ Run `docker compose up -d` to build and start Pi-hole (on older systems, the syn

The equivalent command for `docker run` would be:

```
```bash
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
```

Expand Down
1 change: 0 additions & 1 deletion docs/docker/upgrading/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ docker rm pihole
docker pull pihole/pihole:latest
docker run [ ... arguments (see Getting Started) ... ]
```

8 changes: 2 additions & 6 deletions docs/docker/upgrading/v5-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Nearly all environment variables from previous versions have been removed, but f

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:

```
```text
<enabled>,<ip-address>[/<prefix-len>],<server>[#<port>],<domain>
```

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

You would now set:

```
```text
FTLCONF_dns_revServers: 'true,192.168.0.0/24,192.168.0.1#53,lan'
```

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


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 `;`


### Removed Variables

The following variables can be removed without replacement, as they are no longer used:
Expand All @@ -92,5 +90,3 @@ The following variables can be removed without replacement, as they are no longe
- `WEB_GID`
- `WEB_UID`
- `WEBLOGS_STDOUT`
- `WEBPASSWORD_FILE`

Loading

0 comments on commit 230a9cd

Please sign in to comment.