Skip to content

Commit aee8834

Browse files
committed
Disable run user change in installation page
1 parent 90b3b3d commit aee8834

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ repo_path_helper = Remote Git repositories will be saved to this directory.
224224
lfs_path = Git LFS Root Path
225225
lfs_path_helper = Files tracked by Git LFS will be stored in this directory. Leave empty to disable.
226226
run_user = Run As Username
227-
run_user_helper = Enter the operating system username that Gitea runs as. Note that this user must have access to the repository root path.
227+
run_user_helper = The operating system username that Gitea runs as. Note that this user must have access to the repository root path.
228228
domain = Server Domain
229229
domain_helper = Domain or host address for the server.
230230
ssh_port = SSH Server Port

routers/install/install.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,13 @@ func Install(ctx *context.Context) {
120120

121121
// Note(unknown): it's hard for Windows users change a running user,
122122
// so just use current one if config says default.
123-
if setting.IsWindows && setting.RunUser == "git" {
124-
form.RunUser = user.CurrentUsername()
125-
} else {
123+
if setting.RunUser != "" {
126124
form.RunUser = setting.RunUser
125+
} else {
126+
form.RunUser = user.CurrentUsername()
127+
if form.RunUser == "" {
128+
form.RunUser = "git"
129+
}
127130
}
128131

129132
form.Domain = setting.Domain

templates/install.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
</div>
120120
<div class="inline required field {{if .Err_RunUser}}error{{end}}">
121121
<label for="run_user">{{.locale.Tr "install.run_user"}}</label>
122-
<input id="run_user" name="run_user" value="{{.run_user}}" required>
122+
<input id="run_user" name="run_user" value="{{.run_user}}" disabled>
123123
<span class="help">{{.locale.Tr "install.run_user_helper"}}</span>
124124
</div>
125125
<div class="inline required field">

0 commit comments

Comments
 (0)