How do I enable password reset ? #936

Closed
opened 2025-11-02 03:42:20 -06:00 by GiteaMirror · 19 comments
Owner

Originally created by @freedomtrain on GitHub (Aug 2, 2017).

How do I enable password reset ?

Thanks

Originally created by @freedomtrain on GitHub (Aug 2, 2017). How do I enable password reset ? Thanks
GiteaMirror added the type/question label 2025-11-02 03:42:20 -06:00
Author
Owner

@lunny commented on GitHub (Aug 3, 2017):

Password reset is enabled default.

@lunny commented on GitHub (Aug 3, 2017): Password reset is enabled default.
Author
Owner

@captn3m0 commented on GitHub (Dec 25, 2017):

You can reset password using the command line as well: gitea admin change-password --username username --password PASSWORD

@captn3m0 commented on GitHub (Dec 25, 2017): You can reset password using the command line as well: `gitea admin change-password --username username --password PASSWORD`
Author
Owner

@pinpox commented on GitHub (Jul 6, 2018):

@lunny It is not on the installation with Arch linux's AUR. At least I get an error saying it is disabled.
The command gitea admin change-password --username username --password PASSWORD returns an error:

models.SetEngine: Failed to connect to database: Unknown database type: 
@pinpox commented on GitHub (Jul 6, 2018): @lunny It is not on the installation with Arch linux's AUR. At least I get an error saying it is disabled. The command `gitea admin change-password --username username --password PASSWORD` returns an error: ``` models.SetEngine: Failed to connect to database: Unknown database type: ```
Author
Owner

@lunny commented on GitHub (Jul 8, 2018):

you could use --config to indicate where is your app.ini

@lunny commented on GitHub (Jul 8, 2018): you could use --config to indicate where is your app.ini
Author
Owner

@Poikilos commented on GitHub (Jun 5, 2019):

@techknowlogick Why was this closed without an answer? There is no obvious setting in the sample app.ini: https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample

The comments above do not answer the question. The OP did not ask how to reset a password using the command line interface, nor whether enabling password reset was default, but how to turn on the password reset feature. I am on a gitea repo now and the admin does not know how to turn on password reset (so it clearly isn't on by default--he doesn't know how to change it). If I click reset password, it says:

Forgot Password
Password reset is disabled. Please contact your site administrator.

@Poikilos commented on GitHub (Jun 5, 2019): @techknowlogick Why was this closed without an answer? There is no obvious setting in the sample app.ini: <https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample> The comments above do not answer the question. The OP did not ask how to reset a password using the command line interface, nor whether enabling password reset was default, but how to turn on the password reset feature. I am on a gitea repo now and the admin does not know how to turn on password reset (so it clearly isn't on by default--he doesn't know how to change it). If I click reset password, it says: > **Forgot Password** > Password reset is disabled. Please contact your site administrator.
Author
Owner

@dipyalov commented on GitHub (Jul 19, 2019):

I support @poikilos. Why is this a closed issue? I'm facing the same problem with no clue which config option to change.

@dipyalov commented on GitHub (Jul 19, 2019): I support @poikilos. Why is this a closed issue? I'm facing the same problem with no clue which config option to change.
Author
Owner

@alexanderadam commented on GitHub (Jul 19, 2019):

I'm not a maintainer but this string isn't even in the source code.

@dipyalov are you sure that you are using the latest version, because there was also this PR that was merged in April.

Why was this closed without an answer?

Did his suggestion (gitea admin change-password --username username --password PASSWORD --config CONFIG_PATH) not work?

@alexanderadam commented on GitHub (Jul 19, 2019): I'm not a maintainer but this string isn't even [in the source code](https://github.com/go-gitea/gitea/search?q=%22Password+reset+is%22&type=Code). @dipyalov are you sure that you are using the latest version, because there was also [this PR that was merged in April](https://github.com/go-gitea/gitea/pull/5042). > Why was this closed without an answer? Did his suggestion (`gitea admin change-password --username username --password PASSWORD --config CONFIG_PATH`) not work?
Author
Owner

@jolheiser commented on GitHub (Jul 19, 2019):

@poikilos @dipyalov Password reset is only considered enabled when a mail service is set up, as that's how Gitea currently sends the account recovery.

If no mail service is set up, I believe the CLI is the only other way to do it, or have your admin change it for you and then you change it again after regaining access.
It's not ideal, but I think perhaps a nice future feature would be to then allow admins to force users to change their password, similar to how the CLI does.

@jolheiser commented on GitHub (Jul 19, 2019): @poikilos @dipyalov Password reset is only considered enabled when a mail service is set up, as that's how Gitea currently sends the account recovery. If no mail service is set up, I believe the CLI is the only other way to do it, or have your admin change it for you and then you change it again after regaining access. It's not ideal, but I think perhaps a nice future feature would be to then allow admins to force users to change their password, similar to how the CLI does.
Author
Owner

@Poikilos commented on GitHub (Jul 20, 2019):

I was referring to Gitea Version: 1.8.1 (Go1.12.5). I'll tell him that lack of mail config may be the issue. Shouldn't the admin interface give some kind of warning (to configure mail) where the setting would be, instead of just hiding password reset the setting?

@Poikilos commented on GitHub (Jul 20, 2019): I was referring to Gitea Version: 1.8.1 (Go1.12.5). I'll tell him that lack of mail config may be the issue. Shouldn't the admin interface give some kind of warning (to configure mail) where the setting would be, instead of just hiding password reset the setting?
Author
Owner

@Poikilos commented on GitHub (Jul 20, 2019):

Did his suggestion (gitea admin change-password --username username --password PASSWORD --config CONFIG_PATH) not work?

@alexanderadam The whole point of this topic is that end users cannot reset their passwords. Again, this topic is not discussing manual intervention by admins.

@Poikilos commented on GitHub (Jul 20, 2019): > Did his suggestion (gitea admin change-password --username username --password PASSWORD --config CONFIG_PATH) not work? @alexanderadam The whole point of this topic is that _end users_ cannot reset their passwords. Again, this topic is not discussing manual intervention by admins.
Author
Owner

@alexanderadam commented on GitHub (Jul 21, 2019):

The whole point of this topic is that end users cannot reset their passwords.

Okay, then I probably misread binaryplease writing that he tested the admin command it without --config and got an error. 😉

this topic is not discussing manual intervention by admins

IMHO it isn't possible to do this on a misconfigured system.
Because you can't add the email configuration without being an admin and you can't execute the gitea command.

So either the admin adds the email configuration like described in the config cheat sheet or he uses the command captn3m0 wrote about.

Or, to make this clear: the whole point should is, that asking your admin should be the first step if you are an end user and you encounter some problems on a particular installation (which is not only true for gitea).

@alexanderadam commented on GitHub (Jul 21, 2019): > The whole point of this topic is that end users cannot reset their passwords. Okay, then I probably misread **binaryplease** writing that he tested the admin command it without `--config` and got an error. :wink: > this topic is not discussing manual intervention by admins IMHO it isn't possible to do this on a misconfigured system. Because you can't add the email configuration without being an admin and you can't execute the gitea command. So either the admin [adds the email configuration like described in the config cheat sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#mailer-mailer) or he uses [the command **captn3m0** wrote about](https://github.com/go-gitea/gitea/issues/2247#issuecomment-353866212). Or, to make this clear: the whole point should is, that asking your admin should be the first step if you are an end user and you encounter some problems on a particular installation (which is not only true for gitea).
Author
Owner

@Poikilos commented on GitHub (Jul 21, 2019):

@alexanderadam

Okay, then I probably misread binaryplease writing that he tested the admin command it without --config and got an error. 😉

He's not the OP, and the command isn't something "disabled" (just malfunctioning in the case of one reply, which is off topic or a workaround at best). There is no need to be snarky. The issue is clear, and I've not misunderstood it, unless you or the OP can point to where there is a setting that disables the CLI workaround.

So either the admin adds the email configuration like described in the config cheat sheet or he uses the command captn3m0 wrote about.
Or, to make this clear: the whole point should is, that asking your admin should be the first step if you are an end user and you encounter some problems on a particular installation (which is not only true for gitea).

The OP could be an admin, and the admin on my instance doesn't know how to enable it. I'll ask again: Shouldn't the admin interface give some kind of warning (to configure mail) where the setting would be, instead of just hiding the password reset setting (or is it just hidden from users, also without a warning to admins)?

@Poikilos commented on GitHub (Jul 21, 2019): @alexanderadam > Okay, then I probably misread **binaryplease** writing that he tested the admin command it without `--config` and got an error. 😉 He's not the OP, and the command isn't something "disabled" (just malfunctioning in the case of one reply, which is off topic or a workaround at best). There is no need to be snarky. The issue is clear, and I've not misunderstood it, unless you or the OP can point to where there is a setting that disables the CLI **workaround**. > So either the admin adds the email configuration like described in the config cheat sheet or he uses the command captn3m0 wrote about. > Or, to make this clear: the whole point should is, that asking your admin should be the first step if you are an end user and you encounter some problems on a particular installation (which is not only true for gitea). The OP could be an admin, and the admin on my instance doesn't know how to enable it. I'll ask again: Shouldn't the admin interface give some kind of warning (to configure mail) where the setting would be, instead of just hiding the password reset setting (or is it just hidden from users, also without a warning to admins)?
Author
Owner

@jolheiser commented on GitHub (Jul 22, 2019):

@poikilos There is no setting for password resets. It is considered "enabled" when a mail service is configured, and "disabled" otherwise, as far as I can tell.

Perhaps a better error message could be given, at least to admins?
Password reset is disabled. Please contact your site administrator. seems reasonable to give to a user, since they don't need to know the inner workings.
However, perhaps an admin should be given more context, such as Please set up a mailing configuration to enable Password Reset or something similar?

@jolheiser commented on GitHub (Jul 22, 2019): @poikilos There is no setting for password resets. It is considered "enabled" when a mail service is configured, and "disabled" otherwise, as far as I can tell. Perhaps a better error message could be given, at least to admins? `Password reset is disabled. Please contact your site administrator.` seems reasonable to give to a user, since they don't need to know the inner workings. However, perhaps an admin should be given more context, such as `Please set up a mailing configuration to enable Password Reset` or something similar?
Author
Owner

@VitaliyAT commented on GitHub (Aug 28, 2019):

When I try realize gitea admin change-password --username username --password PASSWORD
For me it's:
root@TestLab:/usr/local/gitea/gitea# ./gitea admin change-password --username gitea --password gitea --config ./conf/app.ini
I'v got this:
2019/08/28 22:14:26 ...s/setting/setting.go:831:NewContext() [F] Expect user 'gitea' but current user is: root

Try install and use Gitea on DSM Synology. First time it was OK - I'v got admin access, but after relogin "Wrong login or password". I already uninstall Gitea and reinstall it again - no luck, apologize all in data base.

It's looped problem. I need change password because it write me that it's wrong, but I can't change it because I need this password for change.

How can I reset all Gitea in my situation? I just in the beginning of it and can do it but don't know exactly how.

@VitaliyAT commented on GitHub (Aug 28, 2019): When I try realize `gitea admin change-password --username username --password PASSWORD` For me it's: ` root@TestLab:/usr/local/gitea/gitea# ./gitea admin change-password --username gitea --password gitea --config ./conf/app.ini` I'v got this: `2019/08/28 22:14:26 ...s/setting/setting.go:831:NewContext() [F] Expect user 'gitea' but current user is: root` Try install and use Gitea on DSM Synology. First time it was OK - I'v got admin access, but after relogin "Wrong login or password". I already uninstall Gitea and reinstall it again - no luck, apologize all in data base. It's looped problem. I need change password because it write me that it's wrong, but I can't change it because I need this password for change. How can I reset all Gitea in my situation? I just in the beginning of it and can do it but don't know exactly how.
Author
Owner

@jolheiser commented on GitHub (Aug 28, 2019):

root@TestLab:/usr/local/gitea/gitea# ./gitea admin change-password --username gitea --password gitea --config ./conf/app.ini

This command would be to change the Gitea user named gitea

2019/08/28 22:14:26 ...s/setting/setting.go:831:NewContext() [F] Expect user 'gitea' but current user is: root

This error is telling you that it is expecting you to run the command as the gitea system account rather than root.

For further help, would you mind opening a new issue so as not to add on to this closed one? 😃

@jolheiser commented on GitHub (Aug 28, 2019): > root@TestLab:/usr/local/gitea/gitea# ./gitea admin change-password --username gitea --password gitea --config ./conf/app.ini This command would be to change the Gitea user named `gitea` > 2019/08/28 22:14:26 ...s/setting/setting.go:831:NewContext() [F] Expect user 'gitea' but current user is: root This error is telling you that it is expecting you to run the command as the `gitea` system account rather than root. For further help, would you mind opening a new issue so as not to add on to this closed one? 😃
Author
Owner

@Poikilos commented on GitHub (Aug 28, 2019):

@VitaliyAT Please read the detailed posts above clarifying that "How do I enable password reset" (for end users) is not the same as "How do I reset a password" (as admin). Consider deleting your comment and posting it in a new issue as jolheiser suggested instead, so that your comment does not further muddy this issue nor bury jolhheiser's proposed solution to this issue.

@Poikilos commented on GitHub (Aug 28, 2019): @VitaliyAT Please read the detailed posts above clarifying that "How do I enable password reset" (for end users) is not the same as "How do I reset a password" (as admin). Consider deleting your comment and posting it in a new issue as jolheiser suggested instead, so that your comment does not further muddy this issue nor bury [jolhheiser's proposed solution](https://github.com/go-gitea/gitea/issues/2247#issuecomment-513620841) to this issue.
Author
Owner

@gewure commented on GitHub (Nov 8, 2019):

honestly, this issue and the way of communication here bugs me.

many reasons:
#1 why close this twice, when its not resolved, as a question?!
#2 "further muddy this issue". nono, its not the users who are to blame here. Show some respect for people trying to advance documentation of gitea and solve problems they have.
#3 generally: the very most people writing github issues try to solve a problem they already tried solving hard before. most people don't even write an issue then. Its maybe 1-5% of users who write at all --- and being greeted with "don't write!!" adds to the general mood of not asking. Which then results in more question, because none gives a **** about resolving the issues, as meant by the author (who, in most cases is no expert on the matter - because of lack of meaningful documentation).

Also "is enabled by default" is simply not true as an answer, because a working mailserver-conf is a requirement and that is by default not enabled.

@poikilos "this topic is not discussing manual intervention by admins." well then, to be honest: it should do so!!

Sorry to comment on a closed one, but .. not that much sorry. Just had the same problem, read the whole issue, am now not really any more informed, other than i got the impression one shouldn't ask questions/write issues ...and (funnily enough) even if someone understands what the real question is ("how to manually change password as admin"), there is NO answer to it ':D

like.. why bother with writing answers, if there is no verbose information in it? Not worth the typing.

whatever. Just my 2 Cents & impression, being a little frustrated. take it as feedback to improve.

@gewure commented on GitHub (Nov 8, 2019): honestly, this issue and the way of communication here bugs me. many reasons: #1 why close this twice, when its not resolved, as a question?! #2 "further muddy this issue". nono, its not the users who are to blame here. Show some respect for people trying to advance documentation of gitea and solve problems they have. #3 generally: the very most people writing github issues try to solve a problem they already tried solving hard before. most people don't even write an issue then. Its maybe 1-5% of users who write at all --- and being greeted with "don't write!!" adds to the general mood of not asking. Which then results in more question, because none gives a **** about resolving the issues, as meant by the author (who, in most cases is no expert on the matter - because of lack of meaningful documentation). Also "is enabled by default" is simply not true as an answer, because a working mailserver-conf is a requirement and that is by default not enabled. @poikilos "this topic is not discussing manual intervention by admins." well then, to be honest: it should do so!! Sorry to comment on a closed one, but .. not that much sorry. Just had the same problem, read the whole issue, am now not really any more informed, other than i got the impression one shouldn't ask questions/write issues ...and (funnily enough) even if someone understands what the *real* question is ("how to manually change password as admin"), there is NO answer to it ':D like.. why bother with writing answers, if there is no verbose information in it? Not worth the typing. whatever. Just my 2 Cents & impression, being a little frustrated. take it as feedback to improve.
Author
Owner

@jolheiser commented on GitHub (Nov 8, 2019):

For anyone who finds this issue, I would like to make another comment here at the bottom to address the aggregation of scenarios in this thread.

How can I enable password reset / How can a user's password be changed?

The original question

How can I enable password reset (for end users)?

There is no setting for password resets. It is considered "enabled" when a mail service is configured, and "disabled" otherwise.


How can a user's password be changed?

  • As an admin, you can change any user's password (and optionally force them to change it on next login)...
    • By navigating to your Site Administration -> User Accounts page and editing a user.
    • By using the CLI.
      Keep in mind most commands will also need a global flag to point the CLI at the correct configuration.
  • As a user you can change it...
    • In your account Settings -> Account page (this method requires you to know your password.) Maybe not entirely relevant to this thread, but posted here for completeness.
    • By using the Forgot Password link, assuming there is a configured mail service.
@jolheiser commented on GitHub (Nov 8, 2019): For anyone who finds this issue, I would like to make another comment here at the bottom to address the aggregation of scenarios in this thread. ## How can I enable password reset / How can a user's password be changed? The original question > How can I enable password reset (for end users)? There is no setting for password resets. It is considered "enabled" when a mail service is configured, and "disabled" otherwise. ----- > How can a user's password be changed? - As an **admin**, you can change any user's password (and optionally force them to change it on next login)... - By navigating to your `Site Administration -> User Accounts` page and editing a user. - By using the [CLI](https://docs.gitea.io/en-us/command-line/#admin). Keep in mind most commands will also need a [global flag](https://docs.gitea.io/en-us/command-line/#global-options) to point the CLI at the correct configuration. - As a **user** you can change it... - In your account `Settings -> Account` page (this method **requires** you to know your password.) Maybe not entirely relevant to this thread, but posted here for completeness. - By using the `Forgot Password` link, assuming there is a configured mail service.
Author
Owner

@Poikilos commented on GitHub (Nov 9, 2019):

@gewure,

  1. A different question was asked than the original issue. Posting separate issues will not help the issue get resolved. I'm not a maintainer and I'm not trying to be unwelcoming. I'm a user trying to get my problem solved. I didn't say for @VitaliyAT not to ask questions, I said post a separate issue, so both problems can get addressed instead of none.

  2. The maintainers posting how to change the password from the command line then closing the issue is a misunderstanding of the issue or need for GUI solutions or at least meaningful warnings pointing to a solution--see https://github.com/go-gitea/gitea/issues/2247#issuecomment-499055290 above, which led to me creating a separate issue: https://github.com/go-gitea/gitea/issues/8017. Closing the issue citing a command doesn't solve the original GUI problem, that's what was saying. It doesn't mean that command line tips are invalid, it just means they don't solve the issue. Again, I'm not trying to be unwelcoming. I'm a user trying to get my problem solved.

@Poikilos commented on GitHub (Nov 9, 2019): @gewure, 2. A different question was asked than the original issue. Posting separate issues will not help the issue get resolved. I'm not a maintainer and I'm not trying to be unwelcoming. I'm a user trying to get my problem solved. I didn't say for @VitaliyAT not to ask questions, I said post a separate issue, so both problems can get addressed instead of none. 3. The maintainers posting how to change the password from the command line then closing the issue is a misunderstanding of the issue or need for GUI solutions or at least meaningful warnings pointing to a solution--see <https://github.com/go-gitea/gitea/issues/2247#issuecomment-499055290> above, which led to me creating a separate issue: <https://github.com/go-gitea/gitea/issues/8017>. Closing the issue citing a command doesn't solve the original GUI problem, that's what was saying. It doesn't mean that command line tips are invalid, it just means they don't solve the issue. Again, I'm not trying to be unwelcoming. I'm a user trying to get my problem solved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#936