Skip to content

Commit f61ff07

Browse files
authored
Merge pull request #3 from netz98/feature/dotenv-support
Add dotenv support (ddev 1.23.5)
2 parents f4dec00 + 785fe5f commit f61ff07

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ Run `ddev describe` to list your project's services and their URLs.
1515

1616
## Configuration
1717

18+
### Docker
19+
20+
To modify the build of the used n8n image for the container there are dotenv variables available.
21+
22+
- `N8N_TAG` - The used n8n image tag. Default is `latest`.
23+
- `N8N_TIMEZONE` - The timezone of the n8n container. Default is `Europe/Berlin`.
24+
- `N8N_BASIC_AUTH_ACTIVE` - Enable basic authentication. Default is `false`.
25+
- `N8N_BASIC_AUTH_USER` - The basic authentication username. Default is `n8n`.
26+
- `N8N_BASIC_AUTH_PASSWORD` - The basic authentication password. Default is `n8n`.
27+
- `N8N_ENCRYPTION_KEY` - The encryption key for sensitive data. Default is `n8n`.
28+
29+
Use the ddev dotenv command to set these variables.
30+
31+
```bash
32+
ddev dotenv set .ddev/.env.n8n --n8n-tag=1.50.0
33+
```
34+
1835
### n8n Settings
1936

2037
Settings are in general defined in the file `.ddev/docker-compose.n8n.yaml` via environment variables.

docker-compose.n8n.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: '3.6'
44
services:
55
n8n:
66
container_name: ddev-${DDEV_SITENAME}-n8n
7-
image: docker.n8n.io/n8nio/n8n:latest
7+
image: docker.n8n.io/n8nio/n8n:${N8N_TAG:-latest}
88
networks: [default, ddev_default]
99
labels:
1010
com.ddev.site-name: ${DDEV_SITENAME}
@@ -17,14 +17,14 @@ services:
1717
volumes:
1818
- ".:/mnt/ddev_config"
1919
environment:
20-
GENERIC_TIMEZONE: "Europe/Berlin"
21-
N8N_BASIC_AUTH_ACTIVE: false
22-
N8N_BASIC_AUTH_USER: "n8n"
23-
N8N_BASIC_AUTH_PASSWORD: "n8n"
20+
GENERIC_TIMEZONE: "${N8N_TIMEZONE:-Europe/Berlin}"
21+
N8N_BASIC_AUTH_ACTIVE: "${N8N_BASIC_AUTH_ACTIVE:-false}"
22+
N8N_BASIC_AUTH_USER: "${N8N_BASIC_AUTH_USER:-n8n}"
23+
N8N_BASIC_AUTH_PASSWORD: "${N8N_BASIC_AUTH_PASSWORD:-n8n}"
2424
N8N_HOST: "${DDEV_SITENAME}.ddev.site"
2525
N8N_PORT: 5678
2626
N8N_PROTOCOL: http
27-
N8N_ENCRYPTION_KEY: "n8n"
27+
N8N_ENCRYPTION_KEY: "${N8N_ENCRYPTION_KEY:-n8n}"
2828
N8N_USER_FOLDER: "/mnt/ddev_config/n8n/data"
2929
#N8N_LOG_LEVEL: debug
3030
N8N_LOG_OUTPUT: "stdout"

tests/test.bats

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,20 @@ teardown() {
2525
@test "install from directory" {
2626
set -eu -o pipefail
2727
cd ${TESTDIR}
28-
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
28+
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
2929
ddev get ${DIR}
3030
if ! ddev restart; then
3131
ddev logs -s n8n
3232
fi
3333
health_checks
3434
}
3535

36+
# bats test_tags=release
3637
@test "install from release" {
3738
set -eu -o pipefail
3839
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
3940
echo "# ddev get netz98/ddev-n8n with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
40-
ddev get netz98/ddev-n8n
41+
ddev add-on get netz98/ddev-n8n
4142
if ! ddev restart >/dev/null; then
4243
ddev logs -s n8n
4344
fi

0 commit comments

Comments
 (0)