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

DefaultRepoUnits doesn't seem to be loaded from app.ini #11271

Closed
2 of 7 tasks
sadaszewski opened this issue May 2, 2020 · 4 comments
Closed
2 of 7 tasks

DefaultRepoUnits doesn't seem to be loaded from app.ini #11271

sadaszewski opened this issue May 2, 2020 · 4 comments
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@sadaszewski
Copy link

sadaszewski commented May 2, 2020

  • Gitea version (or commit ref): 1.11.4
  • Git version:
  • Operating system: FreeBSD
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

DEFAULT_REPO_UNITS setting seems to have no effect. A glance at:

https://github.com/go-gitea/gitea/blob/c8d7ae1ee33e31ed15632a26c74ba9a3ea115043/modules/setting/repository.go

reveals that it isn't even loaded from app.ini as far as I can tell. Please advise.

Screenshots

@sadaszewski
Copy link
Author

sadaszewski commented May 2, 2020

  • Typo, Gitea Release 1.11.4

@guillep2k
Copy link
Member

Maybe you're looking for this?

if err = Cfg.Section("repository").MapTo(&Repository); err != nil {

Cfg.Section() will automagically fill in the values from app.ini.

If you make any changes to app.ini, make sure you restart the instance. If you're having problems, maybe checking in in our Discord chat first would help.

@guillep2k guillep2k added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label May 3, 2020
@sadaszewski
Copy link
Author

Hi guillep2k, thank you for your comment. Agreed, it seems as it is being loaded. Nevertheless it doesn't work, i.e. always all units are added to new repositories. The settings in app.ini seem to be correct specifying:

[repository]
DEFAULT_REPO_UNITS=repo.code

and the app has been restarted multiple times. Nevertheless, all new repositories are created with all units activated. I took another look and in:

var units = make([]RepoUnit, 0, len(DefaultRepoUnits))

one can see that DefaultRepoUnits are referenced but I am afraid this is not the DefaultRepoUnits from:

DefaultRepoUnits []string

I believe those are rather the array of all repo units from here:

DefaultRepoUnits = []UnitType{

Could you please confirm and if so - is somebody working on a fix? Thank you in advance. BR, -- Stanislaw

@zeripath
Copy link
Contributor

zeripath commented May 4, 2020

This feature was added in #8788 which is on the 1.12 milestone. It is therefore not available to 1.11.4.

@zeripath zeripath closed this as completed May 4, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

3 participants