Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/docusaurus 3 #4

Merged
merged 33 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
be84906
enhancement: Change base image from alpine to distroless (#2295)
kvanzuijlen Jan 20, 2024
bc022fb
Add possibility to encode the state param as UrlEncodedBase64 (#2312)
brezinajn Jan 20, 2024
5ba54df
NGINX return 403 for sign_in (#2322) (#2323)
WhiteRabbit-Code Jan 20, 2024
51a5765
chore: Create sha256sum for tar instead of binary (#2343)
kvanzuijlen Jan 20, 2024
ee3e9b8
Log error details when failed loading CSRF cookie (#2345)
charvadzo Jan 20, 2024
2f3c811
Feature - Add env variable support for alpha struct (#2375)
tuunit Jan 20, 2024
0b24f45
remove nsswitch workaround (#2371)
tuunit Jan 20, 2024
184c582
feat: Added renovate configuration (#2377)
kvanzuijlen Jan 20, 2024
4c2bf5a
Feature/add option to skip loading claims from profile url (#2329)
nilsgstrabo Jan 20, 2024
f3dbca6
Add ability to configure username for Redis cluster connections (#2381)
rossigee Jan 20, 2024
daea40d
chore(deps): update module golang.org/x/crypto to v0.17.0 [security] …
renovate[bot] Jan 20, 2024
b8ae644
chore(deps): update github.com/ghodss/yaml digest to d8423dc (#2401)
renovate[bot] Jan 20, 2024
f88f09f
Improved dev environment (#2211)
kvanzuijlen Jan 20, 2024
2df301c
feature: add release automation workflows (#2224)
tuunit Jan 20, 2024
8141895
chore(deps): update module github.com/bsm/redislock to v0.9.4 (#2406)
renovate[bot] Jan 21, 2024
6cd505d
initial commit for docusaurus 3 upgrade
tuunit Jan 13, 2024
4fd2423
fix mdx errors
tuunit Jan 13, 2024
5ea5271
fix mdx issues
tuunit Jan 13, 2024
1dfeb10
fix routing issues
tuunit Jan 13, 2024
903a67a
update docs generation workflow
tuunit Jan 13, 2024
dff7cb7
fix version
tuunit Jan 13, 2024
96cc8d7
fix permissions
tuunit Jan 13, 2024
b1355b3
move slack to header
tuunit Jan 13, 2024
acb600b
remove background color and minify
tuunit Jan 13, 2024
ec50a51
Update docs/docs/configuration/providers/openid_connect.md
tuunit Jan 21, 2024
0256dcd
Update docs/docs/configuration/providers/openid_connect.md
tuunit Jan 21, 2024
ff969e2
Update docs/docs/configuration/providers/openid_connect.md
tuunit Jan 21, 2024
ce6f909
Update docs/docs/configuration/providers/gitlab.md
tuunit Jan 21, 2024
be9a96d
Update docs/docs/configuration/providers/gitlab.md
tuunit Jan 21, 2024
1bc8697
Update docs/docs/configuration/providers/github.md
tuunit Jan 21, 2024
b2982ca
Update docs/docs/configuration/providers/github.md
tuunit Jan 21, 2024
7d4303a
Update docs/docs/configuration/providers/github.md
tuunit Jan 21, 2024
4510a63
Update docs/docs/configuration/providers/github.md
tuunit Jan 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM mcr.microsoft.com/vscode/devcontainers/go:0-1.19

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
pre-commit \
vim \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /go/pkg \
&& chmod -R a+w /go/pkg

WORKDIR /workspace
45 changes: 45 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "oauth2-proxy Dev",
"context": "..",
"dockerFile": "./Dockerfile",
"postCreateCommand": "pre-commit install && go mod download",
"containerEnv": { "DEVCONTAINER": "1" },
"appPort": ["4180:4180"],
"runArgs": ["-e", "GIT_EDITOR=code --wait"],
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"ms-vscode.makefile-tools",
"visualstudioexptteam.vscodeintellicode",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github"
],
"settings": {
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"yaml.customTags": [
"!input scalar",
"!secret scalar",
"!include_dir_named scalar",
"!include_dir_list scalar",
"!include_dir_merge_list scalar",
"!include_dir_merge_named scalar"
]
}
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker": {},
"ghcr.io/devcontainers/features/common-utils": {
"configureZshAsDefaultShell": true,
"username": "vscode",
"userUid": 1000,
"userGid": 1000
},
"ghcr.io/devcontainers/features/kubectl-helm-minikube": {}
}
}
24 changes: 24 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
semanticCommits: "auto",
enabledManagers: [
"dockerfile",
"gomod",
"github-actions",
"npm",
"regex",
],
customManagers: [
{
customType: "regex",
fileMatch: [
"^Makefile"
],
matchStrings: [
"DOCKER_BUILD_RUNTIME_IMAGE_ALPINE\\s+?\\?= alpine:(?<currentValue>.*)\\s"
],
depNameTemplate: "alpine",
datasourceTemplate: "docker",
},
],
}
117 changes: 117 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Create Release
run-name: Create release ${{ inputs.version }}

on:
workflow_dispatch:
inputs:
version:
description: 'Version for new release'
required: true

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
fetch-tags: true

- name: Validate version
id: validate
run: |
function ver { printf "%03d%03d%03d%03d" $(echo "$1" | tr '.' ' '); }

NEW_VERSION=${{ inputs.version }}
NEW_VERSION=${NEW_VERSION#v} # Remove v prefix

LATEST_VERSION=$(git describe --abbrev=0 --tags)
LATEST_VERSION=${LATEST_VERSION#v} # Remove v prefix

# check that new version can be parsed
if [ ! $(ver $NEW_VERSION ) -gt $(ver 0) ]; then
echo "::error::Entered version '${{ inputs.version }}' cannot be parsed"
exit 1
fi

# check version continuity
if [ ! $(ver $LATEST_VERSION) -lt $(ver $NEW_VERSION) ]; then
echo "::error::Entered version '${{ inputs.version }}' is smaller then latest version $LATEST_VERSION"
exit 1
fi

echo "version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"

- name: Prepare Github Actions Bot
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: latest

- name: Update documentation
run: |
cd docs

FULL_VERSION=${{ steps.validate.outputs.version }}
VERSION=${FULL_VERSION%.*}.x

if [ ! -d "versioned_docs/version-${VERSION}" ]; then
npm ci
npm run docusaurus docs:version ${VERSION}

git add .
git commit -m "add new docs version ${VERSION}"
fi

sed -i "s/(current release is .*)/(current release is \`v${FULL_VERSION}\`)/g" docs/installation.md
sed -i "s/(current release is .*)/(current release is \`v${FULL_VERSION}\`)/g" versioned_docs/version-${VERSION}/installation.md

- name: Update Changelog
run: |
VERSION=${{ steps.validate.outputs.version }}

sed -i "s/#.*(Pre-release)/# V${VERSION}/g" CHANGELOG.md

cat << EOF > /tmp/CHANGELOG.prepend
# Vx.x.x (Pre-release)

## Release Highlights

## Important Notes

## Breaking Changes
EOF

echo -e "$(cat /tmp/CHANGELOG.prepend)\n\n$(cat CHANGELOG.md)" > CHANGELOG.md

- name: Update development files
run: |
VERSION=${{ steps.validate.outputs.version }}
cd contrib
grep -rl "quay.io/oauth2-proxy/oauth2-proxy:" | \
xargs sed -i "s#quay.io/oauth2-proxy/oauth2-proxy:v[0-9]\+\.[0-9]\+\.[0-9]\+#quay.io/oauth2-proxy/oauth2-proxy:v${VERSION}#g"

- name: Commit and push
run: |
VERSION=${{ steps.validate.outputs.version }}

git checkout -b release/v${VERSION}
git commit -am "update to release version v${VERSION}"
git push -u origin release/v${VERSION}

- name: Create PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=v${{ steps.validate.outputs.version }}
gh pr create -B master -H release/${VERSION} --title "release ${VERSION}" --body "Release branch and changes created by GitHub Actions. This PR should include changes to the docs, CHANGELOG and local environment files."
64 changes: 30 additions & 34 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,66 +7,62 @@ on:
push:
branches: [master]
paths: ['docs/**']
workflow_dispatch:

jobs:
pull-request-check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: npm
cache-dependency-path: "./docs/package-lock.json"

- name: Test Build
working-directory: ./docs
run: |
npm ci
npm run build

gh-pages-release:
if: github.event_name == 'push'
build-docs:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
path: master

- uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages

- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20

- name: Build docusaurus
working-directory: master/docs
id: build
working-directory: ./docs
run: |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
npm ci
npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/build

- name: Release to github pages
env:
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: gh-pages
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"

# Remove all files except .git
git rm -r *

# Copy the build files from master/docs/build to gh-pages
cp -r ../master/docs/build/* .

# Commit and push
git add .
git commit -m "Update documentation based on ${{ steps.build.outputs.sha }}"
git push origin gh-pages
deploy-docs:
needs: build-docs
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading
Loading