Git-backed Configuration and Token Store
The application can be configured to use a Git repository as a backend for storing both the config.yaml file and the authentication tokens from the auth-dir. This allows for centralized management and versioning of your configuration.
To enable this feature, set the GITSTORE_GIT_URL environment variable to the URL of your Git repository.
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
MANAGEMENT_PASSWORD | Yes | The password for management webui. | |
GITSTORE_GIT_URL | Yes | The HTTPS URL of the Git repository to use. | |
GITSTORE_LOCAL_PATH | No | Current working directory | The local path where the Git repository will be cloned. Inside Docker, this defaults to /CLIProxyAPI. |
GITSTORE_GIT_USERNAME | No | The username for Git authentication. | |
GITSTORE_GIT_TOKEN | No | The personal access token (or password) for Git authentication. |
How it Works
- Cloning: On startup, the application clones the remote Git repository to the
GITSTORE_LOCAL_PATH. - Configuration: It then looks for a
config.yamlinside aconfigdirectory within the cloned repository. - Bootstrapping: If
config/config.yamldoes not exist in the repository, the application will copy the localconfig.example.yamlto that location, commit, and push it to the remote repository as an initial configuration. You must haveconfig.example.yamlavailable. - Token Sync: The
auth-diris also managed within this repository. Any changes to authentication tokens (e.g., through a new login) are automatically committed and pushed to the remote Git repository.