@@ -16,46 +16,50 @@ to this data by administering the GitHub app.
16
16
## Default Configuration
17
17
18
18
> [ !IMPORTANT]
19
- > The default GitHub app requires [ device flow ] ( #device-flow ) to authenticate .
19
+ > The default GitHub app grants Coder access to your organizations' GitHub data .
20
20
>
21
- > This is enabled by default when using the default GitHub app.
22
- > If you disable device flow using ` CODER_OAUTH2_GITHUB_DEVICE_FLOW=false ` , it will be ignored.
21
+ > For production environments, we strongly recommend that you
22
+ > [ configure your own GitHub OAuth app] ( #step-1-configure-the-oauth-application-in-github )
23
+ > to ensure that your data is not shared with Coder (the company).
23
24
24
- By default, only the admin user can sign up.
25
- To allow additional users to sign up with GitHub, add the following environment variable:
25
+ To use the default configuration:
26
26
27
- ``` env
28
- CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS=true
29
- ```
27
+ 1 . [ Install the GitHub app] ( https://github.com/apps/coder/installations/select_target )
28
+ in any GitHub organization that you want to use with Coder.
30
29
31
- [ Install the GitHub app ] ( https://github.com/apps/coder/installations/select_target ) in every GitHub organization that you need to limit sign ups to .
32
- This will grant Coder, the company, access to your organizations' data as described in the installation flow .
33
- In a production environment, we recommend configuring your own GitHub OAuth app as outlined further below, so all of your data is kept private .
30
+ The default GitHub app requires [ device flow ] ( #device-flow ) to authenticate .
31
+ This is enabled by default when using the default GitHub app .
32
+ If you disable device flow using ` CODER_OAUTH2_GITHUB_DEVICE_FLOW=false ` , it will be ignored .
34
33
35
- If you'd like to proceed with the default GitHub app, install it in the
36
- organizations you want to limit sign ups to by visiting
37
- [ this page] ( https://github.com/apps/coder/installations/select_target ) and set
38
- the following environment variable:
34
+ 1 . By default, only the admin user can sign up.
35
+ To allow additional users to sign up with GitHub, add:
39
36
40
- ``` env
41
- CODER_OAUTH2_GITHUB_ALLOWED_ORGS="your-org"
42
- ```
37
+ ``` shell
38
+ CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS=true
39
+ ```
40
+
41
+ 1 . ** Configure Organization Restrictions (Optional)**
42
+ If you want to limit sign-ups to specific GitHub organizations, set:
43
43
44
- For production deployments, we recommend configuring your own GitHub OAuth app
45
- as outlined below. The default is automatically disabled if you configure your
46
- own app or set:
44
+ ``` shell
45
+ CODER_OAUTH2_GITHUB_ALLOWED_ORGS= " your-org "
46
+ ```
47
47
48
- ``` env
48
+ ## Disable the Default GitHub App
49
+
50
+ You can disable the default GitHub app by [ configuring your own app] ( #step-1-configure-the-oauth-application-in-github )
51
+ or by adding the following environment variable to your [ Coder server configuration] ( ../../reference/cli/server.md#options ) :
52
+
53
+ ``` shell
49
54
CODER_OAUTH2_GITHUB_DEFAULT_PROVIDER_ENABLE=false
50
55
```
51
56
52
57
> [ !NOTE]
53
- > After you disable the default GitHub provider with the setting above, the
54
- > ** Sign in with GitHub** button might still appear on your login page even though
55
- > the authentication flow is disabled.
58
+ > After you disable the default GitHub provider, the ** Sign in with GitHub** button
59
+ > might still appear on your login page even though the authentication flow is disabled.
56
60
>
57
- > To completely hide the GitHub sign-in button, you must both disable the default
58
- > provider and ensure you don't have a custom GitHub OAuth app configured.
61
+ > To completely hide the GitHub sign-in button, you must disable the default provider
62
+ > and ensure you don't have a custom GitHub OAuth app configured.
59
63
60
64
## Step 1: Configure the OAuth application in GitHub
61
65
@@ -95,7 +99,7 @@ Alternatively, if you are running Coder as a system service, you can achieve the
95
99
same result as the command above by adding the following environment variables
96
100
to the ` /etc/coder.d/coder.env ` file:
97
101
98
- ``` env
102
+ ``` shell
99
103
CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS=true
100
104
CODER_OAUTH2_GITHUB_ALLOWED_ORGS=" your-org"
101
105
CODER_OAUTH2_GITHUB_CLIENT_ID=" 8d1...e05"
@@ -105,7 +109,7 @@ CODER_OAUTH2_GITHUB_CLIENT_SECRET="57ebc9...02c24c"
105
109
> [ !TIP]
106
110
> To allow everyone to sign up using GitHub, set:
107
111
>
108
- > ``` env
112
+ > ``` shell
109
113
> CODER_OAUTH2_GITHUB_ALLOW_EVERYONE=true
110
114
> ` ` `
111
115
@@ -149,7 +153,7 @@ This is enabled by default for the default GitHub app and cannot be disabled for
149
153
150
154
For your own custom GitHub OAuth app, you can enable device flow by setting:
151
155
152
- ``` env
156
+ ``` shell
153
157
CODER_OAUTH2_GITHUB_DEVICE_FLOW=true
154
158
```
155
159
0 commit comments