Files
ProxmoxVE/ct/n8n.sh
T

63 lines
1.6 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 tteck
2023-03-22 20:48:20 -04:00
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://n8n.io/ | Github: https://github.com/n8n-io/n8n
2023-03-22 20:48:20 -04:00
APP="n8n"
var_tags="${var_tags:-automation}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
2025-08-31 16:51:56 +02:00
var_disk="${var_disk:-10}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
2023-03-22 20:48:20 -04:00
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/systemd/system/n8n.service ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
2026-02-24 11:54:02 +01:00
ensure_dependencies build-essential python3-setuptools graphicsmagick
2026-02-24 11:54:02 +01:00
NODE_VERSION="24" setup_nodejs
msg_info "Updating n8n"
2025-07-28 13:33:51 +02:00
if [ ! -f /opt/n8n.env ]; then
2025-07-29 21:52:15 +02:00
sed -i 's|^Environment="N8N_SECURE_COOKIE=false"$|EnvironmentFile=/opt/n8n.env|' /etc/systemd/system/n8n.service
2025-07-28 13:33:51 +02:00
mkdir -p /opt
cat <<EOF >/opt/n8n.env
N8N_SECURE_COOKIE=false
N8N_PORT=5678
N8N_PROTOCOL=http
2026-01-19 16:33:08 +01:00
N8N_HOST=$LOCAL_IP
2025-07-28 13:33:51 +02:00
EOF
2026-02-24 11:54:02 +01:00
systemctl daemon-reload
2025-07-28 13:33:51 +02:00
fi
2026-02-24 11:54:02 +01:00
$STD npm update -g n8n
systemctl restart n8n
2026-02-24 11:54:02 +01:00
msg_ok "Updated n8n"
msg_ok "Updated successfully!"
exit
2023-03-22 20:48:20 -04:00
}
start
build_container
description
2026-01-06 22:57:40 +01:00
msg_ok "Completed successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:5678${CL}"