diff --git a/docs/docs/installation/gitea.md b/docs/docs/installation/gitea.md index 476497f7..4f0bb5fc 100644 --- a/docs/docs/installation/gitea.md +++ b/docs/docs/installation/gitea.md @@ -39,6 +39,8 @@ GITEA__PERSONAL_ACCESS_TOKEN= GITEA__WEBHOOK_SECRET= GITEA__URL=https://gitea.com # Or self host OPENAI__KEY= +GITEA__SKIP_SSL_VERIFICATION=false # or true +GITEA__SSL_CA_CERT=/path/to/cacert.pem ``` 8. Create a webhook in your Gitea project. Set the URL to `http[s]:///api/v1/gitea_webhooks`, the secret token to the generated secret from step 3, and enable the triggers `push`, `comments` and `merge request events`. diff --git a/pr_agent/git_providers/gitea_provider.py b/pr_agent/git_providers/gitea_provider.py index d7dd2462..0a166ff3 100644 --- a/pr_agent/git_providers/gitea_provider.py +++ b/pr_agent/git_providers/gitea_provider.py @@ -41,6 +41,12 @@ class GiteaProvider(GitProvider): configuration.host = "{}/api/v1".format(self.base_url) configuration.api_key['Authorization'] = f'token {gitea_access_token}' + if get_settings().get("GITEA.SKIP_SSL_VERIFICATION", False): + configuration.verify_ssl = False + + # Use custom cert (self-signed) + configuration.ssl_ca_cert = get_settings().get("GITEA.SSL_CA_CERT", None) + client = giteapy.ApiClient(configuration) self.repo_api = RepoApi(client) self.owner = None