Compare commits

...

31 Commits

Author SHA1 Message Date
goldbillka 7b5f66dcdc Update hass-n8n/config.json 2026-05-04 10:55:42 +03:00
goldbillka b16124e747 Update hass-n8n/Dockerfile 2026-05-04 10:55:26 +03:00
goldbillka fa05314d91 Update hass-n8n/config.json 2026-01-29 10:57:25 +02:00
goldbillka a17093f97a Rollback to 2.1.1 2026-01-29 10:57:11 +02:00
goldbillka b3a1548c62 Update hass-n8n/config.json 2026-01-29 10:51:40 +02:00
goldbillka 577b0b9bb1 Update hass-n8n/docker-entrypoint.sh 2026-01-29 10:51:27 +02:00
goldbillka b7b6cc5100 Update hass-n8n/Dockerfile 2026-01-29 10:36:57 +02:00
goldbillka acd9652c0a Update hass-n8n/config.json 2026-01-29 10:36:29 +02:00
goldbillka cbee085e38 Update hass-n8n/config.json 2026-01-29 10:31:56 +02:00
goldbillka 8d4a37d4e6 Update hass-n8n/Dockerfile 2026-01-29 10:31:43 +02:00
goldbillka 632c764e3d Update hass-n8n/config.json 2026-01-29 10:23:56 +02:00
goldbillka 22637db273 Update hass-n8n/config.json 2026-01-29 10:22:54 +02:00
goldbillka 9ea1aba119 Update hass-n8n/Dockerfile 2026-01-29 10:16:15 +02:00
goldbillka 13d839feba Update hass-n8n/config.json 2026-01-29 10:15:49 +02:00
goldbillka 9fe60d208f Update hass-n8n/config.json 2025-12-23 14:04:42 +02:00
goldbillka cc0906b5d3 Update hass-n8n/docker-entrypoint.sh 2025-12-23 14:04:29 +02:00
goldbillka df5a7b615b Update hass-n8n/config.json 2025-12-23 13:59:02 +02:00
goldbillka b02cdc49e8 Changed to sh instead of bash 2025-12-23 13:58:50 +02:00
goldbillka c59d68b9e1 Added sh compatible entry point 2025-12-23 13:58:09 +02:00
goldbillka 91b347620c Update hass-n8n/config.json 2025-12-23 13:41:29 +02:00
goldbillka bd7b3a6f57 Fixes for 2.x version 2025-12-23 13:41:16 +02:00
goldbillka 8249784503 Update hass-n8n/config.json 2025-12-23 13:11:47 +02:00
goldbillka 03f31d5f5f Update hass-n8n/Dockerfile 2025-12-23 13:11:23 +02:00
goldbillka 0c9ee2a9a2 Update hass-n8n/config.json 2025-11-26 19:16:49 +02:00
goldbillka 4955f4e95e Update hass-n8n/Dockerfile 2025-11-26 19:16:08 +02:00
goldbillka bed771baf4 Update hass-n8n/config.json 2025-11-04 09:47:46 +02:00
goldbillka 4b1ad96a5e Update n8n version. Install claude code 2025-11-04 09:46:17 +02:00
goldbillka 2f85009ef3 Update hass-n8n/config.json 2025-08-19 15:33:10 +03:00
goldbillka 843c4644b8 Update hass-n8n/Dockerfile 2025-08-19 15:32:53 +03:00
goldbillka 1dd3e63ed0 Merge pull request 'Update hass-n8n/Dockerfile' (#2) from update-n8n into master
Reviewed-on: http://homeassistant.local:3000/goldbillka/hass-addons/pulls/2
2025-03-14 23:36:14 +02:00
goldbillka 8c94a9327d Update hass-n8n/Dockerfile 2025-03-14 23:33:45 +02:00
3 changed files with 105 additions and 56 deletions
+54 -4
View File
@@ -1,8 +1,58 @@
ARG N8N_VERSION=1.72.1
ARG N8N_VERSION=2.18.6
ARG JQ_VERSION=1.7.1
# ------------------------------------------------
# 1) busybox-static (sh, sed, mkdir, chown, su, etc.)
# ------------------------------------------------
FROM alpine:3.23 AS busybox-builder
RUN apk add --no-cache busybox-static
# ------------------------------------------------
# 2) jq static (download correct binary for TARGETARCH)
# ------------------------------------------------
FROM alpine:3.23 AS jq-builder
ARG JQ_VERSION
ARG TARGETARCH
RUN apk add --no-cache wget ca-certificates
RUN case "${TARGETARCH}" in \
amd64) JQ_ASSET="jq-linux-amd64" ;; \
arm64) JQ_ASSET="jq-linux-arm64" ;; \
*) echo "Unsupported TARGETARCH=${TARGETARCH}" && exit 1 ;; \
esac \
&& wget -O /usr/local/bin/jq \
"https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/${JQ_ASSET}" \
&& chmod +x /usr/local/bin/jq
# ------------------------------------------------
# 3) claude-code
# ------------------------------------------------
FROM node:20-alpine AS node-builder
RUN npm install -g @anthropic-ai/claude-code
# ------------------------------------------------
# 4) Final image (n8n distroless)
# ------------------------------------------------
FROM docker.n8n.io/n8nio/n8n:${N8N_VERSION}
USER root
RUN apk add --no-cache --update jq bash
# busybox (static) + install applets (/bin/sh, /bin/sed, /bin/su, /bin/chown, etc.)
COPY --from=busybox-builder /bin/busybox /bin/busybox
RUN ["/bin/busybox", "--install", "/bin"]
# jq (static, correct arch)
COPY --from=jq-builder /usr/local/bin/jq /usr/bin/jq
# claude-code
COPY --from=node-builder /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node-builder /usr/local/bin/claude /usr/local/bin/claude
ENV PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
WORKDIR /data
COPY docker-entrypoint.sh /tmp/docker-entrypoint.sh
ENTRYPOINT ["bash", "/tmp/docker-entrypoint.sh"]
EXPOSE 5678/tcp
RUN chmod +x /tmp/docker-entrypoint.sh
ENTRYPOINT ["/bin/sh", "/tmp/docker-entrypoint.sh"]
EXPOSE 443
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "Hass n8n",
"version": "1.82.3",
"version": "2.18.6",
"slug": "hass-n8n",
"description": "Self host your n8n instance",
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
@@ -15,25 +15,25 @@
],
"apparmor": true,
"ports": {
"5678/tcp": 5678
"443/tcp": 5678
},
"ports_description": {
"5678/tcp": "n8n Web interface"
"443/tcp": "n8n Web interface"
},
"options": {
"auth": false,
"auth_username": "",
"auth_password": "",
"n8n_host": "n8n.automator.dedyn.io",
"n8n_port": "5678",
"n8n_host": "n8n.aibuddy.dedyn.io",
"n8n_port": "443",
"node_env": "production",
"webhook_tunnel_url": "https://n8n.automator.dedyn.io/",
"webhook_tunnel_url": "https://n8n.aibuddy.dedyn.io/",
"timezone": "Europe/Kiev",
"protocol": "http",
"certfile": "fullchain_fixed.pem",
"keyfile": "privkey_fixed.pem",
"env_vars_list": [
"WEBHOOK_URL: https://n8n.automator.dedyn.io"
"WEBHOOK_URL: https://n8n.aibuddy.dedyn.io"
],
"cmd_line_args": "start",
"encryption_key": "",
+44 -45
View File
@@ -1,7 +1,8 @@
#!/bin/bash
#!/bin/sh
set -eu
CONFIG_PATH="/data/options.json"
N8N_PATH="$(jq --raw-output '.user_folder // empty' $CONFIG_PATH)"
N8N_PATH="$(jq -r '.user_folder // empty' "$CONFIG_PATH")"
mkdir -p "${N8N_PATH}/.n8n/.cache"
@@ -9,42 +10,45 @@ mkdir -p "${N8N_PATH}/.n8n/.cache"
## USER PARAMETERS ##
#####################
# REQUIRED
# IMPORTANT:
# Don't use: jq ... | while ...; do export ...; done
# Because in POSIX sh it runs in a subshell and exports won't persist.
values="$(jq -r '.env_vars_list[]?' "$CONFIG_PATH")"
# Extract the values from env_vars_list
values=$(jq -r '.env_vars_list | .[]' "$CONFIG_PATH")
# Convert the values to an array
IFS=$'\n' read -r -d '' -a array <<< "$values"
# Export keys and values
for element in "${array[@]}"
do
# Iterate newline-separated list safely in POSIX sh
set -f
IFS='
'
for element in $values; do
key="${element%%:*}"
value="${element#*:}"
value=$(echo "$value" | xargs) # Remove leading and trailing whitespace
export "$key"="$value"
echo "exported ${key}=${value}"
# trim whitespace (POSIX; busybox sed is fine)
value="$(printf '%s' "$value" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
export "$key=$value"
echo "exported $key=$value"
done
unset IFS
set +f
export N8N_HOST="$(jq --raw-output '.n8n_host // empty' $CONFIG_PATH)"
export N8N_PORT="$(jq --raw-output '.n8n_port // empty' $CONFIG_PATH)"
export NODE_ENV="$(jq --raw-output '.node_env // empty' $CONFIG_PATH)"
export WEBHOOK_TUNNEL_URL="$(jq --raw-output '.webhook_tunnel_url // empty' $CONFIG_PATH)"
export N8N_BASIC_AUTH_ACTIVE="$(jq --raw-output '.auth // empty' $CONFIG_PATH)"
export N8N_BASIC_AUTH_USER="$(jq --raw-output '.auth_username // empty' $CONFIG_PATH)"
export N8N_BASIC_AUTH_PASSWORD="$(jq --raw-output '.auth_password // empty' $CONFIG_PATH)"
export GENERIC_TIMEZONE="$(jq --raw-output '.timezone // empty' $CONFIG_PATH)"
export N8N_PROTOCOL="$(jq --raw-output '.protocol // empty' $CONFIG_PATH)"
export N8N_SSL_CERT="/ssl/$(jq --raw-output '.certfile // empty' $CONFIG_PATH)"
export N8N_SSL_KEY="/ssl/$(jq --raw-output '.keyfile // empty' $CONFIG_PATH)"
export N8N_ENCRYPTION_KEY="$(jq --raw-output '.encryption_key // empty' $CONFIG_PATH)"
export N8N_USER_FOLDER="${N8N_PATH}"
export N8N_HOST="$(jq -r '.n8n_host // empty' "$CONFIG_PATH")"
export N8N_PORT="$(jq -r '.n8n_port // empty' "$CONFIG_PATH")"
export NODE_ENV="$(jq -r '.node_env // empty' "$CONFIG_PATH")"
export WEBHOOK_TUNNEL_URL="$(jq -r '.webhook_tunnel_url // empty' "$CONFIG_PATH")"
export N8N_BASIC_AUTH_ACTIVE="$(jq -r '.auth // empty' "$CONFIG_PATH")"
export N8N_BASIC_AUTH_USER="$(jq -r '.auth_username // empty' "$CONFIG_PATH")"
export N8N_BASIC_AUTH_PASSWORD="$(jq -r '.auth_password // empty' "$CONFIG_PATH")"
export GENERIC_TIMEZONE="$(jq -r '.timezone // empty' "$CONFIG_PATH")"
export N8N_PROTOCOL="$(jq -r '.protocol // empty' "$CONFIG_PATH")"
export N8N_SSL_CERT="/ssl/$(jq -r '.certfile // empty' "$CONFIG_PATH")"
export N8N_SSL_KEY="/ssl/$(jq -r '.keyfile // empty' "$CONFIG_PATH")"
export N8N_ENCRYPTION_KEY="$(jq -r '.encryption_key // empty' "$CONFIG_PATH")"
export N8N_USER_FOLDER="$N8N_PATH"
export N8N_CMD_LINE="$(jq -r '.cmd_line_args // empty' "$CONFIG_PATH")"
export N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false
export N8N_CMD_LINE="$(jq --raw-output '.cmd_line_args // empty' $CONFIG_PATH)"
if [ -z "${N8N_BASIC_AUTH_USER}" ] || [ -z "${N8N_BASIC_AUTH_ACTIVE}" ]; then
if [ -z "$N8N_BASIC_AUTH_USER" ] || [ -z "$N8N_BASIC_AUTH_ACTIVE" ]; then
export N8N_BASIC_AUTH_ACTIVE=false
unset N8N_BASIC_AUTH_USER
unset N8N_BASIC_AUTH_PASSWORD
@@ -54,20 +58,15 @@ fi
## MAIN ##
###########
if [ "$#" -gt 0 ]; then
# Got started with arguments
exec n8n "${N8N_CMD_LINE}"
else
# Got started without arguments
exec n8n start
fi
chown -R node /home/node
# Fix ownership BEFORE exec (don't fail container if chown can't run)
chown -R node:node /home/node 2>/dev/null || true
# BusyBox 'su' is available (from busybox --install /bin)
# Use -s to specify shell and -c to run command.
if [ "$#" -gt 0 ]; then
# Got started with arguments
exec su-exec node "$@"
# Started with args (keep behavior similar to your original)
exec su node -s /bin/sh -c "n8n $N8N_CMD_LINE"
else
# Got started without arguments
exec su-exec node n8n
# Started without args
exec su node -s /bin/sh -c "n8n start"
fi