Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ var (
Value: "",
Usage: "New password to set for user",
},
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
},
}

Expand Down Expand Up @@ -123,6 +128,10 @@ func runChangePassword(c *cli.Context) error {
return err
}

if c.IsSet("config") {
setting.CustomConf = c.String("config")
}

if err := initDB(); err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions docs/content/doc/usage/command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Admin operations:
- Options:
- `--username value`, `-u value`: Username. Required.
- `--password value`, `-p value`: New password. Required.
- `--config path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
- Examples:
- `gitea admin change-password --username myname --password asecurepassword`
- `regenerate`
Expand Down