Merge remote-tracking branch 'upstream/main' into feat/authentik-idp

This commit is contained in:
Bethuel
2023-05-25 16:09:37 +03:00
166 changed files with 428 additions and 322 deletions

3
.env Normal file
View File

@@ -0,0 +1,3 @@
NEXT_PUBLIC_DOCSEARCH_APP_ID=APP_NEXT_PUBLIC_DOCSEARCH_APP_ID
NEXT_PUBLIC_DOCSEARCH_API_KEY=APP_NEXT_PUBLIC_DOCSEARCH_API_KEY
NEXT_PUBLIC_DOCSEARCH_INDEX_NAME=APP_NEXT_PUBLIC_DOCSEARCH_INDEX_NAME

View File

@@ -16,15 +16,17 @@ RUN npm install --production
# Copy all files # Copy all files
COPY ./ ./ COPY ./ ./
COPY /docker/entrypoint.sh ./entrypoint.sh
# Build app # Build app
RUN npm run build RUN npm run build
RUN chmod u+x /usr/app/entrypoint.sh
# Expose the listening port # Expose the listening port
EXPOSE 3000 EXPOSE 3000
# Run container as non-root (unprivileged) user # apply env variables to the Nextjs .env file
# The node user is provided in the Node.js Alpine base image ENTRYPOINT ["/usr/app/entrypoint.sh"]
USER node
# Run npm start script with PM2 when container starts CMD npm run start
CMD [ "pm2-runtime", "npm", "--", "start" ]

17
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
# this script will check for the following NEXT_* environment variables passed via Docker environment (-e) and apply them
# to the Nextjs.
# The properties that will be replaced and have to start with APP_ prefix in the .env file
set -ex
NEXT_PUBLIC_DOCSEARCH_APP_ID=${NEXT_PUBLIC_DOCSEARCH_APP_ID:-"none"}
NEXT_PUBLIC_DOCSEARCH_API_KEY=${NEXT_PUBLIC_DOCSEARCH_API_KEY:-"none"}
NEXT_PUBLIC_DOCSEARCH_INDEX_NAME=${NEXT_PUBLIC_DOCSEARCH_INDEX_NAME:"none"}
find /usr/app/.next \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#APP_NEXT_PUBLIC_DOCSEARCH_APP_ID#${NEXT_PUBLIC_DOCSEARCH_APP_ID}#g"
find /usr/app/.next \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#APP_NEXT_PUBLIC_DOCSEARCH_API_KEY#${NEXT_PUBLIC_DOCSEARCH_API_KEY}#g"
find /usr/app/.next \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#APP_NEXT_PUBLIC_DOCSEARCH_INDEX_NAME#${NEXT_PUBLIC_DOCSEARCH_INDEX_NAME}#g"
echo "starting Nextjs"
exec "$@"

View File

@@ -1,45 +1,57 @@
import nextMDX from '@next/mdx' import nextMDX from '@next/mdx'
import { remarkPlugins } from './mdx/remark.mjs' import {remarkPlugins} from './mdx/remark.mjs'
import { rehypePlugins } from './mdx/rehype.mjs' import {rehypePlugins} from './mdx/rehype.mjs'
import { recmaPlugins } from './mdx/recma.mjs' import {recmaPlugins} from './mdx/recma.mjs'
import rehypeSlug from "rehype-slug";
const withMDX = nextMDX({ const withMDX = nextMDX({
options: { options: {
remarkPlugins, remarkPlugins,
// rehypeSlug, // rehypeSlug,
rehypePlugins, rehypePlugins,
recmaPlugins, recmaPlugins,
providerImportSource: '@mdx-js/react', providerImportSource: '@mdx-js/react',
}, },
}) })
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
reactStrictMode: true, assetPrefix: '/docs-static',
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'], reactStrictMode: true,
experimental: { pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
scrollRestoration: true, experimental: {
}, scrollRestoration: true,
redirects: async () => { },
return [ redirects: async () => {
{ return [
source: '/', {
destination: '/docs/introduction', source: '/docs',
permanent: true, destination: '/',
}, permanent: true,
{ },
source: '/docs', {
destination: '/docs/introduction', source: '/docs/:path*',
permanent: true, destination: '/:path*',
}, permanent: true,
{ }
source: '/ipa', ]
destination: '/ipa/introduction', },
permanent: true, rewrites: async () => {
}, return [
] {
} source: '/',
destination: '/introduction',
},
{
source: '/api',
destination: '/ipa/introduction',
},
{
source: '/api/:path*',
destination: '/ipa/:path*',
}
]
}
} }
export default withMDX(nextConfig) export default withMDX(nextConfig)

View File

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 386 KiB

After

Width:  |  Height:  |  Size: 386 KiB

View File

Before

Width:  |  Height:  |  Size: 327 KiB

After

Width:  |  Height:  |  Size: 327 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 409 KiB

After

Width:  |  Height:  |  Size: 409 KiB

View File

Before

Width:  |  Height:  |  Size: 526 KiB

After

Width:  |  Height:  |  Size: 526 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 MiB

After

Width:  |  Height:  |  Size: 5.9 MiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

View File

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

View File

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 155 KiB

View File

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

View File

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 115 KiB

View File

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

View File

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View File

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 273 KiB

View File

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 194 KiB

View File

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 139 KiB

View File

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Some files were not shown because too many files have changed in this diff Show More