-
-
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
Open
kerwin612
wants to merge
10
commits into
go-gitea:main
Choose a base branch
from
kerwin612:feat/redirect-after-install
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+32
−4
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
495cae8
feat: redirect to registration page for first-time admin setup after …
kerwin612 3e3316f
fix
kerwin612 a60a722
fix
kerwin612 b10dfae
Merge branch 'main' into feat/redirect-after-install
kerwin612 bfaa8c5
Merge branch 'main' into feat/redirect-after-install
kerwin612 3a3d951
fix
wxiaoguang a493591
better html id
wxiaoguang 2eefd69
fix lint
wxiaoguang f8bf359
Optimize the sign_up_tip
kerwin612 5095cf8
Merge branch 'main' into feat/redirect-after-install
kerwin612 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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's not true, site admin can use
gitea
CLI to reset user passwordThere 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.
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 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.
Do you have a complete and feasible plan? For example: some users use the "install" page, while some others don't, they just prepare the app.ini manually and set INSTALL_LOCK=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.
Yes. There are only two ways to install Gitea.
If we changed the rule that the first user is admin. Then for web installation, an admin account creation should be required. For command line installation, they have to create the first user from command line
gitea admin
instead of registering the first account from web UI.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.
Does helmchart also work this way?
Uh oh!
There was an error while loading. Please reload this page.
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 can make the helmchart skip admin user creation from CLI
Yes by default yes it follows the cli setup and admin creation from
gitea admin
, but it seems to be currently possible to change yourvalues.yml
to set the admin username/password to an empty string instead of using the preset admin username & password.In that case you could indeed end up in a without admin user state in the helm chart and have to attach via kubectl to the gitea container for the admin account, but you can just update the admin password / create the admin later as well by redeploying/updating the helmchart.
Ref: https://gitea.com/gitea/helm-gitea/src/commit/0d532363ebef69e2baedbb8b9370519b373b5394/templates/gitea/init.yaml#L82, https://gitea.com/gitea/helm-gitea/src/commit/0d532363ebef69e2baedbb8b9370519b373b5394/values.yaml#L353
Uh oh!
There was an error while loading. Please reload this page.
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 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.