Skip to content

Commit 85fb2ea

Browse files
authored
Docs/docusaurus 3 (#5)
* initial commit for docusaurus 3 upgrade * fix mdx errors * fix mdx issues * fix routing issues * update docs generation workflow * fix version * fix permissions * move slack to header * remove background color and minify * Add suggestions
1 parent 8141895 commit 85fb2ea

File tree

41 files changed

+9931
-17303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+9931
-17303
lines changed

.github/workflows/docs.yaml

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,66 +7,62 @@ on:
77
push:
88
branches: [master]
99
paths: ['docs/**']
10+
workflow_dispatch:
1011

1112
jobs:
1213
pull-request-check:
1314
if: github.event_name == 'pull_request'
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v4
18+
19+
- name: Setup Pages
20+
id: pages
21+
uses: actions/configure-pages@v4
1722

1823
- uses: actions/setup-node@v3
1924
with:
20-
node-version: 18
25+
node-version: 20
26+
cache: npm
27+
cache-dependency-path: "./docs/package-lock.json"
2128

2229
- name: Test Build
2330
working-directory: ./docs
2431
run: |
2532
npm ci
2633
npm run build
2734
28-
gh-pages-release:
29-
if: github.event_name == 'push'
35+
build-docs:
36+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
3037
runs-on: ubuntu-latest
31-
permissions:
32-
contents: write
3338
steps:
3439
- uses: actions/checkout@v4
35-
with:
36-
path: master
37-
38-
- uses: actions/checkout@v4
39-
with:
40-
ref: gh-pages
41-
path: gh-pages
4240

4341
- uses: actions/setup-node@v3
4442
with:
45-
node-version: 18
43+
node-version: 20
4644

4745
- name: Build docusaurus
48-
working-directory: master/docs
49-
id: build
46+
working-directory: ./docs
5047
run: |
51-
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
5248
npm ci
5349
npm run build
50+
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: ./docs/build
5455

55-
- name: Release to github pages
56-
env:
57-
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
working-directory: gh-pages
59-
run: |
60-
git config --local user.name "github-actions[bot]"
61-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
62-
63-
# Remove all files except .git
64-
git rm -r *
65-
66-
# Copy the build files from master/docs/build to gh-pages
67-
cp -r ../master/docs/build/* .
68-
69-
# Commit and push
70-
git add .
71-
git commit -m "Update documentation based on ${{ steps.build.outputs.sha }}"
72-
git push origin gh-pages
56+
deploy-docs:
57+
needs: build-docs
58+
runs-on: ubuntu-latest
59+
permissions:
60+
pages: write # to deploy to Pages
61+
id-token: write # to verify the deployment originates from an appropriate source
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

docs/docs/configuration/overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ An example [oauth2-proxy.cfg](https://github.com/oauth2-proxy/oauth2-proxy/blob/
8585
| `--cookie-httponly` | bool | set HttpOnly cookie flag | true |
8686
| `--cookie-name` | string | the name of the cookie that the oauth_proxy creates. Should be changed to use a [cookie prefix](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#cookie_prefixes) (`__Host-` or `__Secure-`) if `--cookie-secure` is set. | `"_oauth2_proxy"` |
8787
| `--cookie-path` | string | an optional cookie path to force cookies to (e.g. `/poc/`) | `"/"` |
88-
| `--cookie-refresh` | duration | refresh the cookie after this duration; `0` to disable; not supported by all providers \[[1](#footnote1)\] | |
88+
| `--cookie-refresh` | duration | refresh the cookie after this duration; `0` to disable; not supported by all providers [^1] | |
8989
| `--cookie-secret` | string | the seed string for secure cookies (optionally base64 encoded) | |
9090
| `--cookie-secure` | bool | set [secure (HTTPS only) cookie flag](https://owasp.org/www-community/controls/SecureFlag) | true |
9191
| `--cookie-samesite` | string | set SameSite cookie attribute (`"lax"`, `"strict"`, `"none"`, or `""`). | `""` |
@@ -175,7 +175,7 @@ An example [oauth2-proxy.cfg](https://github.com/oauth2-proxy/oauth2-proxy/blob/
175175
| `--request-logging` | bool | Log requests | true |
176176
| `--request-logging-format` | string | Template for request log lines | see [Logging Configuration](#logging-configuration) |
177177
| `--resource` | string | The resource that is protected (Azure AD only) | |
178-
| `--reverse-proxy` | bool | are we running behind a reverse proxy, controls whether headers like X-Real-IP are accepted and allows X-Forwarded-{Proto,Host,Uri} headers to be used on redirect selection | false |
178+
| `--reverse-proxy` | bool | are we running behind a reverse proxy, controls whether headers like X-Real-IP are accepted and allows X-Forwarded-\{Proto,Host,Uri\} headers to be used on redirect selection | false |
179179
| `--scope` | string | OAuth scope specification | |
180180
| `--session-cookie-minimal` | bool | strip OAuth tokens from cookie session stores if they aren't needed (cookie session store only) | false |
181181
| `--session-store-type` | string | [Session data storage backend](sessions.md); redis or cookie | cookie |
@@ -206,12 +206,12 @@ An example [oauth2-proxy.cfg](https://github.com/oauth2-proxy/oauth2-proxy/blob/
206206
| `--allowed-role` | string \| list | restrict logins to users with this role (may be given multiple times). Only works with the keycloak-oidc provider. | |
207207
| `--validate-url` | string | Access token validation endpoint | |
208208
| `--version` | n/a | print version string | |
209-
| `--whitelist-domain` | string \| list | allowed domains for redirection after authentication. Prefix domain with a `.` or a `*.` to allow subdomains (e.g. `.example.com`, `*.example.com`) \[[2](#footnote2)\] | |
209+
| `--whitelist-domain` | string \| list | allowed domains for redirection after authentication. Prefix domain with a `.` or a `*.` to allow subdomains (e.g. `.example.com`, `*.example.com`) [^2] | |
210210
| `--trusted-ip` | string \| list | list of IPs or CIDR ranges to allow to bypass authentication (may be given multiple times). When combined with `--reverse-proxy` and optionally `--real-client-ip-header` this will evaluate the trust of the IP stored in an HTTP header by a reverse proxy rather than the layer-3/4 remote address. WARNING: trusting IPs has inherent security flaws, especially when obtaining the IP address from an HTTP header (reverse-proxy mode). Use this option only if you understand the risks and how to manage them. | |
211211
| `--encode-state` | bool | encode the state parameter as UrlEncodedBase64 | false |
212212

213-
> ###### 1. Only these providers support `--cookie-refresh`: GitLab, Google and OIDC {#footnote1}
214-
> ###### 2. When using the `whitelist-domain` option, any domain prefixed with a `.` or a `*.` will allow any subdomain of the specified domain as a valid redirect URL. By default, only empty ports are allowed. This translates to allowing the default port of the URLs protocol (80 for HTTP, 443 for HTTPS, etc.) since browsers omit them. To allow only a specific port, add it to the whitelisted domain: `example.com:8080`. To allow any port, use `*`: `example.com:*`. {#footnote2}
213+
[^1]: Only these providers support `--cookie-refresh`: GitLab, Google and OIDC
214+
[^2]: When using the `whitelist-domain` option, any domain prefixed with a `.` or a `*.` will allow any subdomain of the specified domain as a valid redirect URL. By default, only empty ports are allowed. This translates to allowing the default port of the URLs protocol (80 for HTTP, 443 for HTTPS, etc.) since browsers omit them. To allow only a specific port, add it to the whitelisted domain: `example.com:8080`. To allow any port, use `*`: `example.com:*`.
215215

216216
See below for provider specific options
217217

docs/docs/configuration/providers/facebook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ id: facebook
33
title: Facebook
44
---
55

6-
1. Create a new FB App from <https://developers.facebook.com/>
6+
1. Create a new FB App from https://developers.facebook.com/
77
2. Under FB Login, set your Valid OAuth redirect URIs to `https://internal.yourcompany.com/oauth2/callback`

docs/docs/configuration/providers/github.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,42 @@ org and team or collaborators.
1414

1515
To restrict by organization only, include the following flag:
1616

17-
-github-org="": restrict logins to members of this organisation
17+
```shell
18+
--github-org="" # restrict logins to members of this organisation
19+
```
1820

1921
To restrict within an organization to specific teams, include the following flag in addition to `-github-org`:
2022

21-
-github-team="": restrict logins to members of any of these teams (slug), separated by a comma
23+
```shell
24+
--github-team="" # restrict logins to members of any of these teams (slug), separated by a comma
25+
```
2226

2327
If you would rather restrict access to collaborators of a repository, those users must either have push access to a
2428
public repository or any access to a private repository:
2529

26-
-github-repo="": restrict logins to collaborators of this repository formatted as orgname/repo
30+
```shell
31+
--github-repo="" # restrict logins to collaborators of this repository formatted as orgname/repo
32+
```
2733

2834
If you'd like to allow access to users with **read only** access to a **public** repository you will need to provide a
2935
[token](https://github.com/settings/tokens) for a user that has write access to the repository. The token must be
3036
created with at least the `public_repo` scope:
3137

32-
-github-token="": the token to use when verifying repository collaborators
38+
```shell
39+
--github-token="" # the token to use when verifying repository collaborators
40+
```
3341

3442
To allow a user to log in with their username even if they do not belong to the specified org and team or collaborators,
3543
separated by a comma
3644

37-
-github-user="": allow logins by username, separated by a comma
45+
```
46+
--github-user="": allow logins by username, separated by a comma
47+
```
3848

3949
If you are using GitHub enterprise, make sure you set the following to the appropriate url:
4050

41-
-login-url="http(s)://<enterprise github host>/login/oauth/authorize"
42-
-redeem-url="http(s)://<enterprise github host>/login/oauth/access_token"
43-
-validate-url="http(s)://<enterprise github host>/api/v3"
51+
```
52+
--login-url="http(s)://<enterprise github host>/login/oauth/authorize"
53+
--redeem-url="http(s)://<enterprise github host>/login/oauth/access_token"
54+
--validate-url="http(s)://<enterprise github host>/api/v3"
55+
```

docs/docs/configuration/providers/gitlab.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@ The following config should be set to ensure that the oauth will work properly.
2626

2727
Restricting by group membership is possible with the following option:
2828

29-
--gitlab-group="mygroup,myothergroup": restrict logins to members of any of these groups (slug), separated by a comma
29+
```shell
30+
--gitlab-group="mygroup,myothergroup" # restrict logins to members of any of these groups (slug), separated by a comma
31+
```
3032

3133
If you are using self-hosted GitLab, make sure you set the following to the appropriate URL:
3234

35+
```shell
3336
--oidc-issuer-url="<your gitlab url>"
37+
```
3438

3539
If your self-hosted GitLab is on a subdirectory (e.g. domain.tld/gitlab), as opposed to its own subdomain
3640
(e.g. gitlab.domain.tld), you may need to add a redirect from domain.tld/oauth pointing at e.g. domain.tld/gitlab/oauth.

docs/docs/configuration/providers/keycloak_oidc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ through "dedicated" client mappers._
5757
* **Valid redirect URIs** `https://internal.yourcompany.com/oauth2/callback`
5858
* _Save the configuration._
5959
* Under the **Credentials** tab you will now be able to locate `<your client's secret>`.
60-
2. Configure a dedicated *audience mapper* for your client by navigating to **Clients** -> **<your client's id>** -> **Client scopes**.
61-
* Access the dedicated mappers pane by clicking **<your client's id>-dedicated**, located under *Assigned client scope*.
60+
2. Configure a dedicated *audience mapper* for your client by navigating to **Clients** -> **\<your client's id\>** -> **Client scopes**.
61+
* Access the dedicated mappers pane by clicking **\<your client's id\>-dedicated**, located under *Assigned client scope*.
6262
_(It should have a description of "Dedicated scope and mappers for this client")_
6363
* Click **Configure a new mapper** and select **Audience**
64-
* **Name** 'aud-mapper-<your client's id>'
64+
* **Name** 'aud-mapper-\<your client's id\>'
6565
* **Included Client Audience** select `<your client's id>` from the dropdown.
6666
* _OAuth2 proxy can be set up to pass both the access and ID JWT tokens to your upstream services.
6767
If you require additional audience entries, you can use the **Included Custom Audience** field in addition
@@ -105,7 +105,7 @@ Keycloak "realm roles" can be authorized using the `--allowed-role=<realm role n
105105
evaluated using `--allowed-role=<your client's id>:<client role name>`.
106106

107107
You may limit the _realm roles_ included in the JWT tokens for any given client by navigating to:
108-
**Clients** -> `<your client's id>` -> **Client scopes** -> _<your client's id>-dedicated_ -> **Scope**
108+
**Clients** -> `<your client's id>` -> **Client scopes** -> _\<your client's id\>-dedicated_ -> **Scope**
109109
Disabling **Full scope allowed** activates the **Assign role** option, allowing you to select which roles, if assigned
110110
to a user, will be included in the user's JWT tokens. This can be useful when a user has many associated roles, and you
111111
want to reduce the size and impact of the JWT token.

docs/docs/configuration/providers/openid_connect.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ To configure the OIDC provider for Dex, perform the following steps:
3939
4040
4. In a second terminal, run the oauth2-proxy with the following args:
4141
42-
```
43-
-provider oidc
44-
-provider-display-name "My OIDC Provider"
45-
-client-id oauth2-proxy
46-
-client-secret proxy
47-
-redirect-url http://127.0.0.1:4180/oauth2/callback
48-
-oidc-issuer-url http://127.0.0.1:5556/dex
49-
-cookie-secure=false
50-
-cookie-secret=secret
51-
-email-domain kilgore.trout
42+
```shell
43+
--provider oidc
44+
--provider-display-name "My OIDC Provider"
45+
--client-id oauth2-proxy
46+
--client-secret proxy
47+
--redirect-url http://127.0.0.1:4180/oauth2/callback
48+
--oidc-issuer-url http://127.0.0.1:5556/dex
49+
--cookie-secure=false
50+
--cookie-secret=secret
51+
--email-domain kilgore.trout
5252
```
5353
5454
To serve the current working directory as a website under the `/static` endpoint, add:
5555
56-
```
57-
-upstream file://$PWD/#/static/
56+
```shell
57+
--upstream file://$PWD/#/static/
5858
```
5959
6060
5. Test the setup by visiting http://127.0.0.1:4180 or http://127.0.0.1:4180/static .
@@ -113,7 +113,7 @@ Then you can start the oauth2-proxy with `./oauth2-proxy --config /etc/example.c
113113
#### Okta - localhost
114114
115115
1. Signup for developer account: https://developer.okta.com/signup/
116-
2. Create New `Web` Application: https://${your-okta-domain}/dev/console/apps/new
116+
2. Create New `Web` Application: https://$\{your-okta-domain\}/dev/console/apps/new
117117
3. Example Application Settings for localhost:
118118
* **Name:** My Web App
119119
* **Base URIs:** http://localhost:4180/
@@ -122,12 +122,12 @@ Then you can start the oauth2-proxy with `./oauth2-proxy --config /etc/example.c
122122
* **Group assignments:** `Everyone`
123123
* **Grant type allowed:** `Authorization Code` and `Refresh Token`
124124
4. Make note of the `Client ID` and `Client secret`, they are needed in a future step
125-
5. Make note of the **default** Authorization Server Issuer URI from: https://${your-okta-domain}/admin/oauth2/as
125+
5. Make note of the **default** Authorization Server Issuer URI from: https://$\{your-okta-domain\}/admin/oauth2/as
126126
6. Example config file `/etc/localhost.cfg`
127-
```
127+
```shell
128128
provider = "oidc"
129129
redirect_url = "http://localhost:4180/oauth2/callback"
130-
oidc_issuer_url = "https://${your-okta-domain}/oauth2/default"
130+
oidc_issuer_url = "https://$\{your-okta-domain\}/oauth2/default"
131131
upstreams = [
132132
"http://0.0.0.0:8080"
133133
]

docs/docs/installation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
id: installation
33
title: Installation
4-
slug: /
54
---
65

76
1. Choose how to deploy:

docs/src/pages/index.md renamed to docs/docs/welcome.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: Welcome to OAuth2 Proxy
2+
id: welcome
3+
title: Welcome
34
hide_table_of_contents: true
45
---
56

0 commit comments

Comments
 (0)