diff --git a/Dockerfile b/Dockerfile index 780e9ce3db..a2d7899a47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,6 @@ # syntax=docker/dockerfile:1 -# Stage 1: Build website -FROM --platform=${BUILDPLATFORM} docker.io/node:21 as website-builder - -ENV NODE_ENV=production - -WORKDIR /work/website - -RUN --mount=type=bind,target=/work/website/package.json,src=./website/package.json \ - --mount=type=bind,target=/work/website/package-lock.json,src=./website/package-lock.json \ - --mount=type=cache,id=npm-website,sharing=shared,target=/root/.npm \ - npm ci --include=dev - -COPY ./website /work/website/ -COPY ./blueprints /work/blueprints/ -COPY ./SECURITY.md /work/ - -RUN npm run build-docs-only - -# Stage 2: Build webui +# Stage 1: Build webui FROM --platform=${BUILDPLATFORM} docker.io/node:21 as web-builder ENV NODE_ENV=production @@ -36,7 +18,7 @@ COPY ./gen-ts-api /work/web/node_modules/@goauthentik/api RUN npm run build -# Stage 3: Build go proxy +# Stage 2: Build go proxy FROM --platform=${BUILDPLATFORM} docker.io/golang:1.21.6-bookworm AS go-builder ARG TARGETOS @@ -68,7 +50,7 @@ RUN --mount=type=cache,sharing=locked,target=/go/pkg/mod \ --mount=type=cache,id=go-build-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/root/.cache/go-build \ GOARM="${TARGETVARIANT#v}" go build -o /go/authentik ./cmd/server -# Stage 4: MaxMind GeoIP +# Stage 3: MaxMind GeoIP FROM --platform=${BUILDPLATFORM} ghcr.io/maxmind/geoipupdate:v6.1 as geoip ENV GEOIPUPDATE_EDITION_IDS="GeoLite2-City GeoLite2-ASN" @@ -82,7 +64,7 @@ RUN --mount=type=secret,id=GEOIPUPDATE_ACCOUNT_ID \ mkdir -p /usr/share/GeoIP && \ /bin/sh -c "/usr/bin/entry.sh || echo 'Failed to get GeoIP database, disabling'; exit 0" -# Stage 5: Python dependencies +# Stage 4: Python dependencies FROM docker.io/python:3.12.1-slim-bookworm AS python-deps WORKDIR /ak-root/poetry @@ -107,7 +89,7 @@ RUN --mount=type=bind,target=./pyproject.toml,src=./pyproject.toml \ pip3 install poetry && \ poetry install --only=main --no-ansi --no-interaction -# Stage 6: Run +# Stage 5: Run FROM docker.io/python:3.12.1-slim-bookworm AS final-image ARG GIT_BUILD_HASH @@ -149,7 +131,6 @@ COPY --from=go-builder /go/authentik /bin/authentik COPY --from=python-deps /ak-root/venv /ak-root/venv COPY --from=web-builder /work/web/dist/ /web/dist/ COPY --from=web-builder /work/web/authentik/ /web/authentik/ -COPY --from=website-builder /work/website/help/ /website/help/ COPY --from=geoip /usr/share/GeoIP /geoip USER 1000 diff --git a/internal/web/static.go b/internal/web/static.go index 8e0e3d0ddd..22368c1a02 100644 --- a/internal/web/static.go +++ b/internal/web/static.go @@ -22,7 +22,6 @@ func (ws *WebServer) configureStatic() { distFs := http.FileServer(http.Dir("./web/dist")) distHandler := http.StripPrefix("/static/dist/", distFs) authentikHandler := http.StripPrefix("/static/authentik/", http.FileServer(http.Dir("./web/authentik"))) - helpHandler := http.FileServer(http.Dir("./website/help/")) indexLessRouter.PathPrefix("/static/dist/").Handler(distHandler) indexLessRouter.PathPrefix("/static/authentik/").Handler(authentikHandler) @@ -42,9 +41,6 @@ func (ws *WebServer) configureStatic() { indexLessRouter.PathPrefix("/media/").Handler(http.StripPrefix("/media", fs)) - statRouter.PathPrefix("/if/help/").Handler(http.StripPrefix("/if/help/", helpHandler)) - statRouter.PathPrefix("/help").Handler(http.RedirectHandler("/if/help/", http.StatusMovedPermanently)) - ws.lh.Path("/robots.txt").HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { rw.Header()["Content-Type"] = []string{"text/plain"} rw.WriteHeader(200) diff --git a/website/docusaurus.docs-only.ts b/website/docusaurus.docs-only.ts deleted file mode 100644 index 883f5580f4..0000000000 --- a/website/docusaurus.docs-only.ts +++ /dev/null @@ -1,129 +0,0 @@ -const config = require("./docusaurus.config"); -import type { Config } from "@docusaurus/types"; - -module.exports = async function (): Promise { - const remarkGithub = (await import("remark-github")).default; - const defaultBuildUrl = (await import("remark-github")).defaultBuildUrl; - const mainConfig = await config(); - return { - title: "authentik", - tagline: "Making authentication simple.", - url: "https://goauthentik.io", - baseUrl: "/if/help/", - onBrokenLinks: "throw", - favicon: "img/icon.png", - organizationName: "BeryJu", - projectName: "authentik", - themeConfig: { - navbar: { - logo: { - alt: "authentik logo", - src: "img/icon_left_brand.svg", - }, - items: [ - { - to: "docs/", - activeBasePath: "docs", - label: "Docs", - position: "left", - }, - { - to: "integrations/", - activeBasePath: "integrations", - label: "Integrations", - position: "left", - }, - { - to: "developer-docs/", - activeBasePath: "developer-docs", - label: "Developer Docs", - position: "left", - }, - { - href: "https://github.com/goauthentik/authentik", - label: "GitHub", - position: "right", - }, - { - href: "https://goauthentik.io/discord", - label: "Discord", - position: "right", - }, - ], - }, - footer: { - links: [], - copyright: mainConfig.themeConfig.footer.copyright, - }, - colorMode: mainConfig.themeConfig.colorMode, - tableOfContents: mainConfig.themeConfig.tableOfContents, - prims: mainConfig.themeConfig.prism, - }, - presets: [ - [ - "@docusaurus/preset-classic", - { - docs: { - id: "docs", - sidebarPath: require.resolve("./sidebars.js"), - editUrl: - "https://github.com/goauthentik/authentik/edit/main/website/", - remarkPlugins: [ - [ - remarkGithub, - { - repository: "goauthentik/authentik", - // Only replace issues and PR links - buildUrl: function (values) { - return values.type === "issue" - ? defaultBuildUrl(values) - : false; - }, - }, - ], - ], - }, - pages: false, - theme: { - customCss: require.resolve("./src/css/custom.css"), - }, - }, - ], - ], - plugins: [ - [ - "@docusaurus/plugin-content-docs", - { - id: "docsIntegrations", - path: "integrations", - routeBasePath: "integrations", - sidebarPath: require.resolve("./sidebarsIntegrations.js"), - editUrl: - "https://github.com/goauthentik/authentik/edit/main/website/", - }, - ], - [ - "@docusaurus/plugin-content-docs", - { - id: "docsDevelopers", - path: "developer-docs", - routeBasePath: "developer-docs", - sidebarPath: require.resolve("./sidebarsDev.js"), - editUrl: - "https://github.com/goauthentik/authentik/edit/main/website/", - }, - ], - [ - "@docusaurus/plugin-client-redirects", - { - redirects: [ - { - to: "/docs/", - from: ["/"], - }, - ], - }, - ], - ], - }; -}; diff --git a/website/help/.gitkeep b/website/help/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000