diff --git a/ct/authentik.sh b/ct/authentik.sh index 31e21467..83d0fe3a 100644 --- a/ct/authentik.sh +++ b/ct/authentik.sh @@ -29,6 +29,13 @@ function update_script() { fi RELEASE=$(curl -fsSL https://api.github.com/repos/goauthentik/authentik/releases/latest | grep "tarball_url" | awk '{print substr($2, 2, length($2)-3)}') if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + NODE_VERSION="22" + PG_VERSION="16" + setup_uv + install_postgresql + install_node_and_modules + install_go + msg_info "Stopping ${APP}" systemctl stop authentik-server systemctl stop authentik-worker @@ -54,17 +61,14 @@ function update_script() { go build -o /opt/authentik/authentik-server /opt/authentik/cmd/server/ msg_ok "Built ${APP} server" - msg_info "Installing Python Dependencies" + msg_info "Building Authentik" cd /opt/authentik - $STD poetry install --only=main --no-ansi --no-interaction --no-root - $STD poetry export --without-hashes --without-urls -f requirements.txt --output requirements.txt - $STD pip install --no-cache-dir -r requirements.txt - $STD pip install . - msg_ok "Installed Python Dependencies" + $STD uv sync --frozen --no-install-project --no-dev + uv run python -m lifecycle.migrate + ln -s /opt/authentik/.venv/bin/gunicorn /usr/local/bin/gunicorn + ln -s /opt/authentik/.venv/bin/celery /usr/local/bin/celery + msg_ok "Authentik built" - msg_info "Updating ${APP} to v${RELEASE} (Patience)" - cp -r /opt/authentik/authentik/blueprints /opt/authentik/blueprints - $STD bash /opt/authentik/lifecycle/ak migrate echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP} to v${RELEASE}" diff --git a/install/authentik-install.sh b/install/authentik-install.sh index f0496533..09cff007 100644 --- a/install/authentik-install.sh +++ b/install/authentik-install.sh @@ -80,7 +80,7 @@ RELEASE=$(curl -fsSL https://api.github.com/repos/goauthentik/authentik/releases mkdir -p /opt/authentik curl -fsSL "${RELEASE}" -o "authentik.tar.gz" tar -xzf authentik.tar.gz -C /opt/authentik --strip-components 1 --overwrite - +export NODE_OPTIONS="--max-old-space-size=4096" cd /opt/authentik/website $STD npm install $STD npm run build-bundled diff --git a/misc/tools.func b/misc/tools.func index eda4d17b..c79e4958 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -47,7 +47,7 @@ install_node_and_modules() { msg_ok "Installed Node.js ${NODE_VERSION}" fi - export NODE_OPTIONS="--max_old_space_size=4096" + export NODE_OPTIONS="--max-old-space-size=4096" # Install global Node modules if [[ -n "$NODE_MODULE" ]]; then