WeblateOrg / WeblateOrg/weblate
VCS Integration not possible with slash in URL
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 1.4k
- Avg merge
- 9h 53m
- Merged PRs (30d)
- 395
Description
### Describe the issue
I believe the VCS platform integration doesn't work, when the target API has a slash in the name.
I have successfully configured the pushing via standard git and basic auth to a push URL of my Gitea repo. Now I want to configure Weblate to use the Gitea API to create Pull requests as per https://docs.weblate.org/en/weblate-4.18.2/vcs.html#vcs-gitea. Gitea is hosted at `subdomain.domain.net/git` as configured with NGINX. In my weblate settings I have:
```python
GITEA_CREDENTIALS = {
"subdomain.domain.net": {
"username": "",
"token": ""
},
}
```
This results in the error:
```
Failed to push /: HTTPSConnectionPool(host='subdomain.domain.net', port=443): Max retries exceeded with url: /api/v1/repos/git///forks (Caused by SSLError(PermissionError(13, 'Permission denied')))
```
An auth error, which I presume happens because it tries to Auth against a wrong URL. The url should be `/git/api/v1/repos/git///forks` instead. The push URL is not considered when using `Gitea Pull Request` as `Version control system` in the settings tab.
The logical step would be to change `GITEA_CREDENTIALS ` to say:
```python
GITEA_CREDENTIALS = {
"subdomain.domain.net/git": {
"username": "",
"token": ""
},
}
```
but that doesn't work, as Weblate stops to recognize that config for Gitea with the message:
```
Failed to push /: Gitea pull request API access for subdomain.domain.net is not configured
```
Is my deduction correct? How to solve this or debug further?
### I already tried
- [X] I've read and searched [the documentation](https://docs.weblate.org/).
- [X] I've searched for similar issues in this repository.
### Steps to reproduce the behavior
Try to configure the Gitea Pull request integration, when Gitea is hosted not on the root path of the URL, but a slash sub-path.
### Expected behavior
_No response_
### Screenshots
_No response_
### Exception traceback
_No response_
### How do you run Weblate?
weblate.org service
### Weblate versions
* Weblate: 4.18.2
* Django: 4.2.3
* siphashc: 2.1
* translate-toolkit: 3.9.2
* lxml: 4.9.3
* Pillow: 9.5.0
* nh3: 0.2.14
* python-dateutil: 2.8.2
* social-auth-core: 4.4.2
* social-auth-app-django: 5.2.0
* django-crispy-forms: 2.0
* oauthlib: 3.2.2
* django-compressor: 4.4
* djangorestframework: 3.14.0
* django-filter: 23.2
* django-appconf: 1.0.5
* user-agents: 2.2.0
* filelock: 3.12.2
* rapidfuzz: 3.1.1
* openpyxl: 3.1.2
* celery: 5.3.1
* django-celery-beat: 2.5.0
* kombu: 5.3.1
* translation-finder: 2.15
* weblate-language-data: 2023.5
* html2text: 2020.1.16
* pycairo: 1.24.0
* PyGObject: 3.44.1
* diff-match-patch: 20230430
* requests: 2.31.0
* django-redis: 5.3.0
* hiredis: 2.2.3
* sentry-sdk: 1.28.0
* Cython: 0.29.36
* misaka: 2.1.1
* GitPython: 3.1.32
* borgbackup: 1.2.4
* pyparsing: 3.0.9
* pyahocorasick: 2.0.0
* python-redis-lock: 4.0.0
* charset-normalizer: 3.2.0
* Python: 3.8.10
* Git: 2.25.1
* phply: 1.2.6
* ruamel.yaml: 0.17.32
* tesserocr: 2.6.0
* boto3: 1.26.165
* zeep: 4.2.1
* aeidon: 1.12
* iniparse: 0.5
* Mercurial: 6.5
* git-review: 2.3.1
* Redis server: 5.0.7
* PostgreSQL server: 12.15
* Database backends: django.db.backends.postgresql
* Cache backends: default:RedisCache, avatar:FileBasedCache
* Email setup: django.core.mail.backends.smtp.EmailBackend: smtp-jpn.dmgmori.net
* OS encoding: filesystem=utf-8, default=utf-8
* Celery: redis://localhost:6379, redis://localhost:6379, regular
* Platform: Linux 5.4.0-146-generic (x86_64)
### Weblate deploy checks
_No response_
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.