mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-15 00:01:25 -04:00
Compare commits
3 Commits
4bc6bfb476
...
d9d3f5234e
Author | SHA1 | Date | |
---|---|---|---|
|
d9d3f5234e | ||
|
7d7ba76c08 | ||
|
e76b3f72b2 |
@ -282,6 +282,9 @@ func loadCommonSettingsFrom(cfg ConfigProvider) {
|
||||
loadLogFrom(cfg)
|
||||
loadServerFrom(cfg)
|
||||
loadSSHFrom(cfg)
|
||||
|
||||
mustCurrentRunUserMatch(cfg) // it depends on the SSH config, only non-builtin SSH server requires this check
|
||||
|
||||
loadOAuth2From(cfg)
|
||||
loadSecurityFrom(cfg)
|
||||
loadAttachmentFrom(cfg)
|
||||
@ -314,14 +317,6 @@ func loadRunModeFrom(rootCfg ConfigProvider) {
|
||||
RunMode = rootSec.Key("RUN_MODE").MustString("prod")
|
||||
}
|
||||
IsProd = strings.EqualFold(RunMode, "prod")
|
||||
// Does not check run user when the install lock is off.
|
||||
installLock := rootCfg.Section("security").Key("INSTALL_LOCK").MustBool(false)
|
||||
if installLock {
|
||||
currentUser, match := IsRunUserMatchCurrentUser(RunUser)
|
||||
if !match {
|
||||
log.Fatal("Expect user '%s' but current user is: %s", RunUser, currentUser)
|
||||
}
|
||||
}
|
||||
|
||||
// check if we run as root
|
||||
if os.Getuid() == 0 {
|
||||
@ -333,6 +328,17 @@ func loadRunModeFrom(rootCfg ConfigProvider) {
|
||||
}
|
||||
}
|
||||
|
||||
func mustCurrentRunUserMatch(rootCfg ConfigProvider) {
|
||||
// Does not check run user when the "InstallLock" is off.
|
||||
installLock := rootCfg.Section("security").Key("INSTALL_LOCK").MustBool(false)
|
||||
if installLock {
|
||||
currentUser, match := IsRunUserMatchCurrentUser(RunUser)
|
||||
if !match {
|
||||
log.Fatal("Expect user '%s' but current user is: %s", RunUser, currentUser)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CreateOrAppendToCustomConf creates or updates the custom config.
|
||||
// Use the callback to set individual values.
|
||||
func CreateOrAppendToCustomConf(purpose string, callback func(cfg *ini.File)) {
|
||||
|
@ -1226,7 +1226,7 @@ func RegisterRoutes(m *web.Route) {
|
||||
}, repo.MustBeNotEmpty, reqRepoCodeReader, context.RepoRefByType(context.RepoRefTag, true))
|
||||
m.Post("/tags/delete", repo.DeleteTag, reqSignIn,
|
||||
repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoCodeWriter, context.RepoRef())
|
||||
}, reqSignIn, context.RepoAssignment, context.UnitTypes())
|
||||
}, ignSignIn, context.RepoAssignment, context.UnitTypes())
|
||||
|
||||
// Releases
|
||||
m.Group("/{username}/{reponame}", func() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="ui container user-cards">
|
||||
<div class="user-cards">
|
||||
{{if .CardsTitle}}
|
||||
<h2 class="ui dividing header">
|
||||
{{.CardsTitle}}
|
||||
|
@ -1,6 +1,8 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository watchers">
|
||||
{{template "repo/header" .}}
|
||||
{{template "repo/user_cards" .}}
|
||||
<div class="ui container">
|
||||
{{template "repo/user_cards" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user