Self-hosting Apidog
  1. Configurations
Self-hosting Apidog
  • Overview
  • Introduction
    • Obtaining Apidog On-Premises License
    • System Requirements
    • Data Privacy & Compliance
  • Deployment
    • Running Apidog on Docker
    • Running Apidog on Kubernetes
    • Running Apidog Multi-Container Deployment without Kubernetes
  • Post Deployment
    • Accessing Apidog Admin Panel
    • Accessing Apidog Web Interface
    • Installing Apidog On-Premises Client
  • Configurations
    • Environment Variables
    • Database Configuration
    • Storage Services Configuration
    • Git Connection Configuration
    • 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 Design Flow
  • Troubleshooting
    • Troubleshooting
    • FAQ
  • Apidog API (coming soon)
  1. Configurations

Git Connection Configuration

Overview#

The Git Connection and Backup functionality enables you to automatically back up your API documentation to Git repositories hosted on GitHub or GitLab platforms. This feature is supported for both SaaS and enterprise versions of these platforms, depending on the environment variables you configure.
Version Requirement: This feature requires Apidog On-Premises image version 2.7.38 or later.

GitHub Configuration#

To integrate with GitHub, you need to create a new OAuth app in the GitHub settings. For the GitHub SaaS version, you can access the settings page using the following URL:
https://github.com/settings/developers.
image.png
When creating the OAuth app, set the Authorization callback URL to your Apidog On-Premises API domain, followed by /passport/github/callback.
For-example: https://your-apidog-domain.com/passport/github/callback
Once the app is created, take note of the Client ID and Client Secret, then 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#

To integrate with GitLab, create a new OAuth app in the GitLab settings. For the GitLab SaaS version, visit the following URL:
https://gitlab.com/-/user_settings/applications.
image.png

Configuration Steps#

1.
Redirect Callback URL: Set the callback URL to your Apidog On-Premises API domain, followed by /api/v1/projects/git-connections/gitlab-callback.
Forexample:
https://your-apidog-domain.com/api/v1/projects/git-connections/gitlab-callback
2.
Scopes: Ensure that the api scope is selected.
3.
Once the OAuth app is created, make a note of the Application ID and Application Secret. Then, 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-12-08 05:03:55
Previous
Storage Services Configuration
Next
Using LDAP for Authentication
Built with