This commit is contained in:
CanbiZ 2025-05-05 10:54:54 +02:00
parent 9f50a99f78
commit f76d28bdd9
3 changed files with 15 additions and 11 deletions

View File

@ -29,6 +29,13 @@ function update_script() {
fi fi
RELEASE=$(curl -fsSL https://api.github.com/repos/goauthentik/authentik/releases/latest | grep "tarball_url" | awk '{print substr($2, 2, length($2)-3)}') 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 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}" msg_info "Stopping ${APP}"
systemctl stop authentik-server systemctl stop authentik-server
systemctl stop authentik-worker systemctl stop authentik-worker
@ -54,17 +61,14 @@ function update_script() {
go build -o /opt/authentik/authentik-server /opt/authentik/cmd/server/ go build -o /opt/authentik/authentik-server /opt/authentik/cmd/server/
msg_ok "Built ${APP} server" msg_ok "Built ${APP} server"
msg_info "Installing Python Dependencies" msg_info "Building Authentik"
cd /opt/authentik cd /opt/authentik
$STD poetry install --only=main --no-ansi --no-interaction --no-root $STD uv sync --frozen --no-install-project --no-dev
$STD poetry export --without-hashes --without-urls -f requirements.txt --output requirements.txt uv run python -m lifecycle.migrate
$STD pip install --no-cache-dir -r requirements.txt ln -s /opt/authentik/.venv/bin/gunicorn /usr/local/bin/gunicorn
$STD pip install . ln -s /opt/authentik/.venv/bin/celery /usr/local/bin/celery
msg_ok "Installed Python Dependencies" 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 echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to v${RELEASE}" msg_ok "Updated ${APP} to v${RELEASE}"

View File

@ -80,7 +80,7 @@ RELEASE=$(curl -fsSL https://api.github.com/repos/goauthentik/authentik/releases
mkdir -p /opt/authentik mkdir -p /opt/authentik
curl -fsSL "${RELEASE}" -o "authentik.tar.gz" curl -fsSL "${RELEASE}" -o "authentik.tar.gz"
tar -xzf authentik.tar.gz -C /opt/authentik --strip-components 1 --overwrite tar -xzf authentik.tar.gz -C /opt/authentik --strip-components 1 --overwrite
export NODE_OPTIONS="--max-old-space-size=4096"
cd /opt/authentik/website cd /opt/authentik/website
$STD npm install $STD npm install
$STD npm run build-bundled $STD npm run build-bundled

View File

@ -47,7 +47,7 @@ install_node_and_modules() {
msg_ok "Installed Node.js ${NODE_VERSION}" msg_ok "Installed Node.js ${NODE_VERSION}"
fi fi
export NODE_OPTIONS="--max_old_space_size=4096" export NODE_OPTIONS="--max-old-space-size=4096"
# Install global Node modules # Install global Node modules
if [[ -n "$NODE_MODULE" ]]; then if [[ -n "$NODE_MODULE" ]]; then