Skip to content

Commit

Permalink
Merge pull request #3 from netz98/feature/dotenv-support
Browse files Browse the repository at this point in the history
Add dotenv support (ddev 1.23.5)
  • Loading branch information
cmuench authored Oct 19, 2024
2 parents f4dec00 + 785fe5f commit f61ff07
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ Run `ddev describe` to list your project's services and their URLs.

## Configuration

### Docker

To modify the build of the used n8n image for the container there are dotenv variables available.

- `N8N_TAG` - The used n8n image tag. Default is `latest`.
- `N8N_TIMEZONE` - The timezone of the n8n container. Default is `Europe/Berlin`.
- `N8N_BASIC_AUTH_ACTIVE` - Enable basic authentication. Default is `false`.
- `N8N_BASIC_AUTH_USER` - The basic authentication username. Default is `n8n`.
- `N8N_BASIC_AUTH_PASSWORD` - The basic authentication password. Default is `n8n`.
- `N8N_ENCRYPTION_KEY` - The encryption key for sensitive data. Default is `n8n`.

Use the ddev dotenv command to set these variables.

```bash
ddev dotenv set .ddev/.env.n8n --n8n-tag=1.50.0
```

### n8n Settings

Settings are in general defined in the file `.ddev/docker-compose.n8n.yaml` via environment variables.
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.n8n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: '3.6'
services:
n8n:
container_name: ddev-${DDEV_SITENAME}-n8n
image: docker.n8n.io/n8nio/n8n:latest
image: docker.n8n.io/n8nio/n8n:${N8N_TAG:-latest}
networks: [default, ddev_default]
labels:
com.ddev.site-name: ${DDEV_SITENAME}
Expand All @@ -17,14 +17,14 @@ services:
volumes:
- ".:/mnt/ddev_config"
environment:
GENERIC_TIMEZONE: "Europe/Berlin"
N8N_BASIC_AUTH_ACTIVE: false
N8N_BASIC_AUTH_USER: "n8n"
N8N_BASIC_AUTH_PASSWORD: "n8n"
GENERIC_TIMEZONE: "${N8N_TIMEZONE:-Europe/Berlin}"
N8N_BASIC_AUTH_ACTIVE: "${N8N_BASIC_AUTH_ACTIVE:-false}"
N8N_BASIC_AUTH_USER: "${N8N_BASIC_AUTH_USER:-n8n}"
N8N_BASIC_AUTH_PASSWORD: "${N8N_BASIC_AUTH_PASSWORD:-n8n}"
N8N_HOST: "${DDEV_SITENAME}.ddev.site"
N8N_PORT: 5678
N8N_PROTOCOL: http
N8N_ENCRYPTION_KEY: "n8n"
N8N_ENCRYPTION_KEY: "${N8N_ENCRYPTION_KEY:-n8n}"
N8N_USER_FOLDER: "/mnt/ddev_config/n8n/data"
#N8N_LOG_LEVEL: debug
N8N_LOG_OUTPUT: "stdout"
Expand Down
5 changes: 3 additions & 2 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ teardown() {
@test "install from directory" {
set -eu -o pipefail
cd ${TESTDIR}
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ${DIR}
if ! ddev restart; then
ddev logs -s n8n
fi
health_checks
}

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

0 comments on commit f61ff07

Please sign in to comment.