Skip to content

Commit 792cc33

Browse files
adela-bytebasetianzhouCopilotboojack
authored
docs: network architecture (#932)
* update ngrok usage,emphasize it's for testing purpose only * Update mintlify/snippets/install/start-with-ngrok.mdx Co-authored-by: Copilot <[email protected]> * Update mintlify/tutorials/gitops-gitlab-workflow.mdx Co-authored-by: Copilot <[email protected]> * Update mintlify/tutorials/gitops-azure-devops-workflow.mdx Co-authored-by: Copilot <[email protected]> * Update mintlify/tutorials/gitops-github-workflow.mdx Co-authored-by: Copilot <[email protected]> * Update mintlify/tutorials/gitops-bitbucket-workflow.mdx Co-authored-by: Copilot <[email protected]> * network architecture * update more * update * update * update * update * Update mintlify/snippets/tutorials/bytebase-setup-options.mdx Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Tianzhou <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: boojack <[email protected]>
1 parent 7eb7d73 commit 792cc33

File tree

12 files changed

+135
-74
lines changed

12 files changed

+135
-74
lines changed

mintlify/docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"get-started/self-host/deploy-with-docker",
3737
"get-started/self-host/deploy-with-kubernetes",
3838
"get-started/self-host/external-postgres",
39+
"get-started/self-host/network-architecture",
3940
"get-started/self-host/external-access",
4041
"get-started/self-host/external-url",
4142
"get-started/self-host/production-setup",
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Network Architecture and External Access
3+
---
4+
5+
This guide explains the network connectivity options for Bytebase features that require external access, including GitOps workflows, SSO authentication, and webhooks.
6+
7+
## Features Requiring External Access
8+
9+
- **GitOps Workflows**: CI/CD platforms (GitHub Actions, GitLab CI, etc.) need to call Bytebase API
10+
- **SSO Authentication**: OAuth2/OIDC/SAML providers need callback access
11+
- **Webhooks**: External services sending events to Bytebase
12+
13+
## Three Network Patterns
14+
15+
### 1. Bytebase Cloud
16+
Use [Bytebase Cloud](https://hub.bytebase.com/) for instant setup without infrastructure management. External services connect directly.
17+
18+
**Best for:** Quick testing, evaluation, and small teams
19+
20+
### 2. Self-Hosted Bytebase (Production)
21+
22+
Keep Bytebase inside your private network for security.
23+
24+
**With cloud CI/CD** (GitHub.com, GitLab.com, Bitbucket, Azure DevOps):
25+
26+
- Works without self-hosted runners
27+
- Cloud CI/CD can call Bytebase directly (or via the required exposed endpoint)
28+
29+
**With self-hosted CI/CD** (GitHub Enterprise Server, self-hosted GitLab, Jenkins):
30+
31+
- Install self-hosted runners/agents inside your network
32+
- Runners connect to your internal Bytebase without exposing it to the internet
33+
34+
**Best for:** Production setups with strict network boundaries.
35+
36+
### 3. Self-Hosted Local Testing with Reverse Proxy
37+
38+
Temporarily expose local Bytebase for testing using reverse proxy tools such as:
39+
- [ngrok](https://ngrok.com/)
40+
- [VS Code port forwarding](https://code.visualstudio.com/docs/editor/port-forwarding)
41+
- Other tunneling services
42+
43+
<Warning>
44+
Never use reverse proxy tools in production. They are for local testing only.
45+
</Warning>
46+
47+
<Info>
48+
**Important for Self-Hosted:** Remember to configure the External URL in Bytebase **Settings > General** with your public URL for SSO callbacks and other integrations to work properly.
49+
</Info>

mintlify/gitops/installation.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
22
title: Installation
3-
description: Installation and setup guide for connecting Version Control Systems with Bytebase
43
---
54

65
This guide covers the setup requirements for connecting Version Control Systems (VCS) with Bytebase.
76

7+
<Info>
8+
For understanding network patterns and external access options, see the [Network Architecture guide](/get-started/self-host/network-architecture).
9+
</Info>
10+
811
## Bytebase Cloud
912

1013
**No installation required** for cloud VCS providers:
@@ -51,3 +54,10 @@ When using cloud VCS with self-hosted Bytebase, you need a self-hosted runner:
5154
- Network policies allow communication
5255
- If your GitLab runner lacks internet access, pre-load the bytebase-action Docker image
5356

57+
## Local Testing
58+
59+
To expose local Bytebase for testing with cloud VCS services, use reverse proxy tools like ngrok. See [Network Architecture guide](/get-started/self-host/network-architecture#3-self-hosted-local-testing-with-reverse-proxy) for setup details.
60+
61+
<Warning>
62+
For development and testing only. Never use in production.
63+
</Warning>

mintlify/gitops/migration-based-workflow/overview.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ Open a pull/merge request. Automated SQL review runs in CI/CD.
5555

5656
After merge, CI/CD triggers Bytebase to create a release and deploy to target databases.
5757

58+
## Tutorials
59+
60+
<Card title="Tutorial: Database GitOps with GitHub Actions" icon="github" href="/tutorials/gitops-github-workflow" horizontal />
61+
62+
<Card title="Tutorial: Database GitOps with Azure DevOps Pipeline" icon="microsoft" href="/tutorials/gitops-azure-devops-workflow" horizontal />
63+
64+
<Card title="Tutorial: Database GitOps with GitLab CI" icon="gitlab" href="/tutorials/gitops-gitlab-workflow" horizontal />
65+
66+
<Card title="Tutorial: Database GitOps with Bitbucket Pipelines" icon="bitbucket" href="/tutorials/gitops-bitbucket-workflow" horizontal />
67+
5868
---
5969

6070
## Next Steps

mintlify/snippets/install/start-with-ngrok.mdx

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import TerminalDockerRunVolume from '/snippets/install/terminal-docker-run-volume.mdx';
2+
3+
<Tabs>
4+
<Tab title="Cloud">
5+
Use [Bytebase Cloud](https://hub.bytebase.com/) for instant setup without infrastructure management. CI/CD services can connect immediately.
6+
7+
**Best for:** Quick testing, evaluation, and small teams
8+
</Tab>
9+
<Tab title="Self-Hosted">
10+
Run Bytebase in Docker within your infrastructure:
11+
12+
<TerminalDockerRunVolume />
13+
14+
**Network Access Options:**
15+
16+
- **For testing:** Use tools such as [ngrok](https://ngrok.com/) or [VS Code port forwarding](https://code.visualstudio.com/docs/editor/port-forwarding) to temporarily expose your local Bytebase to cloud CI/CD services. After exposing, configure the **External URL** in Bytebase **Settings > General**.
17+
18+
- **For production:** Use self-hosted CI/CD runners within your private network. Never expose production Bytebase to the internet.
19+
20+
**Best for:** Organizations with security requirements or existing infrastructure
21+
</Tab>
22+
</Tabs>
23+
24+
See [Network Architecture guide](/get-started/self-host/network-architecture#2-self-hosted-bytebase-production).

mintlify/tutorials/github-action-data-masking-part1.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ description: 'Learn how to automate semantic type and global masking rule using
1111
---
1212

1313
import ApiPreface from '/snippets/tutorials/api-preface.mdx';
14-
import StartWithNgrok from '/snippets/install/start-with-ngrok.mdx';
1514
import CreateServiceAccount from '/snippets/tutorials/create-service-account.mdx';
1615

1716
<ApiPreface />
@@ -41,18 +40,17 @@ The complete code for this tutorial is available at: [example-database-security]
4140

4241
## Prerequisites
4342

44-
Before you begin, make sure you have:
45-
46-
- [Docker](https://www.docker.com/) installed
43+
- A Bytebase instance (Bytebase Cloud or self-hosted) with Enterprise Plan
44+
- For self-hosted version, you need [Docker](https://www.docker.com/) to run Bytebase
4745
- A [GitHub](https://github.com/) account
48-
- An [ngrok](http://ngrok.com/) account
49-
- Bytebase Enterprise Plan subscription (you can request a free trial)
5046

5147
## Setup Instructions
5248

53-
### Step 1 - Start Bytebase in Docker and set the External URL generated by ngrok
49+
### Step 1 - Set up Bytebase
50+
51+
import BytebaseSetupOptions from '/snippets/tutorials/bytebase-setup-options.mdx';
5452

55-
<StartWithNgrok />
53+
<BytebaseSetupOptions />
5654

5755
### Step 2 - Create Service Account
5856

@@ -72,7 +70,7 @@ Before you begin, make sure you have:
7270

7371
1. Click **Settings** and then click **Secrets and variables > Actions**. Add the following secrets:
7472

75-
- `BYTEBASE_URL`: ngrok external URL
73+
- `BYTEBASE_URL`: Your Bytebase instance URL (e.g., `https://bytebase.your-company.com` or your Bytebase Cloud URL)
7674
- `BYTEBASE_SERVICE_KEY`: `[email protected]`
7775
- `BYTEBASE_SERVICE_SECRET`: service key copied in the previous step
7876

mintlify/tutorials/gitops-azure-devops-workflow.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ level: Advanced
99
estimated_time: '40 mins'
1010
---
1111

12-
import StartWithNgrok from '/snippets/install/start-with-ngrok.mdx';
1312
import CreateServiceAccountGitOps from '/snippets/tutorials/create-service-account-gitops.mdx';
1413
import ConfigSQLReview from '/snippets/tutorials/config-sql-review.mdx';
1514

@@ -34,14 +33,16 @@ This tutorial code repository is at [https://dev.azure.com/bytebase-hq/\_git/byt
3433

3534
## Prerequisites
3635

37-
- [Docker](https://www.docker.com/) installed
38-
- An [ngrok](https://ngrok.com/) account
36+
- A Bytebase instance (Bytebase Cloud or self-hosted)
37+
- For self-hosted version, you need [Docker](https://www.docker.com/) to run Bytebase
3938

4039
## Automatic Rollout across environments
4140

42-
### Step 1 - Start Bytebase with ngrok
41+
### Step 1 - Set up Bytebase
4342

44-
<StartWithNgrok />
43+
import BytebaseSetupOptions from '/snippets/tutorials/bytebase-setup-options.mdx';
44+
45+
<BytebaseSetupOptions />
4546

4647
### Step 2 - Create Service Account
4748

@@ -60,7 +61,7 @@ This tutorial code repository is at [https://dev.azure.com/bytebase-hq/\_git/byt
6061

6162
1. Go into `pipelines/sql-review.yml` and `pipelines/rollout-release.yml`. In the `env` section, replace the variable values with your own and commit the changes.
6263

63-
- **BYTEBASE_URL**: your ngrok url
64+
- **BYTEBASE_URL**: Your Bytebase instance URL (e.g., `https://bytebase.your-company.com` or your Bytebase Cloud URL)
6465
- **BYTEBASE_SERVICE_ACCOUNT**: `[email protected]` (the service account you created in the previous step)
6566
- **BYTEBASE_PROJECT**: `projects/project-sample` (the sample project in the Bytebase)
6667
- **BYTEBASE_TARGETS**: `instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod` (the two default databases in the sample project)

mintlify/tutorials/gitops-bitbucket-workflow.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ level: Advanced
99
estimated_time: '40 mins'
1010
---
1111

12-
import StartWithNgrok from '/snippets/install/start-with-ngrok.mdx';
1312
import CreateServiceAccountGitOps from '/snippets/tutorials/create-service-account-gitops.mdx';
1413
import ConfigSQLReview from '/snippets/tutorials/config-sql-review.mdx';
1514

@@ -42,14 +41,16 @@ https://bitbucket.org/p0nyyy/cicd/
4241

4342
## Prerequisites
4443

45-
- [Docker](https://www.docker.com/) installed
46-
- An [ngrok](https://ngrok.com/) account
44+
- A Bytebase instance (Bytebase Cloud or self-hosted)
45+
- For self-hosted version, you need [Docker](https://www.docker.com/) to run Bytebase
4746

4847
## Automatic Rollout across environments
4948

50-
### Step 1 - Start Bytebase with ngrok
49+
### Step 1 - Set up Bytebase
5150

52-
<StartWithNgrok />
51+
import BytebaseSetupOptions from '/snippets/tutorials/bytebase-setup-options.mdx';
52+
53+
<BytebaseSetupOptions />
5354

5455
### Step 2 - Create Service Account
5556

@@ -67,7 +68,7 @@ _Note: Usually we enable SQL review for `Prod` environment as above. In this dem
6768

6869
1. Go into `bitbucket-pipelines.yml`, replace the variable in all 3 steps the values with your own and commit the changes.
6970

70-
- **BYTEBASE_URL**: your ngrok url
71+
- **BYTEBASE_URL**: Your Bytebase instance URL (e.g., `https://bytebase.your-company.com` or your Bytebase Cloud URL)
7172
- **BYTEBASE_SERVICE_ACCOUNT**: `[email protected]` (the service account you created in the previous step)
7273
- **BYTEBASE_SERVICE_ACCOUNT_SECRET**: the password of the service account
7374

mintlify/tutorials/gitops-github-workflow.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ level: Advanced
99
estimated_time: '40 mins'
1010
---
1111

12-
import StartWithNgrok from '/snippets/install/start-with-ngrok.mdx';
1312
import CreateServiceAccountGitOps from '/snippets/tutorials/create-service-account-gitops.mdx';
1413
import ConfigSQLReview from '/snippets/tutorials/config-sql-review.mdx';
1514

@@ -46,14 +45,16 @@ https://github.com/bytebase/example-gitops-github-flow
4645

4746
## Prerequisites
4847

49-
- [Docker](https://www.docker.com/) installed
50-
- An [ngrok](https://ngrok.com/) account
48+
- A Bytebase instance (Bytebase Cloud or self-hosted)
49+
- For self-hosted version, you need [Docker](https://www.docker.com/) to run Bytebase.
5150

5251
## Automatic Rollout across environments
5352

54-
### Step 1 - Start Bytebase with ngrok
53+
### Step 1 - Set up Bytebase
5554

56-
<StartWithNgrok />
55+
import BytebaseSetupOptions from '/snippets/tutorials/bytebase-setup-options.mdx';
56+
57+
<BytebaseSetupOptions />
5758

5859
### Step 2 - Create Service Account
5960

@@ -73,7 +74,7 @@ https://github.com/bytebase/example-gitops-github-flow
7374

7475
1. Go into `.github/workflows/release-action.yml` and `.github/workflows/sql-review-action.yml`. In the `env` section, replace the variable values with your own and commit the changes.
7576

76-
- **BYTEBASE_URL**: your ngrok url
77+
- **BYTEBASE_URL**: Your Bytebase instance URL (e.g., `https://bytebase.your-company.com` or your Bytebase Cloud URL)
7778
- **BYTEBASE_SERVICE_ACCOUNT**: `[email protected]` (the service account you created in the previous step)
7879
- **BYTEBASE_PROJECT**: `projects/project-sample` (the sample project in the Bytebase)
7980
- **BYTEBASE_TARGETS**: `instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod` (the two default databases in the sample project)
@@ -182,7 +183,7 @@ Team members can trigger deployments by commenting `/migrate <environment>` on a
182183

183184
1. Go into `.github/workflows/chatops-migrate.yml`. In the `env` section, replace the variable values with your own:
184185

185-
- **BYTEBASE_URL**: your ngrok url
186+
- **BYTEBASE_URL**: Your Bytebase instance URL (e.g., `https://bytebase.your-company.com` or your Bytebase Cloud URL)
186187
- **BYTEBASE_SERVICE_ACCOUNT**: `[email protected]`
187188
- **BYTEBASE_PROJECT**: `projects/project-sample`
188189
- **FILE_PATTERN**: `migrations-semver/*.sql`

0 commit comments

Comments
 (0)