From ab88156e2ed95b7fc33ef8feb09c655c4d8cd6e4 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Mar 2026 16:31:07 +0100 Subject: [PATCH] Add NOT_SECURED and newrelic stub Set NOT_SECURED=true in postiz install script for local/non-secured setups. In simplelogin install, detect the venv site-packages path and create a minimal newrelic package stub (newrelic/__init__.py and newrelic/agent.py) with no-op record_custom_event and initialize functions to avoid import errors when New Relic is not present. --- install/postiz-install.sh | 1 + install/simplelogin-install.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/install/postiz-install.sh b/install/postiz-install.sh index 893d701a6..2a0fece28 100644 --- a/install/postiz-install.sh +++ b/install/postiz-install.sh @@ -45,6 +45,7 @@ MAIN_URL=http://${LOCAL_IP} FRONTEND_URL=http://${LOCAL_IP} NEXT_PUBLIC_BACKEND_URL=http://${LOCAL_IP}/api BACKEND_INTERNAL_URL=http://localhost:3000 +NOT_SECURED=true TEMPORAL_ADDRESS=localhost:7233 IS_GENERAL=true STORAGE_PROVIDER=local diff --git a/install/simplelogin-install.sh b/install/simplelogin-install.sh index cfa672e93..278587fed 100644 --- a/install/simplelogin-install.sh +++ b/install/simplelogin-install.sh @@ -44,6 +44,15 @@ $STD uv venv $STD uv pip install setuptools hatchling editables $STD uv sync --locked --no-dev --no-build-isolation --no-install-package newrelic +VENV_SITE=$(/opt/simplelogin/.venv/bin/python -c "import site; print(site.getsitepackages()[0])") +mkdir -p "${VENV_SITE}/newrelic" +cat <<'STUB' >"${VENV_SITE}/newrelic/__init__.py" +STUB +cat <<'STUB' >"${VENV_SITE}/newrelic/agent.py" +def record_custom_event(*a, **kw): pass +def initialize(*a, **kw): pass +STUB + if [[ -f /opt/simplelogin/static/package.json ]]; then cd /opt/simplelogin/static $STD npm ci || $STD npm install