Skip to content

Commit

Permalink
github app integration docs (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarmatei authored Nov 5, 2024
1 parent 29a4b69 commit 577eebc
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions AUTH-GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,56 @@
# Configure GitHub App integration

If you want to setup our Pull Request integration, please follow this section. If you need instead to setup auth with GitHub, [scroll to the Auth section below](#configure-auth)

⚠️ *If you use any other source control provider ignore this section completely and follow the instructions on your NxCloud workspace setup screen.*

If you use GitHub, the best way to benefit from our integration is to set-up an app:
1. Please follow the instructions [here to setup your GitHub App](https://nx.dev/ci/recipes/enterprise/single-tenant/custom-github-app#creating-a-github-oauth-app)
2. Then configure the below values in your `helm-config.yaml`

```yaml
# helm-values.yml
secret:
name: 'cloudsecret'
nxCloudMongoServerEndpoint: 'NX_CLOUD_MONGO_SERVER_ENDPOINT'
adminPassword: 'ADMIN_PASSWORD'
# define them here
githubAppId: 'NX_CLOUD_GITHUB_APP_ID'
githubPrivateKey: 'NX_CLOUD_GITHUB_PRIVATE_KEY'
githubWebhookSecret: 'NX_CLOUD_GITHUB_WEBHOOK_SECRET'
githubAppClientId: 'NX_CLOUD_GITHUB_APP_CLIENT_ID'
githubAppClientSecret: 'NX_CLOUD_GITHUB_APP_CLIENT_SECRET'

# secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: cloudsecret
type: Opaque
stringData:
NX_CLOUD_MONGO_SERVER_ENDPOINT: '....'
ADMIN_PASSWORD: '....'
NX_CLOUD_GITHUB_APP_ID: '<from the values in step 1>'
NX_CLOUD_GITHUB_PRIVATE_KEY: '<from the values in step 1>'
NX_CLOUD_GITHUB_WEBHOOK_SECRET: '<from the values in step 1>'
NX_CLOUD_GITHUB_APP_CLIENT_ID: '<from the values in step 1>'
NX_CLOUD_GITHUB_APP_CLIENT_SECRET: '<from the values in step 1>'
```
3. Finally, proceed to your NxCloud web app (and your workspace Settings screen) and finish the setup there
# Configure Auth
### GitHub Auth
To use GitHub for user authentication, you will need two values: `GITHUB_AUTH_CLIENT_ID` and `GITHUB_AUTH_CLIENT_SECRET`. Read [here](https://nx.dev/nx-cloud/private-cloud/auth-github) on how to get
To use GitHub for user authentication, you will need two values: `GITHUB_AUTH_CLIENT_ID` and `GITHUB_AUTH_CLIENT_SECRET`. Read [here](https://nx.dev/ci/recipes/enterprise/single-tenant/auth-github) on how to get
those values.

Then update your `helm-values.yaml` and `secrets.yaml`:

```yaml
# helm-values.yml
github:
pr:
apiUrl: 'if-using-self-hosted'
auth:
enabled: true
Expand All @@ -34,17 +75,17 @@ stringData:
GITHUB_AUTH_CLIENT_SECRET: '<from the values above>'
```


### GitLab Auth

To use GitHub for user authentication, you will need two values: `GITLAB_APP_ID` and `GITLAB_APP_SECRET`. Read [here](https://nx.dev/nx-cloud/private-cloud/auth-gitlab) on how to get
To use GitHub for user authentication, you will need two values: `GITLAB_APP_ID` and `GITLAB_APP_SECRET`. Read [here](https://nx.dev/ci/recipes/enterprise/single-tenant/auth-gitlab) on how to get
those values.

Then update your `helm-values.yaml` and `secrets.yaml`:

```yaml
# helm-values.yml
gitlab:
apiUrl: 'if-using-self-hosted'
auth:
enabled: true
Expand Down Expand Up @@ -72,15 +113,14 @@ stringData:

### Bitbucket Auth

To use GitHub for user authentication, you will need two values: `BITBUCKET_APP_ID` and `BITBUCKET_APP_SECRET`. Read [here](https://nx.dev/nx-cloud/private-cloud/auth-bitbucket) on how to get
To use GitHub for user authentication, you will need two values: `BITBUCKET_APP_ID` and `BITBUCKET_APP_SECRET`. Read [here](https://nx.dev/ci/recipes/enterprise/single-tenant/auth-bitbucket) on how to get
those values.

Then update your `helm-values.yaml` and `secrets.yaml`:

```yaml
# helm-values.yml
bitbucket:
apiUrl: 'if-using-self-hosted'
auth:
enabled: true
Expand All @@ -107,7 +147,7 @@ stringData:

### SAML Auth

To use SAML for user authentication, you will need two values: `SAML_ENTRY_POINT` and `SAML_CERT`. Read [here](https://nx.dev/nx-cloud/private-cloud/auth-saml) on how to get
To use SAML for user authentication, you will need two values: `SAML_ENTRY_POINT` and `SAML_CERT`. Read [here](https://nx.dev/ci/recipes/enterprise/single-tenant/auth-bitbucket-data-center) on how to get
those values.

Then update your `helm-values.yaml` and `secrets.yaml`:
Expand Down

0 comments on commit 577eebc

Please sign in to comment.