Compare commits

...

5 Commits

Author SHA1 Message Date
MickLesk 6df1b5bcdf Portainer: Update existing CE and BE installations 2026-08-08 22:42:34 +02:00
community-scripts-pr-app[bot] 8386465a92 Update CHANGELOG.md (#16338)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-08 02:38:26 +00:00
push-app-to-main[bot] bcec3c405a Ignis (#16330)
* Add ignis (ct)

* Fix source line to always use community scripts URL

Updated the source line to always fetch from the community scripts repository.

* Apply suggestion from @tremor021

---------

Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com>
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2026-08-08 12:37:57 +10:00
community-scripts-pr-app[bot] 4c8f5bd1f0 Update CHANGELOG.md (#16337)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-08 02:35:25 +00:00
CanbiZ (MickLesk) d87fef0892 core - setup_nodejs: bypass npm allowScripts policy globally on npm >=11 (#16280)
* setup_nodejs: bypass npm allowScripts policy globally on npm >=11

* Update misc/tools.func

Co-authored-by: Sam Heinz <sam@samheinz.com>

---------

Co-authored-by: Sam Heinz <sam@samheinz.com>
2026-08-08 12:35:03 +10:00
6 changed files with 389 additions and 28 deletions
+12
View File
@@ -518,6 +518,18 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
</details>
## 2026-08-08
### 🆕 New Scripts
- Ignis ([#16330](https://github.com/community-scripts/ProxmoxVE/pull/16330))
### 💾 Core
- #### ✨ New Features
- core - setup_nodejs: bypass npm allowScripts policy globally on npm >=11 [@MickLesk](https://github.com/MickLesk) ([#16280](https://github.com/community-scripts/ProxmoxVE/pull/16280))
## 2026-08-07
### 🆕 New Scripts
+6
View File
@@ -0,0 +1,6 @@
____ _
/ _/___ _____ (_)____
/ // __ `/ __ \/ / ___/
_/ // /_/ / / / / (__ )
/___/\__, /_/ /_/_/____/
/____/
+79
View File
@@ -0,0 +1,79 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Nystik-gh/ignis
APP="Ignis"
var_tags="${var_tags:-notes;obsidian}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-10}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
var_arm64="${var_arm64:-yes}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/ignis ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "ignis" "Nystik-gh/ignis"; then
msg_info "Stopping Service"
systemctl stop ignis
msg_ok "Stopped Service"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ignis" "Nystik-gh/ignis" "tarball"
msg_info "Building Ignis"
cd /opt/ignis
export NODE_OPTIONS="--max-old-space-size=4096"
export IGNIS_BUILD="$(cat ~/.ignis)"
$STD npm ci --ignore-scripts
$STD npm run build
$STD npm install -g @electron/asar
msg_ok "Built Ignis"
msg_info "Checking Obsidian Web Assets"
OBSIDIAN_VERSION=$(grep -oP 'OBSIDIAN_VERSION=\K[0-9.]+' /opt/ignis/apps/ignis-server/Dockerfile | head -n1)
[[ -z "$OBSIDIAN_VERSION" ]] && OBSIDIAN_VERSION="$(cat /opt/ignis_data/obsidian.version 2>/dev/null)"
if [[ -n "$OBSIDIAN_VERSION" && "$OBSIDIAN_VERSION" != "$(cat /opt/ignis_data/obsidian.version 2>/dev/null)" ]]; then
rm -rf /opt/ignis_data/obsidian-app
mkdir -p /opt/ignis_data/obsidian-app
curl -fsSL -o /tmp/obsidian.asar.gz "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian-${OBSIDIAN_VERSION}.asar.gz"
gunzip -f /tmp/obsidian.asar.gz
$STD asar extract /tmp/obsidian.asar /opt/ignis_data/obsidian-app
rm -f /tmp/obsidian.asar
echo "${OBSIDIAN_VERSION}" >/opt/ignis_data/obsidian.version
fi
msg_ok "Checked Obsidian Web Assets"
msg_info "Starting Service"
systemctl start ignis
systemctl reload nginx
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
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}https://${IP}${CL}"
+113
View File
@@ -0,0 +1,113 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Nystik-gh/ignis
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y nginx
msg_ok "Installed Dependencies"
NODE_VERSION="22" setup_nodejs
fetch_and_deploy_gh_release "ignis" "Nystik-gh/ignis" "tarball"
msg_info "Building Ignis"
cd /opt/ignis
export NODE_OPTIONS="--max-old-space-size=4096"
export IGNIS_BUILD="$(cat ~/.ignis)"
$STD npm ci --ignore-scripts
$STD npm run build
$STD npm install -g @electron/asar
msg_ok "Built Ignis"
msg_info "Downloading Obsidian Web Assets"
mkdir -p /opt/ignis_data/{obsidian-app,vaults,data}
OBSIDIAN_VERSION=$(grep -oP 'OBSIDIAN_VERSION=\K[0-9.]+' /opt/ignis/apps/ignis-server/Dockerfile | head -n1)
[[ -z "$OBSIDIAN_VERSION" ]] && OBSIDIAN_VERSION="1.12.7"
curl -fsSL -o /tmp/obsidian.asar.gz "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian-${OBSIDIAN_VERSION}.asar.gz"
gunzip -f /tmp/obsidian.asar.gz
$STD asar extract /tmp/obsidian.asar /opt/ignis_data/obsidian-app
rm -f /tmp/obsidian.asar
echo "${OBSIDIAN_VERSION}" >/opt/ignis_data/obsidian.version
msg_ok "Downloaded Obsidian Web Assets"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/ignis.service
[Unit]
Description=Ignis (Obsidian in the browser)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/ignis
Environment=NODE_ENV=production
Environment=PORT=8080
Environment=VAULT_ROOT=/opt/ignis_data/vaults
Environment=DATA_ROOT=/opt/ignis_data/data
Environment=OBSIDIAN_ASSETS_PATH=/opt/ignis_data/obsidian-app
Environment=AUTO_CREATE_DEFAULT=true
ExecStart=/usr/bin/node /opt/ignis/apps/ignis-server/server/index.js
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now ignis
msg_ok "Created Service"
msg_info "Generating Self-Signed Certificate"
create_self_signed_cert "ignis"
msg_ok "Generated Self-Signed Certificate"
msg_info "Configuring Nginx"
cat <<'EOF' >/etc/nginx/sites-available/ignis.conf
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl default_server;
http2 on;
server_name _;
ssl_certificate /etc/ssl/ignis/ignis.crt;
ssl_certificate_key /etc/ssl/ignis/ignis.key;
client_max_body_size 1024m;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 3600s;
}
}
EOF
ln -sf /etc/nginx/sites-available/ignis.conf /etc/nginx/sites-enabled/ignis.conf
rm -f /etc/nginx/sites-enabled/default
systemctl restart nginx
msg_ok "Configured Nginx"
motd_ssh
customize
cleanup_lxc
+4
View File
@@ -7706,6 +7706,10 @@ setup_nodejs() {
fi
fi
if [[ "$(npm -v 2>/dev/null | cut -d. -f1)" -ge 11 ]]; then
$STD npm config set dangerously-allow-all-scripts true --location=global 2>/dev/null || true
fi
# Set a safe default heap limit for Node.js builds if not explicitly provided.
# Priority:
# 1) NODE_OPTIONS (caller/user override)
+175 -28
View File
@@ -27,6 +27,10 @@ APP_TYPE="addon"
INSTALL_PATH="/opt/portainer"
COMPOSE_FILE="${INSTALL_PATH}/compose.yaml"
DEFAULT_PORT=9443
PORTAINER_IMAGE=""
COMPOSE_WORKDIR=""
COMPOSE_SERVICE=""
COMPOSE_CONFIG_FILES=""
# Initialize all core functions (colors, formatting, icons, STD mode)
load_functions
@@ -66,17 +70,166 @@ UPDATEEOF
}
# ==============================================================================
# UPDATE
# DETECT EXISTING INSTALLATION
# ==============================================================================
function update() {
function detect_portainer() {
PORTAINER_IMAGE=""
COMPOSE_WORKDIR=""
COMPOSE_SERVICE=""
COMPOSE_CONFIG_FILES=""
if ! docker container inspect portainer &>/dev/null; then
return 0
fi
PORTAINER_IMAGE=$(docker inspect portainer --format '{{.Config.Image}}')
if [[ ! "$PORTAINER_IMAGE" =~ (^|/)portainer-(ce|ee)(:|@) ]]; then
msg_error "A container named 'portainer' exists but does not use an official Portainer CE or BE image."
exit 10
fi
COMPOSE_WORKDIR=$(docker inspect portainer --format '{{index .Config.Labels "com.docker.compose.project.working_dir"}}' 2>/dev/null || true)
COMPOSE_SERVICE=$(docker inspect portainer --format '{{index .Config.Labels "com.docker.compose.service"}}' 2>/dev/null || true)
COMPOSE_CONFIG_FILES=$(docker inspect portainer --format '{{index .Config.Labels "com.docker.compose.project.config_files"}}' 2>/dev/null || true)
if [[ "$COMPOSE_WORKDIR" == "<no value>" ]]; then
COMPOSE_WORKDIR=""
fi
if [[ "$COMPOSE_SERVICE" == "<no value>" ]]; then
COMPOSE_SERVICE=""
fi
if [[ "$COMPOSE_CONFIG_FILES" == "<no value>" ]]; then
COMPOSE_CONFIG_FILES=""
fi
return 0
}
# ==============================================================================
# UPDATE COMPOSE INSTALLATION
# ==============================================================================
function update_compose() {
local workdir="$1"
local service="$2"
local config_files="$3"
local config
local -a configs=()
local -a compose_args=()
if [[ -n "$config_files" ]]; then
IFS=',' read -ra configs <<<"$config_files"
for config in "${configs[@]}"; do
compose_args+=(--file "$config")
done
fi
msg_info "Pulling latest ${APP} image"
cd "$INSTALL_PATH"
$STD docker compose pull
if [[ -n "$service" ]]; then
(cd "$workdir" && $STD docker compose "${compose_args[@]}" pull "$service")
else
(cd "$workdir" && $STD docker compose pull)
fi
msg_ok "Pulled latest image"
msg_info "Restarting ${APP}"
$STD docker compose up -d --remove-orphans
if [[ -n "$service" ]]; then
(cd "$workdir" && $STD docker compose "${compose_args[@]}" up -d "$service")
else
(cd "$workdir" && $STD docker compose up -d --remove-orphans)
fi
msg_ok "Restarted ${APP}"
}
# ==============================================================================
# UPDATE STANDALONE INSTALLATION
# ==============================================================================
function update_standalone() {
local old_image_id latest_image_id restart_name restart_max network_mode container_port host_ip host_port source destination mode writable
local was_running privileged user
local -a run_args=(-d --name portainer)
local -a command=()
old_image_id=$(docker inspect portainer --format '{{.Image}}')
was_running=$(docker inspect portainer --format '{{.State.Running}}')
restart_name=$(docker inspect portainer --format '{{.HostConfig.RestartPolicy.Name}}')
restart_max=$(docker inspect portainer --format '{{.HostConfig.RestartPolicy.MaximumRetryCount}}')
network_mode=$(docker inspect portainer --format '{{.HostConfig.NetworkMode}}')
privileged=$(docker inspect portainer --format '{{.HostConfig.Privileged}}')
user=$(docker inspect portainer --format '{{.Config.User}}')
if [[ -n "$restart_name" && "$restart_name" != "no" ]]; then
if [[ "$restart_name" == "on-failure" && "$restart_max" -gt 0 ]]; then
run_args+=(--restart "${restart_name}:${restart_max}")
else
run_args+=(--restart "$restart_name")
fi
fi
[[ "$network_mode" != "default" ]] && run_args+=(--network "$network_mode")
[[ "$privileged" == "true" ]] && run_args+=(--privileged)
[[ -n "$user" ]] && run_args+=(--user "$user")
while IFS='|' read -r container_port host_ip host_port; do
[[ -z "$container_port" || -z "$host_port" ]] && continue
[[ "$host_ip" == *:* ]] && host_ip="[${host_ip}]"
if [[ -n "$host_ip" && "$host_ip" != "0.0.0.0" ]]; then
run_args+=(-p "${host_ip}:${host_port}:${container_port}")
else
run_args+=(-p "${host_port}:${container_port}")
fi
done < <(docker inspect portainer --format '{{range $port, $bindings := .HostConfig.PortBindings}}{{range $bindings}}{{printf "%s|%s|%s\n" $port .HostIp .HostPort}}{{end}}{{end}}')
while IFS='|' read -r source destination mode writable; do
[[ -z "$source" || -z "$destination" ]] && continue
if [[ "$writable" == "false" ]]; then
mode="${mode:+${mode},}ro"
fi
run_args+=(-v "${source}:${destination}${mode:+:${mode}}")
done < <(docker inspect portainer --format '{{range .Mounts}}{{if eq .Type "volume"}}{{.Name}}{{else}}{{.Source}}{{end}}|{{.Destination}}|{{.Mode}}|{{.RW}}{{println}}{{end}}')
while IFS= read -r environment; do
[[ -n "$environment" ]] && run_args+=(-e "$environment")
done < <(docker inspect portainer --format '{{range .Config.Env}}{{println .}}{{end}}')
while IFS= read -r argument; do
[[ -n "$argument" ]] && command+=("$argument")
done < <(docker inspect portainer --format '{{range .Config.Cmd}}{{println .}}{{end}}')
msg_info "Pulling latest ${APP} image"
$STD docker pull "$PORTAINER_IMAGE"
latest_image_id=$(docker image inspect "$PORTAINER_IMAGE" --format '{{.Id}}')
msg_ok "Pulled latest image"
if [[ "$old_image_id" == "$latest_image_id" ]]; then
msg_ok "${APP} is already up to date"
return 0
fi
msg_info "Recreating ${APP}"
[[ "$was_running" == "true" ]] && $STD docker stop portainer
$STD docker rm portainer
if ! $STD docker run "${run_args[@]}" "$PORTAINER_IMAGE" "${command[@]}"; then
msg_warn "Update failed, restoring the previous ${APP} image"
docker rm -f portainer &>/dev/null || true
if $STD docker run "${run_args[@]}" "$old_image_id" "${command[@]}"; then
[[ "$was_running" != "true" ]] && $STD docker stop portainer
msg_error "Failed to update ${APP}; restored the previous container."
else
msg_error "Failed to update or restore ${APP}."
fi
exit 10
fi
msg_ok "Recreated ${APP}"
}
# ==============================================================================
# UPDATE
# ==============================================================================
function update() {
if [[ -f "$COMPOSE_FILE" ]]; then
update_compose "$INSTALL_PATH" "" ""
elif [[ -n "$COMPOSE_WORKDIR" && -n "$COMPOSE_SERVICE" && -d "$COMPOSE_WORKDIR" ]]; then
update_compose "$COMPOSE_WORKDIR" "$COMPOSE_SERVICE" "$COMPOSE_CONFIG_FILES"
else
update_standalone
fi
ensure_update_script
@@ -99,26 +252,16 @@ function check_docker() {
msg_ok "Docker $(docker --version | cut -d' ' -f3 | tr -d ',') and Docker Compose are available"
}
# ==============================================================================
# CHECK EXISTING CONTAINER
# ==============================================================================
function check_existing_container() {
# Guards against clobbering a Portainer container not managed by this addon
# (e.g. Business/Enterprise Edition installed manually or via the legacy docker.sh flow)
if docker ps -a --format '{{.Names}}' | grep -q '^portainer$'; then
msg_error "A container named 'portainer' already exists but is not managed by this addon."
msg_error "This may be a Portainer Business/Enterprise Edition install or a manual setup."
msg_error "Remove/rename that container first, or manage it manually. Exiting."
exit 10
fi
}
# ==============================================================================
# INSTALL
# ==============================================================================
function install() {
check_docker
check_existing_container
detect_portainer
if [[ -n "$PORTAINER_IMAGE" ]]; then
msg_error "${APP} is already installed."
exit 10
fi
msg_info "Creating install directory"
mkdir -p "$INSTALL_PATH"
@@ -148,7 +291,9 @@ function install() {
# Handle type=update (called from update script)
if [[ "${type:-}" == "update" ]]; then
header_info
if [[ -f "$COMPOSE_FILE" ]]; then
check_docker
detect_portainer
if [[ -f "$COMPOSE_FILE" || -n "$PORTAINER_IMAGE" ]]; then
update
else
msg_error "${APP} is not installed. Nothing to update."
@@ -161,18 +306,20 @@ header_info
get_lxc_ip
check_docker
check_existing_container
detect_portainer
# Check if already installed
if [[ -f "$COMPOSE_FILE" ]]; then
if [[ -f "$COMPOSE_FILE" || -n "$PORTAINER_IMAGE" ]]; then
msg_warn "${APP} is already installed."
echo ""
echo -n "${TAB}Uninstall ${APP}? (y/N): "
read -r uninstall_prompt
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
uninstall
exit 0
if [[ -f "$COMPOSE_FILE" ]]; then
echo -n "${TAB}Uninstall ${APP}? (y/N): "
read -r uninstall_prompt
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
uninstall
exit 0
fi
fi
echo -n "${TAB}Update ${APP}? (y/N): "