Skip to content

Remove outdated RunUser logic#37180

Merged
wxiaoguang merged 2 commits intogo-gitea:mainfrom
wxiaoguang:fix-run-user
Apr 12, 2026
Merged

Remove outdated RunUser logic#37180
wxiaoguang merged 2 commits intogo-gitea:mainfrom
wxiaoguang:fix-run-user

Conversation

@wxiaoguang
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang commented Apr 11, 2026

That logic is from 2014~2015 gogs/gogs#660, it unclear why it is necessary or whether it is still needed (whether Windows is still special)

The comment "so just use current one if config says default" is not right anymore: "git" isn't the "default" value of RunUser (Comment out app.example.ini #15807). The RunUser's value is from current session's username.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 11, 2026
@wxiaoguang wxiaoguang requested a review from Copilot April 11, 2026 17:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the installation flow to reflect current RUN_USER semantics (defaulting to the current OS user via user.CurrentUsername()), removing outdated Windows-specific logic and an install-time validation that no longer aligns with how RUN_USER is determined.

Changes:

  • Simplifies install page defaults by always using setting.RunUser for the RunUser form field.
  • Removes the install-time “run user must match current user” validation and deletes the now-unused install.run_user_not_match en-US locale entry.
  • Improves the startup fatal log message when the configured RUN_USER doesn’t match the current user.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
routers/install/install.go Removes outdated Windows RunUser override and drops install-time run-user mismatch validation.
options/locale/locale_en-US.json Removes the no-longer-referenced install.run_user_not_match translation key.
modules/setting/setting.go Clarifies the fatal log message emitted when RUN_USER mismatches the running OS user after install lock.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread options/locale/locale_en-US.json
Comment thread modules/setting/setting.go
@github-actions github-actions Bot added the docs-update-needed The document needs to be updated synchronously label Apr 11, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 11, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 11, 2026
wxiaoguang added a commit to GiteaBot/gitea that referenced this pull request Apr 12, 2026
@wxiaoguang wxiaoguang enabled auto-merge (squash) April 12, 2026 02:23
@wxiaoguang wxiaoguang merged commit c2fa157 into go-gitea:main Apr 12, 2026
26 checks passed
@GiteaBot GiteaBot added this to the 1.27.0 milestone Apr 12, 2026
lunny pushed a commit that referenced this pull request Apr 13, 2026
…, #37180) (#37184)

Backport #37175 by @silverwind

The `Run As Username` field on the install page was a `readonly` input
that looked editable but wasn't, confusing users. Style `readonly`
inputs with a subtle background, matching other frameworks.

<img width="735" height="131" alt="image"
src="https://github.com/user-attachments/assets/cb76ce71-faab-4300-811e-e4c503b59f9a"
/>

Backport #37180

The comment "so just use current one if config says default" is not
right anymore: "git" isn't the "default" value of RunUser (Comment out
app.example.ini #15807). The RunUser's value is from current session's
username.

Fixes #37174

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@wxiaoguang wxiaoguang deleted the fix-run-user branch April 14, 2026 05:33
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 14, 2026
* main:
  Add comment for the design of "user activity time" (go-gitea#37195)
  fix(api): handle missing base branch in PR commits API (go-gitea#37193)
  Refactor htmx and fetch-action related code (go-gitea#37186)
  Fix encoding for Matrix Webhooks (go-gitea#37190)
  Always show owner/repo name in compare page dropdowns (go-gitea#37172)
  fix(api): handle fork-only commits in compare API (go-gitea#37185)
  Improve Contributing docs and set a release schedule (go-gitea#37109)
  Update Nix flake (go-gitea#37183)
  Remove outdated RunUser logic (go-gitea#37180)
  Refactor flash message and remove SanitizeHTML template func (go-gitea#37179)
  Indicate form field readonly via background (go-gitea#37175)
  Remove dead CSS rules (go-gitea#37173)
  Fix flaky `TestCatFileBatch/QueryTerminated` test (go-gitea#37159)
  Implement logout redirection for reverse proxy auth setups (go-gitea#36085)
  Add missing `//nolint:depguard` (go-gitea#37162)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-update-needed The document needs to be updated synchronously lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants