diff --git a/.air.toml b/.air.toml index af182697fb..d13f8c4f99 100644 --- a/.air.toml +++ b/.air.toml @@ -2,28 +2,12 @@ root = "." tmp_dir = ".air" [build] -pre_cmd = ["killall -9 gitea 2>/dev/null || true"] # kill off potential zombie processes from previous runs cmd = "make --no-print-directory backend" bin = "gitea" -delay = 2000 +delay = 1000 include_ext = ["go", "tmpl"] include_file = ["main.go"] include_dir = ["cmd", "models", "modules", "options", "routers", "services"] -exclude_dir = [ - "models/fixtures", - "models/migrations/fixtures", - "modules/avatar/identicon/testdata", - "modules/avatar/testdata", - "modules/git/tests", - "modules/migration/file_format_testdata", - "modules/markup/tests/repo/repo1_filepreview", - "routers/private/tests", - "services/gitdiff/testdata", - "services/migrations/testdata", - "services/webhook/sourcehut/testdata", -] +exclude_dir = ["modules/git/tests", "services/gitdiff/testdata", "modules/avatar/testdata", "models/fixtures", "models/migrations/fixtures", "modules/migration/file_format_testdata", "modules/avatar/identicon/testdata"] exclude_regex = ["_test.go$", "_gen.go$"] stop_on_error = true - -[log] -main_only = true diff --git a/.changelog.yml b/.changelog.yml new file mode 100644 index 0000000000..bfdee0c0ca --- /dev/null +++ b/.changelog.yml @@ -0,0 +1,57 @@ +# The full repository name +repo: go-gitea/gitea + +# Service type (gitea or github) +service: github + +# Base URL for Gitea instance if using gitea service type (optional) +# Default: https://gitea.com +base-url: + +# Changelog groups and which labeled PRs to add to each group +groups: + - + name: BREAKING + labels: + - pr/breaking + - + name: SECURITY + labels: + - topic/security + - + name: FEATURES + labels: + - type/feature + - + name: API + labels: + - modifies/api + - + name: ENHANCEMENTS + labels: + - type/enhancement + - type/refactoring + - topic/ui + - + name: BUGFIXES + labels: + - type/bug + - + name: TESTING + labels: + - type/testing + - + name: BUILD + labels: + - topic/build + - topic/code-linting + - + name: DOCS + labels: + - type/docs + - + name: MISC + default: true + +# regex indicating which labels to skip for the changelog +skip-labels: skip-changelog|backport\/.+ diff --git a/.deadcode-out b/.deadcode-out index 64741ec7ac..3f21d8ef36 100644 --- a/.deadcode-out +++ b/.deadcode-out @@ -1,302 +1,337 @@ -code.gitea.io/gitea/cmd - NoMainListener - -code.gitea.io/gitea/cmd/forgejo - ContextSetNoInit - ContextSetNoExit - ContextSetStderr - ContextGetStderr - ContextSetStdout - ContextSetStdin - -code.gitea.io/gitea/models - IsErrUpdateTaskNotExist - ErrUpdateTaskNotExist.Error - ErrUpdateTaskNotExist.Unwrap - IsErrSHANotFound - IsErrMergeDivergingFastForwardOnly - -code.gitea.io/gitea/models/actions - ScheduleList.GetUserIDs - ScheduleList.GetRepoIDs - ScheduleList.LoadTriggerUser - ScheduleList.LoadRepos - -code.gitea.io/gitea/models/asymkey - ErrGPGKeyAccessDenied.Error - ErrGPGKeyAccessDenied.Unwrap - HasDeployKey - -code.gitea.io/gitea/models/auth - GetSourceByName - WebAuthnCredentials - -code.gitea.io/gitea/models/db - TruncateBeans - InTransaction - DumpTables - -code.gitea.io/gitea/models/dbfs - file.renameTo - Create - Rename - -code.gitea.io/gitea/models/forgefed - GetFederationHost - -code.gitea.io/gitea/models/forgejo/semver - GetVersion - SetVersionString - SetVersion - -code.gitea.io/gitea/models/git - RemoveDeletedBranchByID - -code.gitea.io/gitea/models/issues - IsErrUnknownDependencyType - ErrNewIssueInsert.Error - IsErrIssueWasClosed - ChangeMilestoneStatus - -code.gitea.io/gitea/models/organization - GetTeamNamesByID - UpdateTeamUnits - SearchMembersOptions.ToConds - UsersInTeamsCount - -code.gitea.io/gitea/models/perm/access - GetRepoWriters - -code.gitea.io/gitea/models/project - UpdateColumnSorting - ChangeProjectStatus - -code.gitea.io/gitea/models/repo - DeleteAttachmentsByIssue - FindReposMapByIDs - IsErrTopicNotExist - ErrTopicNotExist.Error - ErrTopicNotExist.Unwrap - GetTopicByName - WatchRepoMode - -code.gitea.io/gitea/models/user - ErrUserInactive.Error - ErrUserInactive.Unwrap - IsErrExternalLoginUserAlreadyExist - IsErrExternalLoginUserNotExist - NewFederatedUser - IsErrUserSettingIsNotExist - GetUserAllSettings - DeleteUserSetting - GetUserEmailsByNames - GetUserNamesByIDs - -code.gitea.io/gitea/modules/activitypub - NewContext - Context.APClientFactory - -code.gitea.io/gitea/modules/assetfs - Bindata - -code.gitea.io/gitea/modules/auth/password/hash - DummyHasher.HashWithSaltBytes - NewDummyHasher - -code.gitea.io/gitea/modules/auth/password/pwn - WithHTTP - -code.gitea.io/gitea/modules/base - SetupGiteaRoot - -code.gitea.io/gitea/modules/cache - GetInt - WithNoCacheContext - RemoveContextData - -code.gitea.io/gitea/modules/charset - BreakWriter.Write - -code.gitea.io/gitea/modules/emoji - ReplaceCodes - -code.gitea.io/gitea/modules/eventsource - Event.String - -code.gitea.io/gitea/modules/forgefed - GetItemByType - JSONUnmarshalerFn - NotEmpty - ToRepository - OnRepository - -code.gitea.io/gitea/modules/git - AllowLFSFiltersArgs - AddChanges - AddChangesWithArgs - CommitChanges - CommitChangesWithArgs - SetUpdateHook - openRepositoryWithDefaultContext - IsTagExist - ToEntryMode - LimitedReaderCloser.Read - LimitedReaderCloser.Close - -code.gitea.io/gitea/modules/gitgraph - Parser.Reset - -code.gitea.io/gitea/modules/gitrepo - GetBranchCommitID - GetWikiDefaultBranch - -code.gitea.io/gitea/modules/graceful - Manager.TerminateContext - Manager.Err - Manager.Value - Manager.Deadline - -code.gitea.io/gitea/modules/hcaptcha - WithHTTP - -code.gitea.io/gitea/modules/hostmatcher - HostMatchList.AppendPattern - -code.gitea.io/gitea/modules/json - StdJSON.Marshal - StdJSON.Unmarshal - StdJSON.NewEncoder - StdJSON.NewDecoder - StdJSON.Indent - -code.gitea.io/gitea/modules/log - NewEventWriterBuffer - -code.gitea.io/gitea/modules/markup - GetRendererByType - RenderString - IsMarkupFile - -code.gitea.io/gitea/modules/markup/console - Render - RenderString - -code.gitea.io/gitea/modules/markup/markdown - IsDetails - IsSummary - IsTaskCheckBoxListItem - IsIcon - RenderRawString - -code.gitea.io/gitea/modules/markup/markdown/math - WithInlineDollarParser - WithBlockDollarParser - -code.gitea.io/gitea/modules/markup/mdstripper - stripRenderer.AddOptions - StripMarkdown - -code.gitea.io/gitea/modules/markup/orgmode - RenderString - -code.gitea.io/gitea/modules/private - ActionsRunnerRegister - -code.gitea.io/gitea/modules/process - Manager.ExecTimeout - -code.gitea.io/gitea/modules/queue - newBaseChannelSimple - newBaseChannelUnique - newBaseRedisSimple - newBaseRedisUnique - testStateRecorder.Records - testStateRecorder.Reset - newWorkerPoolQueueForTest - -code.gitea.io/gitea/modules/queue/lqinternal - QueueItemIDBytes - QueueItemKeyBytes - ListLevelQueueKeys - -code.gitea.io/gitea/modules/setting - NewConfigProviderFromData - GitConfigType.GetOption - InitLoggersForTest - -code.gitea.io/gitea/modules/storage - ErrInvalidConfiguration.Error - IsErrInvalidConfiguration - -code.gitea.io/gitea/modules/structs - ParseCreateHook - ParsePushHook - -code.gitea.io/gitea/modules/sync - StatusTable.Start - StatusTable.IsRunning - -code.gitea.io/gitea/modules/timeutil - GetExecutableModTime - MockSet - MockUnset - -code.gitea.io/gitea/modules/translation - MockLocale.Language - MockLocale.TrString - MockLocale.Tr - MockLocale.TrN - MockLocale.TrSize - MockLocale.PrettyNumber - -code.gitea.io/gitea/modules/util - OptionalArg - -code.gitea.io/gitea/modules/util/filebuffer - CreateFromReader - -code.gitea.io/gitea/modules/validation - IsErrNotValid - -code.gitea.io/gitea/modules/web - RouteMock - RouteMockReset - -code.gitea.io/gitea/modules/web/middleware - DeleteLocaleCookie - -code.gitea.io/gitea/modules/zstd - NewWriter - Writer.Write - Writer.Close - -code.gitea.io/gitea/routers/web - NotFound - -code.gitea.io/gitea/routers/web/org - MustEnableProjects - -code.gitea.io/gitea/services/context - GetPrivateContext - -code.gitea.io/gitea/services/convert - ToSecret - -code.gitea.io/gitea/services/forms - DeadlineForm.Validate - -code.gitea.io/gitea/services/pull - IsCommitStatusContextSuccess - -code.gitea.io/gitea/services/repository - IsErrForkAlreadyExist - -code.gitea.io/gitea/services/repository/files - ContentType.String - GetFileResponseFromCommit - TemporaryUploadRepository.GetLastCommit - TemporaryUploadRepository.GetLastCommitByRef - -code.gitea.io/gitea/services/webhook - NewNotifier +package "code.gitea.io/gitea/cmd" + func NoMainListener + +package "code.gitea.io/gitea/cmd/forgejo" + func ContextSetNoInit + func ContextSetNoExit + func ContextSetStderr + func ContextGetStderr + func ContextSetStdout + func ContextSetStdin + +package "code.gitea.io/gitea/models" + func IsErrUpdateTaskNotExist + func (ErrUpdateTaskNotExist).Error + func (ErrUpdateTaskNotExist).Unwrap + func IsErrSHANotFound + func GetYamlFixturesAccess + +package "code.gitea.io/gitea/models/actions" + func (ScheduleList).GetUserIDs + func (ScheduleList).GetRepoIDs + func (ScheduleList).LoadTriggerUser + func (ScheduleList).LoadRepos + func GetVariableByID + +package "code.gitea.io/gitea/models/asymkey" + func (ErrGPGKeyAccessDenied).Error + func (ErrGPGKeyAccessDenied).Unwrap + func HasDeployKey + +package "code.gitea.io/gitea/models/auth" + func GetSourceByName + func GetWebAuthnCredentialByID + func WebAuthnCredentials + +package "code.gitea.io/gitea/models/db" + func TruncateBeans + func InTransaction + func DumpTables + +package "code.gitea.io/gitea/models/dbfs" + func (*file).renameTo + func Create + func Rename + +package "code.gitea.io/gitea/models/forgejo/semver" + func GetVersion + func SetVersionString + func SetVersion + +package "code.gitea.io/gitea/models/git" + func RemoveDeletedBranchByID + +package "code.gitea.io/gitea/models/issues" + func IsErrUnknownDependencyType + func (ErrNewIssueInsert).Error + func IsErrIssueWasClosed + func ChangeMilestoneStatus + +package "code.gitea.io/gitea/models/migrations/base" + func removeAllWithRetry + func newXORMEngine + func deleteDB + func PrepareTestEnv + func MainTest + +package "code.gitea.io/gitea/models/organization" + func UpdateTeamUnits + func (SearchMembersOptions).ToConds + func UsersInTeamsCount + +package "code.gitea.io/gitea/models/perm/access" + func GetRepoWriters + +package "code.gitea.io/gitea/models/project" + func UpdateBoardSorting + func ChangeProjectStatus + +package "code.gitea.io/gitea/models/repo" + func DeleteAttachmentsByIssue + func (*releaseSorter).Len + func (*releaseSorter).Less + func (*releaseSorter).Swap + func SortReleases + func FindReposMapByIDs + func RepositoryListOfMap + func (SearchOrderBy).String + func IsErrTopicNotExist + func (ErrTopicNotExist).Error + func (ErrTopicNotExist).Unwrap + func GetTopicByName + func WatchRepoMode + +package "code.gitea.io/gitea/models/unittest" + func CheckConsistencyFor + func checkForConsistency + func GetXORMEngine + func OverrideFixtures + func InitFixtures + func LoadFixtures + func Copy + func CopyDir + func FixturesDir + func fatalTestError + func InitSettings + func MainTest + func CreateTestEngine + func PrepareTestDatabase + func PrepareTestEnv + func Cond + func OrderBy + func LoadBeanIfExists + func BeanExists + func AssertExistsAndLoadBean + func GetCount + func AssertNotExistsBean + func AssertExistsIf + func AssertSuccessfulInsert + func AssertCount + func AssertInt64InRange + +package "code.gitea.io/gitea/models/user" + func IsErrPrimaryEmailCannotDelete + func (ErrUserInactive).Error + func (ErrUserInactive).Unwrap + func IsErrExternalLoginUserAlreadyExist + func IsErrExternalLoginUserNotExist + func IsErrUserSettingIsNotExist + func GetUserAllSettings + func DeleteUserSetting + func GetUserEmailsByNames + +package "code.gitea.io/gitea/modules/activitypub" + func CurrentTime + func containsRequiredHTTPHeaders + func NewClient + func (*Client).NewRequest + func (*Client).Post + func GetPrivateKey + +package "code.gitea.io/gitea/modules/assetfs" + func Bindata + +package "code.gitea.io/gitea/modules/auth/password/hash" + func (*DummyHasher).HashWithSaltBytes + func NewDummyHasher + +package "code.gitea.io/gitea/modules/auth/password/pwn" + func WithHTTP + +package "code.gitea.io/gitea/modules/base" + func SetupGiteaRoot + +package "code.gitea.io/gitea/modules/cache" + func GetInt + func WithNoCacheContext + func RemoveContextData + +package "code.gitea.io/gitea/modules/charset" + func (*BreakWriter).Write + func ToUTF8 + +package "code.gitea.io/gitea/modules/context" + func GetPrivateContext + +package "code.gitea.io/gitea/modules/emoji" + func ReplaceCodes + +package "code.gitea.io/gitea/modules/eventsource" + func (*Event).String + +package "code.gitea.io/gitea/modules/git" + func AllowLFSFiltersArgs + func AddChanges + func AddChangesWithArgs + func CommitChanges + func CommitChangesWithArgs + func IsErrExecTimeout + func (ErrExecTimeout).Error + func (ErrUnsupportedVersion).Error + func SetUpdateHook + func openRepositoryWithDefaultContext + func GetBranchCommitID + func IsTagExist + func ToEntryMode + func (*LimitedReaderCloser).Read + func (*LimitedReaderCloser).Close + +package "code.gitea.io/gitea/modules/gitgraph" + func (*Parser).Reset + +package "code.gitea.io/gitea/modules/graceful" + func (*Manager).TerminateContext + func (*Manager).Err + func (*Manager).Value + func (*Manager).Deadline + +package "code.gitea.io/gitea/modules/hcaptcha" + func WithHTTP + +package "code.gitea.io/gitea/modules/json" + func (StdJSON).Marshal + func (StdJSON).Unmarshal + func (StdJSON).NewEncoder + func (StdJSON).NewDecoder + func (StdJSON).Indent + +package "code.gitea.io/gitea/modules/markup" + func IsSameDomain + func GetRendererByType + func RenderString + func IsMarkupFile + +package "code.gitea.io/gitea/modules/markup/console" + func Render + func RenderString + +package "code.gitea.io/gitea/modules/markup/markdown" + func IsDetails + func IsSummary + func IsTaskCheckBoxListItem + func IsIcon + func IsColorPreview + func RenderRawString + +package "code.gitea.io/gitea/modules/markup/markdown/math" + func WithInlineDollarParser + func WithBlockDollarParser + +package "code.gitea.io/gitea/modules/markup/mdstripper" + func StripMarkdown + +package "code.gitea.io/gitea/modules/markup/orgmode" + func RenderString + +package "code.gitea.io/gitea/modules/private" + func ActionsRunnerRegister + +package "code.gitea.io/gitea/modules/process" + func (*Manager).ExecTimeout + +package "code.gitea.io/gitea/modules/queue" + func newBaseChannelSimple + func newBaseChannelUnique + func newBaseRedisSimple + func newBaseRedisUnique + func newWorkerPoolQueueForTest + +package "code.gitea.io/gitea/modules/queue/lqinternal" + func QueueItemIDBytes + func QueueItemKeyBytes + func ListLevelQueueKeys + +package "code.gitea.io/gitea/modules/setting" + func NewConfigProviderFromData + func (*GitConfigType).GetOption + func InitLoggersForTest + +package "code.gitea.io/gitea/modules/storage" + func (ErrInvalidConfiguration).Error + func IsErrInvalidConfiguration + +package "code.gitea.io/gitea/modules/structs" + func ParseCreateHook + func ParsePushHook + +package "code.gitea.io/gitea/modules/sync" + func (*StatusTable).Start + func (*StatusTable).IsRunning + +package "code.gitea.io/gitea/modules/testlogger" + func (*testLoggerWriterCloser).pushT + func (*testLoggerWriterCloser).Write + func (*testLoggerWriterCloser).popT + func (*testLoggerWriterCloser).Close + func (*testLoggerWriterCloser).Reset + func PrintCurrentTest + func Printf + func NewTestLoggerWriter + +package "code.gitea.io/gitea/modules/timeutil" + func GetExecutableModTime + func MockSet + func MockUnset + +package "code.gitea.io/gitea/modules/translation" + func (MockLocale).Language + func (MockLocale).Tr + func (MockLocale).TrN + func (MockLocale).PrettyNumber + +package "code.gitea.io/gitea/modules/util" + func UnsafeStringToBytes + +package "code.gitea.io/gitea/modules/util/filebuffer" + func CreateFromReader + +package "code.gitea.io/gitea/modules/web" + func RouteMock + func RouteMockReset + +package "code.gitea.io/gitea/modules/web/middleware" + func DeleteLocaleCookie + +package "code.gitea.io/gitea/routers/web" + func NotFound + +package "code.gitea.io/gitea/routers/web/org" + func MustEnableProjects + func getActionIssues + func UpdateIssueProject + +package "code.gitea.io/gitea/services/convert" + func ToSecret + +package "code.gitea.io/gitea/services/forms" + func (*DeadlineForm).Validate + +package "code.gitea.io/gitea/services/pull" + func IsCommitStatusContextSuccess + +package "code.gitea.io/gitea/services/repository" + func GetBranchCommitID + func IsErrForkAlreadyExist + +package "code.gitea.io/gitea/services/repository/archiver" + func ArchiveRepository + +package "code.gitea.io/gitea/services/repository/files" + func (*ContentType).String + func GetFileResponseFromCommit + func (*TemporaryUploadRepository).GetLastCommit + func (*TemporaryUploadRepository).GetLastCommitByRef + +package "code.gitea.io/gitea/services/webhook" + func NewNotifier diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4549974afd..9e290fb6a5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,17 +1,14 @@ { "name": "Gitea DevContainer", - "image": "mcr.microsoft.com/devcontainers/go:1.23-bullseye", + "image": "mcr.microsoft.com/devcontainers/go:1.21-bullseye", "features": { // installs nodejs into container "ghcr.io/devcontainers/features/node:1": { - "version": "20" + "version":"20" }, - "ghcr.io/devcontainers/features/git-lfs:1.2.3": {}, + "ghcr.io/devcontainers/features/git-lfs:1.1.0": {}, "ghcr.io/devcontainers-contrib/features/poetry:2": {}, - "ghcr.io/devcontainers/features/python:1": { - "version": "3.12" - }, - "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} + "ghcr.io/devcontainers/features/python:1": {} }, "customizations": { "vscode": { @@ -25,10 +22,9 @@ "DavidAnson.vscode-markdownlint", "Vue.volar", "ms-azuretools.vscode-docker", - "vitest.explorer", - "cweijan.vscode-database-client2", - "GitHub.vscode-pull-request-github", - "Azurite.azurite" + "zixuanchen.vitest-explorer", + "qwtel.sqlite-viewer", + "GitHub.vscode-pull-request-github" ] } }, diff --git a/.dockerignore b/.dockerignore index 5e7a893014..80cbeb040c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,7 +14,7 @@ _test # MS VSCode .vscode -__debug_bin* +__debug_bin # Architecture specific extensions/prefixes *.[568vq] @@ -34,7 +34,6 @@ _testmain.go *coverage.out coverage.all -coverage/ cpu.out /modules/migration/bindata.go @@ -63,6 +62,7 @@ cpu.out /data /indexers /log +/public/img/avatar /tests/integration/gitea-integration-* /tests/integration/indexers-* /tests/e2e/gitea-e2e-* @@ -71,13 +71,14 @@ cpu.out /tests/e2e/test-artifacts /tests/e2e/test-snapshots /tests/*.ini +/node_modules /yarn.lock /yarn-error.log /npm-debug.log* /public/assets/js /public/assets/css /public/assets/fonts -/public/assets/img/avatar +/public/assets/img/webpack /vendor /web_src/fomantic/node_modules /web_src/fomantic/build/* @@ -95,9 +96,6 @@ cpu.out /.air /.go-licenses -# Files and folders that were previously generated -/public/assets/img/webpack - # Snapcraft snap/.snapcraft/ parts/ diff --git a/.editorconfig b/.editorconfig index 8e2234e64b..c0946ac997 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[{*.{go,tmpl,html},Makefile,go.mod}] +[*.{go,tmpl,html}] indent_style = tab [templates/custom/*.tmpl] @@ -21,8 +21,8 @@ indent_style = space [templates/user/auth/oidc_wellknown.tmpl] indent_style = space +[Makefile] +indent_style = tab + [*.svg] insert_final_newline = false - -[options/locale/locale_*.ini] -insert_final_newline = false diff --git a/.envrc.example b/.envrc.example deleted file mode 100644 index 3550a30f2d..0000000000 --- a/.envrc.example +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/.eslintrc.yaml b/.eslintrc.yaml new file mode 100644 index 0000000000..18e8138601 --- /dev/null +++ b/.eslintrc.yaml @@ -0,0 +1,821 @@ +root: true +reportUnusedDisableDirectives: true + +ignorePatterns: + - /web_src/js/vendor + +parserOptions: + sourceType: module + ecmaVersion: latest + +plugins: + - "@eslint-community/eslint-plugin-eslint-comments" + - "@stylistic/eslint-plugin-js" + - eslint-plugin-array-func + - eslint-plugin-i + - eslint-plugin-jquery + - eslint-plugin-no-jquery + - eslint-plugin-no-use-extend-native + - eslint-plugin-regexp + - eslint-plugin-sonarjs + - eslint-plugin-unicorn + - eslint-plugin-vitest + - eslint-plugin-vitest-globals + - eslint-plugin-wc + +env: + es2024: true + node: true + +overrides: + - files: ["web_src/**/*"] + globals: + __webpack_public_path__: true + process: false # https://github.com/webpack/webpack/issues/15833 + - files: ["web_src/**/*", "docs/**/*"] + env: + browser: true + node: false + - files: ["web_src/**/*worker.*"] + env: + worker: true + rules: + no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top] + - files: ["build/generate-images.js"] + rules: + i/no-unresolved: [0] + i/no-extraneous-dependencies: [0] + - files: ["*.config.*"] + rules: + i/no-unused-modules: [0] + - files: ["**/*.test.*", "web_src/js/test/setup.js"] + env: + vitest-globals/env: true + rules: + vitest/consistent-test-filename: [0] + vitest/consistent-test-it: [0] + vitest/expect-expect: [0] + vitest/max-expects: [0] + vitest/max-nested-describe: [0] + vitest/no-alias-methods: [0] + vitest/no-commented-out-tests: [0] + vitest/no-conditional-expect: [0] + vitest/no-conditional-in-test: [0] + vitest/no-conditional-tests: [0] + vitest/no-disabled-tests: [0] + vitest/no-done-callback: [0] + vitest/no-duplicate-hooks: [0] + vitest/no-focused-tests: [0] + vitest/no-hooks: [0] + vitest/no-identical-title: [2] + vitest/no-interpolation-in-snapshots: [0] + vitest/no-large-snapshots: [0] + vitest/no-mocks-import: [0] + vitest/no-restricted-matchers: [0] + vitest/no-restricted-vi-methods: [0] + vitest/no-standalone-expect: [0] + vitest/no-test-prefixes: [0] + vitest/no-test-return-statement: [0] + vitest/prefer-called-with: [0] + vitest/prefer-comparison-matcher: [0] + vitest/prefer-each: [0] + vitest/prefer-equality-matcher: [0] + vitest/prefer-expect-resolves: [0] + vitest/prefer-hooks-in-order: [0] + vitest/prefer-hooks-on-top: [2] + vitest/prefer-lowercase-title: [0] + vitest/prefer-mock-promise-shorthand: [0] + vitest/prefer-snapshot-hint: [0] + vitest/prefer-spy-on: [0] + vitest/prefer-strict-equal: [0] + vitest/prefer-to-be: [0] + vitest/prefer-to-be-falsy: [0] + vitest/prefer-to-be-object: [0] + vitest/prefer-to-be-truthy: [0] + vitest/prefer-to-contain: [0] + vitest/prefer-to-have-length: [0] + vitest/prefer-todo: [0] + vitest/require-hook: [0] + vitest/require-to-throw-message: [0] + vitest/require-top-level-describe: [0] + vitest/valid-describe-callback: [2] + vitest/valid-expect: [2] + vitest/valid-title: [2] + - files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"] + rules: + no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression] + +rules: + "@eslint-community/eslint-comments/disable-enable-pair": [2] + "@eslint-community/eslint-comments/no-aggregating-enable": [2] + "@eslint-community/eslint-comments/no-duplicate-disable": [2] + "@eslint-community/eslint-comments/no-restricted-disable": [0] + "@eslint-community/eslint-comments/no-unlimited-disable": [2] + "@eslint-community/eslint-comments/no-unused-disable": [2] + "@eslint-community/eslint-comments/no-unused-enable": [2] + "@eslint-community/eslint-comments/no-use": [0] + "@eslint-community/eslint-comments/require-description": [0] + "@stylistic/js/array-bracket-newline": [0] + "@stylistic/js/array-bracket-spacing": [2, never] + "@stylistic/js/array-element-newline": [0] + "@stylistic/js/arrow-parens": [2, always] + "@stylistic/js/arrow-spacing": [2, {before: true, after: true}] + "@stylistic/js/block-spacing": [0] + "@stylistic/js/brace-style": [2, 1tbs, {allowSingleLine: true}] + "@stylistic/js/comma-dangle": [2, only-multiline] + "@stylistic/js/comma-spacing": [2, {before: false, after: true}] + "@stylistic/js/comma-style": [2, last] + "@stylistic/js/computed-property-spacing": [2, never] + "@stylistic/js/dot-location": [2, property] + "@stylistic/js/eol-last": [2] + "@stylistic/js/function-call-spacing": [2, never] + "@stylistic/js/function-call-argument-newline": [0] + "@stylistic/js/function-paren-newline": [0] + "@stylistic/js/generator-star-spacing": [0] + "@stylistic/js/implicit-arrow-linebreak": [0] + "@stylistic/js/indent": [2, 2, {ignoreComments: true, SwitchCase: 1}] + "@stylistic/js/key-spacing": [2] + "@stylistic/js/keyword-spacing": [2] + "@stylistic/js/linebreak-style": [2, unix] + "@stylistic/js/lines-around-comment": [0] + "@stylistic/js/lines-between-class-members": [0] + "@stylistic/js/max-len": [0] + "@stylistic/js/max-statements-per-line": [0] + "@stylistic/js/multiline-ternary": [0] + "@stylistic/js/new-parens": [2] + "@stylistic/js/newline-per-chained-call": [0] + "@stylistic/js/no-confusing-arrow": [0] + "@stylistic/js/no-extra-parens": [0] + "@stylistic/js/no-extra-semi": [2] + "@stylistic/js/no-floating-decimal": [0] + "@stylistic/js/no-mixed-operators": [0] + "@stylistic/js/no-mixed-spaces-and-tabs": [2] + "@stylistic/js/no-multi-spaces": [2, {ignoreEOLComments: true, exceptions: {Property: true}}] + "@stylistic/js/no-multiple-empty-lines": [2, {max: 1, maxEOF: 0, maxBOF: 0}] + "@stylistic/js/no-tabs": [2] + "@stylistic/js/no-trailing-spaces": [2] + "@stylistic/js/no-whitespace-before-property": [2] + "@stylistic/js/nonblock-statement-body-position": [2] + "@stylistic/js/object-curly-newline": [0] + "@stylistic/js/object-curly-spacing": [2, never] + "@stylistic/js/object-property-newline": [0] + "@stylistic/js/one-var-declaration-per-line": [0] + "@stylistic/js/operator-linebreak": [2, after] + "@stylistic/js/padded-blocks": [2, never] + "@stylistic/js/padding-line-between-statements": [0] + "@stylistic/js/quote-props": [0] + "@stylistic/js/quotes": [2, single, {avoidEscape: true, allowTemplateLiterals: true}] + "@stylistic/js/rest-spread-spacing": [2, never] + "@stylistic/js/semi": [2, always, {omitLastInOneLineBlock: true}] + "@stylistic/js/semi-spacing": [2, {before: false, after: true}] + "@stylistic/js/semi-style": [2, last] + "@stylistic/js/space-before-blocks": [2, always] + "@stylistic/js/space-before-function-paren": [0] + "@stylistic/js/space-in-parens": [2, never] + "@stylistic/js/space-infix-ops": [2] + "@stylistic/js/space-unary-ops": [2] + "@stylistic/js/spaced-comment": [2, always] + "@stylistic/js/switch-colon-spacing": [2] + "@stylistic/js/template-curly-spacing": [2, never] + "@stylistic/js/template-tag-spacing": [2, never] + "@stylistic/js/wrap-iife": [2, inside] + "@stylistic/js/wrap-regex": [0] + "@stylistic/js/yield-star-spacing": [2, after] + accessor-pairs: [2] + array-callback-return: [2, {checkForEach: true}] + array-func/avoid-reverse: [2] + array-func/from-map: [2] + array-func/no-unnecessary-this-arg: [2] + array-func/prefer-array-from: [2] + array-func/prefer-flat-map: [0] # handled by unicorn/prefer-array-flat-map + array-func/prefer-flat: [0] # handled by unicorn/prefer-array-flat + arrow-body-style: [0] + block-scoped-var: [2] + camelcase: [0] + capitalized-comments: [0] + class-methods-use-this: [0] + complexity: [0] + consistent-return: [0] + consistent-this: [0] + constructor-super: [2] + curly: [0] + default-case-last: [2] + default-case: [0] + default-param-last: [0] + dot-notation: [0] + eqeqeq: [2] + for-direction: [2] + func-name-matching: [2] + func-names: [0] + func-style: [0] + getter-return: [2] + grouped-accessor-pairs: [2] + guard-for-in: [0] + id-blacklist: [0] + id-length: [0] + id-match: [0] + i/consistent-type-specifier-style: [0] + i/default: [0] + i/dynamic-import-chunkname: [0] + i/export: [2] + i/exports-last: [0] + i/extensions: [2, always, {ignorePackages: true}] + i/first: [2] + i/group-exports: [0] + i/max-dependencies: [0] + i/named: [2] + i/namespace: [0] + i/newline-after-import: [0] + i/no-absolute-path: [0] + i/no-amd: [2] + i/no-anonymous-default-export: [0] + i/no-commonjs: [2] + i/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}] + i/no-default-export: [0] + i/no-deprecated: [0] + i/no-dynamic-require: [0] + i/no-empty-named-blocks: [2] + i/no-extraneous-dependencies: [2] + i/no-import-module-exports: [0] + i/no-internal-modules: [0] + i/no-mutable-exports: [0] + i/no-named-as-default-member: [0] + i/no-named-as-default: [2] + i/no-named-default: [0] + i/no-named-export: [0] + i/no-namespace: [0] + i/no-nodejs-modules: [0] + i/no-relative-packages: [0] + i/no-relative-parent-imports: [0] + i/no-restricted-paths: [0] + i/no-self-import: [2] + i/no-unassigned-import: [0] + i/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/]}] + i/no-unused-modules: [2, {unusedExports: true}] + i/no-useless-path-segments: [2, {commonjs: true}] + i/no-webpack-loader-syntax: [2] + i/order: [0] + i/prefer-default-export: [0] + i/unambiguous: [0] + init-declarations: [0] + jquery/no-ajax-events: [2] + jquery/no-ajax: [0] + jquery/no-animate: [2] + jquery/no-attr: [0] + jquery/no-bind: [2] + jquery/no-class: [0] + jquery/no-clone: [2] + jquery/no-closest: [0] + jquery/no-css: [0] + jquery/no-data: [0] + jquery/no-deferred: [2] + jquery/no-delegate: [2] + jquery/no-each: [0] + jquery/no-extend: [2] + jquery/no-fade: [0] + jquery/no-filter: [0] + jquery/no-find: [0] + jquery/no-global-eval: [2] + jquery/no-grep: [2] + jquery/no-has: [2] + jquery/no-hide: [2] + jquery/no-html: [0] + jquery/no-in-array: [2] + jquery/no-is-array: [2] + jquery/no-is-function: [2] + jquery/no-is: [0] + jquery/no-load: [2] + jquery/no-map: [0] + jquery/no-merge: [2] + jquery/no-param: [2] + jquery/no-parent: [0] + jquery/no-parents: [0] + jquery/no-parse-html: [2] + jquery/no-prop: [0] + jquery/no-proxy: [2] + jquery/no-ready: [2] + jquery/no-serialize: [2] + jquery/no-show: [2] + jquery/no-size: [2] + jquery/no-sizzle: [0] + jquery/no-slide: [0] + jquery/no-submit: [0] + jquery/no-text: [0] + jquery/no-toggle: [2] + jquery/no-trigger: [0] + jquery/no-trim: [2] + jquery/no-val: [0] + jquery/no-when: [2] + jquery/no-wrap: [2] + line-comment-position: [0] + logical-assignment-operators: [0] + max-classes-per-file: [0] + max-depth: [0] + max-lines-per-function: [0] + max-lines: [0] + max-nested-callbacks: [0] + max-params: [0] + max-statements: [0] + multiline-comment-style: [2, separate-lines] + new-cap: [0] + no-alert: [0] + no-array-constructor: [2] + no-async-promise-executor: [0] + no-await-in-loop: [0] + no-bitwise: [0] + no-buffer-constructor: [0] + no-caller: [2] + no-case-declarations: [2] + no-class-assign: [2] + no-compare-neg-zero: [2] + no-cond-assign: [2, except-parens] + no-console: [1, {allow: [debug, info, warn, error]}] + no-const-assign: [2] + no-constant-binary-expression: [2] + no-constant-condition: [0] + no-constructor-return: [2] + no-continue: [0] + no-control-regex: [0] + no-debugger: [1] + no-delete-var: [2] + no-div-regex: [0] + no-dupe-args: [2] + no-dupe-class-members: [2] + no-dupe-else-if: [2] + no-dupe-keys: [2] + no-duplicate-case: [2] + no-duplicate-imports: [2] + no-else-return: [2] + no-empty-character-class: [2] + no-empty-function: [0] + no-empty-pattern: [2] + no-empty-static-block: [2] + no-empty: [2, {allowEmptyCatch: true}] + no-eq-null: [2] + no-eval: [2] + no-ex-assign: [2] + no-extend-native: [2] + no-extra-bind: [2] + no-extra-boolean-cast: [2] + no-extra-label: [0] + no-fallthrough: [2] + no-func-assign: [2] + no-global-assign: [2] + no-implicit-coercion: [2] + no-implicit-globals: [0] + no-implied-eval: [2] + no-import-assign: [2] + no-inline-comments: [0] + no-inner-declarations: [2] + no-invalid-regexp: [2] + no-invalid-this: [0] + no-irregular-whitespace: [2] + no-iterator: [2] + no-jquery/no-ajax-events: [2] + no-jquery/no-ajax: [0] + no-jquery/no-and-self: [2] + no-jquery/no-animate-toggle: [2] + no-jquery/no-animate: [2] + no-jquery/no-append-html: [0] + no-jquery/no-attr: [0] + no-jquery/no-bind: [2] + no-jquery/no-box-model: [2] + no-jquery/no-browser: [2] + no-jquery/no-camel-case: [2] + no-jquery/no-class-state: [0] + no-jquery/no-class: [0] + no-jquery/no-clone: [2] + no-jquery/no-closest: [0] + no-jquery/no-constructor-attributes: [2] + no-jquery/no-contains: [2] + no-jquery/no-context-prop: [2] + no-jquery/no-css: [0] + no-jquery/no-data: [0] + no-jquery/no-deferred: [2] + no-jquery/no-delegate: [2] + no-jquery/no-each-collection: [0] + no-jquery/no-each-util: [0] + no-jquery/no-each: [0] + no-jquery/no-error-shorthand: [2] + no-jquery/no-error: [2] + no-jquery/no-escape-selector: [2] + no-jquery/no-event-shorthand: [2] + no-jquery/no-extend: [2] + no-jquery/no-fade: [2] + no-jquery/no-filter: [0] + no-jquery/no-find-collection: [0] + no-jquery/no-find-util: [2] + no-jquery/no-find: [0] + no-jquery/no-fx-interval: [2] + no-jquery/no-global-eval: [2] + no-jquery/no-global-selector: [0] + no-jquery/no-grep: [2] + no-jquery/no-has: [2] + no-jquery/no-hold-ready: [2] + no-jquery/no-html: [0] + no-jquery/no-in-array: [2] + no-jquery/no-is-array: [2] + no-jquery/no-is-empty-object: [2] + no-jquery/no-is-function: [2] + no-jquery/no-is-numeric: [2] + no-jquery/no-is-plain-object: [2] + no-jquery/no-is-window: [2] + no-jquery/no-is: [0] + no-jquery/no-jquery-constructor: [0] + no-jquery/no-live: [2] + no-jquery/no-load-shorthand: [2] + no-jquery/no-load: [2] + no-jquery/no-map-collection: [0] + no-jquery/no-map-util: [2] + no-jquery/no-map: [0] + no-jquery/no-merge: [2] + no-jquery/no-node-name: [2] + no-jquery/no-noop: [2] + no-jquery/no-now: [2] + no-jquery/no-on-ready: [2] + no-jquery/no-other-methods: [0] + no-jquery/no-other-utils: [2] + no-jquery/no-param: [2] + no-jquery/no-parent: [0] + no-jquery/no-parents: [0] + no-jquery/no-parse-html-literal: [0] + no-jquery/no-parse-html: [2] + no-jquery/no-parse-json: [2] + no-jquery/no-parse-xml: [2] + no-jquery/no-prop: [0] + no-jquery/no-proxy: [2] + no-jquery/no-ready-shorthand: [2] + no-jquery/no-ready: [2] + no-jquery/no-selector-prop: [2] + no-jquery/no-serialize: [2] + no-jquery/no-size: [2] + no-jquery/no-sizzle: [0] + no-jquery/no-slide: [2] + no-jquery/no-sub: [2] + no-jquery/no-support: [2] + no-jquery/no-text: [0] + no-jquery/no-trigger: [0] + no-jquery/no-trim: [2] + no-jquery/no-type: [2] + no-jquery/no-unique: [2] + no-jquery/no-unload-shorthand: [2] + no-jquery/no-val: [0] + no-jquery/no-visibility: [2] + no-jquery/no-when: [2] + no-jquery/no-wrap: [2] + no-jquery/variable-pattern: [0] + no-label-var: [2] + no-labels: [0] # handled by no-restricted-syntax + no-lone-blocks: [2] + no-lonely-if: [0] + no-loop-func: [0] + no-loss-of-precision: [2] + no-magic-numbers: [0] + no-misleading-character-class: [2] + no-multi-assign: [0] + no-multi-str: [2] + no-negated-condition: [0] + no-nested-ternary: [0] + no-new-func: [2] + no-new-native-nonconstructor: [2] + no-new-object: [2] + no-new-symbol: [2] + no-new-wrappers: [2] + no-new: [0] + no-nonoctal-decimal-escape: [2] + no-obj-calls: [2] + no-octal-escape: [2] + no-octal: [2] + no-param-reassign: [0] + no-plusplus: [0] + no-promise-executor-return: [0] + no-proto: [2] + no-prototype-builtins: [2] + no-redeclare: [2] + no-regex-spaces: [2] + no-restricted-exports: [0] + no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top, __dirname, __filename] + no-restricted-imports: [0] + no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.js instead"}] + no-return-assign: [0] + no-script-url: [2] + no-self-assign: [2, {props: true}] + no-self-compare: [2] + no-sequences: [2] + no-setter-return: [2] + no-shadow-restricted-names: [2] + no-shadow: [0] + no-sparse-arrays: [2] + no-template-curly-in-string: [2] + no-ternary: [0] + no-this-before-super: [2] + no-throw-literal: [2] + no-undef-init: [2] + no-undef: [2, {typeof: true}] + no-undefined: [0] + no-underscore-dangle: [0] + no-unexpected-multiline: [2] + no-unmodified-loop-condition: [2] + no-unneeded-ternary: [0] + no-unreachable-loop: [2] + no-unreachable: [2] + no-unsafe-finally: [2] + no-unsafe-negation: [2] + no-unused-expressions: [2] + no-unused-labels: [2] + no-unused-private-class-members: [2] + no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, destructuredArrayIgnorePattern: ^_, ignoreRestSiblings: false}] + no-use-before-define: [2, {functions: false, classes: true, variables: true, allowNamedExports: true}] + no-use-extend-native/no-use-extend-native: [2] + no-useless-backreference: [2] + no-useless-call: [2] + no-useless-catch: [2] + no-useless-computed-key: [2] + no-useless-concat: [2] + no-useless-constructor: [2] + no-useless-escape: [2] + no-useless-rename: [2] + no-useless-return: [2] + no-var: [2] + no-void: [2] + no-warning-comments: [0] + no-with: [0] # handled by no-restricted-syntax + object-shorthand: [2, always] + one-var-declaration-per-line: [0] + one-var: [0] + operator-assignment: [2, always] + operator-linebreak: [2, after] + prefer-arrow-callback: [2, {allowNamedFunctions: true, allowUnboundThis: true}] + prefer-const: [2, {destructuring: all, ignoreReadBeforeAssign: true}] + prefer-destructuring: [0] + prefer-exponentiation-operator: [2] + prefer-named-capture-group: [0] + prefer-numeric-literals: [2] + prefer-object-has-own: [2] + prefer-object-spread: [2] + prefer-promise-reject-errors: [2, {allowEmptyReject: false}] + prefer-regex-literals: [2] + prefer-rest-params: [2] + prefer-spread: [2] + prefer-template: [2] + quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}] + radix: [2, as-needed] + regexp/confusing-quantifier: [2] + regexp/control-character-escape: [2] + regexp/hexadecimal-escape: [0] + regexp/letter-case: [0] + regexp/match-any: [2] + regexp/negation: [2] + regexp/no-contradiction-with-assertion: [0] + regexp/no-control-character: [0] + regexp/no-dupe-characters-character-class: [2] + regexp/no-dupe-disjunctions: [2] + regexp/no-empty-alternative: [2] + regexp/no-empty-capturing-group: [2] + regexp/no-empty-character-class: [0] + regexp/no-empty-group: [2] + regexp/no-empty-lookarounds-assertion: [2] + regexp/no-empty-string-literal: [2] + regexp/no-escape-backspace: [2] + regexp/no-extra-lookaround-assertions: [0] + regexp/no-invalid-regexp: [2] + regexp/no-invisible-character: [2] + regexp/no-lazy-ends: [2] + regexp/no-legacy-features: [2] + regexp/no-misleading-capturing-group: [0] + regexp/no-misleading-unicode-character: [0] + regexp/no-missing-g-flag: [2] + regexp/no-non-standard-flag: [2] + regexp/no-obscure-range: [2] + regexp/no-octal: [2] + regexp/no-optional-assertion: [2] + regexp/no-potentially-useless-backreference: [2] + regexp/no-standalone-backslash: [2] + regexp/no-super-linear-backtracking: [0] + regexp/no-super-linear-move: [0] + regexp/no-trivially-nested-assertion: [2] + regexp/no-trivially-nested-quantifier: [2] + regexp/no-unused-capturing-group: [0] + regexp/no-useless-assertions: [2] + regexp/no-useless-backreference: [2] + regexp/no-useless-character-class: [2] + regexp/no-useless-dollar-replacements: [2] + regexp/no-useless-escape: [2] + regexp/no-useless-flag: [2] + regexp/no-useless-lazy: [2] + regexp/no-useless-non-capturing-group: [2] + regexp/no-useless-quantifier: [2] + regexp/no-useless-range: [2] + regexp/no-useless-set-operand: [2] + regexp/no-useless-string-literal: [2] + regexp/no-useless-two-nums-quantifier: [2] + regexp/no-zero-quantifier: [2] + regexp/optimal-lookaround-quantifier: [2] + regexp/optimal-quantifier-concatenation: [0] + regexp/prefer-character-class: [0] + regexp/prefer-d: [0] + regexp/prefer-escape-replacement-dollar-char: [0] + regexp/prefer-lookaround: [0] + regexp/prefer-named-backreference: [0] + regexp/prefer-named-capture-group: [0] + regexp/prefer-named-replacement: [0] + regexp/prefer-plus-quantifier: [2] + regexp/prefer-predefined-assertion: [2] + regexp/prefer-quantifier: [0] + regexp/prefer-question-quantifier: [2] + regexp/prefer-range: [2] + regexp/prefer-regexp-exec: [2] + regexp/prefer-regexp-test: [2] + regexp/prefer-result-array-groups: [0] + regexp/prefer-set-operation: [2] + regexp/prefer-star-quantifier: [2] + regexp/prefer-unicode-codepoint-escapes: [2] + regexp/prefer-w: [0] + regexp/require-unicode-regexp: [0] + regexp/simplify-set-operations: [2] + regexp/sort-alternatives: [0] + regexp/sort-character-class-elements: [0] + regexp/sort-flags: [0] + regexp/strict: [2] + regexp/unicode-escape: [0] + regexp/use-ignore-case: [0] + require-atomic-updates: [0] + require-await: [0] + require-unicode-regexp: [0] + require-yield: [2] + sonarjs/cognitive-complexity: [0] + sonarjs/elseif-without-else: [0] + sonarjs/max-switch-cases: [0] + sonarjs/no-all-duplicated-branches: [2] + sonarjs/no-collapsible-if: [0] + sonarjs/no-collection-size-mischeck: [2] + sonarjs/no-duplicate-string: [0] + sonarjs/no-duplicated-branches: [0] + sonarjs/no-element-overwrite: [2] + sonarjs/no-empty-collection: [2] + sonarjs/no-extra-arguments: [2] + sonarjs/no-gratuitous-expressions: [2] + sonarjs/no-identical-conditions: [2] + sonarjs/no-identical-expressions: [2] + sonarjs/no-identical-functions: [2, 5] + sonarjs/no-ignored-return: [2] + sonarjs/no-inverted-boolean-check: [2] + sonarjs/no-nested-switch: [0] + sonarjs/no-nested-template-literals: [0] + sonarjs/no-one-iteration-loop: [2] + sonarjs/no-redundant-boolean: [2] + sonarjs/no-redundant-jump: [2] + sonarjs/no-same-line-conditional: [2] + sonarjs/no-small-switch: [0] + sonarjs/no-unused-collection: [2] + sonarjs/no-use-of-empty-return-value: [2] + sonarjs/no-useless-catch: [2] + sonarjs/non-existent-operator: [2] + sonarjs/prefer-immediate-return: [0] + sonarjs/prefer-object-literal: [0] + sonarjs/prefer-single-boolean-return: [0] + sonarjs/prefer-while: [2] + sort-imports: [0] + sort-keys: [0] + sort-vars: [0] + strict: [0] + symbol-description: [2] + unicode-bom: [2, never] + unicorn/better-regex: [0] + unicorn/catch-error-name: [0] + unicorn/consistent-destructuring: [2] + unicorn/consistent-function-scoping: [2] + unicorn/custom-error-definition: [0] + unicorn/empty-brace-spaces: [2] + unicorn/error-message: [0] + unicorn/escape-case: [0] + unicorn/expiring-todo-comments: [0] + unicorn/explicit-length-check: [0] + unicorn/filename-case: [0] + unicorn/import-index: [0] + unicorn/import-style: [0] + unicorn/new-for-builtins: [2] + unicorn/no-abusive-eslint-disable: [0] + unicorn/no-array-callback-reference: [0] + unicorn/no-array-for-each: [2] + unicorn/no-array-method-this-argument: [2] + unicorn/no-array-push-push: [2] + unicorn/no-array-reduce: [2] + unicorn/no-await-expression-member: [0] + unicorn/no-console-spaces: [0] + unicorn/no-document-cookie: [2] + unicorn/no-empty-file: [2] + unicorn/no-for-loop: [0] + unicorn/no-hex-escape: [0] + unicorn/no-instanceof-array: [0] + unicorn/no-invalid-remove-event-listener: [2] + unicorn/no-keyword-prefix: [0] + unicorn/no-lonely-if: [2] + unicorn/no-negated-condition: [0] + unicorn/no-nested-ternary: [0] + unicorn/no-new-array: [0] + unicorn/no-new-buffer: [0] + unicorn/no-null: [0] + unicorn/no-object-as-default-parameter: [0] + unicorn/no-process-exit: [0] + unicorn/no-static-only-class: [2] + unicorn/no-thenable: [2] + unicorn/no-this-assignment: [2] + unicorn/no-typeof-undefined: [2] + unicorn/no-unnecessary-await: [2] + unicorn/no-unreadable-array-destructuring: [0] + unicorn/no-unreadable-iife: [2] + unicorn/no-unused-properties: [2] + unicorn/no-useless-fallback-in-spread: [2] + unicorn/no-useless-length-check: [2] + unicorn/no-useless-promise-resolve-reject: [2] + unicorn/no-useless-spread: [2] + unicorn/no-useless-switch-case: [2] + unicorn/no-useless-undefined: [0] + unicorn/no-zero-fractions: [2] + unicorn/number-literal-case: [0] + unicorn/numeric-separators-style: [0] + unicorn/prefer-add-event-listener: [2] + unicorn/prefer-array-find: [2] + unicorn/prefer-array-flat-map: [2] + unicorn/prefer-array-flat: [2] + unicorn/prefer-array-index-of: [2] + unicorn/prefer-array-some: [2] + unicorn/prefer-at: [0] + unicorn/prefer-blob-reading-methods: [2] + unicorn/prefer-code-point: [0] + unicorn/prefer-date-now: [2] + unicorn/prefer-default-parameters: [0] + unicorn/prefer-dom-node-append: [2] + unicorn/prefer-dom-node-dataset: [0] + unicorn/prefer-dom-node-remove: [2] + unicorn/prefer-dom-node-text-content: [2] + unicorn/prefer-event-target: [2] + unicorn/prefer-export-from: [0] + unicorn/prefer-includes: [2] + unicorn/prefer-json-parse-buffer: [0] + unicorn/prefer-keyboard-event-key: [2] + unicorn/prefer-logical-operator-over-ternary: [2] + unicorn/prefer-math-trunc: [2] + unicorn/prefer-modern-dom-apis: [0] + unicorn/prefer-modern-math-apis: [2] + unicorn/prefer-module: [2] + unicorn/prefer-native-coercion-functions: [2] + unicorn/prefer-negative-index: [2] + unicorn/prefer-node-protocol: [2] + unicorn/prefer-number-properties: [0] + unicorn/prefer-object-from-entries: [2] + unicorn/prefer-object-has-own: [0] + unicorn/prefer-optional-catch-binding: [2] + unicorn/prefer-prototype-methods: [0] + unicorn/prefer-query-selector: [0] + unicorn/prefer-reflect-apply: [0] + unicorn/prefer-regexp-test: [2] + unicorn/prefer-set-has: [0] + unicorn/prefer-set-size: [2] + unicorn/prefer-spread: [0] + unicorn/prefer-string-replace-all: [0] + unicorn/prefer-string-slice: [0] + unicorn/prefer-string-starts-ends-with: [2] + unicorn/prefer-string-trim-start-end: [2] + unicorn/prefer-switch: [0] + unicorn/prefer-ternary: [0] + unicorn/prefer-text-content: [2] + unicorn/prefer-top-level-await: [0] + unicorn/prefer-type-error: [0] + unicorn/prevent-abbreviations: [0] + unicorn/relative-url-style: [2] + unicorn/require-array-join-separator: [2] + unicorn/require-number-to-fixed-digits-argument: [2] + unicorn/require-post-message-target-origin: [0] + unicorn/string-content: [0] + unicorn/switch-case-braces: [0] + unicorn/template-indent: [2] + unicorn/text-encoding-identifier-case: [0] + unicorn/throw-new-error: [2] + use-isnan: [2] + valid-typeof: [2, {requireStringLiterals: true}] + vars-on-top: [0] + wc/attach-shadow-constructor: [2] + wc/define-tag-after-class-definition: [0] + wc/expose-class-on-global: [0] + wc/file-name-matches-element: [2] + wc/guard-define-call: [0] + wc/guard-super-call: [2] + wc/max-elements-per-file: [0] + wc/no-child-traversal-in-attributechangedcallback: [2] + wc/no-child-traversal-in-connectedcallback: [2] + wc/no-closed-shadow-root: [2] + wc/no-constructor-attributes: [2] + wc/no-constructor-params: [2] + wc/no-constructor: [2] + wc/no-customized-built-in-elements: [2] + wc/no-exports-with-element: [2] + wc/no-invalid-element-name: [2] + wc/no-invalid-extends: [2] + wc/no-method-prefixed-with-on: [2] + wc/no-self-class: [2] + wc/no-typos: [2] + wc/require-listener-teardown: [2] + wc/tag-name-matches-class: [2] + yoda: [2, never] diff --git a/.forgejo/cascading-pr-end-to-end b/.forgejo/cascading-pr-end-to-end index 8013fde06a..975888b245 100755 --- a/.forgejo/cascading-pr-end-to-end +++ b/.forgejo/cascading-pr-end-to-end @@ -5,30 +5,17 @@ set -ex end_to_end=$1 end_to_end_pr=$2 forgejo=$3 -forgejo_pr_or_ref=$4 - -cd $forgejo -full_version=$(make show-version-full) -minor_version=$(make show-version-minor) +forgejo_pr=$4 +head_url=$(jq --raw-output .head.repo.html_url < $forgejo_pr) +test "$head_url" != null +branch=$(jq --raw-output .head.ref < $forgejo_pr) +test "$branch" != null cd $end_to_end +echo $head_url $branch 7.0.0+0-gitea-1.22.0 > forgejo/sources/1.22 +date > last-upgrade -if ! test -f forgejo/sources/$minor_version; then - echo "FAIL: forgejo/sources/$minor_version does not exist in the end-to-end repository" - false -fi - -echo -n $minor_version >forgejo/build-from-sources -date >last-upgrade - -if test -f "$forgejo_pr_or_ref"; then - forgejo_pr=$forgejo_pr_or_ref - head_url=$(jq --raw-output .head.repo.html_url <$forgejo_pr) - test "$head_url" != null - branch=$(jq --raw-output .head.ref <$forgejo_pr) - test "$branch" != null - echo $head_url $branch $full_version >forgejo/sources/$minor_version -else - forgejo_ref=$forgejo_pr_or_ref - echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY ${forgejo_ref#refs/heads/} $full_version >forgejo/sources/$minor_version -fi +base_url=$(jq --raw-output .base.repo.html_url < $forgejo_pr) +test "$base_url" != null +test "$GITHUB_RUN_NUMBER" +echo $base_url/actions/runs/$GITHUB_RUN_NUMBER/artifacts/forgejo > forgejo/binary-url diff --git a/.forgejo/cascading-release-end-to-end b/.forgejo/cascading-release-end-to-end index 9be0737b0f..7b43c89ed8 100755 --- a/.forgejo/cascading-release-end-to-end +++ b/.forgejo/cascading-release-end-to-end @@ -8,15 +8,5 @@ forgejo=$3 forgejo_ref=$4 cd $end_to_end -date >last-upgrade -organizations=lib/ORGANIZATIONS -if ! test -f $organizations; then - echo "$organizations file not found" - false -fi -# -# Inverse the order of lookup because the goal in the release built -# pipeline is to test the latest build, if available, instead of the -# stable version by the same version. -# -echo forgejo-integration forgejo-experimental forgejo >$organizations +date > last-upgrade +echo $FORGEJO_BINARY > forgejo/binary-url diff --git a/.forgejo/pull_request_template.md b/.forgejo/pull_request_template.md deleted file mode 100644 index d30af48446..0000000000 --- a/.forgejo/pull_request_template.md +++ /dev/null @@ -1,33 +0,0 @@ ---- - -name: "Pull Request Template" -about: "Template for all Pull Requests" -labels: - -- test/needed - ---- - -## Checklist - -The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). - -### Tests - -- I added test coverage for Go changes... - - [ ] in their respective `*_test.go` for unit tests. - - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. -- I added test coverage for JavaScript changes... - - [ ] in `web_src/js/*.test.js` if it can be unit tested. - - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). - -### Documentation - -- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. -- [ ] I did not document these changes and I do not expect someone else to do it. - -### Release notes - -- [ ] I do not want this change to show in the release notes. -- [ ] I want the title to show in the release notes with a link to this pull request. -- [ ] I want the content of the `release-notes/.md` to be be used for the release notes instead of the title. diff --git a/.forgejo/testdata/build-release/Dockerfile b/.forgejo/testdata/build-release/Dockerfile index d10564359e..4b6933845c 100644 --- a/.forgejo/testdata/build-release/Dockerfile +++ b/.forgejo/testdata/build-release/Dockerfile @@ -1,6 +1,3 @@ -FROM data.forgejo.org/oci/alpine:3.21 -ARG RELEASE_VERSION=unkown -LABEL maintainer="contact@forgejo.org" \ - org.opencontainers.image.version="${RELEASE_VERSION}" +FROM public.ecr.aws/docker/library/alpine:3.18 RUN mkdir -p /app/gitea -RUN ( echo '#!/bin/sh' ; echo "echo forgejo v$RELEASE_VERSION" ) > /app/gitea/gitea ; chmod +x /app/gitea/gitea +RUN ( echo '#!/bin/sh' ; echo "echo forgejo v1.2.3" ) > /app/gitea/gitea ; chmod +x /app/gitea/gitea diff --git a/.forgejo/testdata/build-release/go.mod b/.forgejo/testdata/build-release/go.mod deleted file mode 100644 index 729cb6f831..0000000000 --- a/.forgejo/testdata/build-release/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module code.gitea.io/gitea - -go 1.23.3 diff --git a/.forgejo/workflows-composite/apt-install-from/action.yaml b/.forgejo/workflows-composite/apt-install-from/action.yaml deleted file mode 100644 index 615e7cb184..0000000000 --- a/.forgejo/workflows-composite/apt-install-from/action.yaml +++ /dev/null @@ -1,29 +0,0 @@ -inputs: - packages: - description: 'Packages to install' - required: true - release: - description: 'Release to install from' - default: testing - -runs: - using: "composite" - steps: - - name: setup apt package source - run: | - export DEBIAN_FRONTEND=noninteractive - echo "deb http://deb.debian.org/debian/ ${RELEASE} main" > "/etc/apt/sources.list.d/${RELEASE}.list" - env: - RELEASE: ${{inputs.release}} - - name: install packages - run: | - apt-get update -qq - apt-get -q install -qq -y ${PACKAGES} - env: - PACKAGES: ${{inputs.packages}} - - name: remove temporary package list to prevent using it in other steps - run: | - rm "/etc/apt/sources.list.d/${RELEASE}.list" - apt-get update -qq - env: - RELEASE: ${{inputs.release}} diff --git a/.forgejo/workflows-composite/build-backend/action.yaml b/.forgejo/workflows-composite/build-backend/action.yaml deleted file mode 100644 index ada372b834..0000000000 --- a/.forgejo/workflows-composite/build-backend/action.yaml +++ /dev/null @@ -1,15 +0,0 @@ -runs: - using: "composite" - steps: - - run: | - su forgejo -c 'make deps-backend' - - uses: actions/cache@v4 - id: cache-backend - with: - path: ${{github.workspace}}/gitea - key: backend-build-${{ github.sha }} - - if: steps.cache-backend.outputs.cache-hit != 'true' - run: | - su forgejo -c 'make backend' - env: - TAGS: bindata diff --git a/.forgejo/workflows-composite/setup-cache-go/action.yaml b/.forgejo/workflows-composite/setup-cache-go/action.yaml deleted file mode 100644 index 67372d9f36..0000000000 --- a/.forgejo/workflows-composite/setup-cache-go/action.yaml +++ /dev/null @@ -1,59 +0,0 @@ -# SPDX-License-Identifier: MIT -name: 'Forgejo Actions to setup Go and cache dependencies' -author: 'Forgejo authors' -description: | - Wrap the setup-go with improved dependency caching. -inputs: - username: - description: 'User for which to manage the dependency cache' - default: root - -runs: - using: "composite" - steps: - - name: "Install zstd for faster caching" - run: | - apt-get update -qq - apt-get -q install -qq -y zstd - - - name: "Set up Go using setup-go" - uses: https://data.forgejo.org/actions/setup-go@v5 - id: go-version - with: - go-version-file: "go.mod" - # do not cache dependencies, we do this manually - cache: false - - - name: "Get go environment information" - id: go-environment - run: | - echo "modcache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT" - echo "cache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT" - env: - RUN_AS_USER: ${{ inputs.username }} - GO_VERSION: ${{ steps.go-version.outputs.go-version }} - - - name: "Create cache folders with correct permissions (for non-root users)" - if: inputs.username != 'root' - # when the cache is restored, only the permissions of the last part are restored - # so assuming that /home/user exists and we are restoring /home/user/go/pkg/mod, - # both folders will have the correct permissions, but - # /home/user/go and /home/user/go/pkg might be owned by root - run: | - su ${RUN_AS_USER} -c 'mkdir -p "${MODCACHE_DIR}" "${CACHE_DIR}"' - env: - RUN_AS_USER: ${{ inputs.username }} - MODCACHE_DIR: ${{ steps.go-environment.outputs.modcache }} - CACHE_DIR: ${{ steps.go-environment.outputs.cache }} - - - name: "Restore Go dependencies from cache or mark for later caching" - id: cache-deps - uses: actions/cache@v4 - with: - key: setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}-${{ hashFiles('go.sum', 'go.mod') }} - restore-keys: | - setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}- - setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}- - path: | - ${{ steps.go-environment.outputs.modcache }} - ${{ steps.go-environment.outputs.cache }} diff --git a/.forgejo/workflows-composite/setup-env/action.yaml b/.forgejo/workflows-composite/setup-env/action.yaml deleted file mode 100644 index 28216e9b8d..0000000000 --- a/.forgejo/workflows-composite/setup-env/action.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# TODO: -# - [ ] prepare a forgejo ci image with the necessary tools and forgejo user -runs: - using: "composite" - steps: - - name: setup user and permissions - run: | - git config --add safe.directory '*' - # ignore if the user already exists (like with the playwright image) - adduser --quiet --comment forgejo --disabled-password forgejo || true - chown -R forgejo:forgejo . - - - uses: ./.forgejo/workflows-composite/setup-cache-go - with: - username: forgejo - - - name: validate go version - run: | - set -ex - toolchain=$(grep -oP '(?<=toolchain ).+' go.mod) - version=$(go version | cut -d' ' -f3) - if [ "$toolchain" != "$version" ]; then - echo "go version mismatch: $toolchain <> $version" - exit 1 - fi diff --git a/.forgejo/workflows/backport.yml b/.forgejo/workflows/backport.yml deleted file mode 100644 index 795557dfac..0000000000 --- a/.forgejo/workflows/backport.yml +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2024 The Forgejo Authors -# SPDX-License-Identifier: MIT -# -# To modify this workflow: -# -# - change pull_request_target: to pull_request: -# so that it runs from a pull request instead of the default branch -# -# - push it to the wip-ci-backport branch on the forgejo repository -# otherwise it will not have access to the secrets required to push -# the PR -# -# - open a pull request targetting wip-ci-backport that includes a change -# that can be backported without conflict in v1.21 and set the -# `backport/v1.21` label. -# -# - once it works, open a pull request for the sake of keeping track -# of the change even if the PR won't run it because it will use -# whatever is in the default branch instead -# -# - after it is merged, double check it works by setting a -# `backport/v1.21` label on a merged pull request that can be backported -# without conflict. -# -name: issue-labels - -on: - pull_request_target: - types: - - closed - - labeled - -jobs: - backporting: - if: > - ( vars.ROLE == 'forgejo-coding' ) && ( - github.event.pull_request.merged - && - contains(toJSON(github.event.pull_request.labels), 'backport/v') - ) - runs-on: docker - container: - image: 'data.forgejo.org/oci/node:20-bookworm' - steps: - - name: event info - run: | - cat <<'EOF' - ${{ toJSON(github) }} - EOF - - uses: https://data.forgejo.org/actions/git-backporting@v4.8.4 - with: - target-branch-pattern: "^backport/(?(v.*))$" - strategy: ort - strategy-option: find-renames - cherry-pick-options: -x - auth: ${{ secrets.BACKPORT_TOKEN }} - pull-request: ${{ github.event.pull_request.url }} - auto-no-squash: true - enable-err-notification: true - git-user: forgejo-backport-action - git-email: forgejo-backport-action@noreply.codeberg.org diff --git a/.forgejo/workflows/build-release-integration.yml b/.forgejo/workflows/build-release-integration.yml index 6410915644..32e67964ba 100644 --- a/.forgejo/workflows/build-release-integration.yml +++ b/.forgejo/workflows/build-release-integration.yml @@ -9,8 +9,6 @@ on: - docker/** - .forgejo/workflows/build-release.yml - .forgejo/workflows/build-release-integration.yml - branches-ignore: - - renovate/** pull_request: paths: - Makefile @@ -22,13 +20,13 @@ on: jobs: release-simulation: - if: vars.ROLE == 'forgejo-coding' - runs-on: lxc-bookworm + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + runs-on: self-hosted steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - id: forgejo - uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.4 + uses: https://code.forgejo.org/actions/setup-forgejo@v1 with: user: root password: admin1234 @@ -36,10 +34,10 @@ jobs: lxc-ip-prefix: 10.0.9 - name: publish the forgejo release - shell: bash run: | set -x + version=1.2.3 cat > /etc/docker/daemon.json < $binary$suffix - if test "$suffix" = .xz ; then - unxz --keep $binary$suffix - fi - chmod +x $binary - ./$binary --version | grep $version - curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix.sha256 > $binary$suffix.sha256 - shasum -a 256 --check $binary$suffix.sha256 - rm $binary$suffix - done - done - - local sources=forgejo-src-$version.tar.gz - curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources > $sources - curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources.sha256 > $sources.sha256 - shasum -a 256 --check $sources.sha256 - - docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version - docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version-rootless - } - # # Create a new project with a fake forgejo and the release workflow only # @@ -95,41 +62,46 @@ jobs: cp $dir/Dockerfile $dir/Dockerfile.rootless forgejo-test-helper.sh push $dir $url root forgejo - - forgejo-curl.sh api_json -X PUT --data-raw '{"data":"${{ steps.forgejo.outputs.token }}"}' $url/api/v1/repos/root/forgejo/actions/secrets/TOKEN - forgejo-curl.sh api_json -X PUT --data-raw '{"data":"root"}' $url/api/v1/repos/root/forgejo/actions/secrets/DOER - forgejo-curl.sh api_json -X PUT --data-raw '{"data":"true"}' $url/api/v1/repos/root/forgejo/actions/secrets/VERBOSE + sha=$(forgejo-test-helper.sh branch_tip $url root/forgejo main) # # Push a tag to trigger the release workflow and wait for it to complete # - version=1.2.3 - sha=$(forgejo-test-helper.sh branch_tip $url root/forgejo main) forgejo-curl.sh api_json --data-raw '{"tag_name": "v'$version'", "target": "'$sha'"}' $url/api/v1/repos/root/forgejo/tags + forgejo-curl.sh api_json -X PUT --data-raw '{"data":"${{ steps.forgejo.outputs.token }}"}' $url/api/v1/repos/root/forgejo/actions/secrets/TOKEN + forgejo-curl.sh api_json -X PUT --data-raw '{"data":"root"}' $url/api/v1/repos/root/forgejo/actions/secrets/DOER LOOPS=180 forgejo-test-helper.sh wait_success "$url" root/forgejo $sha - sanity_check $url $version # - # Push a commit to a branch that triggers the build of a test release + # uncomment to see the logs even when everything is reported to be working ok # - version=1.2-test - ( - git clone $url/root/forgejo /tmp/forgejo - cd /tmp/forgejo - date > DATE - git config user.email root@example.com - git config user.name username - git add . - git commit -m 'update' - git push $url/root/forgejo main:forgejo - ) - sha=$(forgejo-test-helper.sh branch_tip $url root/forgejo forgejo) - LOOPS=180 forgejo-test-helper.sh wait_success "$url" root/forgejo $sha - sanity_check $url $version + #cat $FORGEJO_RUNNER_LOGS - - name: full logs - if: always() - run: | - sed -e 's/^/[RUNNER LOGS] /' ${{ steps.forgejo.outputs.runner-logs }} - docker logs forgejo | sed -e 's/^/[FORGEJO LOGS]/' - sleep 5 # hack to avoid mixing outputs in Forgejo v1.21 + # + # Minimal sanity checks. e2e test is for the setup-forgejo + # action and the infrastructure playbook. Since the binary + # is a script shell it does not test the sanity of the cross + # build, only the sanity of the naming of the binaries. + # + for arch in amd64 arm64 arm-6 ; do + binary=forgejo-$version-linux-$arch + for suffix in '' '.xz' ; do + curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix > $binary$suffix + if test "$suffix" = .xz ; then + unxz --keep $binary$suffix + fi + chmod +x $binary + ./$binary --version | grep $version + curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix.sha256 > $binary$suffix.sha256 + shasum -a 256 --check $binary$suffix.sha256 + rm $binary$suffix + done + done + + sources=forgejo-src-$version.tar.gz + curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources > $sources + curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources.sha256 > $sources.sha256 + shasum -a 256 --check $sources.sha256 + + docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version + docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version-rootless diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml index f633ab1df0..e02bf15901 100644 --- a/.forgejo/workflows/build-release.yml +++ b/.forgejo/workflows/build-release.yml @@ -1,5 +1,5 @@ # -# See also https://forgejo.org/docs/next/contributor/release/#stable-release-process +# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process # # https://codeberg.org/forgejo-integration/forgejo # @@ -14,28 +14,19 @@ # secrets.CASCADE_DESTINATION_TOKEN: scope read:user, write:repository, write:issue # vars.CASCADE_DESTINATION_DOER: forgejo-ci # -# vars.SKIP_END_TO_END: `true` or `false` -# It must be `false` (or absent) so https://code.forgejo.org/forgejo/end-to-end is run -# with the newly built release. -# It must be set to `true` when a release is missing, for instance because it was -# removed and failed to upload. -# +name: Build release + on: push: - tags: 'v[0-9]+.[0-9]+.*' - branches: - - 'forgejo' - - 'v*/forgejo' + tags: 'v*' jobs: release: - runs-on: lxc-bookworm + runs-on: self-hosted # root is used for testing, allow it if: vars.ROLE == 'forgejo-integration' || github.repository_owner == 'root' steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 + - uses: actions/checkout@v3 - name: Sanitize the name of the repository id: repository @@ -43,47 +34,26 @@ jobs: repository="${{ github.repository }}" echo "value=${repository##*/}" >> "$GITHUB_OUTPUT" - - uses: https://data.forgejo.org/actions/setup-node@v4 + - uses: https://code.forgejo.org/actions/setup-node@v3 with: node-version: 20 - - uses: https://data.forgejo.org/actions/setup-go@v5 + - uses: https://code.forgejo.org/actions/setup-go@v4 with: - go-version-file: "go.mod" + go-version: ">=1.21" + check-latest: true - - name: version from ref - id: release-info - shell: bash + - name: version from ref_name + id: tag-version run: | - set -x - ref="${{ github.ref }}" - if [[ $ref =~ ^refs/heads/ ]] ; then - if test "$ref" = "refs/heads/forgejo" ; then - version=$(git tag -l --sort=version:refname --merged | grep -v -e '-test$' | tail -1 | sed -E -e 's/^(v[0-9]+\.[0-9]+).*/\1/')-test - else - version=${ref#refs/heads/} - version=${version%/forgejo}-test - fi - override=true - fi - if [[ $ref =~ ^refs/tags/ ]] ; then - version=${ref#refs/tags/} - override=false - fi - if test -z "$version" ; then - echo failed to figure out the release version from the reference=$ref - exit 1 - fi - version=${version#v} - git describe --exclude '*-test' --tags --always - echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT" - echo "version=$version" >> "$GITHUB_OUTPUT" - echo "override=$override" >> "$GITHUB_OUTPUT" + version="${{ github.ref_name }}" + version=${version##*v} + echo "value=$version" >> "$GITHUB_OUTPUT" - name: release notes id: release-notes run: | - anchor=${{ steps.release-info.outputs.version }} + anchor=${{ steps.tag-version.outputs.value }} anchor=${anchor//./-} cat >> "$GITHUB_OUTPUT" < /dev/null - curl -sS -X DELETE $url/api/v1/repos/forgejo-experimental/forgejo/tags/$tag > /dev/null - fi - # actions/checkout@v3 sets http.https://codeberg.org/.extraheader with the automatic token. - # Get rid of it so it does not prevent using the token that has write permissions - git config --local --unset http.https://codeberg.org/.extraheader - if test -f .git/shallow ; then - echo "unexptected .git/shallow file is present" - echo "it suggests a checkout --depth X was used which may prevent pushing the commit" - echo "it happens when actions/checkout is called without depth: 0" - fi - git push $url/forgejo-experimental/forgejo ${{ steps.release-info.outputs.sha }}:refs/tags/$tag + env: + FORGEJO_BINARY: "${{ env.GITHUB_SERVER_URL }}/${{ github.repository }}/releases/download/v${{ steps.tag-version.outputs.value }}/forgejo-${{ steps.tag-version.outputs.value }}-linux-amd64" diff --git a/.forgejo/workflows/cascade-setup-end-to-end.yml b/.forgejo/workflows/cascade-setup-end-to-end.yml index 710cd27ba4..be07d87767 100644 --- a/.forgejo/workflows/cascade-setup-end-to-end.yml +++ b/.forgejo/workflows/cascade-setup-end-to-end.yml @@ -1,57 +1,83 @@ -# Copyright 2024 The Forgejo Authors # SPDX-License-Identifier: MIT -# -# To modify this workflow: -# -# - push it to the wip-ci-end-to-end branch on the forgejo repository -# otherwise it will not have access to the secrets required to push -# the cascading PR -# -# - once it works, open a pull request for the sake of keeping track -# of the change even if the PR won't run it because it will use -# whatever is in the default branch instead -# -# - after it is merged, double check it works by setting the -# run-end-to-end-test on a pull request (any pull request will do) -# -name: issue-labels - on: - push: - branches: - - 'wip-ci-end-to-end' pull_request_target: types: - labeled +env: + FEATURE_BRANCHES: "privacy i18n moderation branding dependency" + jobs: - cascade: - if: > - vars.ROLE == 'forgejo-coding' && ( - github.event_name == 'push' || - ( - github.event.action == 'label_updated' && github.event.label.name == 'run-end-to-end-tests' - ) - ) + info: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker container: - image: data.forgejo.org/oci/node:20-bookworm + image: node:20-bookworm steps: - - uses: actions/checkout@v4 + - name: event + run: | + echo github.event.pull_request.head.repo.fork = ${{ github.event.pull_request.head.repo.fork }} + echo github.event.action = ${{ github.event.action }} + echo github.event.pull_request.merged = ${{ github.event.pull_request.merged }} + echo github.event.pull_request.labels.*.name + cat <<'EOF' + ${{ toJSON(github.event.pull_request.labels.*.name) }} + EOF + + build: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') && github.event.action == 'label_updated' && contains(github.event.pull_request.labels.*.name, 'run-end-to-end-tests') }} + runs-on: docker + container: + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 with: fetch-depth: '0' show-progress: 'false' - - uses: https://code.forgejo.org/actions/cascading-pr@v2.2.0 + - name: adduser forgejo + run: | + git config --add safe.directory '*' + git config user.email "you@example.com" + git config user.name "Your Name" + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - name: merge feature branches + run: | + su forgejo -c 'set -ex ; for b in ${{ env.FEATURE_BRANCHES }} ; do git merge -m $b origin/forgejo-$b ; done' + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: ">=1.21" + - name: make deps-backend + run: | + su forgejo -c 'make deps-backend' + - name: make forgejo + run: | + su forgejo -c 'make generate-backend static-executable && ln gitea forgejo' + env: + TAGS: bindata sqlite sqlite_unlock_notify + - uses: actions/upload-artifact@v3 + with: + name: forgejo + path: forgejo + + cascade: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') && github.event.action == 'label_updated' && contains(github.event.pull_request.labels.*.name, 'run-end-to-end-tests') }} + needs: [build] + runs-on: docker + container: + image: node:20-bookworm + steps: + - uses: actions/checkout@v4 + - uses: actions/cascading-pr@v1 with: origin-url: ${{ env.GITHUB_SERVER_URL }} origin-repo: ${{ github.repository }} origin-token: ${{ secrets.END_TO_END_CASCADING_PR_ORIGIN }} origin-pr: ${{ github.event.pull_request.number }} - origin-ref: ${{ github.event_name == 'push' && github.event.ref || '' }} destination-url: https://code.forgejo.org destination-fork-repo: cascading-pr/end-to-end destination-repo: forgejo/end-to-end - destination-branch: main + destination-branch: forgejo-pr destination-token: ${{ secrets.END_TO_END_CASCADING_PR_DESTINATION }} close-merge: true update: .forgejo/cascading-pr-end-to-end diff --git a/.forgejo/workflows/e2e.yml b/.forgejo/workflows/e2e.yml new file mode 100644 index 0000000000..2104f6a067 --- /dev/null +++ b/.forgejo/workflows/e2e.yml @@ -0,0 +1,37 @@ +name: e2e + +on: + pull_request: + paths: + - Makefile + - .forgejo/workflows/e2e.yml + - tests/e2e/** + +jobs: + test-e2e: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + runs-on: docker + container: + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: "~1.21" + check-latest: true + - run: | + apt-get -qq update + apt-get -qq install -q sudo + sed -i -e 's/%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + adduser forgejo sudo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-frontend frontend deps-backend' + - run: | + su forgejo -c 'make generate test-e2e-sqlite' + timeout-minutes: 40 + env: + DEPS_PLAYWRIGHT: 1 + USE_REPO_TEST_DIR: 1 diff --git a/.forgejo/workflows/forgejo-integration-cleanup.yml b/.forgejo/workflows/forgejo-integration-cleanup.yml deleted file mode 100644 index 9cef5fac68..0000000000 --- a/.forgejo/workflows/forgejo-integration-cleanup.yml +++ /dev/null @@ -1,39 +0,0 @@ -on: - workflow_dispatch: - - schedule: - - cron: '@daily' - -jobs: - integration-cleanup: - if: vars.ROLE == 'forgejo-integration' - runs-on: docker - container: - image: 'data.forgejo.org/oci/node:20-bookworm' - steps: - - - name: apt install curl jq - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update -qq - apt-get -q install -qq -y curl jq - - - name: remove old releases and tags - run: | - url=https://any:${{ secrets.TOKEN }}@codeberg.org - curl -sS "$url/api/v1/repos/forgejo-integration/forgejo/releases" | jq -r '.[] | "\(.published_at) \(.tag_name)"' | sort | while read published_at version ; do - if echo $version | grep -e '-test$' >/dev/null; then - old="18 months" - else - old="1 day" - fi - too_old=$(env -i date --date="- $old" +%F) - too_old_seconds=$(env -i date --date="- $old" +%s) - published_at_seconds=$(env -i date --date="$published_at" +%s) - if test $published_at_seconds -le $too_old_seconds ; then - echo "$version was published more than $old ago ($published_at <= $too_old) and will be removed" - curl -X DELETE -sS "$url/api/v1/repos/forgejo-integration/forgejo/releases/tags/$version" - else - echo "$version was published less than $old ago" - fi - done diff --git a/.forgejo/workflows/merge-requirements.yml b/.forgejo/workflows/merge-requirements.yml deleted file mode 100644 index d5270321ad..0000000000 --- a/.forgejo/workflows/merge-requirements.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2024 The Forgejo Authors -# SPDX-License-Identifier: MIT - -name: requirements - -on: - pull_request: - types: - - labeled - - edited - - opened - - synchronize - -jobs: - merge-conditions: - if: vars.ROLE == 'forgejo-coding' - runs-on: docker - container: - image: 'data.forgejo.org/oci/node:20-bookworm' - steps: - - name: Debug output - run: | - cat <<'EOF' - ${{ toJSON(github) }} - EOF - - name: Missing test label - if: > - !( - contains(toJSON(github.event.pull_request.labels), 'test/present') - || contains(toJSON(github.event.pull_request.labels), 'test/not-needed') - || contains(toJSON(github.event.pull_request.labels), 'test/manual') - ) - run: | - echo "Test label must be set to either 'present', 'not-needed' or 'manual'." - exit 1 - - name: Missing manual test instructions - if: > - ( - contains(toJSON(github.event.pull_request.labels), 'test/manual') - && !contains(toJSON(github.event.pull_request.body), '# Test') - ) - run: | - echo "Manual test label is set. The PR description needs to contain test steps introduced by a heading like:" - echo "# Testing" - exit 1 diff --git a/.forgejo/workflows/milestone.yml b/.forgejo/workflows/milestone.yml deleted file mode 100644 index 9a51c515d0..0000000000 --- a/.forgejo/workflows/milestone.yml +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2024 The Forgejo Authors -# SPDX-License-Identifier: MIT -# -name: milestone - -on: - pull_request_target: - types: - - closed - -jobs: - set: - if: vars.ROLE == 'forgejo-coding' && github.event.pull_request.merged - runs-on: docker - container: - image: 'data.forgejo.org/oci/ci:1' - steps: - - uses: https://data.forgejo.org/forgejo/set-milestone@v1.0.0 - with: - forgejo: https://codeberg.org - repository: forgejo/forgejo - token: ${{ secrets.SET_MILESTONE_TOKEN }} - pr-number: ${{ github.event.pull_request.number }} - verbose: ${{ vars.SET_MILESTONE_VERBOSE }} diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index 888f7ec07d..3a4099db5d 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -1,17 +1,17 @@ name: mirror on: - workflow_dispatch: - - schedule: - - cron: '@daily' + push: + branches: + - 'forgejo' + - 'v*/forgejo' jobs: mirror: if: ${{ secrets.MIRROR_TOKEN != '' }} runs-on: docker container: - image: 'data.forgejo.org/oci/node:20-bookworm' + image: 'docker.io/node:20-bookworm' steps: - name: git push {v*/,}forgejo run: | diff --git a/.forgejo/workflows/publish-release.yml b/.forgejo/workflows/publish-release.yml index 0dffff7306..536ac23837 100644 --- a/.forgejo/workflows/publish-release.yml +++ b/.forgejo/workflows/publish-release.yml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT # -# See also https://forgejo.org/docs/next/contributor/release/#stable-release-process +# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process # # https://codeberg.org/forgejo-experimental/forgejo # @@ -36,51 +36,41 @@ on: jobs: publish: - runs-on: lxc-bookworm + runs-on: self-hosted if: vars.DOER != '' && vars.FORGEJO != '' && vars.TO_OWNER != '' && vars.FROM_OWNER != '' && secrets.TOKEN != '' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: copy & sign - uses: https://data.forgejo.org/forgejo/forgejo-build-publish/publish@v5.3.0 + uses: https://code.forgejo.org/forgejo/forgejo-build-publish/publish@v1 with: - from-forgejo: ${{ vars.FORGEJO }} - to-forgejo: ${{ vars.FORGEJO }} + forgejo: ${{ vars.FORGEJO }} from-owner: ${{ vars.FROM_OWNER }} to-owner: ${{ vars.TO_OWNER }} repo: ${{ vars.REPO }} - release-notes: "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/release-notes-published/{VERSION}.md" ref-name: ${{ github.ref_name }} - sha: ${{ github.sha }} - from-token: ${{ secrets.TOKEN }} - to-doer: ${{ vars.DOER }} - to-token: ${{ secrets.TOKEN }} + release-notes: "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#{ANCHOR}" + doer: ${{ vars.DOER }} + token: ${{ secrets.TOKEN }} gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} verbose: ${{ vars.VERBOSE }} - - name: get trigger mirror issue - id: mirror - uses: https://data.forgejo.org/infrastructure/issue-action/get@v1.3.0 - with: - forgejo: https://code.forgejo.org - repository: forgejo/forgejo - labels: mirror-trigger - - name: trigger the mirror - uses: https://data.forgejo.org/infrastructure/issue-action/set@v1.3.0 + - name: set up go for the DNS update below + if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != '' + uses: https://code.forgejo.org/actions/setup-go@v4 with: - forgejo: https://code.forgejo.org - repository: forgejo/forgejo - token: ${{ secrets.LABEL_ISSUE_FORGEJO_MIRROR_TOKEN }} - numbers: ${{ steps.mirror.outputs.numbers }} - label-wait-if-exists: 3600 - label: trigger - - - name: upgrade v*.next.forgejo.org - uses: https://data.forgejo.org/infrastructure/next-digest@v1.1.0 + go-version: ">=1.21" + check-latest: true + - name: update the _release.experimental DNS record + if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != '' + uses: https://code.forgejo.org/actions/ovh-dns-update@v1 with: - url: https://placeholder:${{ secrets.TOKEN_NEXT_DIGEST }}@code.forgejo.org/infrastructure/next-digest - ref_name: '${{ github.ref_name }}' - image: 'codeberg.org/forgejo-experimental/forgejo' - tag_suffix: '-rootless' + subdomain: _release.experimental + domain: forgejo.com # there is a CNAME from .org to .com (for security reasons) + record-id: 5283602601 + value: v=${{ github.ref_name }} + ovh-app-key: ${{ secrets.OVH_APP_KEY }} + ovh-app-secret: ${{ secrets.OVH_APP_SECRET }} + ovh-consumer-key: ${{ secrets.OVH_CON_KEY }} diff --git a/.forgejo/workflows/release-notes-assistant-milestones.yml b/.forgejo/workflows/release-notes-assistant-milestones.yml deleted file mode 100644 index 50b267ec14..0000000000 --- a/.forgejo/workflows/release-notes-assistant-milestones.yml +++ /dev/null @@ -1,33 +0,0 @@ -on: - workflow_dispatch: - - schedule: - - cron: '@daily' - -jobs: - release-notes: - if: vars.ROLE == 'forgejo-coding' - runs-on: docker - container: - image: 'data.forgejo.org/oci/node:20-bookworm' - steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - - uses: https://data.forgejo.org/actions/setup-go@v5 - with: - go-version-file: "go.mod" - cache: false - - - name: apt install jq - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update -qq - apt-get -q install -y -qq jq - - - name: update open milestones - run: | - set -x - curl -sS $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/milestones?state=open | jq -r '.[] | .title' | while read forgejo version ; do - milestone="$forgejo $version" - go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.1 --config .release-notes-assistant.yaml --storage milestone --storage-location "$milestone" --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} release $version - done diff --git a/.forgejo/workflows/release-notes-assistant.yml b/.forgejo/workflows/release-notes-assistant.yml deleted file mode 100644 index 7217bf4d2b..0000000000 --- a/.forgejo/workflows/release-notes-assistant.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: issue-labels - -on: - pull_request_target: - types: - - edited - - synchronize - - labeled - -jobs: - release-notes: - if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note') - runs-on: docker - container: - image: 'data.forgejo.org/oci/node:20-bookworm' - steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - - name: event - run: | - cat <<'EOF' - ${{ toJSON(github.event.pull_request.labels.*.name) }} - EOF - cat <<'EOF' - ${{ toJSON(github.event) }} - EOF - - - uses: https://data.forgejo.org/actions/setup-go@v5 - with: - go-version-file: "go.mod" - cache: false - - - name: apt install jq - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update -qq - apt-get -q install -y -qq jq - - - name: release-notes-assistant preview - run: | - go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.1 --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }} diff --git a/.forgejo/workflows/renovate.yml b/.forgejo/workflows/renovate.yml deleted file mode 100644 index 632fb82c19..0000000000 --- a/.forgejo/workflows/renovate.yml +++ /dev/null @@ -1,71 +0,0 @@ -# -# Runs every 2 hours, but Renovate is limited to create new PR before 4am. -# See renovate.json for more settings. -# Automerge is enabled for Renovate PR's but need to be approved before. -# -name: renovate - -on: - push: - branches: - - renovate/** # self-test updates - paths: - - .forgejo/workflows/renovate.yml - schedule: - - cron: '0 0/2 * * *' - workflow_dispatch: - -env: - RENOVATE_DRY_RUN: ${{ (github.event_name != 'schedule' && github.ref_name != github.event.repository.default_branch) && 'full' || '' }} - RENOVATE_REPOSITORIES: ${{ github.repository }} - -jobs: - renovate: - if: vars.ROLE == 'forgejo-coding' && secrets.RENOVATE_TOKEN != '' - - runs-on: docker - container: - image: data.forgejo.org/renovate/renovate:39.106.0 - - steps: - - name: Load renovate repo cache - uses: https://data.forgejo.org/actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 - with: - path: | - .tmp/cache/renovate/repository - .tmp/cache/renovate/renovate-cache-sqlite - .tmp/osv - key: repo-cache-${{ github.run_id }} - restore-keys: | - repo-cache- - - - name: Run renovate - run: renovate - env: - GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_COM_TOKEN }} - LOG_LEVEL: debug - RENOVATE_BASE_DIR: ${{ github.workspace }}/.tmp - RENOVATE_ENDPOINT: ${{ github.server_url }} - RENOVATE_PLATFORM: gitea - RENOVATE_REPOSITORY_CACHE: 'enabled' - RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} - RENOVATE_GIT_AUTHOR: 'Renovate Bot ' - - RENOVATE_X_SQLITE_PACKAGE_CACHE: true - - GIT_AUTHOR_NAME: 'Renovate Bot' - GIT_AUTHOR_EMAIL: 'forgejo-renovate-action@forgejo.org' - GIT_COMMITTER_NAME: 'Renovate Bot' - GIT_COMMITTER_EMAIL: 'forgejo-renovate-action@forgejo.org' - - OSV_OFFLINE_ROOT_DIR: ${{ github.workspace }}/.tmp/osv - - - name: Save renovate repo cache - if: always() && env.RENOVATE_DRY_RUN != 'full' - uses: https://data.forgejo.org/actions/cache/save@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 - with: - path: | - .tmp/cache/renovate/repository - .tmp/cache/renovate/renovate-cache-sqlite - .tmp/osv - key: repo-cache-${{ github.run_id }} diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index eb3163d3ae..de1298eff8 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -6,282 +6,206 @@ on: branches: - 'forgejo*' - 'v*/forgejo*' - workflow_dispatch: jobs: - backend-checks: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' + lint-backend: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker container: - image: 'data.forgejo.org/oci/node:20-bookworm' - options: --tmpfs /tmp:exec,noatime + image: 'docker.io/node:20-bookworm' steps: - - name: event info - run: | - cat <<'EOF' - ${{ toJSON(github) }} - EOF - - uses: https://data.forgejo.org/actions/checkout@v4 - - uses: ./.forgejo/workflows-composite/setup-env - - run: su forgejo -c 'make deps-backend deps-tools' - - run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check fmt-check swagger-validate' # ensure the "go-licenses" make target runs - - uses: ./.forgejo/workflows-composite/build-backend - frontend-checks: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' - runs-on: docker - container: - image: 'data.forgejo.org/oci/node:20-bookworm' - options: --tmpfs /tmp:exec,noatime - steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - run: make deps-frontend - - run: make lint-frontend - - run: make checks-frontend - - run: make test-frontend-coverage - - run: make frontend - - name: Install zstd for cache saving - # works around https://github.com/actions/cache/issues/1169, because the - # consuming job has zstd and doesn't restore the cache otherwise - run: | - apt-get update -qq - apt-get -q install -qq -y zstd - - name: "Cache frontend build for playwright testing" - uses: actions/cache/save@v4 + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 with: - path: ${{github.workspace}}/public/assets - key: frontend-build-${{ github.sha }} - test-unit: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' + go-version: ">=1.21" + check-latest: true + - run: make deps-backend deps-tools + - run: make lint-backend + env: + TAGS: bindata sqlite sqlite_unlock_notify + checks-backend: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker - needs: [backend-checks, frontend-checks] container: - image: 'data.forgejo.org/oci/node:20-bookworm' - options: --tmpfs /tmp:exec,noatime + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version: ">=1.21" + check-latest: true + - run: make deps-backend deps-tools + - run: make --always-make checks-backend # ensure the "go-licenses" make target runs + test-unit: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + runs-on: docker + needs: [lint-backend, checks-backend] + container: + image: 'docker.io/node:20-bookworm' services: - elasticsearch: - image: data.forgejo.org/oci/bitnami/elasticsearch:7 - options: --tmpfs /bitnami/elasticsearch/data - env: - discovery.type: single-node - ES_JAVA_OPTS: "-Xms512m -Xmx512m" minio: - image: data.forgejo.org/oci/bitnami/minio:2024.8.17 - options: >- - --hostname gitea.minio --tmpfs /bitnami/minio/data:noatime + image: 'docker.io/bitnami/minio:2023.8.31' env: - MINIO_DOMAIN: minio MINIO_ROOT_USER: 123456 MINIO_ROOT_PASSWORD: 12345678 steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - uses: ./.forgejo/workflows-composite/setup-env - - name: install git >= 2.42 - uses: ./.forgejo/workflows-composite/apt-install-from + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 with: - packages: git - - name: test release-notes-assistant.sh + go-version: ">=1.21" + - run: | + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - name: install git >= 2.42 run: | - apt-get -q install -qq -y jq - ./release-notes-assistant.sh test_main - - uses: ./.forgejo/workflows-composite/build-backend + export DEBIAN_FRONTEND=noninteractive + echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list + apt-get update -qq + apt-get -q install -qq -y git + rm /etc/apt/sources.list.d/testing.list + apt-get update -qq + - run: | + su forgejo -c 'make deps-backend' + - run: | + su forgejo -c 'make backend' + env: + TAGS: bindata - run: | su forgejo -c 'make test-backend test-check' - timeout-minutes: 120 + timeout-minutes: 50 env: RACE_ENABLED: 'true' TAGS: bindata - TEST_ELASTICSEARCH_URL: http://elasticsearch:9200 - test-e2e: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' - runs-on: docker - needs: [backend-checks, frontend-checks] - container: - image: 'data.forgejo.org/oci/playwright:latest' - options: --tmpfs /tmp:exec,noatime - steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - with: - fetch-depth: 20 - - uses: ./.forgejo/workflows-composite/setup-env - - name: "Restore frontend build" - uses: actions/cache/restore@v4 - id: cache-frontend - with: - path: ${{github.workspace}}/public/assets - key: frontend-build-${{ github.sha }} - - name: "Build frontend (if not cached)" - if: steps.cache-frontend.outputs.cache-hit != 'true' - run: | - su forgejo -c 'make deps-frontend frontend' - - uses: ./.forgejo/workflows-composite/build-backend - - name: Get changed files - id: changed-files - uses: https://data.forgejo.org/tj-actions/changed-files@v45 - with: - separator: '\n' - - run: | - su forgejo -c 'make generate test-e2e-sqlite' - timeout-minutes: 120 - env: - USE_REPO_TEST_DIR: 1 - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - CHANGED_FILES: ${{steps.changed-files.outputs.all_changed_files}} - - name: Upload test artifacts on failure - if: failure() - uses: https://data.forgejo.org/forgejo/upload-artifact@v4 - with: - name: test-artifacts.zip - path: tests/e2e/test-artifacts/ - retention-days: 3 - test-remote-cacher: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' - runs-on: docker - needs: [backend-checks, frontend-checks, test-unit] - container: - image: 'data.forgejo.org/oci/node:20-bookworm' - options: --tmpfs /tmp:exec,noatime - name: ${{ format('test-remote-cacher ({0})', matrix.cacher.name) }} - strategy: - matrix: - cacher: - - name: redis - image: data.forgejo.org/oci/bitnami/redis:7.2 - options: --tmpfs /bitnami/redis/data:noatime - - name: redict - image: registry.redict.io/redict:7.3.0-scratch - options: --tmpfs /data:noatime - - name: valkey - image: data.forgejo.org/oci/bitnami/valkey:7.2 - options: --tmpfs /bitnami/redis/data:noatime - - name: garnet - image: ghcr.io/microsoft/garnet-alpine:1.0.14 - options: --tmpfs /data:noatime - services: - cacher: - image: ${{ matrix.cacher.image }} - options: ${{ matrix.cacher.options }} - steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - uses: ./.forgejo/workflows-composite/setup-env - - name: install git >= 2.42 - uses: ./.forgejo/workflows-composite/apt-install-from - with: - packages: git - - uses: ./.forgejo/workflows-composite/build-backend - - run: | - su forgejo -c 'make test-remote-cacher test-check' - timeout-minutes: 120 - env: - RACE_ENABLED: 'true' - TAGS: bindata - TEST_REDIS_SERVER: cacher:${{ matrix.cacher.port }} test-mysql: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker - needs: [backend-checks, frontend-checks] + needs: [lint-backend, checks-backend] container: - image: 'data.forgejo.org/oci/node:20-bookworm' - options: --tmpfs /tmp:exec,noatime + image: 'docker.io/node:20-bookworm' services: mysql: - image: 'data.forgejo.org/oci/bitnami/mysql:8.4' + image: 'docker.io/mysql:8-debian' env: - ALLOW_EMPTY_PASSWORD: yes + MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: testgitea - # - # See also https://codeberg.org/forgejo/forgejo/issues/976 - # - MYSQL_EXTRA_FLAGS: --innodb-adaptive-flushing=OFF --innodb-buffer-pool-size=4G --innodb-log-buffer-size=128M --innodb-flush-log-at-trx-commit=0 --innodb-flush-log-at-timeout=30 --innodb-flush-method=nosync --innodb-fsync-threshold=1000000000 --disable-log-bin - options: --tmpfs /bitnami/mysql/data:noatime + # + # See also https://codeberg.org/forgejo/forgejo/issues/976 + # + cmd: ['mysqld', '--innodb-adaptive-flushing=OFF', '--innodb-buffer-pool-size=4G', '--innodb-log-buffer-size=128M', '--innodb-flush-log-at-trx-commit=0', '--innodb-flush-log-at-timeout=30', '--innodb-flush-method=nosync', '--innodb-fsync-threshold=1000000000'] steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - uses: ./.forgejo/workflows-composite/setup-env - - name: install dependencies & git >= 2.42 - uses: ./.forgejo/workflows-composite/apt-install-from + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 with: - packages: git git-lfs - - uses: ./.forgejo/workflows-composite/build-backend + go-version: "1.21" + - name: install dependencies & git >= 2.42 + run: | + export DEBIAN_FRONTEND=noninteractive + echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list + apt-get update -qq + apt-get install --no-install-recommends -qq -y git git-lfs + rm /etc/apt/sources.list.d/testing.list + apt-get update -qq + - name: setup user and permissions + run: | + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-backend' + - run: | + su forgejo -c 'make backend' + env: + TAGS: bindata - run: | su forgejo -c 'make test-mysql-migration test-mysql' - timeout-minutes: 120 + timeout-minutes: 50 env: + TAGS: bindata USE_REPO_TEST_DIR: 1 test-pgsql: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker - needs: [backend-checks, frontend-checks] + needs: [lint-backend, checks-backend] container: - image: 'data.forgejo.org/oci/node:20-bookworm' - options: --tmpfs /tmp:exec,noatime + image: 'docker.io/node:20-bookworm' services: minio: - image: data.forgejo.org/oci/bitnami/minio:2024.8.17 + image: bitnami/minio:2021.3.17 env: - MINIO_ROOT_USER: 123456 - MINIO_ROOT_PASSWORD: 12345678 - options: --tmpfs /bitnami/minio/data - ldap: - image: data.forgejo.org/oci/test-openldap:latest + MINIO_ACCESS_KEY: 123456 + MINIO_SECRET_KEY: 12345678 pgsql: - image: data.forgejo.org/oci/bitnami/postgresql:15 + image: 'docker.io/postgres:15' env: - POSTGRESQL_DATABASE: test - POSTGRESQL_PASSWORD: postgres - POSTGRESQL_FSYNC: off - POSTGRESQL_EXTRA_FLAGS: -c full_page_writes=off - options: --tmpfs /bitnami/postgresql + POSTGRES_DB: test + POSTGRES_PASSWORD: postgres steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - uses: ./.forgejo/workflows-composite/setup-env - - name: install dependencies & git >= 2.42 - uses: ./.forgejo/workflows-composite/apt-install-from + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 with: - packages: git git-lfs - - uses: ./.forgejo/workflows-composite/build-backend + go-version: "1.21" + - name: install dependencies & git >= 2.42 + run: | + export DEBIAN_FRONTEND=noninteractive + echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list + apt-get update -qq + apt-get install --no-install-recommends -qq -y git git-lfs + rm /etc/apt/sources.list.d/testing.list + apt-get update -qq + - name: setup user and permissions + run: | + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-backend' + - run: | + su forgejo -c 'make backend' + env: + TAGS: bindata - run: | su forgejo -c 'make test-pgsql-migration test-pgsql' - timeout-minutes: 120 + timeout-minutes: 50 env: + TAGS: bindata RACE_ENABLED: true USE_REPO_TEST_DIR: 1 - TEST_LDAP: 1 test-sqlite: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' + if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} runs-on: docker - needs: [backend-checks, frontend-checks] + needs: [lint-backend, checks-backend] container: - image: 'data.forgejo.org/oci/node:20-bookworm' - options: --tmpfs /tmp:exec,noatime + image: 'docker.io/node:20-bookworm' steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - uses: ./.forgejo/workflows-composite/setup-env - - name: install dependencies & git >= 2.42 - uses: ./.forgejo/workflows-composite/apt-install-from + - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://code.forgejo.org/actions/setup-go@v4 with: - packages: git git-lfs - - uses: ./.forgejo/workflows-composite/build-backend + go-version: "1.21" + - name: install dependencies & git >= 2.42 + run: | + export DEBIAN_FRONTEND=noninteractive + echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list + apt-get update -qq + apt-get install --no-install-recommends -qq -y git git-lfs + rm /etc/apt/sources.list.d/testing.list + apt-get update -qq + - name: setup user and permissions + run: | + git config --add safe.directory '*' + adduser --quiet --comment forgejo --disabled-password forgejo + chown -R forgejo:forgejo . + - run: | + su forgejo -c 'make deps-backend' + - run: | + su forgejo -c 'make backend' + env: + TAGS: bindata sqlite sqlite_unlock_notify - run: | su forgejo -c 'make test-sqlite-migration test-sqlite' - timeout-minutes: 120 + timeout-minutes: 50 env: - TAGS: sqlite sqlite_unlock_notify + TAGS: bindata sqlite sqlite_unlock_notify RACE_ENABLED: true TEST_TAGS: sqlite sqlite_unlock_notify USE_REPO_TEST_DIR: 1 - security-check: - if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' - runs-on: docker - needs: - - test-sqlite - - test-pgsql - - test-mysql - - test-remote-cacher - - test-unit - container: - image: 'data.forgejo.org/oci/node:20-bookworm' - options: --tmpfs /tmp:exec,noatime - steps: - - uses: https://data.forgejo.org/actions/checkout@v4 - - uses: ./.forgejo/workflows-composite/setup-env - - run: su forgejo -c 'make deps-backend deps-tools' - - run: su forgejo -c 'make security-check' diff --git a/.gitattributes b/.gitattributes index 4e748c071a..51131c7d83 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,5 @@ * text=auto eol=lf *.tmpl linguist-language=go-html-template -*.pb.go linguist-generated /assets/*.json linguist-generated /public/assets/img/svg/*.svg linguist-generated /templates/swagger/v1_json.tmpl linguist-generated diff --git a/.forgejo/issue_template/bug-report-ui.yaml b/.gitea/issue_template/bug-report-ui.yaml similarity index 58% rename from .forgejo/issue_template/bug-report-ui.yaml rename to .gitea/issue_template/bug-report-ui.yaml index 57d578b232..4d80198399 100644 --- a/.forgejo/issue_template/bug-report-ui.yaml +++ b/.gitea/issue_template/bug-report-ui.yaml @@ -1,7 +1,7 @@ name: 🦋 Bug Report (web interface / frontend) description: Something doesn't look quite as it should? Report it here! -title: "bug: " -labels: ["bug/new-report", "forgejo/ui"] +title: "[BUG] " +labels: ["bug", "forgejo/ui"] body: - type: markdown attributes: @@ -13,29 +13,16 @@ body: - Please speak English, as this is the language all maintainers can speak and write. - Be as clear and concise as possible. A very verbose report is harder to interpret in a concrete way. - Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct). - - Take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137). -- type: dropdown - id: can-reproduce - attributes: - label: Can you reproduce the bug on the Forgejo test instance? - description: | - Please try reproducing your issue at https://dev.next.forgejo.org. - It is running the latest development branch and will confirm the problem is not already fixed. - If you can reproduce it, provide a URL in the description. - options: - - "Yes" - - "No" - validations: - required: true + - Please make sure you are using the latest release of Forgejo and take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137). + - Please give all relevant information below for bug reports, as incomplete details may result in the issue not being considered. - type: textarea id: description attributes: label: Description description: | - Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see above). - If you think this is a JavaScript error, include a copy of the JavaScript console. - validations: - required: true + Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below). + If you think this is a JavaScript error, show us the JavaScript console. + If the error appears to relate to Forgejo the server, please also give us `DEBUG` level logs. (See https://forgejo.org/docs/latest/admin/logging-documentation/) - type: textarea id: screenshots attributes: @@ -48,6 +35,20 @@ body: attributes: label: Forgejo Version description: Forgejo version (or commit reference) your instance is running + validations: + required: true +- type: dropdown + id: can-reproduce + attributes: + label: Can you reproduce the bug on Forgejo Next? + description: | + Please try reproducing your issue at [Forgejo Next](https://next.forgejo.org). + If you can reproduce it, please provide a URL in the Description field. + options: + - "Yes" + - "No" + validations: + required: true - type: input id: browser-ver attributes: @@ -55,3 +56,8 @@ body: description: The browser and version that you are using to access Forgejo validations: required: true +- type: input + id: os-ver + attributes: + label: Operating System + description: The operating system you are using to access Forgejo diff --git a/.forgejo/issue_template/bug-report.yaml b/.gitea/issue_template/bug-report.yaml similarity index 66% rename from .forgejo/issue_template/bug-report.yaml rename to .gitea/issue_template/bug-report.yaml index 6e9b116e60..ce67378175 100644 --- a/.forgejo/issue_template/bug-report.yaml +++ b/.gitea/issue_template/bug-report.yaml @@ -1,7 +1,7 @@ name: 🐛 Bug Report (server / backend) description: Found something you weren't expecting? Report it here! -title: "bug: " -labels: bug/new-report +title: "[BUG] " +labels: bug body: - type: markdown attributes: @@ -13,26 +13,14 @@ body: - Please speak English, as this is the language all maintainers can speak and write. - Be as clear and concise as possible. A very verbose report is harder to interpret in a concrete way. - Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct). - - Take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137). -- type: dropdown - id: can-reproduce - attributes: - label: Can you reproduce the bug on the Forgejo test instance? - description: | - Please try reproducing your issue at https://dev.next.forgejo.org. - It is running the latest development branch and will confirm the problem is not already fixed. - If you can reproduce it, provide a URL in the description. - options: - - "Yes" - - "No" - validations: - required: true + - Please make sure you are using the latest release of Forgejo and take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137). + - Please give all relevant information below for bug reports, as incomplete details may result in the issue not being considered. - type: textarea id: description attributes: label: Description description: | - Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see above). + Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below). validations: required: true - type: input @@ -40,14 +28,18 @@ body: attributes: label: Forgejo Version description: Forgejo version (or commit reference) of your instance -- type: textarea - id: run-info + validations: + required: true +- type: dropdown + id: can-reproduce attributes: - label: How are you running Forgejo? + label: Can you reproduce the bug on Forgejo Next? description: | - Please include information on whether you built Forgejo yourself, used one of our downloads, or are using some other package. - Please also tell us how you are running Forgejo, e.g. if it is being run from a container, a command-line, systemd etc. - If you are using a package or systemd tell us what distribution you are using. + Please try reproducing your issue at [Forgejo Next](https://next.forgejo.org). + If you can reproduce it, please provide a URL in the Description field. + options: + - "Yes" + - "No" validations: required: true - type: textarea @@ -61,6 +53,31 @@ body: Please copy and paste your logs here, with any sensitive information (e.g. API keys) removed/hidden. You can wrap your logs in `
...
` tags so it doesn't take up too much space in the issue. +- type: textarea + id: screenshots + attributes: + label: Screenshots + description: If this issue involves the Web Interface, please provide one or more screenshots +- type: input + id: git-ver + attributes: + label: Git Version + description: The version of git running on the server +- type: input + id: os-ver + attributes: + label: Operating System + description: The operating system you are using to run Forgejo +- type: textarea + id: run-info + attributes: + label: How are you running Forgejo? + description: | + Please include information on whether you built Forgejo yourself, used one of our downloads, or are using some other package. + Please also tell us how you are running Forgejo, e.g. if it is being run from docker, a command-line, systemd etc. + If you are using a package or systemd tell us what distribution you are using. + validations: + required: true - type: dropdown id: database attributes: @@ -70,3 +87,4 @@ body: - SQLite - PostgreSQL - MySQL + - MSSQL diff --git a/.forgejo/issue_template/config.yml b/.gitea/issue_template/config.yml similarity index 86% rename from .forgejo/issue_template/config.yml rename to .gitea/issue_template/config.yml index f2ea8d945a..0e3caf9280 100644 --- a/.forgejo/issue_template/config.yml +++ b/.gitea/issue_template/config.yml @@ -1,7 +1,7 @@ contact_links: - name: 🔓 Security Reports url: mailto:security@forgejo.org - about: "Please email (See https://forgejo.org/.well-known/security.txt)." + about: "Please email (GPG: `A4676E79`) instead of opening a public issue." - name: 💬 Matrix Chat Room url: https://matrix.to/#/#forgejo-chat:matrix.org about: Please ask questions and discuss configuration or deployment problems here. diff --git a/.forgejo/issue_template/feature-request.yaml b/.gitea/issue_template/feature-request.yaml similarity index 98% rename from .forgejo/issue_template/feature-request.yaml rename to .gitea/issue_template/feature-request.yaml index 0996680cb4..4b10bea145 100644 --- a/.forgejo/issue_template/feature-request.yaml +++ b/.gitea/issue_template/feature-request.yaml @@ -1,6 +1,6 @@ name: 💡 Feature Request description: Got an idea for a feature that Forgejo doesn't have yet? Suggest it here! -title: "feat: " +title: "[FEAT] " labels: ["enhancement/feature"] body: - type: markdown diff --git a/.gitea/pull_request_template.md b/.gitea/pull_request_template.md new file mode 100644 index 0000000000..a94ec46201 --- /dev/null +++ b/.gitea/pull_request_template.md @@ -0,0 +1,4 @@ + diff --git a/.gitignore b/.gitignore index 79a4108dab..12014d405b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ _test # MS VSCode .vscode -__debug_bin* +__debug_bin *.cgo1.go *.cgo2.c @@ -37,7 +37,6 @@ _testmain.go *coverage.out coverage.all -coverage/ cpu.out /modules/migration/bindata.go @@ -65,7 +64,7 @@ cpu.out /data /indexers /log -/public/assets/img/avatar +/public/img/avatar /tests/integration/gitea-integration-* /tests/integration/indexers-* /tests/e2e/gitea-e2e-* @@ -73,7 +72,6 @@ cpu.out /tests/e2e/reports /tests/e2e/test-artifacts /tests/e2e/test-snapshots -/tests/e2e/.auth /tests/*.ini /tests/**/*.git/**/*.sample /node_modules @@ -85,6 +83,7 @@ cpu.out /public/assets/css /public/assets/fonts /public/assets/licenses.txt +/public/assets/img/webpack /vendor /web_src/fomantic/node_modules /web_src/fomantic/build/* @@ -103,9 +102,6 @@ cpu.out /.go-licenses /.cur-deadcode-out -# Files and folders that were previously generated -/public/assets/img/webpack - # Snapcraft /gitea_a*.txt snap/.snapcraft/ @@ -117,12 +113,6 @@ prime/ *_source.tar.bz2 .DS_Store -# Direnv configuration -/.envrc - -# nix-direnv generated files -.direnv/ - # Make evidence files /.make_evidence diff --git a/.gitpod.yml b/.gitpod.yml index 8671edc47c..35b22c45ae 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -10,19 +10,10 @@ tasks: - name: Run backend command: | gp sync-await setup - - # Get the URL and extract the domain - url=$(gp url 3000) - domain=$(echo $url | awk -F[/:] '{print $4}') - - if [ -f custom/conf/app.ini ]; then - sed -i "s|^ROOT_URL =.*|ROOT_URL = ${url}/|" custom/conf/app.ini - sed -i "s|^DOMAIN =.*|DOMAIN = ${domain}|" custom/conf/app.ini - sed -i "s|^SSH_DOMAIN =.*|SSH_DOMAIN = ${domain}|" custom/conf/app.ini - sed -i "s|^NO_REPLY_ADDRESS =.*|SSH_DOMAIN = noreply.${domain}|" custom/conf/app.ini - else + if [ ! -f custom/conf/app.ini ] + then mkdir -p custom/conf/ - echo -e "[server]\nROOT_URL = ${url}/" > custom/conf/app.ini + echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini fi export TAGS="sqlite sqlite_unlock_notify" @@ -42,8 +33,8 @@ vscode: - DavidAnson.vscode-markdownlint - Vue.volar - ms-azuretools.vscode-docker - - vitest.explorer - - cweijan.vscode-database-client2 + - zixuanchen.vitest-explorer + - qwtel.sqlite-viewer - GitHub.vscode-pull-request-github ports: diff --git a/.golangci.yml b/.golangci.yml index 0678b90bfc..d6ce37f49a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,14 +1,13 @@ linters: - enable-all: false - disable-all: true - fast: false enable: - bidichk + # - deadcode # deprecated - https://github.com/golangci/golangci-lint/issues/1841 - depguard - dupl - errcheck - forbidigo - gocritic + # - gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time. - gofmt - gofumpt - gosimple @@ -18,22 +17,23 @@ linters: - nolintlint - revive - staticcheck + # - structcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841 - stylecheck - - tenv - - testifylint - typecheck - unconvert - unused - - unparam + # - varcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841 - wastedassign + enable-all: false + disable-all: true + fast: false run: timeout: 10m - -output: - sort-results: true - sort-order: [file] - show-stats: true + skip-dirs: + - node_modules + - public + - web_src linters-settings: stylecheck: @@ -43,42 +43,35 @@ linters-settings: gocritic: disabled-checks: - ifElseChain + - singleCaseSwitch # Every time this occurred in the code, there was no other way. revive: - severity: error + ignore-generated-header: false + severity: warning + confidence: 0.8 + errorCode: 1 + warningCode: 1 rules: - - name: atomic - - name: bare-return - name: blank-imports - - name: constant-logical-expr - name: context-as-argument - name: context-keys-type - name: dot-imports - - name: duplicated-imports - - name: empty-lines - - name: error-naming - name: error-return - name: error-strings - - name: errorf + - name: error-naming - name: exported - - name: identical-branches - name: if-return - name: increment-decrement - - name: indent-error-flow - - name: modifies-value-receiver + - name: var-naming + - name: var-declaration - name: package-comments - name: range - name: receiver-naming - - name: redefines-builtin-id - - name: string-of-int - - name: superfluous-else - name: time-naming - - name: unconditional-recursion - name: unexported-return - - name: unreachable-code - - name: var-declaration - - name: var-naming - - name: redefines-builtin-id - disabled: true + - name: indent-error-flow + - name: errorf + - name: duplicated-imports + - name: modifies-value-receiver gofumpt: extra-rules: true depguard: @@ -97,21 +90,12 @@ linters-settings: desc: do not use the internal package, use AddXxx function instead - pkg: gopkg.in/ini.v1 desc: do not use the ini package, use gitea's config system instead - - pkg: github.com/minio/sha256-simd - desc: use crypto/sha256 instead, see https://codeberg.org/forgejo/forgejo/pulls/1528 - testifylint: - disable: - - go-require issues: max-issues-per-linter: 0 max-same-issues: 0 - exclude-dirs: [node_modules, public, web_src] - exclude-case-sensitive: true exclude-rules: - - path: models/db/sql_postgres_with_schema.go - linters: - - nolintlint + # Exclude some linters from running on tests files. - path: _test\.go linters: - gocyclo @@ -129,19 +113,19 @@ issues: - path: cmd linters: - forbidigo - - text: "webhook" - linters: + - linters: - dupl - - text: "`ID' should not be capitalized" - linters: + text: "webhook" + - linters: - gocritic - - text: "swagger" - linters: + text: "`ID' should not be capitalized" + - linters: - unused - deadcode - - text: "argument x is overwritten before first use" - linters: + text: "swagger" + - linters: - staticcheck + text: "argument x is overwritten before first use" - text: "commentFormatting: put a space between `//` and comment text" linters: - gocritic diff --git a/.ignore b/.ignore index 5b96dabd38..5c945ab981 100644 --- a/.ignore +++ b/.ignore @@ -4,8 +4,6 @@ /modules/options/bindata.go /modules/public/bindata.go /modules/templates/bindata.go -/options/gitignore -/options/license -/public/assets /vendor +/public/assets node_modules diff --git a/.mailmap b/.mailmap deleted file mode 100644 index 88ff1591a4..0000000000 --- a/.mailmap +++ /dev/null @@ -1,2 +0,0 @@ -Unknwon -Unknwon 无闻 diff --git a/.release-notes-assistant.yaml b/.release-notes-assistant.yaml deleted file mode 100644 index b3e5a8e665..0000000000 --- a/.release-notes-assistant.yaml +++ /dev/null @@ -1,27 +0,0 @@ -categorize: './release-notes-assistant.sh' -branch-development: 'forgejo' -branch-pattern: 'v*/forgejo' -branch-find-version: 'v(?P\d+\.\d+)/forgejo' -branch-to-version: '${version}.0' -branch-from-version: 'v%[1]d.%[2]d/forgejo' -tag-from-version: 'v%[1]d.%[2]d.%[3]d' -branch-known: - - 'v7.0/forgejo' -cleanup-line: 'sed -Ee "s/^(feat|fix):\s*//g" -e "s/^\[WIP\] //" -e "s/^WIP: //" -e "s;\[(UI|BUG|FEAT|v.*?/forgejo)\]\s*;;g"' -render-header: | - - ## Release notes -comment: | -
- Where does that come from? - The following is a preview of the release notes for this pull request, as they will appear in the upcoming release. They are derived from the content of the `%[2]s/%[3]s.md` file, if it exists, or the title of the pull request. They were also added at the bottom of the description of this pull request for easier reference. - - This message and the release notes originate from a call to the [release-notes-assistant](https://code.forgejo.org/forgejo/release-notes-assistant). - - ```diff - %[4]s - ``` - -
- - %[1]s diff --git a/.stylelintrc.yaml b/.stylelintrc.yaml new file mode 100644 index 0000000000..d1be3eed82 --- /dev/null +++ b/.stylelintrc.yaml @@ -0,0 +1,221 @@ +plugins: + - stylelint-declaration-strict-value + - stylelint-declaration-block-no-ignored-properties + - stylelint-stylistic + +ignoreFiles: + - "**/*.go" + +overrides: + - files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console.css", "font_i18n.css"] + rules: + scale-unlimited/declaration-strict-value: null + - files: ["**/chroma/*", "**/codemirror/*"] + rules: + block-no-empty: null + - files: ["**/*.vue"] + customSyntax: postcss-html + +rules: + alpha-value-notation: null + annotation-no-unknown: true + at-rule-allowed-list: null + at-rule-disallowed-list: null + at-rule-empty-line-before: null + at-rule-no-unknown: true + at-rule-no-vendor-prefix: true + at-rule-property-required-list: null + block-no-empty: true + color-function-notation: null + color-hex-alpha: null + color-hex-length: null + color-named: null + color-no-hex: null + color-no-invalid-hex: true + comment-empty-line-before: null + comment-no-empty: true + comment-pattern: null + comment-whitespace-inside: null + comment-word-disallowed-list: null + custom-media-pattern: null + custom-property-empty-line-before: null + custom-property-no-missing-var-function: true + custom-property-pattern: null + declaration-block-no-duplicate-custom-properties: true + declaration-block-no-duplicate-properties: [true, {ignore: [consecutive-duplicates-with-different-values]}] + declaration-block-no-redundant-longhand-properties: null + declaration-block-no-shorthand-property-overrides: null + declaration-block-single-line-max-declarations: null + declaration-empty-line-before: null + declaration-no-important: null + declaration-property-max-values: null + declaration-property-unit-allowed-list: null + declaration-property-unit-disallowed-list: {line-height: [em]} + declaration-property-value-allowed-list: null + declaration-property-value-disallowed-list: null + declaration-property-value-no-unknown: true + font-family-name-quotes: always-where-recommended + font-family-no-duplicate-names: true + font-family-no-missing-generic-family-keyword: true + font-weight-notation: null + function-allowed-list: null + function-calc-no-unspaced-operator: true + function-disallowed-list: null + function-linear-gradient-no-nonstandard-direction: true + function-name-case: lower + function-no-unknown: null + function-url-no-scheme-relative: null + function-url-quotes: always + function-url-scheme-allowed-list: null + function-url-scheme-disallowed-list: null + hue-degree-notation: null + import-notation: string + keyframe-block-no-duplicate-selectors: true + keyframe-declaration-no-important: true + keyframe-selector-notation: null + keyframes-name-pattern: null + length-zero-no-unit: [true, ignore: [custom-properties], ignoreFunctions: [var]] + max-nesting-depth: null + media-feature-name-allowed-list: null + media-feature-name-disallowed-list: null + media-feature-name-no-unknown: true + media-feature-name-no-vendor-prefix: true + media-feature-name-unit-allowed-list: null + media-feature-name-value-allowed-list: null + media-feature-name-value-no-unknown: true + media-feature-range-notation: null + media-query-no-invalid: true + named-grid-areas-no-invalid: true + no-descending-specificity: null + no-duplicate-at-import-rules: true + no-duplicate-selectors: true + no-empty-source: true + no-invalid-double-slash-comments: true + no-invalid-position-at-import-rule: null + no-irregular-whitespace: true + no-unknown-animations: null + no-unknown-custom-properties: null + number-max-precision: null + plugin/declaration-block-no-ignored-properties: true + property-allowed-list: null + property-disallowed-list: null + property-no-unknown: true + property-no-vendor-prefix: null + rule-empty-line-before: null + rule-selector-property-disallowed-list: null + scale-unlimited/declaration-strict-value: [[/color$/, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true, expandShorthand: true}] + selector-attribute-name-disallowed-list: null + selector-attribute-operator-allowed-list: null + selector-attribute-operator-disallowed-list: null + selector-attribute-quotes: always + selector-class-pattern: null + selector-combinator-allowed-list: null + selector-combinator-disallowed-list: null + selector-disallowed-list: null + selector-id-pattern: null + selector-max-attribute: null + selector-max-class: null + selector-max-combinators: null + selector-max-compound-selectors: null + selector-max-id: null + selector-max-pseudo-class: null + selector-max-specificity: null + selector-max-type: null + selector-max-universal: null + selector-nested-pattern: null + selector-no-qualifying-type: null + selector-no-vendor-prefix: true + selector-not-notation: null + selector-pseudo-class-allowed-list: null + selector-pseudo-class-disallowed-list: null + selector-pseudo-class-no-unknown: true + selector-pseudo-element-allowed-list: null + selector-pseudo-element-colon-notation: double + selector-pseudo-element-disallowed-list: null + selector-pseudo-element-no-unknown: true + selector-type-case: lower + selector-type-no-unknown: [true, {ignore: [custom-elements]}] + shorthand-property-no-redundant-values: true + string-no-newline: true + stylistic/at-rule-name-case: null + stylistic/at-rule-name-newline-after: null + stylistic/at-rule-name-space-after: null + stylistic/at-rule-semicolon-newline-after: null + stylistic/at-rule-semicolon-space-before: null + stylistic/block-closing-brace-empty-line-before: null + stylistic/block-closing-brace-newline-after: null + stylistic/block-closing-brace-newline-before: null + stylistic/block-closing-brace-space-after: null + stylistic/block-closing-brace-space-before: null + stylistic/block-opening-brace-newline-after: null + stylistic/block-opening-brace-newline-before: null + stylistic/block-opening-brace-space-after: null + stylistic/block-opening-brace-space-before: null + stylistic/color-hex-case: lower + stylistic/declaration-bang-space-after: never + stylistic/declaration-bang-space-before: null + stylistic/declaration-block-semicolon-newline-after: null + stylistic/declaration-block-semicolon-newline-before: null + stylistic/declaration-block-semicolon-space-after: null + stylistic/declaration-block-semicolon-space-before: never + stylistic/declaration-block-trailing-semicolon: null + stylistic/declaration-colon-newline-after: null + stylistic/declaration-colon-space-after: null + stylistic/declaration-colon-space-before: never + stylistic/function-comma-newline-after: null + stylistic/function-comma-newline-before: null + stylistic/function-comma-space-after: null + stylistic/function-comma-space-before: null + stylistic/function-max-empty-lines: 0 + stylistic/function-parentheses-newline-inside: never-multi-line + stylistic/function-parentheses-space-inside: null + stylistic/function-whitespace-after: null + stylistic/indentation: 2 + stylistic/linebreaks: null + stylistic/max-empty-lines: 1 + stylistic/max-line-length: null + stylistic/media-feature-colon-space-after: null + stylistic/media-feature-colon-space-before: never + stylistic/media-feature-name-case: null + stylistic/media-feature-parentheses-space-inside: null + stylistic/media-feature-range-operator-space-after: always + stylistic/media-feature-range-operator-space-before: always + stylistic/media-query-list-comma-newline-after: null + stylistic/media-query-list-comma-newline-before: null + stylistic/media-query-list-comma-space-after: null + stylistic/media-query-list-comma-space-before: null + stylistic/no-empty-first-line: null + stylistic/no-eol-whitespace: true + stylistic/no-extra-semicolons: true + stylistic/no-missing-end-of-source-newline: null + stylistic/number-leading-zero: null + stylistic/number-no-trailing-zeros: null + stylistic/property-case: lower + stylistic/selector-attribute-brackets-space-inside: null + stylistic/selector-attribute-operator-space-after: null + stylistic/selector-attribute-operator-space-before: null + stylistic/selector-combinator-space-after: null + stylistic/selector-combinator-space-before: null + stylistic/selector-descendant-combinator-no-non-space: null + stylistic/selector-list-comma-newline-after: null + stylistic/selector-list-comma-newline-before: null + stylistic/selector-list-comma-space-after: always-single-line + stylistic/selector-list-comma-space-before: never-single-line + stylistic/selector-max-empty-lines: 0 + stylistic/selector-pseudo-class-case: lower + stylistic/selector-pseudo-class-parentheses-space-inside: never + stylistic/selector-pseudo-element-case: lower + stylistic/string-quotes: double + stylistic/unicode-bom: null + stylistic/unit-case: lower + stylistic/value-list-comma-newline-after: null + stylistic/value-list-comma-newline-before: null + stylistic/value-list-comma-space-after: null + stylistic/value-list-comma-space-before: null + stylistic/value-list-max-empty-lines: 0 + time-min-milliseconds: null + unit-allowed-list: null + unit-disallowed-list: null + unit-no-unknown: true + value-keyword-case: null + value-no-vendor-prefix: [true, {ignoreValues: [box, inline-box]}] diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..ae87638f1c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8355 @@ +# Changelog + +This changelog goes through all the changes that have been made in each release +without substantial changes to our git log; to see the highlights of what has +been added to each release, please refer to the [blog](https://blog.gitea.com). + +## [1.21.0](https://github.com/go-gitea/gitea/releases/tag/v1.21.0) - 2023-11-14 + +* BREAKING + * Restrict certificate type for builtin SSH server (#26789) + * Refactor to use urfave/cli/v2 (#25959) + * Move public asset files to the proper directory (#25907) + * Remove commit status running and warning to align GitHub (#25839) (partially reverted: Restore warning commit status (#27504) (#27529)) + * Remove "CHARSET" config option for MySQL, always use "utf8mb4" (#25413) + * Set SSH_AUTHORIZED_KEYS_BACKUP to false (#25412) +* FEATURES + * User details page (#26713) + * Chore(actions): support cron schedule task (#26655) + * Support rebuilding issue indexer manually (#26546) + * Allow to archive labels (#26478) + * Add disable workflow feature (#26413) + * Support `.git-blame-ignore-revs` file (#26395) + * Pre-register OAuth2 applications for git credential helpers (#26291) + * Add `Retry` button when creating a mirror-repo fails (#26228) + * Artifacts retention and auto clean up (#26131) + * Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (#25974) + * Implement auto-cancellation of concurrent jobs if the event is push (#25716) + * Newly pushed branches hints on repository home page (#25715) + * Display branch commit status (#25608) + * Add direct serving of package content (#25543) + * Add commits dropdown in PR files view and allow commit by commit review (#25528) + * Allow package cleanup from admin page (#25307) + * Batch delete issue and improve tippy opts (#25253) + * Show branches and tags that contain a commit (#25180) + * Add actor and status dropdowns to run list (#25118) + * Allow Organisations to have a E-Mail (#25082) + * Add codeowners feature (#24910) + * Actions Artifacts support uploading multiple files and directories (#24874) + * Support configuration variables on Gitea Actions (#24724) + * Support downloading raw task logs (#24451) +* API + * Unify two factor check (#27915) (#27929) + * Fix package webhook (#27839) (#27855) + * Fix/upload artifact error windows (#27802) (#27840) + * Fix bad method call when deleting user secrets via API (#27829) (#27831) + * Do not force creation of _cargo-index repo on publish (#27266) (#27765) + * Delete repos of org when purge delete user (#27273) (#27728) + * Fix org team endpoint (#27721) (#27727) + * Api: GetPullRequestCommits: return file list (#27483) (#27539) + * Don't let API add 2 exclusive labels from same scope (#27433) (#27460) + * Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143) (#27304) + * Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251) + * Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27163) + * Allow empty Conan files (#27092) + * Fix token endpoints ignore specified account (#27080) + * Reduce usage of `db.DefaultContext` (#27073) (#27083) (#27089) (#27103) (#27262) (#27265) (#27347) (#26076) + * Make SSPI auth mockable (#27036) + * Extract auth middleware from service (#27028) + * Add `RemoteAddress` to mirrors (#26952) + * Feat(API): add routes and functions for managing user's secrets (#26909) + * Feat(API): add secret deletion functionality for repository (#26808) + * Feat(API): add route and implementation for creating/updating repository secret (#26766) + * Add Upload URL to release API (#26663) + * Feat(API): update and delete secret for managing organization secrets (#26660) + * Feat: implement organization secret creation API (#26566) + * Add API route to list org secrets (#26485) + * Set commit id when ref used explicitly (#26447) + * PATCH branch-protection updates check list even when checks are disabled (#26351) + * Add file status for API "Get a single commit from a repository" (#16205) (#25831) + * Add API for changing Avatars (#25369) +* BUGFIXES + * Fix viewing wiki commit on empty repo (#28040) (#28044) + * Enable system users for comment.LoadPoster (#28014) (#28032) + * Fixed duplicate attachments on dump on windows (#28019) (#28031) + * Fix wrong xorm Delete usage(backport for 1.21) (#28002) + * Add word-break to repo description in home page (#27924) (#27957) + * Fix rendering assignee changed comments without assignee (#27927) (#27952) + * Add word break to release title (#27942) (#27947) + * Fix JS NPE when viewing specific range of PR commits (#27912) (#27923) + * Show correct commit sha when viewing single commit diff (#27916) (#27921) + * Fix 500 when deleting a dismissed review (#27903) (#27910) + * Fix DownloadFunc when migrating releases (#27887) (#27890) + * Fix http protocol auth (#27875) (#27876) + * Refactor postgres connection string building (#27723) (#27869) + * Close all hashed buffers (#27787) (#27790) + * Fix label render containing invalid HTML (#27752) (#27762) + * Fix duplicate project board when hitting `enter` key (#27746) (#27751) + * Fix `link-action` redirect network error (#27734) (#27749) + * Fix sticky diff header background (#27697) (#27712) + * Always delete existing scheduled action tasks (#27662) (#27688) + * Support allowed hosts for webhook to work with proxy (#27655) (#27675) + * Fix poster is not loaded in get default merge message (#27657) (#27666) + * Improve dropdown button alignment and fix hover bug (#27632) (#27637) + * Improve retrying index issues (#27554) (#27634) + * Fix 404 when deleting Docker package with an internal version (#27615) (#27630) + * Backport manually for a tmpl issue in v1.21 (#27612) + * Don't show Link to TOTP if not set up (#27585) (#27588) + * Fix data-race bug when accessing task.LastRun (#27584) (#27586) + * Fix attachment download bug (#27486) (#27571) + * Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) (#27551) + * Improve dropdown's behavior when there is a search input in menu (#27526) (#27534) + * Fix panic in storageHandler (#27446) (#27479) + * When comparing with an non-exist repository, return 404 but 500 (#27437) (#27442) + * Fix pr template (#27436) (#27440) + * Fix git 2.11 error when checking IsEmpty (#27393) (#27397) + * Allow get release download files and lfs files with oauth2 token format (#26430) (#27379) + * Fix missing ctx for GetRepoLink in dashboard (#27372) (#27375) + * Absolute positioned checkboxes overlay floated elements (#26870) (#27366) + * Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365) + * Fix repo count in org action settings (#27245) (#27353) + * Add logs for data broken of comment review (#27326) (#27345) + * Fix the approval count of PR when there is no protection branch rule (#27272) (#27343) + * Fix Bug in Issue Config when only contact links are set (#26521) (#27334) + * Improve issue history dialog and make poster can delete their own history (#27323) (#27327) + * Fix orphan check for deleted branch (#27310) (#27321) + * Fix protected branch icon location (#26576) (#27317) + * Fix yaml test (#27297) (#27303) + * Fix some animation bugs (#27287) (#27294) + * Fix incorrect change from #27231 (#27275) (#27282) + * Add missing public user visibility in user details page (#27246) (#27250) + * Fix EOL handling in web editor (#27141) (#27234) + * Fix issues on action runners page (#27226) (#27233) + * Quote table `release` in sql queries (#27205) (#27218) + * Fix release URL in webhooks (#27182) (#27185) + * Fix review request number and add more tests (#27104) (#27168) + * Fix the variable regexp pattern on web page (#27161) (#27164) + * Fix: treat tab "overview" as "repositories" in user profiles without readme (#27124) + * Fix NPE when editing OAuth2 applications (#27078) + * Fix the incorrect route path in the user edit page. (#27007) + * Fix the secret regexp pattern on web page (#26910) + * Allow users with write permissions for issues to add attachments with API (#26837) + * Make "link-action" backend code respond correct JSON content (#26680) + * Use line-height: normal by default (#26635) + * Fix NPM packages name validation (#26595) + * Rewrite the DiffFileTreeItem and fix misalignment (#26565) + * Return empty when searching issues with no repos (#26545) + * Explain SearchOptions and fix ToSearchOptions (#26542) + * Add missing triggers to update issue indexer (#26539) + * Handle base64 decoding correctly to avoid panic (#26483) + * Avoiding accessing undefined mentionValues (#26461) + * Fix incorrect redirection in new issue using references (#26440) + * Fix the bug when getting files changed for `pull_request_target` event (#26320) + * Remove IsWarning in tmpl (#26120) + * Fix loading `LFS_JWT_SECRET` from wrong section (#26109) + * Fixing redirection issue for logged-in users (#26105) + * Improve "gitea doctor" sub-command and fix "help" commands (#26072) + * Fix the truncate and alignment problem for some admin tables (#26042) + * Update minimum password length requirements (#25946) + * Do not "guess" the file encoding/BOM when using API to upload files (#25828) + * Restructure issue list template, styles (#25750) + * Fix `ref` for workflows triggered by `pull_request_target` (#25743) + * Fix issues indexer document mapping (#25619) + * Use JSON response for "user/logout" (#25522) + * Fix migrate page layout on mobile (#25507) + * Link to existing PR when trying to open a new PR on the same branches (#25494) + * Do not publish docker release images on `-dev` tags (#25471) + * Support `pull_request_target` event (#25229) + * Modify the content format of the Feishu webhook (#25106) +* ENHANCEMENTS + * Render email addresses as such if followed by punctuation (#27987) (#27992) + * Show error toast when file size exceeds the limits (#27985) (#27986) + * Fix citation error when the file size is larger than 1024 bytes (#27958) (#27965) + * Remove action runners on user deletion (#27902) (#27908) + * Remove set tabindex on view issue (#27892) (#27896) + * Reduce margin/padding on flex-list items and divider (#27872) (#27874) + * Change katex limits (#27823) (#27868) + * Clean up template locale usage (#27856) (#27857) + * Add dedicated class for empty placeholders (#27788) (#27792) + * Add gap between diff boxes (#27776) (#27781) + * Fix incorrect "tab" parameter for repo search sub-template (#27755) (#27764) + * Enable followCursor for language stats bar (#27713) (#27739) + * Improve diff tree spacing (#27714) (#27719) + * Feed UI Improvements (#27356) (#27717) + * Improve feed icons and feed merge text color (#27498) (#27716) + * [FIX] resolve confusing colors in languages stats by insert a gap (#27704) (#27715) + * Add doctor dbconsistency fix to delete repos with no owner (#27290) (#27693) + * Fix required checkboxes in issue forms (#27592) (#27692) + * Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661) + * Cleanup repo details icons/labels (#27644) (#27654) + * Keep filter when showing unfiltered results on explore page (#27192) (#27589) + * Show manual cron run's last time (#27544) (#27577) + * Revert "Fix pr template (#27436)" (#27567) + * Increase queue length (#27555) (#27562) + * Avoid run change title process when the title is same (#27467) (#27558) + * Remove max-width and add hide text overflow (#27359) (#27550) + * Add hover background to wiki list page (#27507) (#27521) + * Fix mermaid flowchart margin issue (#27503) (#27516) + * Refactor system setting (#27000) (#27452) + * Fix missing `ctx` in new_form.tmpl (#27434) (#27438) + * Add Index to `action.user_id` (#27403) (#27425) + * Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408) + * Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407) + * Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402) + * Hide archived labels when filtering by labels on the issue list (#27115) (#27381) + * Highlight user details link (#26998) (#27376) + * Add protected branch name description (#27257) (#27351) + * Improve tree not found page (#26570) (#27346) + * Add Index to `comment.dependent_issue_id` (#27325) (#27340) + * Improve branch list UI (#27319) (#27324) + * Fix divider in subscription page (#27298) (#27301) + * Add missed return to actions view fetch (#27289) (#27293) + * Backport ctx locale refactoring manually (#27231) (#27259) (#27260) + * Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211) (#27253) + * Use mask-based fade-out effect for `.new-menu` (#27181) (#27243) + * Cleanup locale function usage (#27227) (#27240) + * Fix z-index on markdown completion (#27237) (#27239) + * Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225) (#27228) + * Allow copying issue comment link on archived repos and when not logged in (#27193) (#27210) + * Fix: text decorator on issue sidebar menu label (#27206) (#27209) + * Fix dropdown icon position (#27175) (#27177) + * Add index to `issue_user.issue_id` (#27154) (#27158) + * Increase auth provider icon size on login page (#27122) + * Remove a `gt-float-right` and some unnecessary helpers (#27110) + * Change green buttons to primary color (#27099) + * Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095) + * Use `print` instead of `printf` (#27093) + * Remove the useless function `GetUserIssueStats` and move relevant tests to `indexer_test.go` (#27067) + * Search branches (#27055) + * Display all user types and org types on admin management UI (#27050) + * Ui correction in mobile view nav bar left aligned items. (#27046) + * Chroma color tweaks (#26978) + * Move some functions to service layer (#26969) + * Improve "language stats" UI (#26968) + * Replace `util.SliceXxx` with `slices.Xxx` (#26958) + * Refactor dashboard/feed.tmpl (#26956) + * Move repository deletion to service layer (#26948) + * Fix the missing repo count (#26942) + * Improve hint when uploading a too large avatar (#26935) + * Extract common code to new template (#26933) + * Move createrepository from module to service layer (#26927) + * Move notification interface to services layer (#26915) + * Move feed notification service layer (#26908) + * Move ui notification to service layer (#26907) + * Move indexer notification to service layer (#26906) + * Move mail notification logic to service layer (#26905) + * Extract common code to new template (#26903) + * Show queue's active worker number (#26896) + * Fix media description render for orgmode (#26895) + * Remove CSS `has` selector and improve various styles (#26891) + * Relocate the `RSS user feed` button (#26882) + * Refactor "shortsha" (#26877) + * Refactor `og:description` to limit the max length (#26876) + * Move web/api context related testing function into a separate package (#26859) + * Redable error on S3 storage connection failure (#26856) + * Improve opengraph previews (#26851) + * Add more descriptive error on forgot password page (#26848) + * Show always repo count in header (#26842) + * Remove "TODO" tasks from CSS file (#26835) + * Render code blocks in repo description (#26830) + * Minor dashboard tweaks, fix flex-list margins (#26829) + * Remove polluted `.ui.right` (#26825) + * Display archived labels specially when listing labels (#26820) + * Remove polluted ".ui.left" style (#26809) + * Make it posible to customize nav text color via css var (#26807) + * Refactor lfs requests (#26783) + * Improve flex list item padding (#26779) + * Remove fomantic `text` module (#26777) + * Remove fomantic `item` module (#26775) + * Remove redundant nil check in `WalkGitLog` (#26773) + * Reduce some allocations in type conversion (#26772) + * Refactor some CSS styles and simplify code (#26771) + * Unify `border-radius` behavior (#26770) + * Improve modal dialog UI (#26764) + * Allow "latest" to be used in release vTag when downloading file (#26748) + * Adding hint `Archived` to archive label. (#26741) + * Move `modules/mirror` to `services` (#26737) + * Add "dir=auto" for input/textarea elements by default (#26735) + * Add auth-required to config.json for Cargo http registry (#26729) + * Simplify helper CSS classes and avoid abuse (#26728) + * Make web context initialize correctly for different cases (#26726) + * Focus editor on "Write" tab click (#26714) + * Remove incorrect CSS helper classes (#26712) + * Fix review bar misalignment (#26711) + * Add reverseproxy auth for API back with default disabled (#26703) + * Add default label in branch select list (#26697) + * Improve Image Diff UI (#26696) + * Fixed text overflow in dropdown menu (#26694) + * [Refactor] getIssueStatsChunk to move inner function into own one (#26671) + * Remove fomantic loader module (#26670) + * Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips (#26658) + * Improve some flex layouts (#26649) + * Improve the branch selector tab UI (#26631) + * Improve show role (#26621) + * Remove avatarHTML from template helpers (#26598) + * Allow text selection in actions step header (#26588) + * Improve translation of milestone filters (#26569) + * Add optimistic lock to ActionRun table (#26563) + * Update team invitation email link (#26550) + * Differentiate better between user settings and admin settings (#26538) + * Check disabled workflow when rerun jobs (#26535) + * Improve deadline icon location in milestone list page (#26532) + * Improve repo sub menu (#26531) + * Fix the display of org level badges (#26504) + * Rename `Sync2` -> `Sync` (#26479) + * Fix stderr usages (#26477) + * Remove fomantic transition module (#26469) + * Refactor tests (#26464) + * Refactor project templates (#26448) + * Fall back to esbuild for css minify (#26445) + * Always show usernames in reaction tooltips (#26444) + * Use correct pull request commit link instead of a generic commit link (#26434) + * Refactor "editorconfig" (#26391) + * Make `user-content-* ` consistent with github (#26388) + * Remove unnecessary template helper repoAvatar (#26387) + * Remove unnecessary template helper DisableGravatar (#26386) + * Use template context function for avatar rendering (#26385) + * Rename code_langauge.go to code_language.go (#26377) + * Use more `IssueList` instead of `[]*Issue` (#26369) + * Do not highlight `#number` in documents (#26365) + * Fix display problems of members and teams unit (#26363) + * Fix 404 error when remove self from an organization (#26362) + * Improve CLI and messages (#26341) + * Refactor backend SVG package and add tests (#26335) + * Add link to job details and tooltip to commit status in repo list in dashboard (#26326) + * Use yellow if an approved review is stale (#26312) + * Remove commit load branches and tags in wiki repo (#26304) + * Add highlight to selected repos in milestone dashboard (#26300) + * Delete `issue_service.CreateComment` (#26298) + * Do not show Profile README when repository is private (#26295) + * Tweak actions menu (#26278) + * Start using template context function (#26254) + * Use calendar icon for `Joined on...` in profiles (#26215) + * Add 'Show on a map' button to Location in profile, fix layout (#26214) + * Render plaintext task list items for markdown files (#26186) + * Add tooltip to describe LFS table column and color `delete LFS file` button red (#26181) + * Release attachments duplicated check (#26176) + * De-emphasize issue sidebar buttons (#26171) + * Fixing the align of commit stats in commit_page template. (#26161) + * Allow editing push mirrors after creation (#26151) + * Move web JSON functions to web context and simplify code (#26132) + * Refactor improve NoBetterThan (#26126) + * Improve clickable area in repo action view page (#26115) + * Add context parameter to some database functions (#26055) + * Docusaurus-ify (#26051) + * Improve text for empty issue/pr description (#26047) + * Categorize admin settings sidebar panel (#26030) + * Remove redundant "RouteMethods" method (#26024) + * Refactor and enhance issue indexer to support both searching, filtering and paging (#26012) + * Add a link to OpenID Issuer URL in WebFinger response (#26000) + * Fix UI for release tag page / wiki page / subscription page (#25948) + * Support copy protected branch from template repository (#25889) + * Improve display of Labels/Projects/Assignees sort options (#25886) + * Fix margin on the new/edit project page. (#25885) + * Show image size on view page (#25884) + * Remove ref name in PR commits page (#25876) + * Allow the use of alternative net.Listener implementations by downstreams (#25855) + * Refactor "Content" for file uploading (#25851) + * Add error info if no user can fork the repo (#25820) + * Show edit title button on commits tab of PR, too (#25791) + * Introduce `flex-list` & `flex-item` elements for Gitea UI (#25790) + * Don't stack PR tab menu on small screens (#25789) + * Repository Archived text title center align (#25767) + * Make route middleware/handler mockable (#25766) + * Move issue filters to shared template (#25729) + * Use frontend fetch for branch dropdown component (#25719) + * Add open/closed field support for issue index (#25708) + * Some less naked returns (#25682) + * Fix inconsistent user profile layout across tabs (#25625) + * Get latest commit statuses from database instead of git data on dashboard for repositories (#25605) + * Adding branch-name copy to clipboard branches screen. (#25596) + * Update emoji set to Unicode 15 (#25595) + * Move some files under repo/setting (#25585) + * Add custom ansi colors and CSS variables for them (#25546) + * Add log line anchor for action logs (#25532) + * Use flex instead of float for sort button and search input (#25519) + * Update octicons and use `octicon-file-directory-symlink` (#25453) + * Add toasts to UI (#25449) + * Fine tune project board label colors and modal content background (#25419) + * Import additional secrets via file uri (#25408) + * Switch to ansi_up for ansi rendering in actions (#25401) + * Store and use seconds for timeline time comments (#25392) + * Support displaying diff stats in PR tab bar (#25387) + * Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380) + * Refactor: TotalTimes return seconds (#25370) + * Navbar styling rework (#25343) + * Introduce shared template for search inputs (#25338) + * Only show 'Manage Account Links' when necessary (#25311) + * Improve 'Privacy' section in profile settings (#25309) + * Substitute variables in path names of template repos too (#25294) + * Fix tags line no margin see #25255 (#25280) + * Use fetch to send requests to create issues/comments (#25258) + * Change form actions to fetch for submit review box (#25219) + * Improve AJAX link and modal confirm dialog (#25210) + * Reduce unnecessary DB queries for Actions tasks (#25199) + * Disable `Create column` button while the column name is empty (#25192) + * Refactor indexer (#25174) + * Adjust style for action run list (align icons, adjust padding) (#25170) + * Remove duplicated functions when deleting a branch (#25128) + * Make confusable character warning less jarring (#25069) + * Highlight viewed files differently in the PR filetree (#24956) + * Support changing labels of Actions runner without re-registration (#24806) + * Fix duplicate Reviewed-by trailers (#24796) + * Resolve issue with sort icons on admin/users and admin/runners (#24360) + * Split lfs size from repository size (#22900) + * Sync branches into databases (#22743) + * Disable run user change in installation page (#22499) + * Add merge files files to GetCommitFileStatus (#20515) + * Show OpenID Connect and OAuth on signup page (#20242) +* SECURITY + * Dont leak private users via extensions (#28023) (#28029) + * Expanded minimum RSA Keylength to 3072 (#26604) +* TESTING + * Add user secrets API integration tests (#27832) (#27852) + * Add tests for db indexer in indexer_test.go (#27087) + * Speed up TestEventSourceManagerRun (#26262) + * Add unit test for user renaming (#26261) + * Add some Wiki unit tests (#26260) + * Improve unit test for caching (#26185) + * Add unit test for `HashAvatar` (#25662) +* TRANSLATION + * Backport translations to v1.21 (#27899) + * Fix issues in translation file (#27699) (#27737) + * Add locale for deleted head branch (#26296) + * Improve multiple strings in en-US locale (#26213) + * Fix broken translations for package documantion (#25742) + * Correct translation wrong format (#25643) +* BUILD + * Dockerfile small refactor (#27757) (#27826) + * Fix build errors on BSD (in BSDMakefile) (#27594) (#27608) + * Fully replace drone with actions (#27556) (#27575) + * Enable markdownlint `no-duplicate-header` (#27500) (#27506) + * Enable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295) + * Update snap package (#27021) + * Bump go to 1.21 (#26608) + * Bump xgo to go-1.21.x and node to 20 in release-version (#26589) + * Add template linting via djlint (#25212) +* DOCS + * Change default size of issue/pr attachments and repo file (#27946) (#28017) + * Remove `known issue` section in Gitea Actions Doc (#27930) (#27938) + * Remove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119) + * Update brew installation documentation since gitea moved to brew core package (#27070) + * Actions are no longer experimental, so enable them by default (#27054) + * Add a documentation note for Windows Service (#26938) + * Add sparse url in cargo package guide (#26937) + * Update nginx recommendations (#26924) + * Update backup instructions to align with archive structure (#26902) + * Expanding documentation in queue.go (#26889) + * Update info regarding internet connection for build (#26776) + * Docs: template variables (#26547) + * Update index doc (#26455) + * Update zh-cn documentation (#26406) + * Fix typos and grammer problems for actions documentation (#26328) + * Update documentation for 1.21 actions (#26317) + * Doc update swagger doc for POST /orgs/{org}/teams (#26155) + * Doc sync authentication.md to zh-cn (#26117) + * Doc guide the user to create the appropriate level runner (#26091) + * Make organization redirect warning more clear (#26077) + * Update blog links (#25843) + * Fix default value for LocalURL (#25426) + * Update `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig (#25194) +* MISC + * Replace deprecated `elliptic.Marshal` (#26800) + * Add elapsed time on debug for slow git commands (#25642) + +## [1.20.5](https://github.com/go-gitea/gitea/releases/tag/v1.20.5) - 2023-10-03 + +* ENHANCEMENTS + * Fix z-index on markdown completion (#27237) (#27242 & #27238) + * Use secure cookie for HTTPS sites (#26999) (#27013) +* BUGFIXES + * Fix git 2.11 error when checking IsEmpty (#27393) (#27396) + * Allow get release download files and lfs files with oauth2 token format (#26430) (#27378) + * Fix orphan check for deleted branch (#27310) (#27320) + * Quote table `release` in sql queries (#27205) (#27219) + * Fix release URL in webhooks (#27182) (#27184) + * Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152) (#27156) + * fix pagination for followers and following (#27127) (#27138) + * Fix issue templates when blank isses are disabled (#27061) (#27082) + * Fix context cache bug & enable context cache for dashabord commits' authors(#26991) (#27017) + * Fix INI parsing for value with trailing slash (#26995) (#27001) + * Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27249) + * Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27167 & #27162) + * Fix bug of review request number (#27406) (#27104) +* TESTING + * services/wiki: Close() after error handling (#27129) (#27137) +* DOCS + * Improve actions docs related to `pull_request` event (#27126) (#27145) +* MISC + * Add logs for data broken of comment review (#27326) (#27344) + * Load reviewer before sending notification (#27063) (#27064) + +## [1.20.4](https://github.com/go-gitea/gitea/releases/tag/v1.20.4) - 2023-09-08 + +* SECURITY + * Check blocklist for emails when adding them to account (#26812) (#26831) +* ENHANCEMENTS + * Add `branch_filter` to hooks API endpoints (#26599) (#26632) + * Fix incorrect "tabindex" attributes (#26733) (#26734) + * Use line-height: normal by default (#26635) (#26708) + * Fix unable to display individual-level project (#26198) (#26636) +* BUGFIXES + * Fix wrong review requested number (#26784) (#26880) + * Avoid double-unescaping of form value (#26853) (#26863) + * Redirect from `{repo}/issues/new` to `{repo}/issues/new/choose` when blank issues are disabled (#26813) (#26847) + * Sync tags when adopting repos (#26816) (#26834) + * Fix verifyCommits error when push a new branch (#26664) (#26810) + * Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759) (#26806) + * Fix some slice append usages (#26778) (#26798) + * Add fix incorrect can_create_org_repo for org owner team (#26683) (#26791) + * Fix bug for ctx usage (#26763) + * Make issue template field template access correct template data (#26698) (#26709) + * Use correct minio error (#26634) (#26639) + * Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597) (#26618) + * Set errwriter for urfave/cli v1 (#26616) + * Fix reopen logic for agit flow pull request (#26399) (#26613) + * Fix context filter has no effect in dashboard (#26695) (#26811) + * Fix being unable to use a repo that prohibits accepting PRs as a PR source. (#26785) (#26790) + * Fix Page Not Found error (#26768) + +## [1.20.3](https://github.com/go-gitea/gitea/releases/tag/v1.20.3) - 2023-08-20 + +* BREAKING + * Fix the wrong derive path (#26271) (#26318) +* SECURITY + * Fix API leaking Usermail if not logged in (#25097) (#26350) +* FEATURES + * Add ThreadID parameter for Telegram webhooks (#25996) (#26480) +* ENHANCEMENTS + * Add minimum polyfill to support "relative-time-element" in PaleMoon (#26575) (#26578) + * Fix dark theme highlight for "NameNamespace" (#26519) (#26527) + * Detect ogg mime-type as audio or video (#26494) (#26505) + * Use `object-fit: contain` for oauth2 custom icons (#26493) (#26498) + * Move dropzone progress bar to bottom to show filename when uploading (#26492) (#26497) + * Remove last newline from config file (#26468) (#26471) + * Minio: add missing region on client initialization (#26412) (#26438) + * Add pull request review request webhook event (#26401) (#26407) + * Fix text truncate (#26354) (#26384) + * Fix incorrect color of selected assignees when create issue (#26324) (#26372) + * Display human-readable text instead of cryptic filemodes (#26352) (#26358) + * Hide `last indexed SHA` when a repo could not be indexed yet (#26340) (#26345) + * Fix the topic validation rule and suport dots (#26286) (#26303) + * Fix due date rendering the wrong date in issue (#26268) (#26274) + * Don't autosize textarea in diff view (#26233) (#26244) + * Fix commit compare style (#26209) (#26226) + * Warn instead of reporting an error when a webhook cannot be found (#26039) (#26211) +* BUGFIXES + * Use "input" event instead of "keyup" event for migration form (#26602) (#26605) + * Do not use deprecated log config options by default (#26592) (#26600) + * Fix "issueReposQueryPattern does not match query" (#26556) (#26564) + * Sync repo's IsEmpty status correctly (#26517) (#26560) + * Fix project filter bugs (#26490) (#26558) + * Use `hidden` over `clip` for text truncation (#26520) (#26522) + * Set "type=button" for editor's toolbar buttons (#26510) (#26518) + * Fix NuGet search endpoints (#25613) (#26499) + * Fix storage path logic especially for relative paths (#26441) (#26481) + * Close stdout correctly for "git blame" (#26470) (#26473) + * Check first if minio bucket exists before trying to create it (#26420) (#26465) + * Avoiding accessing undefined tributeValues #26461 (#26462) + * Call git.InitSimple for runRepoSyncReleases (#26396) (#26450) + * Add transaction when creating pull request created dirty data (#26259) (#26437) + * Fix wrong middleware sequence (#26428) (#26436) + * Fix admin queue page title and fix CI failures (#26409) (#26421) + * Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392) (#26405) + * Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368) + * Fix incorrect CLI exit code and duplicate error message (#26346) (#26347) + * Prevent newline errors with Debian packages (#26332) (#26342) + * Fix bug with sqlite load read (#26305) (#26339) + * Make git batch operations use parent context timeout instead of default timeout (#26325) (#26330) + * Support getting changed files when commit ID is `EmptySHA` (#26290) (#26316) + * Clarify the logger's MODE config option (#26267) (#26281) + * Use shared template for webhook icons (#26242) (#26246) + * Fix pull request check list is limited (#26179) (#26245) + * Fix attachment clipboard copy on insecure origin (#26224) (#26231) + * Fix access check for org-level project (#26182) (#26223) +* MISC + * Improve profile readme rendering (#25988) (#26453) + * [docs] Add missing backtick in quickstart.zh-cn.md (#26349) (#26357) + * Upgrade x/net to 0.13.0 (#26301) + +## [1.20.2](https://github.com/go-gitea/gitea/releases/tag/v1.20.2) - 2023-07-29 + +* ENHANCEMENTS + * Calculate MAX_WORKERS default value by CPU number (#26177) (#26183) + * Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154) +* BUGFIXES + * Fix allowed user types setting problem (#26200) (#26206) + * Fix handling of plenty Nuget package versions (#26075) (#26173) + * Fix UI regression of asciinema player (#26159) (#26162) + * Fix LFS object list style (#26133) (#26147) + * Fix allowed user types setting problem (#26200) (#26206) + * Prevent primary key update on migration (#26192) (#26199) + * Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158) + * Fix bugs in LFS meta garbage collection (#26122) (#26157) + * Update xorm version (#26128) (#26150) + * Remove "misc" scope check from public API endpoints (#26134) (#26149) + * Fix CLI allowing creation of access tokens with existing name (#26071) (#26144) + * Fix incorrect router logger (#26137) (#26143) + * Improve commit graph alignment and truncating (#26112) (#26127) + * Avoid writing config file if not installed (#26107) (#26113) + * Fix escape problems in the branch selector (#25875) (#26103) + * Fix handling of Debian files with trailing slash (#26087) (#26098) + * Fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089) + * Use stderr as fallback if the log file can't be opened (#26074) (#26083) + * Increase table cell horizontal padding (#26140) (#26142) + * Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124) + * Fix duplicated url prefix on issue context menu (#26066) (#26067) + +## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/v1.20.1) - 2023-07-22 + +* SECURITY + * Disallow dangerous URL schemes (#25960) (#25964) +* ENHANCEMENTS + * Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947) (#25972) + * Make pending commit status yellow again (#25935) (#25968) +* BUGFIXES + * Fix version in rpm repodata/primary.xml.gz (#26009) (#26048) + * Fix env config parsing for "GITEA____APP_NAME" (#26001) (#26013) + * ParseScope with owner/repo always sets owner to zero (#25987) (#25989) + * Fix SSPI auth panic (#25955) (#25969) + * Avoid creating directories when loading config (#25944) (#25957) + * Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937) + * Ignore `runs-on` with expressions when warning no matched runners (#25917) (#25933) + * Avoid opening/closing PRs which are already merged (#25883) (#25903) +* DOCS + * RPM Registry: Show zypper commands for SUSE based distros as well (#25981) (#26020) + * Correctly refer to dev tags as nightly in the docker docs (#26004) (#26019) + * Update path related documents (#25417) (#25982) +* MISC + * Adding remaining enum for migration repo model type. (#26021) (#26034) + * Fix the route for pull-request's authors (#26016) (#26018) + * Fix commit status color on dashboard repolist (#25993) (#25998) + * Avoid hard-coding height in language dropdown menu (#25986) (#25997) + * Add shutting down notice (#25920) (#25922) + * Fix incorrect milestone count when provide a keyword (#25880) (#25904) + +## [1.20.0](https://github.com/go-gitea/gitea/releases/tag/v1.20.0) - 2023-07-16 + +* BREAKING + * Fix WORK_DIR for docker (root) image (#25738) (#25811) + * Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581) (#25604) + * Refactor path & config system (#25330) (#25416) + * Fix all possible setting error related storages and added some tests (#23911) (#25244) + * Use a separate admin page to show global stats, remove `actions` stat (#25062) + * Remove the service worker (#25010) + * Remove meta tags `theme-color` and `default-theme` (#24960) + * Use `[git.config]` for reflog cleaning up (#24958) + * Allow all URL schemes in Markdown links by default (#24805) + * Redesign Scoped Access Tokens (#24767) + * Fix team members API endpoint pagination (#24754) + * Rewrite logger system (#24726) + * Increase default LFS auth timeout from 20m to 24h (#24628) + * Rewrite queue (#24505) + * Remove unused setting `time.FORMAT` (#24430) + * Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270) + * Correct the access log format (#24085) + * Reserve ".png" suffix for user/org names (#23992) + * Prefer native parser for SSH public key parsing (#23798) + * Editor preview support for external renderers (#23333) + * Add Gitea Profile Readmes (#23260) + * Refactor `ctx` in templates (#23105) +* SECURITY + * Test if container blob is accessible before mounting (#22759) (#25784) + * Set type="password" on all auth_token fields (#22175) +* FEATURES + * Add button on diff header to copy file name, misc diff header tweaks (#24986) + * API endpoint for changing/creating/deleting multiple files (#24887) + * Support changing git config through `app.ini`, use `diff.algorithm=histogram` by default (#24860) + * Add up and down arrows to selected lookup repositories (#24727) + * Add Go package registry (#24687) + * Add status indicator on main home screen for each repo (#24638) + * Support for status check pattern (#24633) + * Implement Cargo HTTP index (#24452) + * Add Debian package registry (#24426) + * Add the ability to pin Issues (#24406) + * Add follow organization and fix the logic of following page (#24345) + * Allow `webp` images as avatars (#24248) + * Support upload `outputs` and use `needs` context on Actions (#24230) + * Allow adding new files to an empty repo (#24164) + * Make wiki title supports dashes and improve wiki name related features (#24143) + * Add monospace toggle button to textarea (#24034) + * Use auto-updating, natively hoverable, localized time elements (#23988) + * Add ntlm authentication support for mail (#23811) + * Add CLI command to register runner tokens (#23762) + * Add Alpine package registry (#23714) + * Expand/Collapse all changed files (#23639) + * Add unset default project column (#23531) + * Add activity feeds API (#23494) + * Add RPM registry (#23380) + * Add meilisearch support (#23136) + * Add API for License templates (#23009) + * Add admin API email endpoints (#22792) + * Add user rename endpoint to admin api (#22789) + * Add API for gitignore templates (#22783) + * Implement actions artifacts (#22738) + * Add RSS Feeds for branches and files (#22719) + * Display when a repo was archived (#22664) + * Add Swift package registry (#22404) + * Add CRAN package registry (#22331) + * Add user webhooks (#21563) + * Implement systemd-notify protocol (#21151) + * Implement Issue Config (#20956) + * Add API to manage issue dependencies (#17935) +* API + * Use correct response code in push mirror creation response in v1_json.tmpl (#25476) (#25571) + * Fix `Permission` in API returned repository struct (#25388) (#25441) + * Add API for Label templates (#24602) + * Filters for GetAllCommits (#24568) + * Add ability to specify '--not' from GetAllCommits (#24409) + * Support uploading file to empty repo by API (#24357) + * Add absent repounits to create/edit repo API (#23500) + * Add login name and source id for admin user searching API (#23376) + * Create a branch directly from commit on the create branch API (#22956) +* ENHANCEMENTS + * Make `add line comment` buttons focusable (#25894) (#25896) + * Always pass 6-digit hex color to monaco (#25780) (#25782) + * Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764) + * Hide `add file` button for pull mirrors (#25748) (#25751) + * Allow/fix review (approve/reject) of empty PRs (#25690) (#25732) + * Fix tags header and pretty format numbers (#25624) (#25694) + * Actions list enhancements (#25601) (#25678) + * Fix show more for image on diff page (#25672) (#25673) + * Prevent SVG shrinking (#25652) (#25669) + * Fix UI misalignment on user setting page (#25629) (#25656) + * Use css on labels (#25626) (#25636) + * Read-only checkboxes don't appear and don't entirely act the way one might expect (#25573) (#25602) + * Redirect to package after version deletion (#25594) (#25599) + * Reduce table padding globally (#25568) (#25577) + * Change `Regenerate Secret` button display (#25534) (#25541) + * Fix rerun icon on action view component (#25531) (#25536) + * Move some regexp out of functions (#25430) (#25445) + * Diff page enhancements (#25398) (#25437) + * Various UI fixes (#25264) (#25431) + * Fix label list divider (#25312) (#25372) + * Fix UI on mobile view (#25315) (#25340) + * When viewing a file, hide the add button (#25320) (#25339) + * Show if File is Executable (#25287) (#25300) + * Fix edit OAuth application width (#25262) (#25263) + * Use flex to align SVG and text (#25163) (#25260) + * Revert overflow: overlay (revert #21850) (#25231) (#25239) + * Use inline SVG for built-in OAuth providers (#25171) (#25234) + * Change access token UI to select dropdowns (#25109) (#25230) + * Remove hacky patch for "safari emoji glitch fix" (#25208) (#25211) + * Minor arc-green color tweaks (#25175) (#25205) + * Button and color enhancements (#24989) (#25176) + * Fix mobile navbar and misc cleanups (#25134) (#25169) + * Modify OAuth login ui and fix display name, iconurl related logic (#25030) (#25161) + * Improve notification icon and navbar (#25111) (#25124) + * Add details summary for vertical menus in settings to allow toggling (#25098) + * Don't display `select all issues` checkbox when no issues are available (#25086) + * Use RepositoryList instead of []*Repository (#25074) + * Add ability to set multiple redirect URIs in OAuth application UI (#25072) + * Use git command instead of the ini package to remove the `origin` remote (#25066) + * Remove cancel button from branch protection form (#25063) + * Show file tree by default (#25052) + * Add Progressbar to Milestone Page (#25050) + * Minor UI improvements: logo alignment, auth map editor, auth name display (#25043) + * Allow for PKCE flow without client secret + add docs (#25033) + * Refactor INI package (first step) (#25024) + * Various style fixes (#25008) + * Fix delete user account modal (#25004) + * Refactor diffFileInfo / DiffTreeStore (#24998) + * Add user level action runners (#24995) + * Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (#24988) + * Add step start time to `ViewStepLog` (#24980) + * Add dark mode to API Docs (#24971) + * Display file mode for new file and file mode changes (#24966) + * Make the 500 page load themes (#24953) + * Show `bot` label next to username when rendering autor link if the user is a bot (#24943) + * Repo list improvements, fix bold helper classes (#24935) + * Improve queue and logger context (#24924) + * Improve RunMode / dev mode (#24886) + * Improve some Forms (#24878) + * Add show timestamp/seconds and fullscreen options to action page (#24876) + * Fix double border and adjust width for user profile page (#24870) + * Improve Actions CSS (#24864) + * Fix `@font-face` overrides (#24855) + * Remove `In your repositories` link in milestones dashboard (#24853) + * Fix missing yes/no in delete time log modal (#24851) + * Show new pull request button also on subdirectories and files (#24842) + * Make environment-to-ini support loading key value from file (#24832) + * Support wildcard in email domain allow/block list (#24831) + * Use `CommentList` instead of `[]*Comment` (#24828) + * Add RTL rendering support to Markdown (#24816) + * Rework notifications list (#24812) + * Mute repo names in dashboard repo list (#24811) + * Fix max width and margin of comment box on conversation page (#24809) + * Some refactors for issues stats (#24793) + * Rework label colors (#24790) + * Fix OAuth login loading state (#24788) + * Remove duplicated issues options and some more refactors (#24787) + * Decouple the different contexts from each other (#24786) + * Remove background on user dashboard filter bar (#24779) + * Improve and fix bugs surrounding reactions (#24760) + * Make the color of zero-contribution-squares in the activity heatmap more subtle (#24758) + * Fix WEBP image copying (#24743) + * Rework OAuth login buttons, swap github logo to monocolor (#24740) + * Consolidate the two review boxes into one (#24738) + * Unification of registration fields order (#24737) + * Refactor Pull Mirror and fix out-of-sync bugs (#24732) + * Improvements for action detail page (#24718) + * Fix flash of unstyled content in action view page (#24712) + * Don't filter action runs based on state (#24711) + * Optimize actions list by removing an unnecessary `git` call (#24710) + * Support no label/assignee filter and batch clearing labels/assignees (#24707) + * Add icon support for safari (#24697) + * Use standard HTTP library to serve files (#24693) + * Improve button-ghost, remove tertiary button (#24692) + * Only hide tooltip tippy instances (#24688) + * Support migrating storage for actions log via command line (#24679) + * Remove highlight in repo list (#24675) + * Add markdown preview to Submit Review Textarea (#24672) + * Update pin and add pin-slash (#24669) + * Improve empty notifications display (#24668) + * Support SSH for go get (#24664) + * Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) + * Only show one tippy at a time (#24648) + * Notification list enhancements, fix striped tables on dark theme (#24639) + * Improve queue & process & stacktrace (#24636) + * Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) + * Remove fluid on compare diff page (#24627) + * Add a tooltip to the job rerun button (#24617) + * Attach a tooltip to the action status icon (#24614) + * Make the actions control button look like an actual button (#24611) + * Remove unnecessary code (#24610) + * Make repo migration cancelable and fix various bugs (#24605) + * Improve updating Actions tasks (#24600) + * Attach a tooltip to the action control button (#24595) + * Make repository response support HTTP range request (#24592) + * Improve Gitea's web context, decouple "issue template" code into service package (#24590) + * Modify luminance calculation and extract related functions into single files (#24586) + * Simplify template helper functions (#24570) + * Split "modules/context.go" to separate files (#24569) + * Add org visibility label to non-organization's dashboard (#24558) + * Update LDAP filters to include both username and email address (#24547) + * Review fixes and enhancements (#24526) + * Display warning when user try to rename default branch (#24512) + * Fix color for transfer related buttons when having no permission to act (#24510) + * Rework button coloring, add focus and active colors (#24507) + * New webhook trigger for receiving Pull Request review requests (#24481) + * Add goto issue id function (#24479) + * Fix incorrect webhook time and use relative-time to display it (#24477) + * RSS icon fixes (#24476) + * Replace `N/A` with `-` everywhere (#24474) + * Pass 'not' to commit count (#24473) + * Enhance stylelint rule config, remove dead CSS (#24472) + * Remove `font-awesome` and fomantic `icon` module (#24471) + * Improve "new-menu" (#24465) + * Remove fomantic breadcrumb module (#24463) + * Improve template system and panic recovery (#24461) + * Make Issue/PR/projects more compact, misc CSS tweaks (#24459) + * Replace remaining fontawesome dropdown icons with SVG (#24455) + * Remove all direct references to font-awesome (#24448) + * Move links out of translation (#24446) + * Add `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442) + * Hide 'Mirror Settings' when unneeded, improve hints (#24433) + * Add "Updated" column for admin repositories list (#24429) + * Improve issue list filter (#24425) + * Rework header bar on issue, pull requests and milestone (#24420) + * Improve template helper (#24417) + * Make repo size style matches others (commits/branches/tags) (#24408) + * Support markdown editor for issue template (#24400) + * Improve commit date in commit graph (#24399) + * Start cleaning the messy ".ui.left / .ui.right", improve label list page, fix stackable menu (#24393) + * Merge setting.InitXXX into one function with options (#24389) + * Move `Rename branch` from repo settings page to the page of branches list (#24380) + * Improve protected branch setting page (#24379) + * Display 'Unknown' when runner.version is empty (#24378) + * Display owner of a runner as a tooltip instead of static text (#24377) + * Fix incorrect last online time in runner_edit.tmpl (#24376) + * Fix unclear `IsRepositoryExist` logic (#24374) + * Add custom helm repo name generated from url (#24363) + * Replace placeholders in licenses (#24354) + * Add rerun workflow button and refactor to use SVG octicons (#24350) + * Fix runner button height (#24338) + * Restore bold on repolist (#24337) + * Improve RSS (#24335) + * Refactor "route" related code, fix Safari cookie bug (#24330) + * Alert error message if open dependencies are included in the issues that try to batch close (#24329) + * Add missed column title in runner management page (#24328) + * Automatically select the org when click create repo from org dashboard (#24325) + * Modify width of ui container, fine tune css for settings pages and org header (#24315) + * Fix config list overflow and layout (#24312) + * Improve some modal action buttons (#24289) + * Move code from module to service (#24287) + * Sort users and orgs on explore by recency by default (#24279) + * Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275) + * Show workflow config error on file view also (#24267) + * Improve template helper functions: string/slice (#24266) + * Use more specific test methods (#24265) + * Add `DumpVar` helper function to help debugging templates (#24262) + * Limit avatar upload to valid image files (#24258) + * Improve emoji and mention matching (#24255) + * Change to vertical navbar layout for secondary navbar for repo/user/admin settings (#24246) + * Refactor config provider (#24245) + * Improve test logger (#24235) + * Default show closed actions list if all actions was closed (#24234) + * Add missing badges in user profile for /projects and /packages (#24232) + * Add repository counter badge to repository tab (#24205) + * Move secrets and runners settings to actions settings (#24200) + * Require at least one unit to be enabled (#24189) + * Use same action status svg icons on actions list as on action page (#24178) + * Use secondary pointing menu for tabs on user/organization home page (#24162) + * Improve Wiki TOC (#24137) + * Refactor locale number (#24134) + * Localize activity heatmap (except tooltip) (#24131) + * Fix duplicate modals when clicking on "remove all" repository button (#24129) + * Add runner check in repo action page (#24124) + * Support triggering workflows by wiki related events (#24119) + * Refactor cookie (#24107) + * Remove untranslatable `on_date` key (#24106) + * Refactor delete_modal_actions template and use it for project column related actions (#24097) + * Improve git log for debugging (#24095) + * Add option to search for users is active join a team (#24093) + * Add PDF rendering via PDFObject (#24086) + * Refactor web route (#24080) + * Make HTML template functions support context (#24056) + * Refactor rename user and rename organization (#24052) + * Localize milestone related time strings (#24051) + * Expand selected file when clicking file tree (#24041) + * Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (#24040) + * Add placeholder and aria attributes to release and wiki edit page (#24031) + * Add new user types `reserved`, `bot`, and `remote` (#24026) + * Allow adding SSH keys even if SSH server is disabled (#24025) + * Use a general approach to access custom/static/builtin assets (#24022) + * Update github.com/google/go-github to v52 (#24004) + * Replace tribute with text-expander-element for textarea (#23985) + * Group template helper functions, remove `Printf`, improve template error messages (#23982) + * Drop "unrolled/render" package (#23965) + * Add job.duration in web ui (#23963) + * Tweak pull request branch delete ui (#23951) + * Merge template functions "dict/Dict/mergeinto" (#23932) + * Use a general Eval function for expressions in templates. (#23927) + * Clean template/helper.go (#23922) + * Actions: Use default branch as ref when a branch/tag delete occurs (#23910) + * Add tooltips for MD editor buttons and add `muted` class for buttons (#23896) + * Improve markdown editor: width, height, preferred (#23895) + * Make Release Download URLs predictable (#23891) + * Remove fomantic ".link" selector and styles (#23888) + * Added close/open button to details page of milestone (#23877) + * Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) + * Introduce GiteaLocaleNumber custom element to handle number localization on pages. (#23861) + * Make first section on home page full width (#23854) + * Use different SVG for pending and running actions (#23836) + * Display image size for multiarch container images (#23821) + * Improve action log display with control chars (#23820) + * Fix dropdown direction behavior (#23806) + * Fix incorrect/Improve error handle in edit user page (#23805) + * Use clippie module to copy to clipboard (#23801) + * Make minio package support legacy MD5 checksum (#23768) + * Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) + * Refactor docs (#23752) + * Fix markup background, improve wiki rendering (#23750) + * Make label templates have consistent behavior and priority (#23749) + * Improve LoadUnitConfig to handle invalid or duplicate units (#23736) + * Append `(comment)` when a link points at a comment rather than the whole issue (#23734) + * Clean some legacy files and move some build files (#23699) + * Refactor repo commit list (#23690) + * Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) + * Add aria attributes to interactive time tooltips. (#23661) + * Fix long project name display in issue list and in related dropdown (#23653) + * Use data-tooltip-content for tippy tooltip (#23649) + * Fix new issue/pull request btn margin when it is next to sort (#23647) + * Fine tune more downdrop settings, use SVG for labels, improve Repo Topic Edit form (#23626) + * Allow new file and edit file preview if it has editable extension (#23624) + * Replace a few fontawesome icons with svg (#23602) + * `Publish Review` buttons should indicate why they are disabled (#23598) + * Convert issue list checkboxes to native (#23596) + * Set opaque background on markup and images (#23578) + * Use a general approach to show tooltip, fix temporary tooltip bug (#23574) + * Improve `` to make it output `svg` node and optimize performance (#23570) + * Enable color for consistency checks diffs (#23563) + * Fix dropdown icon misalignment when using fomantic icon (#23558) + * Decouple the issue-template code from comment_tab.tmpl (#23556) + * Remove `id="comment-form"` dead code, fix tag (#23555) + * Diff improvements (#23553) + * Sort Python package descriptors by version to mimic PyPI format (#23550) + * Use a general approch to improve a11y for all checkboxes and dropdowns. (#23542) + * Fix long name ui issues and label ui issue (#23541) + * Return `repository` in npm package metadata endpoint (#23539) + * Use `project.IconName` instead of repeated unreadable `if-else` chains (#23538) + * Remove stars in dashboard repo list (#23530) + * Update mini-css-extract-plugin, remove postcss (#23520) + * Change `Close` to either `Close issue` or `Close pull request` (#23506) + * Fix theme-auto loading (#23504) + * Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491) + * Display the version of runner in the runner list (#23490) + * Replace Less with CSS (#23481) + * Fix `.locale.Tr` function not found in delete modal (#23468) + * Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463) + * Add project type descriptions in issue badge and improve project icons (#23437) + * Use context for `RepositoryList.LoadAttributes` (#23435) + * Refactor branch/tag selector to Vue SFC (#23421) + * Keep (add if not existing) xmlns attribute for generated SVG images (#23410) + * Refactor dashboard repo list to Vue SFC (#23405) + * Add workflow error notification in ui (#23404) + * Refactor branch/tag selector dropdown (first step) (#23394) + * Reduce duplicate and useless code in options (#23369) + * Convert `
` to ` +
+ + + + diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 8f2b1c12e3..1cc4b7bb09 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -7,8 +7,6 @@
{{ctx.Locale.Tr "admin.config.app_name"}}
{{AppName}}
-
{{ctx.Locale.Tr "admin.config.app_slogan"}}
-
{{AppSlogan}}
{{ctx.Locale.Tr "admin.config.app_ver"}}
{{AppVer}}{{.AppBuiltWith}}
{{ctx.Locale.Tr "admin.config.custom_conf"}}
@@ -159,8 +157,6 @@
{{if .Service.DefaultKeepEmailPrivate}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{ctx.Locale.Tr "admin.config.default_allow_create_organization"}}
{{if .Service.DefaultAllowCreateOrganization}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
-
{{ctx.Locale.Tr "admin.config.allow_dots_in_usernames"}}
-
{{if .Service.AllowDotsInUsernames}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{ctx.Locale.Tr "admin.config.enable_timetracking"}}
{{if .Service.EnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{if .Service.EnableTimetracking}} @@ -233,8 +229,8 @@
{{ctx.Locale.Tr "admin.config.mailer_user"}}
{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}
-
{{ctx.Locale.Tr "admin.config.send_test_mail"}}
-
+
{{ctx.Locale.Tr "admin.config.send_test_mail"}}
+
{{.CsrfTokenHtml}}
@@ -264,14 +260,6 @@
{{ctx.Locale.Tr "admin.config.cache_item_ttl"}}
{{.CacheItemTTL}}
{{end}} -
-
{{ctx.Locale.Tr "admin.config.cache_test"}}
-
- - {{.CsrfTokenHtml}} - -
-
@@ -295,6 +283,27 @@ +

+ {{ctx.Locale.Tr "admin.config.picture_config"}} +

+
+
+
{{ctx.Locale.Tr "admin.config.disable_gravatar"}}
+
+
+ +
+
+
+
{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}
+
+
+ +
+
+
+
+

{{ctx.Locale.Tr "admin.config.git_config"}}

@@ -344,7 +353,7 @@ {{range $loggerName, $loggerDetail := .Loggers}}
{{ctx.Locale.Tr "admin.config.logger_name_fmt" $loggerName}}
{{if $loggerDetail.IsEnabled}} -
{{$loggerDetail.EventWriters | JsonUtils.EncodeToString | JsonUtils.PrettyIndent}}
+
{{$loggerDetail.EventWriters | JsonUtils.EncodeToString | JsonUtils.PrettyIndent}}
{{else}}
{{ctx.Locale.Tr "admin.config.disabled_logger"}}
{{end}} diff --git a/templates/admin/config_settings.tmpl b/templates/admin/config_settings.tmpl deleted file mode 100644 index 02ab5fd0fb..0000000000 --- a/templates/admin/config_settings.tmpl +++ /dev/null @@ -1,42 +0,0 @@ -{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}} -

- {{ctx.Locale.Tr "admin.config.picture_config"}} -

-
-
-
{{ctx.Locale.Tr "admin.config.disable_gravatar"}}
-
-
- -
-
-
-
{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}
-
-
- -
-
-
-
- -

- {{ctx.Locale.Tr "repository"}} -

-
-
-
-
- {{ctx.Locale.Tr "admin.config.open_with_editor_app_help"}} -
{{.DefaultOpenWithEditorAppsString}}
-
-
-
- -
-
- -
-
-
-{{template "admin/layout_footer" .}} diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl index ee37f6ca75..af30cc06e1 100644 --- a/templates/admin/cron.tmpl +++ b/templates/admin/cron.tmpl @@ -5,7 +5,7 @@
- +
@@ -23,8 +23,8 @@ - - + + diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index b61de666b8..65d9c370f3 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -2,7 +2,7 @@
{{if .NeedUpdate}}
-

{{ctx.Locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer "https://forgejo.org/news"}}

+

{{(ctx.Locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}

{{end}}

@@ -11,7 +11,7 @@
{{.CsrfTokenHtml}} -

{{ctx.Locale.Tr (printf "admin.dashboard.%s" .Name)}} {{.Spec}}{{DateUtils.FullTime .Next}}{{if gt .Prev.Year 1}}{{DateUtils.FullTime .Prev}}{{else}}-{{end}}{{DateTime "full" .Next}}{{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}-{{end}} {{.ExecTimes}} {{if eq .Status ""}}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}
+
@@ -63,10 +63,6 @@ - - - -
{{ctx.Locale.Tr "admin.dashboard.delete_inactive_accounts"}}{{ctx.Locale.Tr "admin.dashboard.sync_repo_branches"}}
{{ctx.Locale.Tr "admin.dashboard.sync_repo_tags"}}
@@ -75,10 +71,69 @@

{{ctx.Locale.Tr "admin.dashboard.system_status"}}

- {{/* TODO: make these stats work in multi-server deployments, likely needs per-server stats in DB */}} -
-
- {{template "admin/system_status" .}} +
+
+
{{ctx.Locale.Tr "admin.dashboard.server_uptime"}}
+
{{.SysStatus.StartTime}}
+
{{ctx.Locale.Tr "admin.dashboard.current_goroutine"}}
+
{{.SysStatus.NumGoroutine}}
+
+
{{ctx.Locale.Tr "admin.dashboard.current_memory_usage"}}
+
{{.SysStatus.MemAllocated}}
+
{{ctx.Locale.Tr "admin.dashboard.total_memory_allocated"}}
+
{{.SysStatus.MemTotal}}
+
{{ctx.Locale.Tr "admin.dashboard.memory_obtained"}}
+
{{.SysStatus.MemSys}}
+
{{ctx.Locale.Tr "admin.dashboard.pointer_lookup_times"}}
+
{{.SysStatus.Lookups}}
+
{{ctx.Locale.Tr "admin.dashboard.memory_allocate_times"}}
+
{{.SysStatus.MemMallocs}}
+
{{ctx.Locale.Tr "admin.dashboard.memory_free_times"}}
+
{{.SysStatus.MemFrees}}
+
+
{{ctx.Locale.Tr "admin.dashboard.current_heap_usage"}}
+
{{.SysStatus.HeapAlloc}}
+
{{ctx.Locale.Tr "admin.dashboard.heap_memory_obtained"}}
+
{{.SysStatus.HeapSys}}
+
{{ctx.Locale.Tr "admin.dashboard.heap_memory_idle"}}
+
{{.SysStatus.HeapIdle}}
+
{{ctx.Locale.Tr "admin.dashboard.heap_memory_in_use"}}
+
{{.SysStatus.HeapInuse}}
+
{{ctx.Locale.Tr "admin.dashboard.heap_memory_released"}}
+
{{.SysStatus.HeapReleased}}
+
{{ctx.Locale.Tr "admin.dashboard.heap_objects"}}
+
{{.SysStatus.HeapObjects}}
+
+
{{ctx.Locale.Tr "admin.dashboard.bootstrap_stack_usage"}}
+
{{.SysStatus.StackInuse}}
+
{{ctx.Locale.Tr "admin.dashboard.stack_memory_obtained"}}
+
{{.SysStatus.StackSys}}
+
{{ctx.Locale.Tr "admin.dashboard.mspan_structures_usage"}}
+
{{.SysStatus.MSpanInuse}}
+
{{ctx.Locale.Tr "admin.dashboard.mspan_structures_obtained"}}
+
{{.SysStatus.MSpanSys}}
+
{{ctx.Locale.Tr "admin.dashboard.mcache_structures_usage"}}
+
{{.SysStatus.MCacheInuse}}
+
{{ctx.Locale.Tr "admin.dashboard.mcache_structures_obtained"}}
+
{{.SysStatus.MCacheSys}}
+
{{ctx.Locale.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}
+
{{.SysStatus.BuckHashSys}}
+
{{ctx.Locale.Tr "admin.dashboard.gc_metadata_obtained"}}
+
{{.SysStatus.GCSys}}
+
{{ctx.Locale.Tr "admin.dashboard.other_system_allocation_obtained"}}
+
{{.SysStatus.OtherSys}}
+
+
{{ctx.Locale.Tr "admin.dashboard.next_gc_recycle"}}
+
{{.SysStatus.NextGC}}
+
{{ctx.Locale.Tr "admin.dashboard.last_gc_time"}}
+
{{.SysStatus.LastGC}}
+
{{ctx.Locale.Tr "admin.dashboard.total_gc_pause"}}
+
{{.SysStatus.PauseTotalNs}}
+
{{ctx.Locale.Tr "admin.dashboard.last_gc_pause"}}
+
{{.SysStatus.PauseNs}}
+
{{ctx.Locale.Tr "admin.dashboard.gc_times"}}
+
{{.SysStatus.NumGC}}
+
{{template "admin/layout_footer" .}} diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index b07c6fcc01..bcd80368e6 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -4,21 +4,24 @@ {{ctx.Locale.Tr "admin.emails.email_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
- - - - {{template "admin/layout_footer" .}} diff --git a/templates/admin/layout_head.tmpl b/templates/admin/layout_head.tmpl index 8ba47f2f14..0067f336e0 100644 --- a/templates/admin/layout_head.tmpl +++ b/templates/admin/layout_head.tmpl @@ -1,9 +1,11 @@ {{template "base/head" .ctxData}}
+
+ {{template "base/alert" .ctxData}} +
{{template "admin/navbar" .ctxData}}
- {{template "base/alert" .ctxData}} {{/* block: admin-setting-content */}} {{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}} diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl index 1ec703b296..fa79f0f759 100644 --- a/templates/admin/navbar.tmpl +++ b/templates/admin/navbar.tmpl @@ -4,11 +4,9 @@ {{ctx.Locale.Tr "admin.dashboard"}} - {{if .DatabaseType.IsMySQL}} {{ctx.Locale.Tr "admin.self_check"}} - {{end}}
{{ctx.Locale.Tr "admin.identity_access"}}
{{end}} -
- {{ctx.Locale.Tr "admin.config"}} - -
+ + {{ctx.Locale.Tr "admin.config"}} + {{ctx.Locale.Tr "admin.notices"}} diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index 04a0b64432..ed410425b5 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -17,11 +17,11 @@ {{range .Notices}} -
+
{{.ID}} {{ctx.Locale.Tr .TrStr}} - {{.Description}} - {{DateUtils.AbsoluteShort .CreatedUnix}} + {{.Description}} + {{DateTime "short" .CreatedUnix}} {{svg "octicon-note" 16}} {{end}} @@ -31,7 +31,7 @@ -
+ {{.CsrfTokenHtml}}
@@ -49,8 +49,8 @@
- @@ -62,7 +62,10 @@ {{template "admin/layout_footer" .}} diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index d0805c85bc..0d79456b47 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -7,26 +7,7 @@
- + {{template "admin/base/search" .}}
@@ -63,7 +44,7 @@ - + {{end}} diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index aa38731d4f..5cfd9ddefa 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -2,10 +2,10 @@

{{ctx.Locale.Tr "admin.packages.package_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .TotalCount}}, - {{ctx.Locale.Tr "admin.packages.total_size" (ctx.Locale.TrSize .TotalBlobSize)}}, - {{ctx.Locale.Tr "admin.packages.unreferenced_size" (ctx.Locale.TrSize .TotalUnreferencedBlobSize)}}) + {{ctx.Locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}}, + {{ctx.Locale.Tr "admin.packages.unreferenced_size" (FileSize .TotalUnreferencedBlobSize)}})
-
+ {{.CsrfTokenHtml}} @@ -13,16 +13,16 @@

-
- {{template "shared/search/input" dict "Value" .Query}} - {{range $type := .AvailableTypes}} {{$type.Name}} {{end}} - {{template "shared/search/button"}} +
@@ -62,16 +62,16 @@ {{end}}
- - + + - - + + {{end}} @@ -88,7 +88,7 @@ {{ctx.Locale.Tr "packages.settings.delete"}}
- {{ctx.Locale.Tr "packages.settings.delete.notice" (``|SafeHTML) (``|SafeHTML)}} + {{ctx.Locale.Tr "packages.settings.delete.notice" `` `` | Safe}}
{{template "base/modal_actions_confirm" .}} diff --git a/templates/admin/queue_manage.tmpl b/templates/admin/queue_manage.tmpl index dc0196fc6a..80214d1021 100644 --- a/templates/admin/queue_manage.tmpl +++ b/templates/admin/queue_manage.tmpl @@ -30,7 +30,7 @@ - {{else}} {{$sum}} - + {{$.CsrfTokenHtml}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index c4924c3fac..fdba0734a2 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -7,7 +7,7 @@
- {{template "shared/repo_search" .}} + {{template "admin/repo/search" .}}
{{.NumTeams}} {{.NumMembers}} {{.NumRepos}}{{DateUtils.AbsoluteShort .CreatedUnix}}{{DateTime "short" .CreatedUnix}} {{svg "octicon-pencil"}}
{{.Package.Type.Name}}{{.Package.Name}}{{.Version.Version}}{{.Package.Name}}{{.Version.Version}} {{.Creator.Name}} {{if .Repository}} {{.Repository.Name}} {{end}} {{ctx.Locale.TrSize .CalculateBlobSize}}{{DateUtils.AbsoluteShort .Version.CreatedUnix}}{{FileSize .CalculateBlobSize}}{{DateTime "short" .Version.CreatedUnix}} {{svg "octicon-trash"}}
@@ -19,13 +19,13 @@ {{ctx.Locale.Tr "admin.repos.name"}} {{SortArrow "alphabetically" "reversealphabetically" $.SortType false}} - + @@ -47,13 +47,13 @@ - - - - + + + + {{end}} @@ -101,7 +101,7 @@

{{ctx.Locale.Tr "repo.settings.delete_desc"}}

- {{ctx.Locale.Tr "repo.settings.delete_notices_2" (``|SafeHTML)}}
+ {{ctx.Locale.Tr "repo.settings.delete_notices_2" `` | Safe}}
{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}
{{template "base/modal_actions_confirm" .}} diff --git a/templates/admin/repo/search.tmpl b/templates/admin/repo/search.tmpl new file mode 100644 index 0000000000..247ec5491a --- /dev/null +++ b/templates/admin/repo/search.tmpl @@ -0,0 +1,29 @@ + diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl index a33cb43a2f..fb4f16791d 100644 --- a/templates/admin/repo/unadopted.tmpl +++ b/templates/admin/repo/unadopted.tmpl @@ -8,10 +8,10 @@
-
- - - {{template "shared/search/button"}} +
+ + +
@@ -20,10 +20,10 @@ {{if .Dirs}}
{{range $dirI, $dir := .Dirs}} -
- {{svg "octicon-file-directory-fill"}} {{$dir}} +
+ {{svg "octicon-file-directory-fill"}} {{$dir}}
- + diff --git a/templates/admin/stacktrace-row.tmpl b/templates/admin/stacktrace-row.tmpl index 048056cf4e..ffb8bf812f 100644 --- a/templates/admin/stacktrace-row.tmpl +++ b/templates/admin/stacktrace-row.tmpl @@ -1,21 +1,19 @@
-
-
+
+
{{if eq .Process.Type "request"}} {{svg "octicon-globe" 16}} {{else if eq .Process.Type "system"}} {{svg "octicon-cpu" 16}} {{else if eq .Process.Type "normal"}} {{svg "octicon-terminal" 16}} - {{else if eq .Process.Type "git"}} - {{svg "octicon-git-branch" 16}} {{else}} {{svg "octicon-code" 16}} {{end}}
-
+
{{.Process.Description}}
-
{{if ne .Process.Type "none"}}{{DateUtils.TimeSince .Process.Start}}{{end}}
+
{{if ne .Process.Type "none"}}{{TimeSince .Process.Start ctx.Locale}}{{end}}
{{if or (eq .Process.Type "request") (eq .Process.Type "normal")}} @@ -24,14 +22,14 @@
{{if .Process.Stacks}} -
+
{{range .Process.Stacks}}
-
- {{svg "octicon-code" 16}}{{.Description}}{{if gt .Count 1}} * {{.Count}}{{end}} +
+ {{svg "octicon-code" 16}}{{.Description}}{{if gt .Count 1}} * {{.Count}}{{end}}
{{range .Labels}} @@ -42,9 +40,9 @@
{{range .Entry}} -
- {{svg "octicon-dot-fill" 16}} -
+
+ {{svg "octicon-dot-fill" 16}} +
{{.Function}}
{{.File}}:{{.Line}}
diff --git a/templates/admin/stacktrace.tmpl b/templates/admin/stacktrace.tmpl index afe8e6942a..894e41f8d7 100644 --- a/templates/admin/stacktrace.tmpl +++ b/templates/admin/stacktrace.tmpl @@ -1,19 +1,18 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}}
-
-
+
+ -
- - + +
+ + {{ctx.Locale.Tr "tool.raw_seconds"}} +
@@ -40,7 +39,7 @@ {{ctx.Locale.Tr "admin.monitor.process.cancel"}}
-

{{ctx.Locale.Tr "admin.monitor.process.cancel_notices" (``|SafeHTML)}}

+

{{ctx.Locale.Tr "admin.monitor.process.cancel_notices" `` | Safe}}

{{ctx.Locale.Tr "admin.monitor.process.cancel_desc"}}

{{template "base/modal_actions_confirm" .}} diff --git a/templates/admin/stats.tmpl b/templates/admin/stats.tmpl index 70f2aa7fb4..04fa862a85 100644 --- a/templates/admin/stats.tmpl +++ b/templates/admin/stats.tmpl @@ -5,10 +5,10 @@
{{ctx.Locale.Tr "repo.watchers"}}{{ctx.Locale.Tr "admin.repos.watches"}} - {{ctx.Locale.Tr "repo.stars"}} + {{ctx.Locale.Tr "admin.repos.stars"}} {{SortArrow "moststars" "feweststars" $.SortType false}} - {{ctx.Locale.Tr "repo.forks"}} + {{ctx.Locale.Tr "admin.repos.forks"}} {{SortArrow "mostforks" "fewestforks" $.SortType false}} {{ctx.Locale.Tr "admin.repos.issues"}}
{{.ID}} - {{.Owner.Name}} + {{.Owner.Name}} {{if .Owner.Visibility.IsPrivate}} {{svg "octicon-lock"}} {{end}} - {{.Name}} + {{.Name}} {{if .IsArchived}} {{ctx.Locale.Tr "repo.desc.archived"}} {{end}} @@ -80,10 +80,10 @@ {{.NumStars}} {{.NumForks}} {{.NumIssues}}{{ctx.Locale.TrSize .GitSize}}{{ctx.Locale.TrSize .LFSSize}}{{DateUtils.AbsoluteShort .UpdatedUnix}}{{DateUtils.AbsoluteShort .CreatedUnix}}{{FileSize .GitSize}}{{FileSize .LFSSize}}{{DateTime "short" .UpdatedUnix}}{{DateTime "short" .CreatedUnix}} {{svg "octicon-trash"}}
- {{range $statsKey, $statsValue := .Stats}} + {{range $statsKey := .StatsKeys}} - + {{end}}
{{$statsKey}}{{$statsValue}}{{index $.StatsCounter $statsKey}}
diff --git a/templates/admin/system_status.tmpl b/templates/admin/system_status.tmpl deleted file mode 100644 index 7b5c9be6cc..0000000000 --- a/templates/admin/system_status.tmpl +++ /dev/null @@ -1,62 +0,0 @@ -
-
{{ctx.Locale.Tr "admin.dashboard.server_uptime"}}
-
{{.SysStatus.StartTime}}
-
{{ctx.Locale.Tr "admin.dashboard.current_goroutine"}}
-
{{.SysStatus.NumGoroutine}}
-
-
{{ctx.Locale.Tr "admin.dashboard.current_memory_usage"}}
-
{{.SysStatus.MemAllocated}}
-
{{ctx.Locale.Tr "admin.dashboard.total_memory_allocated"}}
-
{{.SysStatus.MemTotal}}
-
{{ctx.Locale.Tr "admin.dashboard.memory_obtained"}}
-
{{.SysStatus.MemSys}}
-
{{ctx.Locale.Tr "admin.dashboard.pointer_lookup_times"}}
-
{{.SysStatus.Lookups}}
-
{{ctx.Locale.Tr "admin.dashboard.memory_allocate_times"}}
-
{{.SysStatus.MemMallocs}}
-
{{ctx.Locale.Tr "admin.dashboard.memory_free_times"}}
-
{{.SysStatus.MemFrees}}
-
-
{{ctx.Locale.Tr "admin.dashboard.current_heap_usage"}}
-
{{.SysStatus.HeapAlloc}}
-
{{ctx.Locale.Tr "admin.dashboard.heap_memory_obtained"}}
-
{{.SysStatus.HeapSys}}
-
{{ctx.Locale.Tr "admin.dashboard.heap_memory_idle"}}
-
{{.SysStatus.HeapIdle}}
-
{{ctx.Locale.Tr "admin.dashboard.heap_memory_in_use"}}
-
{{.SysStatus.HeapInuse}}
-
{{ctx.Locale.Tr "admin.dashboard.heap_memory_released"}}
-
{{.SysStatus.HeapReleased}}
-
{{ctx.Locale.Tr "admin.dashboard.heap_objects"}}
-
{{.SysStatus.HeapObjects}}
-
-
{{ctx.Locale.Tr "admin.dashboard.bootstrap_stack_usage"}}
-
{{.SysStatus.StackInuse}}
-
{{ctx.Locale.Tr "admin.dashboard.stack_memory_obtained"}}
-
{{.SysStatus.StackSys}}
-
{{ctx.Locale.Tr "admin.dashboard.mspan_structures_usage"}}
-
{{.SysStatus.MSpanInuse}}
-
{{ctx.Locale.Tr "admin.dashboard.mspan_structures_obtained"}}
-
{{.SysStatus.MSpanSys}}
-
{{ctx.Locale.Tr "admin.dashboard.mcache_structures_usage"}}
-
{{.SysStatus.MCacheInuse}}
-
{{ctx.Locale.Tr "admin.dashboard.mcache_structures_obtained"}}
-
{{.SysStatus.MCacheSys}}
-
{{ctx.Locale.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}
-
{{.SysStatus.BuckHashSys}}
-
{{ctx.Locale.Tr "admin.dashboard.gc_metadata_obtained"}}
-
{{.SysStatus.GCSys}}
-
{{ctx.Locale.Tr "admin.dashboard.other_system_allocation_obtained"}}
-
{{.SysStatus.OtherSys}}
-
-
{{ctx.Locale.Tr "admin.dashboard.next_gc_recycle"}}
-
{{.SysStatus.NextGC}}
-
{{ctx.Locale.Tr "admin.dashboard.last_gc_time"}}
-
{{.SysStatus.LastGCTime}}
-
{{ctx.Locale.Tr "admin.dashboard.total_gc_pause"}}
-
{{.SysStatus.PauseTotalNs}}
-
{{ctx.Locale.Tr "admin.dashboard.last_gc_pause"}}
-
{{.SysStatus.PauseNs}}
-
{{ctx.Locale.Tr "admin.dashboard.gc_times"}}
-
{{.SysStatus.NumGC}}
-
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index f5c85e9290..fcb8ce0827 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -53,7 +53,7 @@
-
+
@@ -61,34 +61,15 @@
-
- - -
-
+

{{ctx.Locale.Tr "admin.users.password_helper"}}

- -
- - -
-
@@ -110,53 +91,46 @@
- +
- {{ctx.Locale.Tr "admin.users.activated.description"}}
- +
- {{ctx.Locale.Tr "admin.users.block.description"}}
- +
- {{ctx.Locale.Tr "admin.users.admin.description"}}
- +
- {{ctx.Locale.Tr "admin.users.restricted.description"}}
-
-
- +
+
+
- {{ctx.Locale.Tr "admin.users.allow_git_hook_tooltip"}}
-
+
- +
- {{ctx.Locale.Tr "admin.users.local_import.description"}}
{{if not .DisableRegularOrgCreation}}
- +
- {{ctx.Locale.Tr "admin.users.organization_creation.description"}}
{{end}} @@ -192,7 +166,7 @@
-
+
@@ -205,7 +179,7 @@
-
+
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 9b3447f44a..8fdc80fc70 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -52,7 +52,11 @@
- {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.user_kind")}} + +
+ {{template "shared/searchinput" dict "Value" .Keyword}} + +
@@ -92,18 +96,18 @@ {{ctx.Locale.Tr "admin.users.remote"}} {{end}} - {{.Email}} + {{.Email}} {{if .IsActive}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{if .IsRestricted}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{if index $.UsersTwoFaStatus .ID}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} - {{DateUtils.AbsoluteShort .CreatedUnix}} + {{DateTime "short" .CreatedUnix}} {{if .LastLoginUnix}} - {{DateUtils.AbsoluteShort .LastLoginUnix}} + {{DateTime "short" .LastLoginUnix}} {{else}} {{ctx.Locale.Tr "admin.users.never_login"}} {{end}} -
+ diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl index b04ebc4b60..81f70511d0 100644 --- a/templates/admin/user/new.tmpl +++ b/templates/admin/user/new.tmpl @@ -26,7 +26,7 @@
-
+
@@ -59,12 +59,12 @@
-
+
-
+
diff --git a/templates/admin/user/view.tmpl b/templates/admin/user/view.tmpl index 21943a8382..fd3017607c 100644 --- a/templates/admin/user/view.tmpl +++ b/templates/admin/user/view.tmpl @@ -2,7 +2,7 @@
-
+

{{.Title}}
@@ -13,7 +13,7 @@ {{template "admin/user/view_details" .}}

-
+

{{ctx.Locale.Tr "admin.emails"}}
diff --git a/templates/admin/user/view_details.tmpl b/templates/admin/user/view_details.tmpl index be2f32b5ec..21425eecb4 100644 --- a/templates/admin/user/view_details.tmpl +++ b/templates/admin/user/view_details.tmpl @@ -48,14 +48,6 @@ {{svg "octicon-x"}} {{end}}
- {{if .User.Language}} -
- - {{ctx.Locale.Tr "settings.language"}}: - {{range .AllLangs}}{{if eq $.User.Language .Lang}}{{.Name}}{{end}}{{end}} - -
- {{end}} {{if .User.Location}}
{{svg "octicon-location"}}{{.User.Location}} diff --git a/templates/api/packages/pypi/simple.tmpl b/templates/api/packages/pypi/simple.tmpl index 181f8266e6..77cb035600 100644 --- a/templates/api/packages/pypi/simple.tmpl +++ b/templates/api/packages/pypi/simple.tmpl @@ -8,7 +8,7 @@ {{range .PackageDescriptors}} {{$p := .}} {{range .Files}} - {{.File.Name}}
+ {{.File.Name}}
{{end}} {{end}} diff --git a/templates/base/alert.tmpl b/templates/base/alert.tmpl index e2853d3dab..160584f769 100644 --- a/templates/base/alert.tmpl +++ b/templates/base/alert.tmpl @@ -1,23 +1,20 @@ {{if .Flash.ErrorMsg}} -
-

{{.Flash.ErrorMsg | SanitizeHTML}}

+
+

{{.Flash.ErrorMsg | Str2html}}

{{end}} {{if .Flash.SuccessMsg}} -
-

{{.Flash.SuccessMsg | SanitizeHTML}}

+
+

{{.Flash.SuccessMsg | Str2html}}

{{end}} {{if .Flash.InfoMsg}} -
-

{{.Flash.InfoMsg | SanitizeHTML}}

+
+

{{.Flash.InfoMsg | Str2html}}

{{end}} {{if .Flash.WarningMsg}} -
-

{{.Flash.WarningMsg | SanitizeHTML}}

+
+

{{.Flash.WarningMsg | Str2html}}

{{end}} -{{if and (not .Flash.ErrorMsg) (not .Flash.SuccessMsg) (not .Flash.InfoMsg) (not .Flash.WarningMsg) (not .IsHTMX)}} -
-{{end}} diff --git a/templates/base/alert_details.tmpl b/templates/base/alert_details.tmpl index 6801c8240f..1d7ec15dc0 100644 --- a/templates/base/alert_details.tmpl +++ b/templates/base/alert_details.tmpl @@ -2,6 +2,6 @@
{{.Summary}} - {{.Details | SanitizeHTML}} + {{.Details | Str2html}}
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index fed426a469..d65a3626a4 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -16,5 +16,6 @@ {{template "custom/footer" .}} + {{ctx.DataRaceCheck $.Context}} diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index 133ebac33a..f0a7865602 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -1,14 +1,12 @@
diff --git a/templates/devtest/flex-list.tmpl b/templates/devtest/flex-list.tmpl index 015ab1e154..c8584c110b 100644 --- a/templates/devtest/flex-list.tmpl +++ b/templates/devtest/flex-list.tmpl @@ -25,7 +25,7 @@
@@ -73,7 +73,7 @@

If parent provides the padding/margin space:

-
+
item 1 (no padding top)
item 2 (no padding bottom)
diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl index 5cd36721a7..eda169a043 100644 --- a/templates/devtest/fomantic-modal.tmpl +++ b/templates/devtest/fomantic-modal.tmpl @@ -5,7 +5,7 @@ @@ -14,7 +14,7 @@
Form dialog (layout 2)
-
+
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
@@ -24,7 +24,7 @@
Form dialog (layout 3)
-
+
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
@@ -33,7 +33,7 @@ - +
{{template "base/footer" .}} diff --git a/templates/devtest/label.tmpl b/templates/devtest/label.tmpl deleted file mode 100644 index c4b52a3e23..0000000000 --- a/templates/devtest/label.tmpl +++ /dev/null @@ -1,27 +0,0 @@ -{{template "base/head" .}} - -
-
-

Label

-
- simple label - red label - green label -
-
- basic label - basic red label - basic green label -
-
- long content must be in a non-flex "gt-ellipsis" element, otherwise it won't get ellipsis. very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label -
-
- very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label -
-
- very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label -
-
-
-{{template "base/footer" .}} diff --git a/templates/devtest/tmplerr.tmpl b/templates/devtest/tmplerr.tmpl index dd938c895e..2fe3f1effd 100644 --- a/templates/devtest/tmplerr.tmpl +++ b/templates/devtest/tmplerr.tmpl @@ -1,10 +1,10 @@ {{template "base/head" .}}
-
-
+
+
hello hello hello hello hello hello hello hello hello hello
-
+
{{template "devtest/tmplerr-sub" .}}
diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl index 039933fa2d..2298575887 100644 --- a/templates/explore/code.tmpl +++ b/templates/explore/code.tmpl @@ -2,7 +2,7 @@
{{template "explore/navbar" .}}
- {{template "shared/search/code/search" .}} + {{template "code/searchcombo" .}}
{{template "base/footer" .}} diff --git a/templates/explore/navbar.tmpl b/templates/explore/navbar.tmpl index c07c0ba4a4..7f2aea497a 100644 --- a/templates/explore/navbar.tmpl +++ b/templates/explore/navbar.tmpl @@ -1,23 +1,20 @@ - -
+ diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index ab5999832d..c51dcaa3ff 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -13,42 +13,33 @@ {{.Name}} {{if .IsArchived}} - {{ctx.Locale.Tr "repo.desc.archived"}} + {{ctx.Locale.Tr "repo.desc.archived"}} {{end}} {{if .IsPrivate}} - {{ctx.Locale.Tr "repo.desc.private"}} + {{ctx.Locale.Tr "repo.desc.private"}} {{else}} {{if .Owner.Visibility.IsPrivate}} - {{ctx.Locale.Tr "repo.desc.internal"}} + {{ctx.Locale.Tr "repo.desc.internal"}} {{end}} {{end}} {{if .IsTemplate}} - {{ctx.Locale.Tr "repo.desc.template"}} + {{ctx.Locale.Tr "repo.desc.template"}} {{end}} {{if eq .ObjectFormatName "sha256"}} - {{ctx.Locale.Tr "repo.desc.sha256"}} + {{ctx.Locale.Tr "repo.desc.sha256"}} {{end}}
- {{$description := .DescriptionHTML $.Context}} @@ -62,12 +53,12 @@ {{end}}
{{end}} -
{{ctx.Locale.Tr "org.repo_updated" (DateUtils.TimeSince .UpdatedUnix)}}
+
{{ctx.Locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix ctx.Locale}}
{{else}}
- {{ctx.Locale.Tr "search.no_results"}} + {{ctx.Locale.Tr "explore.repo_no_results"}}
{{end}}
diff --git a/templates/explore/repo_search.tmpl b/templates/explore/repo_search.tmpl new file mode 100644 index 0000000000..eaf2e7a090 --- /dev/null +++ b/templates/explore/repo_search.tmpl @@ -0,0 +1,42 @@ + +{{if and .PageIsExploreRepositories .OnlyShowRelevant}} +
+ {{ctx.Locale.Tr "explore.relevant_repositories" ((printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))|Escape) | Safe}} +
+{{end}} +
diff --git a/templates/explore/repos.tmpl b/templates/explore/repos.tmpl index 53742bf0d9..dfede2ffcc 100644 --- a/templates/explore/repos.tmpl +++ b/templates/explore/repos.tmpl @@ -2,7 +2,7 @@
{{template "explore/navbar" .}}
- {{template "shared/repo_search" .}} + {{template "explore/repo_search" .}} {{template "explore/repo_list" .}} {{template "base/paginate" .}}
diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl index 1d984a2e37..74b80436dc 100644 --- a/templates/explore/search.tmpl +++ b/templates/explore/search.tmpl @@ -1,22 +1,23 @@ -

- {{ctx.Locale.Tr "startpage.install_desc" "https://forgejo.org/download/#installation-from-binary" "https://forgejo.org/download/#container-image" "https://forgejo.org/download"}} + {{ctx.Locale.Tr "startpage.install_desc" | Str2html}}

@@ -25,7 +25,7 @@ {{svg "octicon-device-desktop"}} {{ctx.Locale.Tr "startpage.platform"}}

- {{ctx.Locale.Tr "startpage.platform_desc"}} + {{ctx.Locale.Tr "startpage.platform_desc" | Str2html}}

@@ -35,7 +35,7 @@ {{svg "octicon-rocket"}} {{ctx.Locale.Tr "startpage.lightweight"}}

- {{ctx.Locale.Tr "startpage.lightweight_desc"}} + {{ctx.Locale.Tr "startpage.lightweight_desc" | Str2html}}

@@ -43,7 +43,7 @@ {{svg "octicon-code"}} {{ctx.Locale.Tr "startpage.license"}}

- {{ctx.Locale.Tr "startpage.license_desc" "https://forgejo.org/download" "https://codeberg.org/forgejo/forgejo"}} + {{ctx.Locale.Tr "startpage.license_desc" | Str2html}}

diff --git a/templates/htmx/milestone_sidebar.tmpl b/templates/htmx/milestone_sidebar.tmpl deleted file mode 100644 index 05bbd802cc..0000000000 --- a/templates/htmx/milestone_sidebar.tmpl +++ /dev/null @@ -1,4 +0,0 @@ -
- {{template "repo/issue/view_content/comments" .}} -
-{{template "repo/issue/view_content/sidebar/milestones" .}} diff --git a/templates/install.tmpl b/templates/install.tmpl index ae800df130..e9b267fa1c 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -8,9 +8,9 @@
{{template "base/alert" .}} -
-

{{ctx.Locale.Tr "install.docker_helper" "https://forgejo.org/docs/latest/admin/installation-docker/"}}

+

{{ctx.Locale.Tr "install.docker_helper" "https://docs.gitea.com/installation/install-with-docker" | Safe}}

+

{{ctx.Locale.Tr "install.db_title"}}

{{ctx.Locale.Tr "install.require_db_desc"}}

@@ -28,7 +28,7 @@
-
+
@@ -47,7 +47,7 @@
-
+
-
+
- {{ctx.Locale.Tr "install.sqlite_helper"}} + {{ctx.Locale.Tr "install.sqlite_helper" | Safe}}
@@ -107,11 +107,6 @@ {{ctx.Locale.Tr "install.app_name_helper"}}
-
- - - {{ctx.Locale.Tr "install.app_slogan_helper"}} -
@@ -129,7 +124,7 @@
- + {{ctx.Locale.Tr "install.domain_helper"}}
@@ -144,7 +139,7 @@
- + {{ctx.Locale.Tr "install.app_url_helper"}}
@@ -152,27 +147,20 @@ {{ctx.Locale.Tr "install.log_root_path_helper"}}
-
-
- - -
- {{ctx.Locale.Tr "install.disable_registration.description"}} -
- +
- {{ctx.Locale.Tr "install.enable_update_checker_helper_forgejo"}} + {{ctx.Locale.Tr "install.enable_update_checker_helper"}}

{{ctx.Locale.Tr "install.optional_title"}}

-
- +
+ {{ctx.Locale.Tr "install.email_title"}}
@@ -186,7 +174,7 @@
- {{ctx.Locale.TrString "install.smtp_from_helper"}}{{/* it contains lt/gt chars*/}} + {{ctx.Locale.Tr "install.smtp_from_helper"}}
@@ -211,86 +199,81 @@
-
- +
+ {{ctx.Locale.Tr "install.server_service_title"}}
- +
- {{ctx.Locale.Tr "install.offline_mode.description"}}
- +
- {{ctx.Locale.Tr "install.disable_gravatar.description"}}
- +
- {{ctx.Locale.Tr "install.federated_avatar_lookup.description"}}
- +
- {{ctx.Locale.Tr "install.openid_signin.description"}} +
+
+
+ + +
- +
- {{ctx.Locale.Tr "install.allow_only_external_registration.description"}}
- +
- {{ctx.Locale.Tr "install.openid_signup.description"}}
- +
- {{ctx.Locale.Tr "install.enable_captcha.description"}}
- +
- {{ctx.Locale.Tr "install.require_sign_in_view.description"}}
- +
- {{ctx.Locale.Tr "install.default_keep_email_private.description"}}
- +
- {{ctx.Locale.Tr "install.default_allow_create_organization.description"}}
- +
- {{ctx.Locale.Tr "install.default_enable_timetracking.description"}}
@@ -314,11 +297,11 @@
-
- +
+ {{ctx.Locale.Tr "install.admin_title"}} -

{{ctx.Locale.Tr "install.admin_setting.description"}}

+

{{ctx.Locale.Tr "install.admin_setting_desc"}}

@@ -337,8 +320,6 @@
-
- {{if .EnvConfigKeys}}

{{ctx.Locale.Tr "install.env_config_keys"}}

@@ -346,15 +327,18 @@
{{ctx.Locale.Tr "install.env_config_keys_prompt"}}
-
+
{{range .EnvConfigKeys}}{{.}}{{end}}
{{end}} -

{{ctx.Locale.Tr "install.config_location_hint"}} {{.CustomConfFile}}

+
-
+
+ These configuration options will be written into: {{.CustomConfFile}} +
+
@@ -363,5 +347,5 @@
- + {{template "base/footer" .}} diff --git a/templates/mail/auth/2fa_disabled.tmpl b/templates/mail/auth/2fa_disabled.tmpl deleted file mode 100644 index 3f9d3795c0..0000000000 --- a/templates/mail/auth/2fa_disabled.tmpl +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


-

{{.locale.Tr "mail.totp_disabled.text_1"}}


- {{if not .HasWebAuthn}}

{{.locale.Tr "mail.totp_disabled.no_2fa"}}


{{end}} -

{{.locale.Tr "mail.account_security_caution.text_1"}}


-

{{.locale.Tr "mail.account_security_caution.text_2"}}


- - {{template "common/footer_simple" .}} - - diff --git a/templates/mail/auth/activate.tmpl b/templates/mail/auth/activate.tmpl index eb7ea5a8ec..a15afe3d49 100644 --- a/templates/mail/auth/activate.tmpl +++ b/templates/mail/auth/activate.tmpl @@ -3,12 +3,13 @@ + {{.locale.Tr "mail.activate_account.title" (.DisplayName|DotEscape)}} {{$activate_url := printf "%suser/activate?code=%s" AppUrl (QueryEscape .Code)}} -

{{.locale.Tr "mail.activate_account.text_1" (.DisplayName|DotEscape) AppName}}


-

{{.locale.Tr "mail.activate_account.text_2" .ActiveCodeLives}}

{{$activate_url}}


+

{{.locale.Tr "mail.activate_account.text_1" (.DisplayName|DotEscape) AppName | Str2html}}


+

{{.locale.Tr "mail.activate_account.text_2" .ActiveCodeLives | Str2html}}

{{$activate_url}}


{{.locale.Tr "mail.link_not_working_do_paste"}}

© {{AppName}}

diff --git a/templates/mail/auth/activate_email.tmpl b/templates/mail/auth/activate_email.tmpl index 9ca54d3084..b15cc2a68a 100644 --- a/templates/mail/auth/activate_email.tmpl +++ b/templates/mail/auth/activate_email.tmpl @@ -3,12 +3,13 @@ + {{.locale.Tr "mail.activate_email.title" (.DisplayName|DotEscape)}} {{$activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl (QueryEscape .Code) (QueryEscape .Email)}} -

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


-

{{.locale.Tr "mail.activate_email.text" .ActiveCodeLives}}

{{$activate_url}}


+

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}


+

{{.locale.Tr "mail.activate_email.text" .ActiveCodeLives | Str2html}}

{{$activate_url}}


{{.locale.Tr "mail.link_not_working_do_paste"}}

© {{AppName}}

diff --git a/templates/mail/auth/password_change.tmpl b/templates/mail/auth/password_change.tmpl deleted file mode 100644 index 4366b8d720..0000000000 --- a/templates/mail/auth/password_change.tmpl +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - -

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


-

{{.locale.Tr "mail.password_change.text_1"}}


-

{{.locale.Tr "mail.account_security_caution.text_1"}}


-

{{.locale.Tr "mail.account_security_caution.text_2"}}


- - {{template "common/footer_simple" .}} - - diff --git a/templates/mail/auth/primary_mail_change.tmpl b/templates/mail/auth/primary_mail_change.tmpl deleted file mode 100644 index d17be19886..0000000000 --- a/templates/mail/auth/primary_mail_change.tmpl +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


-

{{.locale.Tr "mail.primary_mail_change.text_1" .NewPrimaryMail}}


-

{{.locale.Tr "mail.account_security_caution.text_1"}}


-

{{.locale.Tr "mail.account_security_caution.text_2"}}


- - {{template "common/footer_simple" .}} - - diff --git a/templates/mail/auth/register_notify.tmpl b/templates/mail/auth/register_notify.tmpl index d3a668b0ef..3cdb456fb3 100644 --- a/templates/mail/auth/register_notify.tmpl +++ b/templates/mail/auth/register_notify.tmpl @@ -3,14 +3,15 @@ + {{.locale.Tr "mail.register_notify.title" (.DisplayName|DotEscape) AppName}} {{$set_pwd_url := printf "%[1]suser/forgot_password" AppUrl}} -

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}


{{.locale.Tr "mail.register_notify.text_1" AppName}}


{{.locale.Tr "mail.register_notify.text_2" .Username}}

{{AppUrl}}user/login


-

{{.locale.Tr "mail.register_notify.text_3" $set_pwd_url}}


+

{{.locale.Tr "mail.register_notify.text_3" ($set_pwd_url | Escape) | Str2html}}


© {{AppName}}

diff --git a/templates/mail/auth/removed_security_key.tmpl b/templates/mail/auth/removed_security_key.tmpl deleted file mode 100644 index 18ae18725e..0000000000 --- a/templates/mail/auth/removed_security_key.tmpl +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


-

{{.locale.Tr "mail.removed_security_key.text_1" .SecurityKeyName}}


- {{if and (not .HasWebAuthn) (not .HasTOTP)}}

{{.locale.Tr "mail.removed_security_key.no_2fa"}}


{{end}} -

{{.locale.Tr "mail.account_security_caution.text_1"}}


-

{{.locale.Tr "mail.account_security_caution.text_2"}}


- - {{template "common/footer_simple" .}} - - diff --git a/templates/mail/auth/reset_passwd.tmpl b/templates/mail/auth/reset_passwd.tmpl index b85b770d87..172844c954 100644 --- a/templates/mail/auth/reset_passwd.tmpl +++ b/templates/mail/auth/reset_passwd.tmpl @@ -3,12 +3,13 @@ + {{.locale.Tr "mail.reset_password.title" (.DisplayName|DotEscape)}} {{$recover_url := printf "%suser/recover_account?code=%s" AppUrl (QueryEscape .Code)}} -

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


-

{{.locale.Tr "mail.reset_password.text" .ResetPwdCodeLives}}

{{$recover_url}}


+

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}


+

{{.locale.Tr "mail.reset_password.text" .ResetPwdCodeLives | Str2html}}

{{$recover_url}}


{{.locale.Tr "mail.link_not_working_do_paste"}}

© {{AppName}}

diff --git a/templates/mail/auth/totp_enrolled.tmpl b/templates/mail/auth/totp_enrolled.tmpl deleted file mode 100644 index 9c665e028c..0000000000 --- a/templates/mail/auth/totp_enrolled.tmpl +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - -

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


- {{if .HasWebAuthn}}

{{.locale.Tr "mail.totp_enrolled.text_1.has_webauthn"}}

{{else}}

{{.locale.Tr "mail.totp_enrolled.text_1.no_webauthn"}}

{{end}}
-

{{.locale.Tr "mail.account_security_caution.text_1"}}


-

{{.locale.Tr "mail.account_security_caution.text_2"}}


- {{template "common/footer_simple" .}} - - diff --git a/templates/mail/common/footer_simple.tmpl b/templates/mail/common/footer_simple.tmpl deleted file mode 100644 index baec3e5fd3..0000000000 --- a/templates/mail/common/footer_simple.tmpl +++ /dev/null @@ -1 +0,0 @@ -

{{AppName}}

diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl index f8ad62ae56..d02ea39918 100644 --- a/templates/mail/issue/assigned.tmpl +++ b/templates/mail/issue/assigned.tmpl @@ -5,16 +5,17 @@ .footer { font-size:small; color:#666;} + {{.Subject}} -{{$repo_url := HTMLFormat "%s" .Issue.Repo.HTMLURL .Issue.Repo.FullName}} -{{$link := HTMLFormat "#%d" .Link .Issue.Index}} +{{$repo_url := printf "%s" (Escape .Issue.Repo.HTMLURL) (Escape .Issue.Repo.FullName)}} +{{$link := printf "#%d" (Escape .Link) .Issue.Index}}

{{if .IsPull}} - {{.locale.Tr "mail.issue_assigned.pull" .Doer.Name $link $repo_url}} + {{.locale.Tr "mail.issue_assigned.pull" .Doer.Name $link $repo_url | Str2html}} {{else}} - {{.locale.Tr "mail.issue_assigned.issue" .Doer.Name $link $repo_url}} + {{.locale.Tr "mail.issue_assigned.issue" .Doer.Name $link $repo_url | Str2html}} {{end}}