From 3faab424a4f56b8b9fe1d1e396f372ff1d1f5afd Mon Sep 17 00:00:00 2001 From: nicolas Date: Thu, 12 Jun 2025 16:01:26 +0200 Subject: [PATCH 1/2] feat: support self-signed gitea cert --- pr_agent/git_providers/gitea_provider.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 From 4bac78b1b9c6ec778a330e2042e787e2cd99ec3a Mon Sep 17 00:00:00 2001 From: nicolas Date: Fri, 13 Jun 2025 19:16:13 +0200 Subject: [PATCH 2/2] docs: add gitea self signed configuration --- docs/docs/installation/gitea.md | 2 ++ 1 file changed, 2 insertions(+) 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`.