Merge pull request #1868 from NicoFgrx/main

feat: support self-signed gitea cert
This commit is contained in:
Tal
2025-06-17 08:21:40 +03:00
committed by GitHub
2 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,8 @@ GITEA__PERSONAL_ACCESS_TOKEN=<personal_access_token>
GITEA__WEBHOOK_SECRET=<webhook_secret>
GITEA__URL=https://gitea.com # Or self host
OPENAI__KEY=<your_openai_api_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]://<PR_AGENT_HOSTNAME>/api/v1/gitea_webhooks`, the secret token to the generated secret from step 3, and enable the triggers `push`, `comments` and `merge request events`.

View File

@ -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