From 577eebccf2115e2a16fd0418327571aaae3d3136 Mon Sep 17 00:00:00 2001 From: Rares Matei Date: Tue, 5 Nov 2024 14:38:21 +0000 Subject: [PATCH] github app integration docs (#143) --- AUTH-GUIDE.md | 56 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/AUTH-GUIDE.md b/AUTH-GUIDE.md index 8cedd2c..6542039 100644 --- a/AUTH-GUIDE.md +++ b/AUTH-GUIDE.md @@ -1,6 +1,49 @@ +# 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: '' + NX_CLOUD_GITHUB_PRIVATE_KEY: '' + NX_CLOUD_GITHUB_WEBHOOK_SECRET: '' + NX_CLOUD_GITHUB_APP_CLIENT_ID: '' + NX_CLOUD_GITHUB_APP_CLIENT_SECRET: '' +``` + +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`: @@ -8,8 +51,6 @@ Then update your `helm-values.yaml` and `secrets.yaml`: ```yaml # helm-values.yml github: - pr: - apiUrl: 'if-using-self-hosted' auth: enabled: true @@ -34,9 +75,10 @@ stringData: GITHUB_AUTH_CLIENT_SECRET: '' ``` + ### 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`: @@ -44,7 +86,6 @@ Then update your `helm-values.yaml` and `secrets.yaml`: ```yaml # helm-values.yml gitlab: - apiUrl: 'if-using-self-hosted' auth: enabled: true @@ -72,7 +113,7 @@ 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`: @@ -80,7 +121,6 @@ Then update your `helm-values.yaml` and `secrets.yaml`: ```yaml # helm-values.yml bitbucket: - apiUrl: 'if-using-self-hosted' auth: enabled: true @@ -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`: