When setting up drone and gitea, my user cannot log in, the the following message:
Login Failed. Forbidden
Before pulling the latest gitea and drone docker images I was able to login.
Current versions:
Drone from docker drone/drone:1
Gitea from docker gitea/gitea:1 (799f5e0)
Reverse proxy: traefik
Gitea logs:
[Macaron] 2019-04-27 10:07:20: Started GET /api/v1/users/[:user]/tokens for 88.217.37.92
gitea_1 | [Macaron] 2019-04-27 10:07:20: Completed GET /api/v1/users/[:user]/tokens 403 Forbidden in 37.509493ms
(Where [:user] is my username)
Is this due to the way the api in Gitea works? api/v1/users/[:user]/tokens requires basic authentication in url?
Is there anything I would miss from configuration below?
It seems for drone 1.1.0 (as stated in the changelog) the gitea now supports oauth2.
Now the next problem is cloning does not work:
1 Initialized empty Git repository in /drone/src/.git/
2 + git fetch origin +refs/heads/master:
3 fatal: could not read Username for 'https://URL': No such device or address
Gitea logs the following:
Completed GET /user/repo.git/info/refs?service=git-upload-pack 401 Unauthorized
Where user is my username, and repo.git is the name of the repository.
Thanks for your reply @bradrydzewski
I already checked all those links
Also implemented the .drone.yml for debug, and finished without any issues. Curl works as expected.
Unfortunately I could not find the actual root cause (maybe I missed something on those posts?)
Another detail I found is given I have 2FA active in Gitea, I cannot pull the repo by username and password but I need the token.
What would be the right configuration?
Should I then configure
- DRONE_GIT_ALWAYS=true
- DRONE_GIT_USERNAME=x-oauth-token
- DRONE_GIT_PASSWORD=?
There are known issues (in Gitea) with 2FA and their new oauth2 implementation as it related to cloning a repository. I believe the Gitea folks are working to patch this in the 1.8.1 release, according to techknowlogick (Gitea maintainer). You might want to check in the Gitea discord channel to get more information.
For anyone coming here from search, what @bradrydzewski said above is correct. There was a bug in Gitea that’ll be released in 1.8.1. The patch has been merged, and we are just waiting for a release which should be within the next week. Feel free to join us on Gitea discord if you need help in the interim.