Self-hosting Apidog
  1. Configuration
Self-hosting Apidog
  • Introduction
    • Installation Overview
    • System Requirements
  • Licensing
    • Obtaining Apidog On-premises License
  • Deployment
    • Running Apidog on Docker
    • Running Apidog on Kubernetes
    • Running Apidog Multi-Container Deployment without Kubernetes
    • Privacy
  • Initial Setup
    • Admin Panel
    • Installing Apidog Client
    • Access Apidog Web
  • Configuration
    • Environment Variables
    • Configuring the application database
    • Configuring the application storage service
    • Configuring the git connection environment
    • Authentication Providers
      • Using LDAP for authentication
      • Using OKTA for authentication
      • Using OAuth2.0 for authentication
  • Maintenance & Upgrades
    • Updating Apidog
    • Backing up Apidog
    • License Renewal
    • System Data Flow
  • Troubleshooting
    • Troubleshooting
    • FAQ
  • Apidog API (coming soon)
  1. Configuration

Configuring the git connection environment

Overview#

The Git Connection and Backup functionality allows you to automatically backup your API documentation to Git repositories hosted on GitHub or GitLab platforms. This feature supports both SaaS and enterprise versions of these platforms, depending on the environment variables you configure.

GitHub configuration#

Create a new OAuth app on the GitHub settings page. The page URL for the GitHub SaaS version is https://github.com/settings/developers.
image.png
The Authorization callback URL should be your Apidog On-premises API domain with the URL /passport/github/callback.
Then remember the application Client ID and Client Secret, and configure the following environment variables:
Environment VariableDescriptionDefault ValueNotes
GIT_CONNECTION_GITHUB_ENABLEWhether to enable GitHub Git connectiontrueSet to true to enable GitHub integration
GITHUB_AUTH_HOSTGitHub authentication host URL-Use https://github.com for SaaS GitHub or your enterprise GitHub host
GITHUB_API_HOSTGitHub API host URL-Use https://api.github.com for SaaS GitHub. Or use GITHUB_AUTH_HOST with /api/v3 for enterprise version
GITHUB_KEYGitHub OAuth application client ID-Required for GitHub OAuth authentication
GITHUB_SECRETGitHub OAuth application client secret-Required for GitHub OAuth authentication
GIT_CONNECTION_GITHUB_REJECT_UNAUTHORIZEDSSL certificate validation for GitHubtrueSet to false for self-signed certificates in enterprise environments

Configuration example for GitHub SaaS version#

- name: GIT_CONNECTION_GITHUB_ENABLE
  value: 'true'
- name: GITHUB_AUTH_HOST
  value: 'https://github.com'
- name: GITHUB_API_HOST
  value: 'https://api.github.com'
- name: GITHUB_KEY
  value: <your-github-client-id>
- name: GITHUB_SECRET
  value: <your-github-client-secret>
- name: GIT_CONNECTION_GITHUB_REJECT_UNAUTHORIZED
  value: 'true'

Configuration example for GitHub enterprise version#

- name: GIT_CONNECTION_GITHUB_ENABLE
  value: 'true'
- name: GITHUB_AUTH_HOST
  value: 'https://github.yourcompany.com'
- name: GITHUB_API_HOST
  value: 'https://github.yourcompany.com/api/v3'
- name: GITHUB_KEY
  value: <your-enterprise-github-client-id>
- name: GITHUB_SECRET
  value: <your-enterprise-github-client-secret>
- name: GIT_CONNECTION_GITHUB_REJECT_UNAUTHORIZED
  value: 'false'

GitLab Configuration#

Create a new OAuth app on the GitLab settings page. The page URL for the GitLab SaaS version is https://gitlab.com/-/user_settings/applications.
image.png
The Redirect callback URL should be your Apidog On-premises API domain with the URL /api/v1/projects/git-connections/gitlab-callback.
The scopes need to check api only.
Then remember the Application ID and Secret, and configure the following environment variables:
Environment VariableDescriptionDefault ValueNotes
GIT_CONNECTION_GITLAB_COM_ENABLEWhether to enable GitLab.com connectionfalseSet to true to enable GitLab.com integration
GITLAB_COM_AUTH_HOSTGitLab.com authentication host URL-Use https://gitlab.com for SaaS GitLab or your enterprise GitLab host
GITLAB_COM_KEYGitLab.com OAuth application client ID-Required for GitLab OAuth authentication
GITLAB_COM_SECRETGitLab.com OAuth application client secret-Required for GitLab OAuth authentication
GITLAB_SCOPEGitLab OAuth scope permissions-Define required permissions (e.g., api, read_user, read_repository). Must match the scope configured in your GitLab application
GITLAB_REDIRECT_URIGitLab OAuth redirect URI-Must match the redirect URI configured in your GitLab application
GIT_CONNECTION_GITLAB_COM_REJECT_UNAUTHORIZEDSSL certificate validation for GitLab.comtrueSet to false for self-signed certificates in enterprise environments

Configuration example for GitLab SaaS version#

- name: GIT_CONNECTION_GITLAB_COM_ENABLE
  value: 'true'
- name: GITLAB_COM_AUTH_HOST
  value: 'https://gitlab.com'
- name: GITLAB_COM_KEY
  value: <your-gitlab-client-id>
- name: GITLAB_COM_SECRET
  value: <your-gitlab-client-secret>
- name: GITLAB_SCOPE
  value: 'api'
- name: GITLAB_REDIRECT_URI
  value: 'https://your-apidog-domain.com/api/v1/projects/git-connections/gitlab-callback'
- name: GIT_CONNECTION_GITLAB_COM_REJECT_UNAUTHORIZED
  value: 'true'

Configuration example for GitLab enterprise version#

- name: GIT_CONNECTION_GITLAB_COM_ENABLE
  value: 'true'
- name: GITLAB_COM_AUTH_HOST
  value: 'https://gitlab.yourcompany.com'
- name: GITLAB_COM_KEY
  value: <your-enterprise-gitlab-client-id>
- name: GITLAB_COM_SECRET
  value: <your-enterprise-gitlab-client-secret>
- name: GITLAB_SCOPE
  value: 'api'
- name: GITLAB_REDIRECT_URI
  value: 'https://your-apidog-domain.com/api/v1/projects/git-connections/gitlab-callback'
- name: GIT_CONNECTION_GITLAB_COM_REJECT_UNAUTHORIZED
  value: 'false'
Modified at 2025-09-28 07:58:42
Previous
Configuring the application storage service
Next
Using LDAP for authentication
Built with