-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION #1369
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
Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION #1369
Conversation
Omit the configuration variable (the default) to be dependent. Fixes go-gitea#1363
LGTM |
LGTM |
drone reporting broken ? build was successful... |
(comment fixed this - ready to merge) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few thoughts
@@ -203,7 +203,8 @@ IMPORT_LOCAL_PATHS = false | |||
; Whether to allow signin in via OpenID | |||
ENABLE_OPENID_SIGNIN = true | |||
; Whether to allow registering via OpenID | |||
ENABLE_OPENID_SIGNUP = true | |||
; Do not include to rely on DISABLE_REGISTRATION setting | |||
;ENABLE_OPENID_SIGNUP = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not default this to %(DISABLE_REGISTRATION)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would only work if it's renamed to DISABLE_OPENID_SIGNUP
, which kinda makes sense anyhow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, I didn't know about %(DISABLE_REGISTRATION) - would that use the value of DISABLE_REGISTRATION found under custom
dir too ?
Renaming a variable would be a compatibility break, then we'd need to migrate config files ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrating variablenames could be done by removing the old default from conf/app.ini
but load it from custom/conf/app.ini
if it exists. then cfg = oldVar; if exists(newVar) { cfg = newVar }
in LoadConfig
. Maybe throw a deprication warning. So no migration needed. And would make the config defautls easier. Since ENABLE_OPENID_SIGNUP = ! DISABLE_REGISTRATION
which I don't think you can do in ini
format 😒
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are migration scripts allowed to modify stuff under custom/ ?
In general, is Gitea binary supposed to have write privilege in that dir ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkcsoft I just realized it doesn't take write access to custom/
to do what you're asking, which is basically still support the old variable in custom if present. Sounds a bit complex though, is that still worth the advantage being the possibility to write DISABLE_OPENID_REGISTRATION = %DISABLE_REGISTRATION
in custom/conf/app.ini
?
I think this is good enough to be merged. Has 2 LGTM and passed Drone. Fixes #1363 so please merge |
Omit the configuration variable (the default) to be dependent.
Fixes #1363