81d065b9bb
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Universal: PR Check / Validate PR (pull_request) Successful in 9s
Generic: Project CI / Lint & Validate (pull_request) Successful in 32s
Generic: Standards Compliance / Secret Scanning (push) Failing after 9s
Universal: PR Check / Secret Scan (pull_request) Successful in 51s
Generic: Standards Compliance / License Header Validation (push) Successful in 9s
Generic: Standards Compliance / Repository Structure Validation (push) Successful in 8s
Generic: Standards Compliance / Coding Standards Check (push) Successful in 10s
Generic: Standards Compliance / Workflow Configuration Check (push) Failing after 9s
Generic: Standards Compliance / Documentation Quality Check (push) Successful in 8s
Generic: Standards Compliance / README Completeness Check (push) Failing after 7s
Generic: Standards Compliance / Version Consistency Check (push) Successful in 1m2s
Generic: Standards Compliance / Script Integrity Validation (push) Successful in 26s
Generic: Standards Compliance / Git Repository Hygiene (push) Successful in 1m5s
Generic: Standards Compliance / File Naming Standards (push) Successful in 10s
Generic: Standards Compliance / Line Length Check (push) Successful in 23s
Generic: Standards Compliance / Insecure Code Pattern Detection (push) Successful in 10s
Generic: Standards Compliance / Code Complexity Analysis (push) Successful in 1m2s
Generic: Standards Compliance / Code Duplication Detection (push) Successful in 1m8s
Generic: Standards Compliance / Dead Code Detection (push) Successful in 16s
Generic: Standards Compliance / File Size Limits (push) Successful in 16s
Generic: Standards Compliance / TODO/FIXME Tracking (push) Successful in 14s
Generic: Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 1m3s
Deploy (Prod) / Build & Deploy to Prod (push) Successful in 5m9s
Generic: Standards Compliance / Broken Link Detection (push) Successful in 12s
Generic: Standards Compliance / API Documentation Coverage (push) Successful in 7s
Generic: Standards Compliance / Accessibility Check (push) Successful in 7s
Generic: Standards Compliance / Performance Metrics (push) Successful in 8s
Generic: Standards Compliance / Binary File Detection (push) Successful in 2m12s
Generic: Standards Compliance / Unused Dependencies Check (push) Successful in 55s
Generic: Standards Compliance / Terraform Configuration Validation (push) Successful in 12s
Generic: Standards Compliance / Enterprise Readiness Check (push) Successful in 55s
Generic: Standards Compliance / Repository Health Check (push) Successful in 54s
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Standards Compliance / Compliance Summary (push) Has been cancelled
Comprehensive MokoGIT theme/branding built from the authoritative mokoconsulting.tech
design tokens (MokoOnyx *.custom.css):
- Theme: replace gitea themes entirely with theme-mokogit-{light,dark,auto} (default
mokogit-auto); brand tokens (primary #010156 / accent #3f8ff0, navy nav+footer #112855,
semantic palette); mokogit-brand.css component reskin; runtime custom-stylesheet override
hook (templates/custom/header.tmpl -> mokogit-custom.css, re-skin live with no rebuild).
- Font Awesome 7 Free 7.1.0: vendored unmodified (CSS headers intact + webfonts + verbatim
LICENSE.txt), license-compliant for distribution/white-label (Icons CC BY 4.0, Fonts SIL
OFL 1.1, Code MIT); attributed in THIRD-PARTY-NOTICES.md, README, and wiki.
- Light/dark toggle: navbar sun/moon control, server-persisted via the existing
/user/settings/appearance/theme endpoint (anonymous falls back to localStorage).
- Accessibility menu: 6 options (text resize, color invert, high contrast, link highlight,
readable font, pause animations); localStorage-persisted, applied on <html>, ARIA/keyboard.
- PWA: service worker (network-first navigation + cached offline fallback) + branded offline
page + enhanced manifest (display standalone, navy theme_color, app shortcuts); manifest
icon sourced from the site-admin branding icon if set, else the bundled MokoGIT logo.
Verified: `go build ./...` and `vite build` both green; only mokogit themes emit.
186 lines
5.6 KiB
Go
186 lines
5.6 KiB
Go
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package setting
|
|
|
|
import (
|
|
"time"
|
|
|
|
"code.mokoconsulting.tech/MokoConsulting/MokoGIT/modules/container"
|
|
"code.mokoconsulting.tech/MokoConsulting/MokoGIT/modules/log"
|
|
)
|
|
|
|
// UI settings
|
|
var UI = struct {
|
|
ExplorePagingNum int
|
|
SitemapPagingNum int
|
|
IssuePagingNum int
|
|
RepoSearchPagingNum int
|
|
MembersPagingNum int
|
|
FeedMaxCommitNum int
|
|
FeedPagingNum int
|
|
PackagesPagingNum int
|
|
GraphMaxCommitNum int
|
|
CodeCommentLines int
|
|
ReactionMaxUserNum int
|
|
MaxDisplayFileSize int64
|
|
ShowUserEmail bool
|
|
DefaultTheme string
|
|
Themes []string
|
|
FileIconTheme string
|
|
FolderIconTheme string
|
|
Reactions []string
|
|
ReactionsLookup container.Set[string] `ini:"-"`
|
|
CustomEmojis []string
|
|
CustomEmojisMap map[string]string `ini:"-"`
|
|
EnabledEmojis []string
|
|
EnabledEmojisSet container.Set[string] `ini:"-"`
|
|
SearchRepoDescription bool
|
|
OnlyShowRelevantRepos bool
|
|
ExploreDefaultSort string `ini:"EXPLORE_PAGING_DEFAULT_SORT"`
|
|
PreferredTimestampTense string
|
|
|
|
AmbiguousUnicodeDetection bool
|
|
|
|
// TODO: DefaultShowFullName is introduced by https://github.com/go-gitea/gitea/pull/6710
|
|
// But there are still many edge cases:
|
|
// * Many places still use "username", not respecting this setting
|
|
// * Many places use "Full Name" if it is not empty, cause inconsistent UI for users who have set their full name but some others don't
|
|
// * Even if DefaultShowFullName=false, many places still need to show the full name
|
|
// For most cases, either "username" or "username (Full Name)" should be used and are good enough.
|
|
// Only in very few cases (e.g.: unimportant lists, narrow layout), "username" or "Full Name" can be used.
|
|
DefaultShowFullName bool
|
|
|
|
Notification struct {
|
|
MinTimeout time.Duration
|
|
TimeoutStep time.Duration
|
|
MaxTimeout time.Duration
|
|
EventSourceUpdateTime time.Duration
|
|
} `ini:"ui.notification"`
|
|
|
|
SVG struct {
|
|
Enabled bool `ini:"ENABLE_RENDER"`
|
|
} `ini:"ui.svg"`
|
|
|
|
CSV struct {
|
|
MaxFileSize int64
|
|
MaxRows int
|
|
} `ini:"ui.csv"`
|
|
|
|
Admin struct {
|
|
UserPagingNum int
|
|
RepoPagingNum int
|
|
NoticePagingNum int
|
|
OrgPagingNum int
|
|
} `ini:"ui.admin"`
|
|
User struct {
|
|
RepoPagingNum int
|
|
OrgPagingNum int
|
|
} `ini:"ui.user"`
|
|
Meta struct {
|
|
Author string
|
|
Description string
|
|
Keywords string
|
|
} `ini:"ui.meta"`
|
|
}{
|
|
ExplorePagingNum: 20,
|
|
SitemapPagingNum: 20,
|
|
IssuePagingNum: 20,
|
|
RepoSearchPagingNum: 20,
|
|
MembersPagingNum: 20,
|
|
FeedMaxCommitNum: 5,
|
|
FeedPagingNum: 20,
|
|
PackagesPagingNum: 20,
|
|
GraphMaxCommitNum: 100,
|
|
CodeCommentLines: 4,
|
|
ReactionMaxUserNum: 10,
|
|
MaxDisplayFileSize: 8388608,
|
|
DefaultTheme: `mokogit-auto`,
|
|
FileIconTheme: `material`,
|
|
FolderIconTheme: `basic`,
|
|
Reactions: []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`},
|
|
CustomEmojis: []string{`git`, `gitea`, `codeberg`, `gitlab`, `github`, `gogs`},
|
|
CustomEmojisMap: map[string]string{"git": ":git:", "gitea": ":gitea:", "codeberg": ":codeberg:", "gitlab": ":gitlab:", "github": ":github:", "gogs": ":gogs:"},
|
|
ExploreDefaultSort: "recentupdate",
|
|
PreferredTimestampTense: "mixed",
|
|
|
|
AmbiguousUnicodeDetection: true,
|
|
|
|
Notification: struct {
|
|
MinTimeout time.Duration
|
|
TimeoutStep time.Duration
|
|
MaxTimeout time.Duration
|
|
EventSourceUpdateTime time.Duration
|
|
}{
|
|
MinTimeout: 10 * time.Second,
|
|
TimeoutStep: 10 * time.Second,
|
|
MaxTimeout: 60 * time.Second,
|
|
EventSourceUpdateTime: 10 * time.Second,
|
|
},
|
|
SVG: struct {
|
|
Enabled bool `ini:"ENABLE_RENDER"`
|
|
}{
|
|
Enabled: true,
|
|
},
|
|
CSV: struct {
|
|
MaxFileSize int64
|
|
MaxRows int
|
|
}{
|
|
MaxFileSize: 524288,
|
|
MaxRows: 2500,
|
|
},
|
|
Admin: struct {
|
|
UserPagingNum int
|
|
RepoPagingNum int
|
|
NoticePagingNum int
|
|
OrgPagingNum int
|
|
}{
|
|
UserPagingNum: 50,
|
|
RepoPagingNum: 50,
|
|
NoticePagingNum: 25,
|
|
OrgPagingNum: 50,
|
|
},
|
|
User: struct {
|
|
RepoPagingNum int
|
|
OrgPagingNum int
|
|
}{
|
|
RepoPagingNum: 15,
|
|
OrgPagingNum: 15,
|
|
},
|
|
Meta: struct {
|
|
Author string
|
|
Description string
|
|
Keywords string
|
|
}{
|
|
Author: "Gitea - Git with a cup of tea",
|
|
Description: "Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go",
|
|
Keywords: "go,git,self-hosted,gitea",
|
|
},
|
|
}
|
|
|
|
func loadUIFrom(rootCfg ConfigProvider) {
|
|
mustMapSetting(rootCfg, "ui", &UI)
|
|
sec := rootCfg.Section("ui")
|
|
UI.ShowUserEmail = sec.Key("SHOW_USER_EMAIL").MustBool(true)
|
|
UI.DefaultShowFullName = sec.Key("DEFAULT_SHOW_FULL_NAME").MustBool(false)
|
|
UI.SearchRepoDescription = sec.Key("SEARCH_REPO_DESCRIPTION").MustBool(true)
|
|
|
|
if UI.PreferredTimestampTense != "mixed" && UI.PreferredTimestampTense != "absolute" {
|
|
log.Fatal("ui.PREFERRED_TIMESTAMP_TENSE must be either 'mixed' or 'absolute'")
|
|
}
|
|
|
|
// OnlyShowRelevantRepos=false is important for many private/enterprise instances,
|
|
// because many private repositories do not have "description/topic", users just want to search by their names.
|
|
UI.OnlyShowRelevantRepos = sec.Key("ONLY_SHOW_RELEVANT_REPOS").MustBool(false)
|
|
|
|
UI.ReactionsLookup = make(container.Set[string])
|
|
for _, reaction := range UI.Reactions {
|
|
UI.ReactionsLookup.Add(reaction)
|
|
}
|
|
UI.CustomEmojisMap = make(map[string]string)
|
|
for _, emoji := range UI.CustomEmojis {
|
|
UI.CustomEmojisMap[emoji] = ":" + emoji + ":"
|
|
}
|
|
UI.EnabledEmojisSet = container.SetOf(UI.EnabledEmojis...)
|
|
}
|