Compare commits

..

No commits in common. "d9d3f5234e45e25e3fbb922b65082770e49a58de" and "4bc6bfb476d9cb42cfc4e0ccfd76adc90cf7644b" have entirely different histories.

4 changed files with 11 additions and 19 deletions

View File

@ -282,9 +282,6 @@ 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)
@ -317,6 +314,14 @@ 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 {
@ -328,17 +333,6 @@ 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)) {

View 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())
}, ignSignIn, context.RepoAssignment, context.UnitTypes())
}, reqSignIn, context.RepoAssignment, context.UnitTypes())
// Releases
m.Group("/{username}/{reponame}", func() {

View File

@ -1,4 +1,4 @@
<div class="user-cards">
<div class="ui container user-cards">
{{if .CardsTitle}}
<h2 class="ui dividing header">
{{.CardsTitle}}

View File

@ -1,8 +1,6 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content repository watchers">
{{template "repo/header" .}}
<div class="ui container">
{{template "repo/user_cards" .}}
</div>
{{template "repo/user_cards" .}}
</div>
{{template "base/footer" .}}