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

Web installer has some settings hardcoded #2984

Closed
2 of 8 tasks
0rzech opened this issue Nov 26, 2017 · 26 comments · Fixed by #3010
Closed
2 of 8 tasks

Web installer has some settings hardcoded #2984

0rzech opened this issue Nov 26, 2017 · 26 comments · Fixed by #3010
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@0rzech
Copy link
Contributor

0rzech commented Nov 26, 2017

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

Description

Gitea web installer has some settings hardcoded. As s seen in routers/install.go, some settings are not read from modules/setting/settings.go, eg:

This impedes automatic deployments.

Expected behavior

All installer settings should be read from setting module, which in turn should be a single source of truth for defaults and app.ini values.

@0rzech 0rzech changed the title Gitea web installer has some settings hardcoded Web installer has some settings hardcoded Nov 26, 2017
@lunny
Copy link
Member

lunny commented Nov 27, 2017

Yes, that's why OpenID is disabled default but in fact not.

@strk
Copy link
Member

strk commented Nov 27, 2017 via email

@lunny
Copy link
Member

lunny commented Nov 27, 2017

@strk I think disable them default should be better to keep it synchrony with default setting.

@0rzech
Copy link
Contributor Author

0rzech commented Nov 27, 2017

@lunny @strk Gitea installer should use what users puts in their app.ini before installation. If one prepares app.ini with disabled openid and logs set to Warn, then this is what Gitea installer should pick. As of now, some settings are used properly and other are not because of hardcodes in installer. IMHO, there is no good reason to force some defaults on users who prepared their custom app.ini, is it?

@lunny
Copy link
Member

lunny commented Nov 27, 2017

@orzech yes, that's what I said. That should be a bug and maybe someone could send a PR to fix that. And I wish it could be back port to v1.3

@lunny lunny added this to the 1.4.0 milestone Nov 27, 2017
@0rzech
Copy link
Contributor Author

0rzech commented Nov 27, 2017

@lunny Sorry, I misread your comments. If you're fine with a novice in Go and in Web taking this task, then I can do it. I can't guarantee it will make on time for v1.3, though.

@strk
Copy link
Member

strk commented Nov 27, 2017 via email

@0rzech
Copy link
Contributor Author

0rzech commented Nov 27, 2017

@strk The web installer will not show up when there is INSTALL_LOCK = true in app.ini. The file itself definitely can exist and be customized to user's preference.

@strk
Copy link
Member

strk commented Nov 27, 2017 via email

@lafriks
Copy link
Member

lafriks commented Nov 27, 2017

And that would be not nice to them to enable it

@strk
Copy link
Member

strk commented Nov 27, 2017

So anyway, in current master branch OPENID is enabled in custom/conf/app.ini.sample and there's no other app.ini other than the one for docker, so what discrepancy are we talking about ?

@0rzech
Copy link
Contributor Author

0rzech commented Nov 28, 2017

The issue is with hardcoded values of some settings in web installer, not with having OpenID enabled or not.

@strk
Copy link
Member

strk commented Nov 28, 2017 via email

@strk
Copy link
Member

strk commented Nov 28, 2017 via email

@0rzech
Copy link
Contributor Author

0rzech commented Nov 28, 2017

Actually, MySQL is not hardcoded and neither seems 'git' user. Nevertheless there are other hardcoded settings indeed.

@strk
Copy link
Member

strk commented Nov 28, 2017 via email

@0rzech
Copy link
Contributor Author

0rzech commented Nov 28, 2017

I recommend you run the setup process few times with changing various app.ini settings to see what's hardcoded and what's not. I am able to change database settings just by modifying app.ini before starting web installer. I think I was able to do that with run user too, but I don't remember now that well.

Install defaults may differ from runtime defaults, yes, but defaults != hardcodes. As of now, some settings can be changed successfully by modyfying app.ini before running web installer, while other values are silently ignored and hardcoded into it. And that should not happen.

App.ini should be loaded in whole, not in part - especially that some settings are not available in web installer at all. And even if they were, a user should not be forced to always click through some settings when custom app.ini is provided.

@strk
Copy link
Member

strk commented Nov 28, 2017 via email

@0rzech
Copy link
Contributor Author

0rzech commented Nov 28, 2017

Thank you for explanation, "silently ignored" is the key here, would be clearly a bug.

You're welcome, but still the key here is "ignored at all". I wouldn't consider it fine behavior to "ignore loudly" either.

Presence of a setting should be honoured.

Yes, very much this.

Please try my PR as of commit 6c8ff4a and let me know how you like it.

Thanks. I'll post my results once done some simple tests.

strk added a commit to strk/gitea that referenced this issue Nov 29, 2017
@0rzech
Copy link
Contributor Author

0rzech commented Nov 29, 2017

@lafriks This issue should not be closed yet, because there are still other hardcoded values in web installer.

@lafriks
Copy link
Member

lafriks commented Nov 29, 2017

@0rzech this was closed automatically when I merged PR :)

@lafriks lafriks reopened this Nov 29, 2017
@0rzech
Copy link
Contributor Author

0rzech commented Nov 29, 2017

@lafriks Ah, sorry then. ;) Github should not do automated tasks under disguise of people. ;)

@0rzech
Copy link
Contributor Author

0rzech commented Dec 1, 2017

@strk I've run web installer with your changes and my OpenID preferences were respected. Thanks.

@lunny
Copy link
Member

lunny commented Dec 5, 2017

@0rzech anything left on this issue?

@0rzech
Copy link
Contributor Author

0rzech commented Dec 5, 2017

@lunny I think there is. There are whole groups of settings related to logging not covered by installer, for instance. As of now, the GUI supports file type only.

@lafriks lafriks modified the milestones: 1.4.0, 1.5.0 Jan 15, 2018
@lunny lunny modified the milestones: 1.5.0, 1.6.0 May 11, 2018
@lafriks lafriks modified the milestones: 1.6.0, 1.7.0 Sep 16, 2018
@lafriks lafriks modified the milestones: 1.7.0, 1.8.0 Dec 27, 2018
@lafriks lafriks modified the milestones: 1.8.0, 1.x.x Feb 19, 2019
@stale
Copy link

stale bot commented Apr 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Apr 20, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Apr 20, 2019
@stale stale bot removed the issue/stale label Apr 20, 2019
@lunny lunny removed this from the 1.x.x milestone Apr 13, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants