gitea: SMTP-Auth broken in gitea 1.18.0+rc0
Description
There are two problems with smtp auth in gitea:
- One can create an Authentication Source in the web UI, but you can not edit it by clicking the pencil button. On doing so the 500 page is shown and in the logs you get this
gitea1.18 | 2022/11/09 20:23:38 [636bfe33] router: completed GET /user/events for 87.123.115.202:0, 200 OK in 7182.9ms @ events/events.go:19(events.Events)
gitea1.18 | 2022/11/09 20:23:38 ...s/context/context.go:219:HTML() [D] [636bfe3a] Template: admin/auth/edit
gitea1.18 | 2022/11/09 20:23:38 ...s/context/context.go:232:HTML() [E] [636bfe3a] Render failed: template: admin/auth/edit:199:58: executing "admin/auth/edit" at <$cfg.Host>: can't evaluate field Host in type convert.Conversion
gitea1.18 | 2022/11/09 20:23:38 ...s/context/context.go:219:HTML() [D] [636bfe3a] Template: status/500
gitea1.18 | 2022/11/09 20:23:38 [636bfe3a] router: completed GET /admin/auths/1 for 87.123.115.202:0, 500 Internal Server Error in 7.2ms @ admin/auths.go:320(admin.EditAuthSource)
- Users can not authenticate using the smtp authentication source (even in an upgraded install where smtp-auth used to work flawlessly)
When a user tries to log in, an empty page is shown.
In the logs one can see this:
gitea1.18 | 2022/11/09 20:12:49 ...ers/web/auth/auth.go:221:SignInPost() [E] [636bfbb1] UserSignIn: dial tcp :587: connect: connection refused
gitea1.18 | 2022/11/09 20:12:49 [636bfbb1] router: completed POST /user/login for 87.123.115.202:0, 0 in 1.8ms @ auth/auth.go:177(auth.SignInPost)
I checked these things:
- Problem happenes with a fresh install and my upgraded install
- Problem does not happen with gitea 1.17.3 (fresh install and upgraded from previous versions)
- Smtp-Server is reachable and can be used to authenticate (works for gitea 1.17.3)
- Username and password are correct (used keepass to auto-type in 1.18-rc0 and 1.17.3)
- no customization at all, just set up via docker, added authorization source, added user
Gitea Version
1.18-rc0 (docker image gitea:latest)
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
not relevant
Operating System
Linux (docker)
How are you running Gitea?
Used this docker-compose.yml
version: "3"
networks:
gitea:
external: false
services:
server:
image: gitea/gitea:latest
container_name: gitea1.18
environment:
- USER_UID=1002
- USER_GID=1002
restart: always
expose:
- 22
- 3000
networks:
- gitea
volumes:
- ./gitea:/data
# - /home/git/.ssh:/data/git/.ssh
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "127.0.0.1:2222:22"
docker image ls
:
REPOSITORY TAG IMAGE ID CREATED SIZE
...
gitea/gitea latest 54e1c09fe090 2 weeks ago 255MB
...
Database
SQLite
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (9 by maintainers)
Commits related to this issue
- Revert unrelated changes for SMTP auth (#21767) (#21768) Backport #21767 The purpose of #18982 is to improve the SMTP mailer, but there were some unrelated changes made to the SMTP auth in http... — committed to go-gitea/gitea by wxiaoguang 2 years ago
- Revert unrelated changes for SMTP auth (#21767) The purpose of #18982 is to improve the SMTP mailer, but there were some unrelated changes made to the SMTP auth in https://github.com/go-gitea/gitea... — committed to go-gitea/gitea by wxiaoguang 2 years ago
- Revert unrelated changes for SMTP auth (#21767) The purpose of #18982 is to improve the SMTP mailer, but there were some unrelated changes made to the SMTP auth in https://github.com/go-gitea/gitea... — committed to fsologureng/gitea by wxiaoguang 2 years ago
- Correct the fallbacks for mailer configuration Unfortunately the fallback configuration code for [mailer] that were added in #18982 are incorrect. When you read a value from an ini section that key i... — committed to zeripath/gitea by zeripath 2 years ago
- Correct the fallbacks for mailer configuration (#21945) Unfortunately the fallback configuration code for [mailer] that were added in #18982 are incorrect. When you read a value from an ini section ... — committed to go-gitea/gitea by zeripath 2 years ago
- Correct the fallbacks for mailer configuration (#21945) Backport #21945 Unfortunately the fallback configuration code for [mailer] that were added in #18982 are incorrect. When you read a value from... — committed to zeripath/gitea by zeripath 2 years ago
- Correct the fallbacks for mailer configuration (#21945) (#21953) Backport #21945 Unfortunately the fallback configuration code for [mailer] that were added in #18982 are incorrect. When you read ... — committed to go-gitea/gitea by zeripath 2 years ago
It helps that I really do know this codebase - but assuming that you know any imperative language then go is extremely easy to learn.
Ah! The fallbacks won’t work due to a mistaken assumption by the author of the PR.
The merged PRs are in:
dev
(if you want to stay in 1.18, do not use this)1.18-dev
(which will be next rc, like 1.18-rc1)I still owe a feedback: The change works for me.
Thank you
Thanks for the fix. I will give it a try later today.
And praise to backups …