Skip to content
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

If you create a repo called action, it cannot be update #18037

Closed
akkuman opened this issue Dec 20, 2021 · 3 comments · Fixed by #18045
Closed

If you create a repo called action, it cannot be update #18037

akkuman opened this issue Dec 20, 2021 · 3 comments · Fixed by #18045
Labels
Milestone

Comments

@akkuman
Copy link

akkuman commented Dec 20, 2021

Gitea Version

1.16.0+dev-717-g25677cdc5

Git Version

No response

Operating System

No response

How are you running Gitea?

https://try.gitea.io

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

I tried to fix the problem, but found that I could only fix it by disabling the repository that the user created called action.

you can see the demo https://try.gitea.io/Akkuman/action

it cannot be delete or update

Screenshots

No response

@zeripath
Copy link
Contributor

zeripath commented Dec 20, 2021

Yup this is because it posts to it are being conflicted with:

gitea/routers/web/web.go

Lines 487 to 489 in 2cd1479

m.Group("/{username}", func() {
m.Post("/action/{action}", user.Action)
}, reqSignIn)

Two options;

  1. Make action a reserved name for repos
  2. Move the above endpoint elsewhere.

I think if we can move the above endpoint elsewhere and avoid a reserved name that would be useful. However we need to check the api.go router file to see if there are other conflicted routes that need to be addressed too.

@lunny
Copy link
Member

lunny commented Dec 20, 2021

How about change the router to <username>/-/action?

@zeripath
Copy link
Contributor

somewhat annoyingly - appears to be a valid repository name. Previously when we've discussed this we've considered using ! but one simple thing is just to make the POST /:username/action/:action simply
POST /:username

@lunny lunny added the type/bug label Dec 20, 2021
zeripath added a commit to zeripath/gitea that referenced this issue Dec 20, 2021
The current code unfortunately requires that `action` be a reserved
repository name as it prevents posts to change the settings for
action repositories. However, we can simply change action handler
to work on POST /{username} instead.

Fix go-gitea#18037

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Dec 20, 2021
)

The current code unfortunately requires that `action` be a reserved
repository name as it prevents posts to change the settings for
action repositories. However, we can simply change action handler
to work on POST /{username} instead.

Fix #18037

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.15.8 milestone Dec 20, 2021
zeripath added a commit to zeripath/gitea that referenced this issue Dec 20, 2021
…gitea#18045)

Backport go-gitea#18045

The current code unfortunately requires that `action` be a reserved
repository name as it prevents posts to change the settings for
action repositories. However, we can simply change action handler
to work on POST /{username} instead.

Fix go-gitea#18037

Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick pushed a commit that referenced this issue Dec 20, 2021
) (#18046)

Backport #18045

The current code unfortunately requires that `action` be a reserved
repository name as it prevents posts to change the settings for
action repositories. However, we can simply change action handler
to work on POST /{username} instead.

Fix #18037

Signed-off-by: Andrew Thornton <art27@cantab.net>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
…gitea#18045)

The current code unfortunately requires that `action` be a reserved
repository name as it prevents posts to change the settings for
action repositories. However, we can simply change action handler
to work on POST /{username} instead.

Fix go-gitea#18037

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants