You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/docs/guides/hedgedoc.md
+105-110
Original file line number
Diff line number
Diff line change
@@ -7,141 +7,109 @@ lang: en-US
7
7
keywords:
8
8
[
9
9
pomerium,
10
-
identity access proxy,
11
-
data,
12
-
logging,
13
-
graphing,
14
10
HedgeDoc,
15
11
authentication,
16
12
authorization,
17
13
]
18
-
description: This guide covers how to use Pomerium to authenticate and authorize users of HedgeDoc.
14
+
description: Learn how to control access to your HedgeDoc web application behind Pomerium.
19
15
---
20
16
21
17
# HedgeDoc
22
18
23
-
Use Pomerium to secure access to HedgeDoc by providing identity and context.
19
+
In this guide, you'll learn how to run a HedgeDoc web application behind Pomerium. You'll also add an authorization policy that enables Pomerium to gran or deny access based on policy criteria.
24
20
25
21
## What is HedgeDoc?
26
22
27
-
[HedgeDoc](https://hedgedoc.org/) is a collaborative, web-based Markdown editor that allows you to create notes, graphs, and diagrams in your browser.
23
+
[HedgeDoc](https://hedgedoc.org/) is a collaborative, web-based Markdown editor that allows you to create notes, graphs, and diagrams in your browser. You can share a link to your documents with other members of your organization so you can collaborate in real time.
28
24
29
-
You can share a link to your document with other members of your organization so you can collaborate in real time.
25
+
## How to secure HedgeDoc with Pomerium
30
26
31
-
## Integrate Pomerium with HedgeDoc
27
+
HedgeDoc is an open-source project that you can serve behind a [reverse proxy](https://docs.hedgedoc.org/guides/reverse-proxy/).
32
28
33
-
HedgeDoc is an open-source, self-hosted software that allows you to configure authentication and authorization with a [reverse proxy](https://docs.hedgedoc.org/guides/reverse-proxy/).
29
+
In this guide, you'll configure Pomerium to authenticate and authorize users. To do this, you'll add an authorization policy that grants or denies access based on the policy criteria.
34
30
35
-
You can configure Pomerium so that it authenticates and authorizes users against an Identity Provider (IdP) before users can access HedgeDoc's services.
31
+
### Before you start
36
32
37
-
The flow looks like this:
33
+
To complete this guide, you need:
38
34
39
-
1. User requests to access the secured app
40
-
2. Pomerium identifies user
41
-
3. Pomerium checks if user is authorized to access routes defined in the authorization [`policy`](https://www.pomerium.com/docs/reference/routes/policy)
42
-
4. If authorized, Pomerium authenticates user against IdP
43
-
5. After IdP establishes user's identity, Pomerium checks permissions against the secured app
44
-
6. User can make authorized requests in the secured app
This guide uses Docker containers to create the minimal development environment required to run Pomerium with another service. Visit the [Pomerium using Docker](https://www.pomerium.com/docs/quickstart) quickstart for more information.
This guide uses [GitHub](https://www.pomerium.com/docs/identity-providers/github) as the pre-configured IdP.
41
+
If you completed our [**Quickstart guide**](/docs/quickstart), you should have a working Pomerium project with the following YAML files:
64
42
65
-
:::
66
-
67
-
### Pomerium configuration
68
-
69
-
Your Pomerium configuration file must include a [Cookie Secret](https://www.pomerium.com/docs/reference/cookie-secret) and a [Secret Key](https://www.pomerium.com/docs/reference/signing-key).
43
+
-`config.yaml`
44
+
-`docker-compose.yaml`
70
45
71
-
To create a Cookie Secret, run the following command in your terminal:
72
-
73
-
```bash
74
-
head -c32 /dev/urandom | base64
75
-
```
46
+
If you haven't completed the Quickstart:
76
47
77
-
To create a Secret Key, run the following command:
78
-
79
-
```bash
80
-
cat ec_private.pem | base64
81
-
```
82
-
83
-
:::tip **Note**
84
-
85
-
This guide assumes you've generated self-signed wildcard certificates. Check [Certificates](https://www.pomerium.com/docs/topics/certificates#self-signed-wildcard-certificate) for more information.
48
+
- Create a `config.yaml` file for your Pomerium configuration
49
+
- Create a `docker-compose.yaml` file for your Docker configuration
86
50
87
51
:::
88
52
89
-
Place your `cookie_secret` and `secret_key` in your `config.yaml` file:
53
+
### Set up Pomerium
90
54
91
-
```yaml
92
-
cookie_secret: <cookie secret>
93
-
signing_key: <signing key>
94
-
```
95
-
96
-
Then, enable Pomerium to allow [Websocket Connections](https://www.pomerium.com/docs/reference/routes/timeouts#websocket-connections):
To see if Pomerium is configured correctly, run the following command in your terminal:
75
+
#### Create a wildcard TLS certificate
118
76
119
-
```bash
120
-
docker-compose up
121
-
```
122
-
123
-
Navigate to `https://authenticate.localhost.pomerium.io`. Pomerium will redirect you to your GitHub OAuth app, where you can authorize the OAuth app to access your GitHub account.
77
+
HedgeDoc requires an encrypted TLS connection to add and manage users. For the purposes of this guide, you will use `mkcert` to generate local development certificates:
Update your environment variables with the following values:
145
+
> See the [HedgeDoc - Configuration](https://docs.hedgedoc.org/configuration/#configuration) page for more information on configuration keys and environment variables.
146
+
147
+
#### Generate a session secret
148
+
149
+
HedgeDoc requires a session secret to sign session cookies. If you don't add a session secret, HedgeDoc generates a random one for you upon startup, which will end any active sessions and sign out your users.
150
+
151
+
Adding a session secret will allow you to resume a session even if you stop your Docker services.
152
+
153
+
To generate a secret, run:
154
+
155
+
```shell-session
156
+
$ head -c32 /dev/urandom | base64
157
+
MPGHgArlo81ohUoMtDtv8qCBLJu0lwXDCPcrml0wF2Q=
158
+
```
159
+
160
+
Replace the value of `CMD_SESSION_SECRET` with the output:
0 commit comments