Feature request: option to default to private repository #1388

Closed
opened 2025-11-02 03:59:00 -06:00 by GiteaMirror · 12 comments
Owner

Originally created by @mqudsi on GitHub (Dec 19, 2017).

This is a minor feature request, yet somewhat important in that it pertains to security-related UX.

It would be nice to have either a per-user/organization or a global (site admin option) to default the checkbox controlling private repository status to a checked state. We had a few close calls with gitea where private code was almost checked into a public repository as a result of this, and would really appreciate such an option.

Keep in mind that something private can always be made public, but for a lot of private things once they are made public there's no ever taking them back.

Here's a screenshot to make it clear what option is being referred to:

default checked

(I am not entirely sure, but I feel that gogs may have had such an option)

Originally created by @mqudsi on GitHub (Dec 19, 2017). This is a minor feature request, yet somewhat important in that it pertains to security-related UX. It would be nice to have either a per-user/organization or a global (site admin option) to default the checkbox controlling private repository status to a checked state. We had a few close calls with gitea where private code was almost checked into a public repository as a result of this, and would really appreciate such an option. Keep in mind that something private can always be made public, but for a lot of private things once they are made public there's no ever taking them back. Here's a screenshot to make it clear what option is being referred to: ![default checked](https://user-images.githubusercontent.com/606923/34175690-f2996276-e4c2-11e7-9053-abd1ff5e56c9.png) (_I am not entirely sure, but I feel that gogs **may** have had such an option_)
GiteaMirror added the type/feature label 2025-11-02 03:59:00 -06:00
Author
Owner

@programmeroftheeve commented on GitHub (Dec 19, 2017):

Set this in your app.ini config

[repository]
; Force every new repository to be private
FORCE_PRIVATE = false

This defaults new repos to private. They can always be changed to public afterwords.

@programmeroftheeve commented on GitHub (Dec 19, 2017): Set this in your app.ini config ``` [repository] ; Force every new repository to be private FORCE_PRIVATE = false ``` This defaults new repos to private. They can always be changed to public afterwords.
Author
Owner

@mqudsi commented on GitHub (Dec 19, 2017):

Thanks. I've come across that but didn't realize that the user still had the option to make repositories public thereafter.

It would be nice to have a middle ground option where the checkmark can be ticked by default, but the user has the option of changing that at creation time.

@mqudsi commented on GitHub (Dec 19, 2017): Thanks. I've come across that but didn't realize that the user still had the option to make repositories public thereafter. It would be nice to have a middle ground option where the checkmark can be ticked by default, but the user has the option of changing that at creation time.
Author
Owner

@lafriks commented on GitHub (Dec 19, 2017):

It is named badly but actually does exactly what you want, just makes private checked by default

@lafriks commented on GitHub (Dec 19, 2017): It is named badly but actually does exactly what you want, just makes private checked by default
Author
Owner

@mqudsi commented on GitHub (Dec 19, 2017):

@lafriks no, for me it forces the tick to be selected and that tick cannot be unselected on the new repo screen.

@mqudsi commented on GitHub (Dec 19, 2017): @lafriks no, for me it forces the tick to be selected and that tick cannot be unselected on the new repo screen.
Author
Owner

@mqudsi commented on GitHub (Dec 19, 2017):

image

@mqudsi commented on GitHub (Dec 19, 2017): ![image](https://user-images.githubusercontent.com/606923/34178337-75797272-e4cc-11e7-8dd4-8afa2debd4ab.png)
Author
Owner

@lafriks commented on GitHub (Dec 19, 2017):

Oh, sorry than. Quick look at code looked like it should not actually force but you are right

@lafriks commented on GitHub (Dec 19, 2017): Oh, sorry than. Quick look at code looked like it should not actually force but you are right
Author
Owner

@mqudsi commented on GitHub (Dec 19, 2017):

No problem. Thanks for the fast reply and changing the tag.

@mqudsi commented on GitHub (Dec 19, 2017): No problem. Thanks for the fast reply and changing the tag.
Author
Owner

@strk commented on GitHub (Dec 19, 2017):

I'd love to tweak that default-checked behavior too.
In my case I'd like new repositories to be public by default,
so unchecked-by-default.

And eventually an option to prevent some users from creating
private repositories at all...

@strk commented on GitHub (Dec 19, 2017): I'd love to tweak that default-checked behavior too. In my case I'd like new repositories to be public by default, so unchecked-by-default. And eventually an option to prevent some users from creating private repositories at all...
Author
Owner

@mqudsi commented on GitHub (Dec 20, 2017):

Awesome! Thank you very much!

@mqudsi commented on GitHub (Dec 20, 2017): Awesome! Thank you very much!
Author
Owner

@robetus commented on GitHub (Mar 6, 2018):

I understand that you can now make all new and migrated repos private default, but what about being about to remove the ability by users to make the repo private after it is created? This is what @mqudsi was asking about originally. Has this been implemented?

@robetus commented on GitHub (Mar 6, 2018): I understand that you can now make all new and migrated repos private default, but what about being about to remove the ability by users to make the repo private after it is created? This is what @mqudsi was asking about originally. Has this been implemented?
Author
Owner

@mqudsi commented on GitHub (Mar 6, 2018):

No, my issue has been addressed. You should probably open a new issue.

@mqudsi commented on GitHub (Mar 6, 2018): No, my issue has been addressed. You should probably open a new issue.
Author
Owner

@chriseaton commented on GitHub (Apr 18, 2020):

If you found this on Google, the option available is: DEFAULT_PRIVATE = true

@chriseaton commented on GitHub (Apr 18, 2020): If you found this on Google, the option available is: `DEFAULT_PRIVATE = true`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1388