-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add post-installation redirect based on admin account status #34493
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
base: main
Are you sure you want to change the base?
Conversation
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't speak on frontend design, but otherwise this looks good to me.
Was iffy about the HasUsers()
calls ignoring DB errors, but after further reading it seems the worst that can happen is:
- User accesses sign up page (or completes the install config if they're on the install page)
- A DB error occurs
- Server sends sign up page + the
sign_up_tip
message to the user
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.
Looks good!
And also please review admin related bug fix: Fix last admin check when syncing users #34649 |
@@ -421,6 +421,7 @@ remember_me.compromised = The login token is not valid anymore which may indicat | |||
forgot_password_title= Forgot Password | |||
forgot_password = Forgot password? | |||
need_account = Need an account? | |||
sign_up_tip = You are registering the first account in the system, which has administrator privileges. Please carefully remember your username and password, as forgetting these credentials may require system reset and reinitialization. |
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.
as forgetting these credentials may require system reset and reinitialization.
That's not true, site admin can use gitea
CLI to reset user password
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.
You are registering the first account in the system. Please remember your username and password, as this account typically has administrative privileges.
How about this? Is it okay?
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.
imo the wording is fine..? If the sysadmin and the first registered user are not the same person (e.g. as a SaaS platform without terminal access), the first registered user may not be able to access the gitea
cli.
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.
the first registered user may not be able to access the
gitea
cli.
- Why they can't contact their site admin with CLI access?
- If the "first" user doesn't have CLI access, then how could they do "system reset and reinitialization" as the message says if they forget password?
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.
e.g. as a SaaS platform without terminal access
As a SaaS platform, isn't there a separate instance management console to help to reset the password? For example, gitea cloud?
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.
If the "first" user doesn't have CLI access, then how could they do "system reset and reinitialization" as the message says if they forget password?
The first user who accessed the webpage to register account might not be the same person who does sysadmin. The person also might be able to reach out to a separated sysadmin person/team to do "system reset and reinitialization", by either via email or other method they have.
What I mean is since the copywriting is "may", so it's likely fine (or maybe we can also change it to "might"). We simply cannot assume the person who control site admin account is the same person who can access the server console to use gitea
cli.
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.
Looks like it needs more consideration. I think it could be another issue to not block this pull request.
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.
not block this pull request.
The message should be clear and should not confuse or frighten end users.
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.
You are registering the first account in the system, which has administrator privileges. Please carefully remember your username and password.
How about this?
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.
What about If you forget the username or password, please refer to the Gitea documentation ....
The two approaches could be clearly written in the docs:
- For a self-hosted instance, contact server admin to use cli or redeploy.
- For Gitea Cloud, use management console
This PR adds a feature to direct users to appropriate pages after system installation: