-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/serv: initalize session settings properly #6916
Conversation
This should fix go-gitea#5478 and with REQUIRE_SIGNIN_VIEW=true lfs auth errors
No, I don't think |
@lunny then should settings be initialized in NewContext instead? I'm not getting settings in the git-lfs-authenticate. It works now on my server with this customization. What would be a better way? |
LFS has initalized in |
Line 215 in 13583a6
LFS also depends on other settings being in place to know what claims the jwt token needs. It's initialized here: gitea/modules/setting/service.go Lines 51 to 60 in 13583a6
|
@nopjmp you are right. But I think we also need to load minimal settings. |
We could always just include the user claims in the jwt token regardless of the repository setting and access mode, if the user is using an authenticated ssh key. I don't think that's unreasonable, but it could increase the load on larger git servers theoretically. Alternatively, NewContext could initialize the setting.Service.RequireSignInView from the configuration file. |
I'm going to suggest we do the compete opposite - make serv and hook as dumb as possible and move almost all their logic on to a private URL endpoint. This should be faster as there won't be the back and forth between the Gitea web service and these processes, and if there is a deadlock it should be easier to manage. We will also be able to kill the serv and hook logs and make better logging as it will use the default Gitea logs. |
I spent some time thinking and agree with @zeripath on this. I'm going to keep my local hack in my repo for now since I need this to work on my instance. Additionally, I'll convert this over to an issue to make tracking it easier as I should have done in the first place. |
The above was merged as #6993. |
This should fix #5478 and with REQUIRE_SIGNIN_VIEW=true lfs auth errors
Without this,
ssh git@<domain> git-lfs-authenticate <repo> download
will not return user claim and will cause an authentication error. cmd/dump also uses this same pattern.gitea/cmd/dump.go
Lines 62 to 63 in e1fcd6b
I'm not sure, but it also looks like it needs to be done here?
gitea/cmd/cmd.go
Lines 39 to 48 in e1fcd6b