Disabling stars does not affect API calls #13957

Closed
opened 2025-11-02 10:58:20 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @HeCorr on GitHub (Jan 10, 2025).

Originally assigned to: @HeCorr on GitHub.

Description

If you disable the stars functionality with DISABLE_STARS, API calls to /repos/{owner}/{repo}/stargazers still work, as well as the other star-related endpoints.

[repository]
DISABLE_STARS = true
GET http://localhost:8080/gitea/api/v1/repos/HeCorr/test/stargazers

[
  {
    "id": 1,
    "login": "HeCorr",
    ...
  }
]

Gitea Version

39cc72562b

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.47.1

Operating System

Linux

How are you running Gitea?

Built from source with docker build --build-arg TAGS="bindata sqlite sqlite_unlock_notify" -t gitea . and running it within Docker.

Database

SQLite

Originally created by @HeCorr on GitHub (Jan 10, 2025). Originally assigned to: @HeCorr on GitHub. ### Description If you disable the stars functionality with `DISABLE_STARS`, API calls to `/repos/{owner}/{repo}/stargazers` still work, as well as the other star-related endpoints. ```ini [repository] DISABLE_STARS = true ``` ``` GET http://localhost:8080/gitea/api/v1/repos/HeCorr/test/stargazers [ { "id": 1, "login": "HeCorr", ... } ] ``` ### Gitea Version 39cc72562b1f9607d9eb8141daa8050d4468aade ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.47.1 ### Operating System Linux ### How are you running Gitea? Built from source with `docker build --build-arg TAGS="bindata sqlite sqlite_unlock_notify" -t gitea .` and running it within Docker. ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 10:58:20 -06:00
Author
Owner

@HeCorr commented on GitHub (Jan 10, 2025):

I am attempting to fix this, please assign me.

@HeCorr commented on GitHub (Jan 10, 2025): I am attempting to fix this, please assign me.
Author
Owner

@wxiaoguang commented on GitHub (Jan 11, 2025):

To be honest, that's a longstanding question in my mind: why we should make it able to disable everything.

For some features like "git hook" or "registration", we need to disable because it causes essential differences.

But for something like "stars", disabling it or not, does it really affect daily usage? If an option is not must, I'd like to keep code simple, to avoid making the logic more and more complex (and if the code is not covered by tests, they might break in the future and difficult to maintain)

@wxiaoguang commented on GitHub (Jan 11, 2025): To be honest, that's a longstanding question in my mind: why we should make it able to disable everything. For some features like "git hook" or "registration", we need to disable because it causes essential differences. But for something like "stars", disabling it or not, does it really affect daily usage? If an option is not must, I'd like to keep code simple, to avoid making the logic more and more complex (and if the code is not covered by tests, they might break in the future and difficult to maintain)
Author
Owner

@HeCorr commented on GitHub (Jan 11, 2025):

@wxiaoguang As a Gitea instance operator I'd expect that disabling a feature would make it completely disabled, not just hide it from the UI.

I do understand your point of this not being crucial, but for some usecases such as using Gitea solely for bug tracking, where stars or watching don't make any sense, it would be annoying if your users could still use a functionality you intented to fully disable.

@HeCorr commented on GitHub (Jan 11, 2025): @wxiaoguang As a Gitea instance operator I'd expect that disabling a feature would make it completely disabled, not just hide it from the UI. I do understand your point of this not being crucial, but for some usecases such as using Gitea solely for bug tracking, where stars or watching don't make any sense, it would be annoying if your users could still use a functionality you intented to fully disable.
Author
Owner

@wxiaoguang commented on GitHub (Jan 11, 2025):

I do understand your point of this not being crucial, but for some usecases such as using Gitea solely for bug tracking, where stars or watching don't make any sense, it would be annoying if your users could still use a functionality you intented to fully disable.

Why it would be "annoying" since it doesn't exist on the UI? When you use Gitea solely for bug tracking, there are still plenty of unneeded features besides "stars". If these unused features are all "annoying", I do not think it is feasible to disabled them one-by-one by a lot of new options.

@wxiaoguang commented on GitHub (Jan 11, 2025): > I do understand your point of this not being crucial, but for some usecases such as using Gitea solely for bug tracking, where stars or watching don't make any sense, it would be annoying if your users could still use a functionality you intented to fully disable. Why it would be "annoying" since it doesn't exist on the UI? When you use Gitea solely for bug tracking, there are still plenty of unneeded features besides "stars". If these unused features are all "annoying", I do not think it is feasible to disabled them one-by-one by a lot of new options.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13957