mirror of
https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo.git
synced 2025-07-06 17:00:04 +02:00
Compare commits
150 commits
forgejo
...
v10.0.1-gi
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6c61f80d21 | ||
![]() |
1298a315bd | ||
![]() |
c5b3812553 | ||
![]() |
0ee62840ff | ||
![]() |
efe77599e6 | ||
![]() |
22855c6238 | ||
![]() |
aa683cb1e2 | ||
![]() |
99d2de8956 | ||
![]() |
4b75d40853 | ||
![]() |
aa6674de6e | ||
![]() |
971f6f7bab | ||
![]() |
1dd3a341a7 | ||
![]() |
592b23f5cd | ||
![]() |
4d65d593ad | ||
![]() |
3cf2111dbf | ||
![]() |
cdc80b9fe6 | ||
![]() |
8065657151 | ||
![]() |
78ff09f63d | ||
![]() |
4c60dfb6f0 | ||
![]() |
5b2ae61a12 | ||
![]() |
e83f575da5 | ||
![]() |
246131cc69 | ||
![]() |
e97e20427d | ||
![]() |
5ff7951560 | ||
![]() |
56a9ea1fc3 | ||
![]() |
82c9a86e83 | ||
![]() |
2845a75cbe | ||
![]() |
2c0cb04776 | ||
![]() |
635770f8a4 | ||
![]() |
0831aeccd1 | ||
![]() |
0c81519d4e | ||
![]() |
3c11eb1e26 | ||
![]() |
24264cb45f | ||
![]() |
f0da2f268a | ||
![]() |
d8bf745749 | ||
![]() |
f42432a9e4 | ||
![]() |
cc193ec4ef | ||
![]() |
3d7458b8cc | ||
![]() |
37a8fa9b5c | ||
![]() |
d13faeccaa | ||
![]() |
57de00e5b9 | ||
![]() |
52485edf64 | ||
![]() |
1d01b58227 | ||
![]() |
2771c2e591 | ||
![]() |
3c7f598230 | ||
![]() |
6ef900899e | ||
![]() |
a9f0bb9f68 | ||
![]() |
3b4f1b3469 | ||
![]() |
77fc232e5b | ||
![]() |
5a7d70658d | ||
![]() |
5046a10aec | ||
![]() |
77db7655e0 | ||
![]() |
c324910c31 | ||
![]() |
57ad0b868d | ||
![]() |
34d2a8531c | ||
![]() |
d260013a51 | ||
![]() |
3168330425 | ||
![]() |
2491bbfa69 | ||
![]() |
ac01c7a384 | ||
![]() |
b615d41457 | ||
![]() |
184bdef340 | ||
![]() |
27276ff26e | ||
![]() |
1b00bf2d26 | ||
![]() |
69bc17ea35 | ||
![]() |
0db9a24a4b | ||
![]() |
4016f2890d | ||
![]() |
c198cb6e65 | ||
![]() |
114d8975b5 | ||
![]() |
7ee19b4c6c | ||
![]() |
faa263d54a | ||
![]() |
0ecf28f37f | ||
![]() |
d10034f4d8 | ||
![]() |
553fc3cc42 | ||
![]() |
6d7bf7369d | ||
![]() |
eb83b05430 | ||
![]() |
61e345cd36 | ||
![]() |
5c5e1c87ba | ||
![]() |
7546c4acf3 | ||
![]() |
25e81d05f0 | ||
![]() |
054537989f | ||
![]() |
348e0e1fac | ||
![]() |
627634a76e | ||
![]() |
28db11f2e7 | ||
![]() |
6d0bf55f05 | ||
![]() |
2d1e163913 | ||
![]() |
26b7c6b86a | ||
![]() |
05056b8aa2 | ||
![]() |
39843ee2b3 | ||
![]() |
3b7ed0cda2 | ||
![]() |
2b1e74a76f | ||
![]() |
c439e26c33 | ||
![]() |
317559fdd9 | ||
![]() |
b88cd0c111 | ||
![]() |
5326183693 | ||
![]() |
5b6e0ca99c | ||
![]() |
90730e83ba | ||
![]() |
775770ad81 | ||
![]() |
4eb7e0fe08 | ||
![]() |
597d806753 | ||
![]() |
2b6a4137d5 | ||
![]() |
35266133d8 | ||
![]() |
dab3121c65 | ||
![]() |
3ce1a6562d | ||
![]() |
3b5f162fe6 | ||
![]() |
f63e5a1cff | ||
![]() |
25640f201e | ||
![]() |
ef205915cc | ||
![]() |
81d351ce5f | ||
![]() |
cd08097bbb | ||
![]() |
13496203bc | ||
![]() |
8f47560bf7 | ||
![]() |
9e6c3f226c | ||
![]() |
c7c7f69f82 | ||
![]() |
86a09562fd | ||
![]() |
ce5c3e32c1 | ||
![]() |
fa9f6e0cdd | ||
![]() |
172a48be8a | ||
![]() |
4a25a3e154 | ||
![]() |
6266715486 | ||
![]() |
3496c819da | ||
![]() |
4f8d96a6de | ||
![]() |
8d353ad258 | ||
![]() |
865d4f538b | ||
![]() |
ecbbaabfc8 | ||
![]() |
38f058a5f0 | ||
![]() |
1a64ae1dc4 | ||
![]() |
a8cc73fe87 | ||
![]() |
7a84081755 | ||
![]() |
2ac9b16297 | ||
![]() |
2bcbfbc5d4 | ||
![]() |
4999de50c3 | ||
![]() |
eb00a80efc | ||
![]() |
c7c22aae8c | ||
![]() |
0eab84d02e | ||
![]() |
e71fd7d28d | ||
![]() |
055348430e | ||
![]() |
440be42baf | ||
![]() |
f1b98d16c7 | ||
![]() |
662b385596 | ||
![]() |
023aaef2b9 | ||
![]() |
cb745a771a | ||
![]() |
38d2933cc1 | ||
![]() |
5a0c79e6b4 | ||
![]() |
424f85304e | ||
![]() |
382db9e8de | ||
![]() |
0ff66fa3bb | ||
![]() |
d5c5724f44 | ||
![]() |
1da56f0eb8 | ||
![]() |
6a78a71172 | ||
![]() |
f6c442c2fe |
2573 changed files with 24733 additions and 42936 deletions
192
.deadcode-out
192
.deadcode-out
|
@ -1,7 +1,7 @@
|
||||||
forgejo.org/cmd
|
code.gitea.io/gitea/cmd
|
||||||
NoMainListener
|
NoMainListener
|
||||||
|
|
||||||
forgejo.org/cmd/forgejo
|
code.gitea.io/gitea/cmd/forgejo
|
||||||
ContextSetNoInit
|
ContextSetNoInit
|
||||||
ContextSetNoExit
|
ContextSetNoExit
|
||||||
ContextSetStderr
|
ContextSetStderr
|
||||||
|
@ -9,94 +9,128 @@ forgejo.org/cmd/forgejo
|
||||||
ContextSetStdout
|
ContextSetStdout
|
||||||
ContextSetStdin
|
ContextSetStdin
|
||||||
|
|
||||||
forgejo.org/models
|
code.gitea.io/gitea/models
|
||||||
|
IsErrUpdateTaskNotExist
|
||||||
|
ErrUpdateTaskNotExist.Error
|
||||||
|
ErrUpdateTaskNotExist.Unwrap
|
||||||
IsErrSHANotFound
|
IsErrSHANotFound
|
||||||
IsErrMergeDivergingFastForwardOnly
|
IsErrMergeDivergingFastForwardOnly
|
||||||
|
|
||||||
forgejo.org/models/auth
|
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
|
WebAuthnCredentials
|
||||||
|
|
||||||
forgejo.org/models/db
|
code.gitea.io/gitea/models/db
|
||||||
TruncateBeans
|
TruncateBeans
|
||||||
InTransaction
|
InTransaction
|
||||||
DumpTables
|
DumpTables
|
||||||
|
|
||||||
forgejo.org/models/dbfs
|
code.gitea.io/gitea/models/dbfs
|
||||||
file.renameTo
|
file.renameTo
|
||||||
Create
|
Create
|
||||||
Rename
|
Rename
|
||||||
|
|
||||||
forgejo.org/models/forgefed
|
code.gitea.io/gitea/models/forgefed
|
||||||
GetFederationHost
|
GetFederationHost
|
||||||
|
|
||||||
forgejo.org/models/forgejo/semver
|
code.gitea.io/gitea/models/forgejo/semver
|
||||||
GetVersion
|
GetVersion
|
||||||
SetVersionString
|
SetVersionString
|
||||||
SetVersion
|
SetVersion
|
||||||
|
|
||||||
forgejo.org/models/git
|
code.gitea.io/gitea/models/git
|
||||||
RemoveDeletedBranchByID
|
RemoveDeletedBranchByID
|
||||||
|
|
||||||
forgejo.org/models/issues
|
code.gitea.io/gitea/models/issues
|
||||||
IsErrUnknownDependencyType
|
IsErrUnknownDependencyType
|
||||||
|
ErrNewIssueInsert.Error
|
||||||
IsErrIssueWasClosed
|
IsErrIssueWasClosed
|
||||||
|
ChangeMilestoneStatus
|
||||||
|
|
||||||
forgejo.org/models/organization
|
code.gitea.io/gitea/models/organization
|
||||||
|
GetTeamNamesByID
|
||||||
|
UpdateTeamUnits
|
||||||
SearchMembersOptions.ToConds
|
SearchMembersOptions.ToConds
|
||||||
|
UsersInTeamsCount
|
||||||
|
|
||||||
forgejo.org/models/perm/access
|
code.gitea.io/gitea/models/perm/access
|
||||||
GetRepoWriters
|
GetRepoWriters
|
||||||
|
|
||||||
forgejo.org/models/repo
|
code.gitea.io/gitea/models/project
|
||||||
|
UpdateColumnSorting
|
||||||
|
ChangeProjectStatus
|
||||||
|
|
||||||
|
code.gitea.io/gitea/models/repo
|
||||||
|
DeleteAttachmentsByIssue
|
||||||
|
FindReposMapByIDs
|
||||||
|
IsErrTopicNotExist
|
||||||
|
ErrTopicNotExist.Error
|
||||||
|
ErrTopicNotExist.Unwrap
|
||||||
|
GetTopicByName
|
||||||
WatchRepoMode
|
WatchRepoMode
|
||||||
|
|
||||||
forgejo.org/models/user
|
code.gitea.io/gitea/models/user
|
||||||
|
ErrUserInactive.Error
|
||||||
|
ErrUserInactive.Unwrap
|
||||||
IsErrExternalLoginUserAlreadyExist
|
IsErrExternalLoginUserAlreadyExist
|
||||||
IsErrExternalLoginUserNotExist
|
IsErrExternalLoginUserNotExist
|
||||||
NewFederatedUser
|
NewFederatedUser
|
||||||
IsErrUserSettingIsNotExist
|
IsErrUserSettingIsNotExist
|
||||||
GetUserAllSettings
|
GetUserAllSettings
|
||||||
DeleteUserSetting
|
DeleteUserSetting
|
||||||
|
GetUserEmailsByNames
|
||||||
|
GetUserNamesByIDs
|
||||||
|
|
||||||
forgejo.org/modules/activitypub
|
code.gitea.io/gitea/modules/activitypub
|
||||||
NewContext
|
NewContext
|
||||||
Context.APClientFactory
|
Context.APClientFactory
|
||||||
|
|
||||||
forgejo.org/modules/assetfs
|
code.gitea.io/gitea/modules/assetfs
|
||||||
Bindata
|
Bindata
|
||||||
|
|
||||||
forgejo.org/modules/auth/password/hash
|
code.gitea.io/gitea/modules/auth/password/hash
|
||||||
DummyHasher.HashWithSaltBytes
|
DummyHasher.HashWithSaltBytes
|
||||||
NewDummyHasher
|
NewDummyHasher
|
||||||
|
|
||||||
forgejo.org/modules/auth/password/pwn
|
code.gitea.io/gitea/modules/auth/password/pwn
|
||||||
WithHTTP
|
WithHTTP
|
||||||
|
|
||||||
forgejo.org/modules/base
|
code.gitea.io/gitea/modules/base
|
||||||
SetupGiteaRoot
|
SetupGiteaRoot
|
||||||
|
|
||||||
forgejo.org/modules/cache
|
code.gitea.io/gitea/modules/cache
|
||||||
GetInt
|
GetInt
|
||||||
WithNoCacheContext
|
WithNoCacheContext
|
||||||
RemoveContextData
|
RemoveContextData
|
||||||
|
|
||||||
forgejo.org/modules/emoji
|
code.gitea.io/gitea/modules/charset
|
||||||
|
BreakWriter.Write
|
||||||
|
|
||||||
|
code.gitea.io/gitea/modules/emoji
|
||||||
ReplaceCodes
|
ReplaceCodes
|
||||||
|
|
||||||
forgejo.org/modules/eventsource
|
code.gitea.io/gitea/modules/eventsource
|
||||||
Event.String
|
Event.String
|
||||||
|
|
||||||
forgejo.org/modules/forgefed
|
code.gitea.io/gitea/modules/forgefed
|
||||||
NewForgeUndoLike
|
|
||||||
ForgeUndoLike.UnmarshalJSON
|
|
||||||
ForgeUndoLike.Validate
|
|
||||||
GetItemByType
|
GetItemByType
|
||||||
JSONUnmarshalerFn
|
JSONUnmarshalerFn
|
||||||
NotEmpty
|
NotEmpty
|
||||||
ToRepository
|
ToRepository
|
||||||
OnRepository
|
OnRepository
|
||||||
|
|
||||||
forgejo.org/modules/git
|
code.gitea.io/gitea/modules/git
|
||||||
AllowLFSFiltersArgs
|
AllowLFSFiltersArgs
|
||||||
AddChanges
|
AddChanges
|
||||||
AddChangesWithArgs
|
AddChangesWithArgs
|
||||||
|
@ -104,57 +138,71 @@ forgejo.org/modules/git
|
||||||
CommitChangesWithArgs
|
CommitChangesWithArgs
|
||||||
SetUpdateHook
|
SetUpdateHook
|
||||||
openRepositoryWithDefaultContext
|
openRepositoryWithDefaultContext
|
||||||
|
IsTagExist
|
||||||
ToEntryMode
|
ToEntryMode
|
||||||
|
LimitedReaderCloser.Read
|
||||||
|
LimitedReaderCloser.Close
|
||||||
|
|
||||||
forgejo.org/modules/gitrepo
|
code.gitea.io/gitea/modules/gitgraph
|
||||||
|
Parser.Reset
|
||||||
|
|
||||||
|
code.gitea.io/gitea/modules/gitrepo
|
||||||
GetBranchCommitID
|
GetBranchCommitID
|
||||||
GetWikiDefaultBranch
|
GetWikiDefaultBranch
|
||||||
|
|
||||||
forgejo.org/modules/graceful
|
code.gitea.io/gitea/modules/graceful
|
||||||
Manager.TerminateContext
|
Manager.TerminateContext
|
||||||
Manager.Err
|
Manager.Err
|
||||||
Manager.Value
|
Manager.Value
|
||||||
Manager.Deadline
|
Manager.Deadline
|
||||||
|
|
||||||
forgejo.org/modules/hcaptcha
|
code.gitea.io/gitea/modules/hcaptcha
|
||||||
WithHTTP
|
WithHTTP
|
||||||
|
|
||||||
forgejo.org/modules/hostmatcher
|
code.gitea.io/gitea/modules/hostmatcher
|
||||||
HostMatchList.AppendPattern
|
HostMatchList.AppendPattern
|
||||||
|
|
||||||
forgejo.org/modules/json
|
code.gitea.io/gitea/modules/json
|
||||||
StdJSON.Marshal
|
StdJSON.Marshal
|
||||||
StdJSON.Unmarshal
|
StdJSON.Unmarshal
|
||||||
StdJSON.NewEncoder
|
StdJSON.NewEncoder
|
||||||
StdJSON.NewDecoder
|
StdJSON.NewDecoder
|
||||||
StdJSON.Indent
|
StdJSON.Indent
|
||||||
|
|
||||||
forgejo.org/modules/log
|
code.gitea.io/gitea/modules/markup
|
||||||
NewEventWriterBuffer
|
|
||||||
|
|
||||||
forgejo.org/modules/markup
|
|
||||||
GetRendererByType
|
GetRendererByType
|
||||||
RenderString
|
RenderString
|
||||||
IsMarkupFile
|
IsMarkupFile
|
||||||
|
|
||||||
forgejo.org/modules/markup/console
|
code.gitea.io/gitea/modules/markup/console
|
||||||
Render
|
Render
|
||||||
RenderString
|
RenderString
|
||||||
|
|
||||||
forgejo.org/modules/markup/markdown
|
code.gitea.io/gitea/modules/markup/markdown
|
||||||
|
IsDetails
|
||||||
|
IsSummary
|
||||||
|
IsTaskCheckBoxListItem
|
||||||
|
IsIcon
|
||||||
RenderRawString
|
RenderRawString
|
||||||
|
|
||||||
forgejo.org/modules/markup/mdstripper
|
code.gitea.io/gitea/modules/markup/markdown/math
|
||||||
|
WithInlineDollarParser
|
||||||
|
WithBlockDollarParser
|
||||||
|
|
||||||
|
code.gitea.io/gitea/modules/markup/mdstripper
|
||||||
stripRenderer.AddOptions
|
stripRenderer.AddOptions
|
||||||
StripMarkdown
|
StripMarkdown
|
||||||
|
|
||||||
forgejo.org/modules/markup/orgmode
|
code.gitea.io/gitea/modules/markup/orgmode
|
||||||
RenderString
|
RenderString
|
||||||
|
|
||||||
forgejo.org/modules/process
|
code.gitea.io/gitea/modules/private
|
||||||
|
ActionsRunnerRegister
|
||||||
|
|
||||||
|
code.gitea.io/gitea/modules/process
|
||||||
Manager.ExecTimeout
|
Manager.ExecTimeout
|
||||||
|
|
||||||
forgejo.org/modules/queue
|
code.gitea.io/gitea/modules/queue
|
||||||
newBaseChannelSimple
|
newBaseChannelSimple
|
||||||
newBaseChannelUnique
|
newBaseChannelUnique
|
||||||
newBaseRedisSimple
|
newBaseRedisSimple
|
||||||
|
@ -163,71 +211,89 @@ forgejo.org/modules/queue
|
||||||
testStateRecorder.Reset
|
testStateRecorder.Reset
|
||||||
newWorkerPoolQueueForTest
|
newWorkerPoolQueueForTest
|
||||||
|
|
||||||
forgejo.org/modules/queue/lqinternal
|
code.gitea.io/gitea/modules/queue/lqinternal
|
||||||
QueueItemIDBytes
|
QueueItemIDBytes
|
||||||
QueueItemKeyBytes
|
QueueItemKeyBytes
|
||||||
ListLevelQueueKeys
|
ListLevelQueueKeys
|
||||||
|
|
||||||
forgejo.org/modules/setting
|
code.gitea.io/gitea/modules/setting
|
||||||
NewConfigProviderFromData
|
NewConfigProviderFromData
|
||||||
GitConfigType.GetOption
|
GitConfigType.GetOption
|
||||||
InitLoggersForTest
|
InitLoggersForTest
|
||||||
|
|
||||||
forgejo.org/modules/sync
|
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.Start
|
||||||
StatusTable.IsRunning
|
StatusTable.IsRunning
|
||||||
|
|
||||||
forgejo.org/modules/timeutil
|
code.gitea.io/gitea/modules/timeutil
|
||||||
GetExecutableModTime
|
GetExecutableModTime
|
||||||
MockSet
|
MockSet
|
||||||
MockUnset
|
MockUnset
|
||||||
|
|
||||||
forgejo.org/modules/translation
|
code.gitea.io/gitea/modules/translation
|
||||||
MockLocale.Language
|
MockLocale.Language
|
||||||
MockLocale.TrString
|
MockLocale.TrString
|
||||||
MockLocale.Tr
|
MockLocale.Tr
|
||||||
MockLocale.TrN
|
MockLocale.TrN
|
||||||
MockLocale.TrPluralString
|
|
||||||
MockLocale.TrSize
|
MockLocale.TrSize
|
||||||
MockLocale.HasKey
|
|
||||||
MockLocale.PrettyNumber
|
MockLocale.PrettyNumber
|
||||||
|
|
||||||
forgejo.org/modules/util
|
code.gitea.io/gitea/modules/util
|
||||||
OptionalArg
|
OptionalArg
|
||||||
|
|
||||||
forgejo.org/modules/util/filebuffer
|
code.gitea.io/gitea/modules/util/filebuffer
|
||||||
CreateFromReader
|
CreateFromReader
|
||||||
|
|
||||||
forgejo.org/modules/validation
|
code.gitea.io/gitea/modules/validation
|
||||||
IsErrNotValid
|
IsErrNotValid
|
||||||
|
|
||||||
forgejo.org/modules/web
|
code.gitea.io/gitea/modules/web
|
||||||
RouteMock
|
RouteMock
|
||||||
RouteMockReset
|
RouteMockReset
|
||||||
|
|
||||||
forgejo.org/modules/zstd
|
code.gitea.io/gitea/modules/web/middleware
|
||||||
|
DeleteLocaleCookie
|
||||||
|
|
||||||
|
code.gitea.io/gitea/modules/zstd
|
||||||
NewWriter
|
NewWriter
|
||||||
Writer.Write
|
Writer.Write
|
||||||
Writer.Close
|
Writer.Close
|
||||||
|
|
||||||
forgejo.org/routers/web
|
code.gitea.io/gitea/routers/web
|
||||||
NotFound
|
NotFound
|
||||||
|
|
||||||
forgejo.org/routers/web/org
|
code.gitea.io/gitea/routers/web/org
|
||||||
MustEnableProjects
|
MustEnableProjects
|
||||||
|
|
||||||
forgejo.org/services/context
|
code.gitea.io/gitea/services/context
|
||||||
GetPrivateContext
|
GetPrivateContext
|
||||||
|
|
||||||
forgejo.org/services/repository
|
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
|
IsErrForkAlreadyExist
|
||||||
|
|
||||||
forgejo.org/services/repository/files
|
code.gitea.io/gitea/services/repository/files
|
||||||
ContentType.String
|
ContentType.String
|
||||||
|
GetFileResponseFromCommit
|
||||||
|
TemporaryUploadRepository.GetLastCommit
|
||||||
|
TemporaryUploadRepository.GetLastCommitByRef
|
||||||
|
|
||||||
forgejo.org/services/repository/gitgraph
|
code.gitea.io/gitea/services/webhook
|
||||||
Parser.Reset
|
|
||||||
|
|
||||||
forgejo.org/services/webhook
|
|
||||||
NewNotifier
|
NewNotifier
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Gitea DevContainer",
|
"name": "Gitea DevContainer",
|
||||||
"image": "mcr.microsoft.com/devcontainers/go:1.24-bullseye",
|
"image": "mcr.microsoft.com/devcontainers/go:1.23-bullseye",
|
||||||
"features": {
|
"features": {
|
||||||
// installs nodejs into container
|
// installs nodejs into container
|
||||||
"ghcr.io/devcontainers/features/node:1": {
|
"ghcr.io/devcontainers/features/node:1": {
|
||||||
|
|
|
@ -34,7 +34,6 @@ _testmain.go
|
||||||
|
|
||||||
*coverage.out
|
*coverage.out
|
||||||
coverage.all
|
coverage.all
|
||||||
coverage/
|
|
||||||
cpu.out
|
cpu.out
|
||||||
|
|
||||||
/modules/migration/bindata.go
|
/modules/migration/bindata.go
|
||||||
|
|
|
@ -26,8 +26,3 @@ insert_final_newline = false
|
||||||
|
|
||||||
[options/locale/locale_*.ini]
|
[options/locale/locale_*.ini]
|
||||||
insert_final_newline = false
|
insert_final_newline = false
|
||||||
|
|
||||||
# Weblate JSON output defaults to four spaces
|
|
||||||
[options/locale_next/locale_*.json]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
|
|
2
.forgejo/testdata/build-release/Dockerfile
vendored
2
.forgejo/testdata/build-release/Dockerfile
vendored
|
@ -1,4 +1,4 @@
|
||||||
FROM data.forgejo.org/oci/alpine:3.21
|
FROM data.forgejo.org/oci/alpine:3.20
|
||||||
ARG RELEASE_VERSION=unkown
|
ARG RELEASE_VERSION=unkown
|
||||||
LABEL maintainer="contact@forgejo.org" \
|
LABEL maintainer="contact@forgejo.org" \
|
||||||
org.opencontainers.image.version="${RELEASE_VERSION}"
|
org.opencontainers.image.version="${RELEASE_VERSION}"
|
||||||
|
|
2
.forgejo/testdata/build-release/go.mod
vendored
2
.forgejo/testdata/build-release/go.mod
vendored
|
@ -1,3 +1,3 @@
|
||||||
module forgejo.org
|
module code.gitea.io/gitea
|
||||||
|
|
||||||
go 1.23.3
|
go 1.23.3
|
||||||
|
|
|
@ -27,10 +27,8 @@ runs:
|
||||||
- name: "Get go environment information"
|
- name: "Get go environment information"
|
||||||
id: go-environment
|
id: go-environment
|
||||||
run: |
|
run: |
|
||||||
chmod 755 $HOME # ensure ${RUN_AS_USER} has permission when go is located in $HOME
|
echo "modcache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT"
|
||||||
export GOROOT="$(go env GOROOT)"
|
echo "cache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT"
|
||||||
echo "modcache=$(su ${RUN_AS_USER} -c '${GOROOT}/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "cache=$(su ${RUN_AS_USER} -c '${GOROOT}/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT"
|
|
||||||
env:
|
env:
|
||||||
RUN_AS_USER: ${{ inputs.username }}
|
RUN_AS_USER: ${{ inputs.username }}
|
||||||
GO_VERSION: ${{ steps.go-version.outputs.go-version }}
|
GO_VERSION: ${{ steps.go-version.outputs.go-version }}
|
||||||
|
|
|
@ -40,7 +40,7 @@ jobs:
|
||||||
)
|
)
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
- name: event info
|
- name: event info
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -45,7 +45,7 @@ jobs:
|
||||||
|
|
||||||
- uses: https://data.forgejo.org/actions/setup-node@v4
|
- uses: https://data.forgejo.org/actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 20
|
||||||
|
|
||||||
- uses: https://data.forgejo.org/actions/setup-go@v5
|
- uses: https://data.forgejo.org/actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
@ -164,7 +164,7 @@ jobs:
|
||||||
|
|
||||||
- name: build container & release
|
- name: build container & release
|
||||||
if: ${{ secrets.TOKEN != '' }}
|
if: ${{ secrets.TOKEN != '' }}
|
||||||
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.4
|
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.1
|
||||||
with:
|
with:
|
||||||
forgejo: "${{ env.GITHUB_SERVER_URL }}"
|
forgejo: "${{ env.GITHUB_SERVER_URL }}"
|
||||||
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
||||||
|
@ -183,7 +183,7 @@ jobs:
|
||||||
|
|
||||||
- name: build rootless container
|
- name: build rootless container
|
||||||
if: ${{ secrets.TOKEN != '' }}
|
if: ${{ secrets.TOKEN != '' }}
|
||||||
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.4
|
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.1
|
||||||
with:
|
with:
|
||||||
forgejo: "${{ env.GITHUB_SERVER_URL }}"
|
forgejo: "${{ env.GITHUB_SERVER_URL }}"
|
||||||
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
||||||
|
|
|
@ -35,7 +35,7 @@ jobs:
|
||||||
)
|
)
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: data.forgejo.org/oci/node:22-bookworm
|
image: data.forgejo.org/oci/node:20-bookworm
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -9,7 +9,7 @@ jobs:
|
||||||
if: vars.ROLE == 'forgejo-integration'
|
if: vars.ROLE == 'forgejo-integration'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: apt install curl jq
|
- name: apt install curl jq
|
||||||
|
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
if: vars.ROLE == 'forgejo-coding'
|
if: vars.ROLE == 'forgejo-coding'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
- name: Debug output
|
- name: Debug output
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
if: ${{ secrets.MIRROR_TOKEN != '' }}
|
if: ${{ secrets.MIRROR_TOKEN != '' }}
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
- name: git push {v*/,}forgejo
|
- name: git push {v*/,}forgejo
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#
|
#
|
||||||
# See also https://forgejo.org/docs/next/contributor/release/#stable-release-process
|
# See also https://forgejo.org/docs/next/contributor/release/#stable-release-process
|
||||||
#
|
#
|
||||||
# TOKEN_NEXT_DIGEST is a token with write repository access to https://invisible.forgejo.org/infrastructure/next-digest issued by https://invisible.forgejo.org/forgejo-next-digest
|
|
||||||
#
|
|
||||||
# https://codeberg.org/forgejo-experimental/forgejo
|
# https://codeberg.org/forgejo-experimental/forgejo
|
||||||
#
|
#
|
||||||
# Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental
|
# Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental
|
||||||
|
@ -16,7 +14,7 @@
|
||||||
# vars.DOER: forgejo-experimental-ci
|
# vars.DOER: forgejo-experimental-ci
|
||||||
# secrets.TOKEN: <generated from codeberg.org/forgejo-experimental-ci>
|
# secrets.TOKEN: <generated from codeberg.org/forgejo-experimental-ci>
|
||||||
#
|
#
|
||||||
# http://invisible.forgejo.org/forgejo/forgejo
|
# http://private.forgejo.org/forgejo/forgejo
|
||||||
#
|
#
|
||||||
# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo
|
# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo
|
||||||
#
|
#
|
||||||
|
@ -44,7 +42,7 @@ jobs:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
- name: copy & sign
|
- name: copy & sign
|
||||||
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/publish@v5.3.4
|
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/publish@v5.3.1
|
||||||
with:
|
with:
|
||||||
from-forgejo: ${{ vars.FORGEJO }}
|
from-forgejo: ${{ vars.FORGEJO }}
|
||||||
to-forgejo: ${{ vars.FORGEJO }}
|
to-forgejo: ${{ vars.FORGEJO }}
|
||||||
|
@ -63,14 +61,14 @@ jobs:
|
||||||
|
|
||||||
- name: get trigger mirror issue
|
- name: get trigger mirror issue
|
||||||
id: mirror
|
id: mirror
|
||||||
uses: https://data.forgejo.org/infrastructure/issue-action/get@v1.3.0
|
uses: https://data.forgejo.org/infrastructure/issue-action/get@v1.1.0
|
||||||
with:
|
with:
|
||||||
forgejo: https://code.forgejo.org
|
forgejo: https://code.forgejo.org
|
||||||
repository: forgejo/forgejo
|
repository: forgejo/forgejo
|
||||||
labels: mirror-trigger
|
labels: mirror-trigger
|
||||||
|
|
||||||
- name: trigger the mirror
|
- name: trigger the mirror
|
||||||
uses: https://data.forgejo.org/infrastructure/issue-action/set@v1.3.0
|
uses: https://data.forgejo.org/infrastructure/issue-action/set@v1.1.0
|
||||||
with:
|
with:
|
||||||
forgejo: https://code.forgejo.org
|
forgejo: https://code.forgejo.org
|
||||||
repository: forgejo/forgejo
|
repository: forgejo/forgejo
|
||||||
|
@ -82,7 +80,7 @@ jobs:
|
||||||
- name: upgrade v*.next.forgejo.org
|
- name: upgrade v*.next.forgejo.org
|
||||||
uses: https://data.forgejo.org/infrastructure/next-digest@v1.1.0
|
uses: https://data.forgejo.org/infrastructure/next-digest@v1.1.0
|
||||||
with:
|
with:
|
||||||
url: https://placeholder:${{ secrets.TOKEN_NEXT_DIGEST }}@invisible.forgejo.org/infrastructure/next-digest
|
url: https://placeholder:${{ secrets.TOKEN_NEXT_DIGEST }}@code.forgejo.org/infrastructure/next-digest
|
||||||
ref_name: '${{ github.ref_name }}'
|
ref_name: '${{ github.ref_name }}'
|
||||||
image: 'codeberg.org/forgejo-experimental/forgejo'
|
image: 'codeberg.org/forgejo-experimental/forgejo'
|
||||||
tag_suffix: '-rootless'
|
tag_suffix: '-rootless'
|
||||||
|
|
|
@ -9,7 +9,7 @@ jobs:
|
||||||
if: vars.ROLE == 'forgejo-coding'
|
if: vars.ROLE == 'forgejo-coding'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note')
|
if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note')
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,6 @@ on:
|
||||||
env:
|
env:
|
||||||
RENOVATE_DRY_RUN: ${{ (github.event_name != 'schedule' && github.ref_name != github.event.repository.default_branch) && 'full' || '' }}
|
RENOVATE_DRY_RUN: ${{ (github.event_name != 'schedule' && github.ref_name != github.event.repository.default_branch) && 'full' || '' }}
|
||||||
RENOVATE_REPOSITORIES: ${{ github.repository }}
|
RENOVATE_REPOSITORIES: ${{ github.repository }}
|
||||||
# fix because 10.0.0-58-7e1df53+gitea-1.22.0 < 10.0.0 for semver
|
|
||||||
# and codeberg api returns such versions from `git describe --tags`
|
|
||||||
RENOVATE_X_PLATFORM_VERSION: 10.0.0+gitea-1.22.0
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
renovate:
|
renovate:
|
||||||
|
@ -28,7 +25,7 @@ jobs:
|
||||||
|
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: data.forgejo.org/renovate/renovate:39.212.0
|
image: data.forgejo.org/forgejo-contrib/renovate:39.69.2
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Load renovate repo cache
|
- name: Load renovate repo cache
|
||||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
backend-checks:
|
backend-checks:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
options: --tmpfs /tmp:exec,noatime
|
options: --tmpfs /tmp:exec,noatime
|
||||||
steps:
|
steps:
|
||||||
- name: event info
|
- name: event info
|
||||||
|
@ -23,12 +23,12 @@ jobs:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
- uses: ./.forgejo/workflows-composite/setup-env
|
- uses: ./.forgejo/workflows-composite/setup-env
|
||||||
- run: su forgejo -c 'make deps-backend deps-tools'
|
- run: su forgejo -c 'make deps-backend deps-tools'
|
||||||
- run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check lint-swagger fmt-check swagger-validate' # ensure the "go-licenses" make target runs
|
- 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
|
- uses: ./.forgejo/workflows-composite/build-backend
|
||||||
frontend-checks:
|
frontend-checks:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
options: --tmpfs /tmp:exec,noatime
|
options: --tmpfs /tmp:exec,noatime
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
@ -53,7 +53,7 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [backend-checks, frontend-checks]
|
needs: [backend-checks, frontend-checks]
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
options: --tmpfs /tmp:exec,noatime
|
options: --tmpfs /tmp:exec,noatime
|
||||||
services:
|
services:
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
|
@ -136,7 +136,7 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [backend-checks, frontend-checks, test-unit]
|
needs: [backend-checks, frontend-checks, test-unit]
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
options: --tmpfs /tmp:exec,noatime
|
options: --tmpfs /tmp:exec,noatime
|
||||||
name: ${{ format('test-remote-cacher ({0})', matrix.cacher.name) }}
|
name: ${{ format('test-remote-cacher ({0})', matrix.cacher.name) }}
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -177,7 +177,7 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [backend-checks, frontend-checks]
|
needs: [backend-checks, frontend-checks]
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
options: --tmpfs /tmp:exec,noatime
|
options: --tmpfs /tmp:exec,noatime
|
||||||
services:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
|
@ -206,7 +206,7 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [backend-checks, frontend-checks]
|
needs: [backend-checks, frontend-checks]
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
options: --tmpfs /tmp:exec,noatime
|
options: --tmpfs /tmp:exec,noatime
|
||||||
services:
|
services:
|
||||||
minio:
|
minio:
|
||||||
|
@ -218,7 +218,7 @@ jobs:
|
||||||
ldap:
|
ldap:
|
||||||
image: data.forgejo.org/oci/test-openldap:latest
|
image: data.forgejo.org/oci/test-openldap:latest
|
||||||
pgsql:
|
pgsql:
|
||||||
image: data.forgejo.org/oci/bitnami/postgresql:16
|
image: data.forgejo.org/oci/bitnami/postgresql:15
|
||||||
env:
|
env:
|
||||||
POSTGRESQL_DATABASE: test
|
POSTGRESQL_DATABASE: test
|
||||||
POSTGRESQL_PASSWORD: postgres
|
POSTGRESQL_PASSWORD: postgres
|
||||||
|
@ -243,7 +243,7 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [backend-checks, frontend-checks]
|
needs: [backend-checks, frontend-checks]
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
options: --tmpfs /tmp:exec,noatime
|
options: --tmpfs /tmp:exec,noatime
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
@ -267,7 +267,7 @@ jobs:
|
||||||
- test-pgsql
|
- test-pgsql
|
||||||
- test-mysql
|
- test-mysql
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||||
options: --tmpfs /tmp:exec,noatime
|
options: --tmpfs /tmp:exec,noatime
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -37,7 +37,6 @@ _testmain.go
|
||||||
|
|
||||||
*coverage.out
|
*coverage.out
|
||||||
coverage.all
|
coverage.all
|
||||||
coverage/
|
|
||||||
cpu.out
|
cpu.out
|
||||||
|
|
||||||
/modules/migration/bindata.go
|
/modules/migration/bindata.go
|
||||||
|
@ -57,7 +56,6 @@ cpu.out
|
||||||
/gitea-vet
|
/gitea-vet
|
||||||
/debug
|
/debug
|
||||||
/integrations.test
|
/integrations.test
|
||||||
/forgejo
|
|
||||||
|
|
||||||
/bin
|
/bin
|
||||||
/dist
|
/dist
|
||||||
|
|
|
@ -19,12 +19,12 @@ linters:
|
||||||
- revive
|
- revive
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- stylecheck
|
- stylecheck
|
||||||
|
- tenv
|
||||||
- testifylint
|
- testifylint
|
||||||
- typecheck
|
- typecheck
|
||||||
- unconvert
|
- unconvert
|
||||||
- unused
|
- unused
|
||||||
- unparam
|
- unparam
|
||||||
- usetesting
|
|
||||||
- wastedassign
|
- wastedassign
|
||||||
|
|
||||||
run:
|
run:
|
||||||
|
@ -93,7 +93,7 @@ linters-settings:
|
||||||
desc: use os or io instead
|
desc: use os or io instead
|
||||||
- pkg: golang.org/x/exp
|
- pkg: golang.org/x/exp
|
||||||
desc: it's experimental and unreliable
|
desc: it's experimental and unreliable
|
||||||
- pkg: forgejo.org/modules/git/internal
|
- pkg: code.gitea.io/gitea/modules/git/internal
|
||||||
desc: do not use the internal package, use AddXxx function instead
|
desc: do not use the internal package, use AddXxx function instead
|
||||||
- pkg: gopkg.in/ini.v1
|
- pkg: gopkg.in/ini.v1
|
||||||
desc: do not use the ini package, use gitea's config system instead
|
desc: do not use the ini package, use gitea's config system instead
|
||||||
|
|
|
@ -33,9 +33,8 @@ models/.* @gusted
|
||||||
# for code that lives in here.
|
# for code that lives in here.
|
||||||
routers/.* @gusted
|
routers/.* @gusted
|
||||||
|
|
||||||
# Let locale changes be checked by the translation team.
|
# Let new strings be checked by the translation team.
|
||||||
options/locale/.* @0ko
|
options/locale/locale_en-US.ini @0ko
|
||||||
options/locale_next/.* @0ko
|
|
||||||
|
|
||||||
# Personal interest
|
# Personal interest
|
||||||
.*/webhook.* @oliverpool
|
.*/webhook.* @oliverpool
|
||||||
|
|
22
Dockerfile
22
Dockerfile
|
@ -1,6 +1,6 @@
|
||||||
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx
|
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.24-alpine3.21 AS build-env
|
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.23-alpine3.20 as build-env
|
||||||
|
|
||||||
ARG GOPROXY
|
ARG GOPROXY
|
||||||
ENV GOPROXY=${GOPROXY:-direct}
|
ENV GOPROXY=${GOPROXY:-direct}
|
||||||
|
@ -30,8 +30,8 @@ RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
|
||||||
|
|
||||||
RUN apk --no-cache add build-base git nodejs npm
|
RUN apk --no-cache add build-base git nodejs npm
|
||||||
|
|
||||||
COPY . ${GOPATH}/src/forgejo.org
|
COPY . ${GOPATH}/src/code.gitea.io/gitea
|
||||||
WORKDIR ${GOPATH}/src/forgejo.org
|
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
||||||
|
|
||||||
RUN make clean
|
RUN make clean
|
||||||
RUN make frontend
|
RUN make frontend
|
||||||
|
@ -47,11 +47,11 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \
|
||||||
/tmp/local/etc/s6/gitea/* \
|
/tmp/local/etc/s6/gitea/* \
|
||||||
/tmp/local/etc/s6/openssh/* \
|
/tmp/local/etc/s6/openssh/* \
|
||||||
/tmp/local/etc/s6/.s6-svscan/* \
|
/tmp/local/etc/s6/.s6-svscan/* \
|
||||||
/go/src/forgejo.org/gitea \
|
/go/src/code.gitea.io/gitea/gitea \
|
||||||
/go/src/forgejo.org/environment-to-ini
|
/go/src/code.gitea.io/gitea/environment-to-ini
|
||||||
RUN chmod 644 /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete
|
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
|
||||||
|
|
||||||
FROM data.forgejo.org/oci/alpine:3.21
|
FROM data.forgejo.org/oci/alpine:3.20
|
||||||
ARG RELEASE_VERSION
|
ARG RELEASE_VERSION
|
||||||
LABEL maintainer="contact@forgejo.org" \
|
LABEL maintainer="contact@forgejo.org" \
|
||||||
org.opencontainers.image.authors="Forgejo" \
|
org.opencontainers.image.authors="Forgejo" \
|
||||||
|
@ -99,11 +99,11 @@ ENV GITEA_CUSTOM=/data/gitea
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/entrypoint"]
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||||
CMD ["/usr/bin/s6-svscan", "/etc/s6"]
|
CMD ["/bin/s6-svscan", "/etc/s6"]
|
||||||
|
|
||||||
COPY --from=build-env /tmp/local /
|
COPY --from=build-env /tmp/local /
|
||||||
RUN cd /usr/local/bin ; ln -s gitea forgejo
|
RUN cd /usr/local/bin ; ln -s gitea forgejo
|
||||||
COPY --from=build-env /go/src/forgejo.org/gitea /app/gitea/gitea
|
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
||||||
RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli
|
RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli
|
||||||
COPY --from=build-env /go/src/forgejo.org/environment-to-ini /usr/local/bin/environment-to-ini
|
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
||||||
COPY --from=build-env /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx
|
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.24-alpine3.21 AS build-env
|
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.23-alpine3.20 as build-env
|
||||||
|
|
||||||
ARG GOPROXY
|
ARG GOPROXY
|
||||||
ENV GOPROXY=${GOPROXY:-direct}
|
ENV GOPROXY=${GOPROXY:-direct}
|
||||||
|
@ -30,8 +30,8 @@ RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
|
||||||
|
|
||||||
RUN apk --no-cache add build-base git nodejs npm
|
RUN apk --no-cache add build-base git nodejs npm
|
||||||
|
|
||||||
COPY . ${GOPATH}/src/forgejo.org
|
COPY . ${GOPATH}/src/code.gitea.io/gitea
|
||||||
WORKDIR ${GOPATH}/src/forgejo.org
|
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
||||||
|
|
||||||
RUN make clean
|
RUN make clean
|
||||||
RUN make frontend
|
RUN make frontend
|
||||||
|
@ -45,12 +45,11 @@ COPY docker/rootless /tmp/local
|
||||||
RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
|
RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
|
||||||
/tmp/local/usr/local/bin/docker-setup.sh \
|
/tmp/local/usr/local/bin/docker-setup.sh \
|
||||||
/tmp/local/usr/local/bin/gitea \
|
/tmp/local/usr/local/bin/gitea \
|
||||||
/go/src/forgejo.org/gitea \
|
/go/src/code.gitea.io/gitea/gitea \
|
||||||
/go/src/forgejo.org/environment-to-ini
|
/go/src/code.gitea.io/gitea/environment-to-ini
|
||||||
RUN chmod 644 /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete
|
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
|
||||||
|
|
||||||
FROM data.forgejo.org/oci/alpine:3.21
|
FROM data.forgejo.org/oci/alpine:3.20
|
||||||
ARG RELEASE_VERSION
|
|
||||||
LABEL maintainer="contact@forgejo.org" \
|
LABEL maintainer="contact@forgejo.org" \
|
||||||
org.opencontainers.image.authors="Forgejo" \
|
org.opencontainers.image.authors="Forgejo" \
|
||||||
org.opencontainers.image.url="https://forgejo.org" \
|
org.opencontainers.image.url="https://forgejo.org" \
|
||||||
|
@ -72,7 +71,6 @@ RUN apk --no-cache add \
|
||||||
git \
|
git \
|
||||||
curl \
|
curl \
|
||||||
gnupg \
|
gnupg \
|
||||||
openssh-client \
|
|
||||||
git-annex \
|
git-annex \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
@ -92,10 +90,10 @@ RUN chown git:git /var/lib/gitea /etc/gitea
|
||||||
|
|
||||||
COPY --from=build-env /tmp/local /
|
COPY --from=build-env /tmp/local /
|
||||||
RUN cd /usr/local/bin ; ln -s gitea forgejo
|
RUN cd /usr/local/bin ; ln -s gitea forgejo
|
||||||
COPY --from=build-env --chown=root:root /go/src/forgejo.org/gitea /app/gitea/gitea
|
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
||||||
RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli
|
RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli
|
||||||
COPY --from=build-env --chown=root:root /go/src/forgejo.org/environment-to-ini /usr/local/bin/environment-to-ini
|
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
||||||
COPY --from=build-env /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
||||||
|
|
||||||
#git:git
|
#git:git
|
||||||
USER 1000:1000
|
USER 1000:1000
|
||||||
|
|
114
Makefile
114
Makefile
|
@ -16,7 +16,7 @@ else
|
||||||
|
|
||||||
DIST := dist
|
DIST := dist
|
||||||
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
||||||
IMPORT := forgejo.org
|
IMPORT := code.gitea.io/gitea
|
||||||
|
|
||||||
GO ?= $(shell go env GOROOT)/bin/go
|
GO ?= $(shell go env GOROOT)/bin/go
|
||||||
SHASUM ?= shasum -a 256
|
SHASUM ?= shasum -a 256
|
||||||
|
@ -37,19 +37,19 @@ endif
|
||||||
XGO_VERSION := go-1.21.x
|
XGO_VERSION := go-1.21.x
|
||||||
|
|
||||||
AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go
|
AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go
|
||||||
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.2.1 # renovate: datasource=go
|
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.0.3 # renovate: datasource=go
|
||||||
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.7.0 # renovate: datasource=go
|
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.7.0 # renovate: datasource=go
|
||||||
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.7 # renovate: datasource=go
|
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2 # renovate: datasource=go
|
||||||
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # renovate: datasource=go
|
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # renovate: datasource=go
|
||||||
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.6.0 # renovate: datasource=go
|
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.6.0 # renovate: datasource=go
|
||||||
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # renovate: datasource=go
|
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # renovate: datasource=go
|
||||||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
|
||||||
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0 # renovate: datasource=go
|
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0 # renovate: datasource=go
|
||||||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 # renovate: datasource=go
|
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 # renovate: datasource=go
|
||||||
DEADCODE_PACKAGE ?= golang.org/x/tools/cmd/deadcode@v0.31.0 # renovate: datasource=go
|
DEADCODE_PACKAGE ?= golang.org/x/tools/cmd/deadcode@v0.28.0 # renovate: datasource=go
|
||||||
GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.4.0 # renovate: datasource=go
|
GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.4.0 # renovate: datasource=go
|
||||||
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.18.1 # renovate: datasource=go
|
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.17.0 # renovate: datasource=go
|
||||||
RENOVATE_NPM_PACKAGE ?= renovate@39.212.0 # renovate: datasource=docker packageName=data.forgejo.org/renovate/renovate
|
RENOVATE_NPM_PACKAGE ?= renovate@39.82.1 # renovate: datasource=docker packageName=code.forgejo.org/forgejo-contrib/renovate
|
||||||
|
|
||||||
# https://github.com/disposable-email-domains/disposable-email-domains/commits/main/
|
# https://github.com/disposable-email-domains/disposable-email-domains/commits/main/
|
||||||
DISPOSABLE_EMAILS_SHA ?= 0c27e671231d27cf66370034d7f6818037416989 # renovate: ...
|
DISPOSABLE_EMAILS_SHA ?= 0c27e671231d27cf66370034d7f6818037416989 # renovate: ...
|
||||||
|
@ -59,8 +59,20 @@ ifeq ($(HAS_GO), yes)
|
||||||
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
|
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GOFLAGS := -v
|
ifeq ($(GOOS),windows)
|
||||||
EXECUTABLE ?= gitea
|
IS_WINDOWS := yes
|
||||||
|
else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
|
||||||
|
ifeq ($(GOOS),)
|
||||||
|
IS_WINDOWS := yes
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(IS_WINDOWS),yes)
|
||||||
|
GOFLAGS := -v -buildmode=exe
|
||||||
|
EXECUTABLE ?= gitea.exe
|
||||||
|
else
|
||||||
|
GOFLAGS := -v
|
||||||
|
EXECUTABLE ?= gitea
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu)
|
ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu)
|
||||||
SED_INPLACE := sed -i
|
SED_INPLACE := sed -i
|
||||||
|
@ -115,20 +127,15 @@ FORGEJO_VERSION_API ?= ${FORGEJO_VERSION}
|
||||||
show-version-api:
|
show-version-api:
|
||||||
@echo ${FORGEJO_VERSION_API}
|
@echo ${FORGEJO_VERSION_API}
|
||||||
|
|
||||||
# Strip binaries by default to reduce size, allow overriding for debugging
|
|
||||||
STRIP ?= 1
|
|
||||||
ifeq ($(STRIP),1)
|
|
||||||
LDFLAGS := $(LDFLAGS) -s -w
|
|
||||||
endif
|
|
||||||
LDFLAGS := $(LDFLAGS) -X "main.ReleaseVersion=$(RELEASE_VERSION)" -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(FORGEJO_VERSION)" -X "main.Tags=$(TAGS)" -X "main.ForgejoVersion=$(FORGEJO_VERSION_API)"
|
LDFLAGS := $(LDFLAGS) -X "main.ReleaseVersion=$(RELEASE_VERSION)" -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(FORGEJO_VERSION)" -X "main.Tags=$(TAGS)" -X "main.ForgejoVersion=$(FORGEJO_VERSION_API)"
|
||||||
|
|
||||||
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
|
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
|
||||||
|
|
||||||
ifeq ($(HAS_GO), yes)
|
ifeq ($(HAS_GO), yes)
|
||||||
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list forgejo.org/models/migrations/...) $(shell $(GO) list forgejo.org/models/forgejo_migrations/...) forgejo.org/tests/integration/migration-test forgejo.org/tests forgejo.org/tests/integration forgejo.org/tests/e2e,$(shell $(GO) list ./...))
|
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) $(shell $(GO) list code.gitea.io/gitea/models/forgejo_migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./...))
|
||||||
endif
|
endif
|
||||||
REMOTE_CACHER_MODULES ?= cache nosql session queue
|
REMOTE_CACHER_MODULES ?= cache nosql session queue
|
||||||
GO_TEST_REMOTE_CACHER_PACKAGES ?= $(addprefix forgejo.org/modules/,$(REMOTE_CACHER_MODULES))
|
GO_TEST_REMOTE_CACHER_PACKAGES ?= $(addprefix code.gitea.io/gitea/modules/,$(REMOTE_CACHER_MODULES))
|
||||||
|
|
||||||
FOMANTIC_WORK_DIR := web_src/fomantic
|
FOMANTIC_WORK_DIR := web_src/fomantic
|
||||||
|
|
||||||
|
@ -161,7 +168,7 @@ GO_DIRS := build cmd models modules routers services tests
|
||||||
WEB_DIRS := web_src/js web_src/css
|
WEB_DIRS := web_src/js web_src/css
|
||||||
|
|
||||||
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
|
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
|
||||||
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(wildcard *.go *.js *.ts *.vue *.md *.yml *.yaml)
|
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(wildcard *.go *.js *.ts *.vue *.md *.yml *.yaml *.toml)
|
||||||
|
|
||||||
GO_SOURCES := $(wildcard *.go)
|
GO_SOURCES := $(wildcard *.go)
|
||||||
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go)
|
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go)
|
||||||
|
@ -169,7 +176,7 @@ GO_SOURCES += $(GENERATED_GO_DEST)
|
||||||
GO_SOURCES_NO_BINDATA := $(GO_SOURCES)
|
GO_SOURCES_NO_BINDATA := $(GO_SOURCES)
|
||||||
|
|
||||||
ifeq ($(HAS_GO), yes)
|
ifeq ($(HAS_GO), yes)
|
||||||
MIGRATION_PACKAGES := $(shell $(GO) list forgejo.org/models/migrations/... forgejo.org/models/forgejo_migrations/...)
|
MIGRATION_PACKAGES := $(shell $(GO) list code.gitea.io/gitea/models/migrations/... code.gitea.io/gitea/models/forgejo_migrations/...)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
|
ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
|
||||||
|
@ -413,22 +420,22 @@ lint-frontend: lint-js lint-css
|
||||||
lint-frontend-fix: lint-js-fix lint-css-fix
|
lint-frontend-fix: lint-js-fix lint-css-fix
|
||||||
|
|
||||||
.PHONY: lint-backend
|
.PHONY: lint-backend
|
||||||
lint-backend: lint-go lint-go-vet lint-editorconfig lint-renovate lint-locale lint-locale-usage lint-disposable-emails
|
lint-backend: lint-go lint-go-vet lint-editorconfig lint-renovate lint-locale lint-disposable-emails
|
||||||
|
|
||||||
.PHONY: lint-backend-fix
|
.PHONY: lint-backend-fix
|
||||||
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig lint-disposable-emails-fix
|
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig lint-disposable-emails-fix
|
||||||
|
|
||||||
.PHONY: lint-codespell
|
.PHONY: lint-codespell
|
||||||
lint-codespell: deps-py
|
lint-codespell:
|
||||||
@poetry run codespell
|
codespell
|
||||||
|
|
||||||
.PHONY: lint-codespell-fix
|
.PHONY: lint-codespell-fix
|
||||||
lint-codespell-fix: deps-py
|
lint-codespell-fix:
|
||||||
@poetry run codespell -w
|
codespell -w
|
||||||
|
|
||||||
.PHONY: lint-codespell-fix-i
|
.PHONY: lint-codespell-fix-i
|
||||||
lint-codespell-fix-i: deps-py
|
lint-codespell-fix-i:
|
||||||
@poetry run codespell -w -i 3 -C 2
|
codespell -w -i 3 -C 2
|
||||||
|
|
||||||
.PHONY: lint-js
|
.PHONY: lint-js
|
||||||
lint-js: node_modules
|
lint-js: node_modules
|
||||||
|
@ -458,11 +465,7 @@ lint-renovate: node_modules
|
||||||
|
|
||||||
.PHONY: lint-locale
|
.PHONY: lint-locale
|
||||||
lint-locale:
|
lint-locale:
|
||||||
$(GO) run build/lint-locale/lint-locale.go
|
$(GO) run build/lint-locale.go
|
||||||
|
|
||||||
.PHONY: lint-locale-usage
|
|
||||||
lint-locale-usage:
|
|
||||||
$(GO) run build/lint-locale-usage/lint-locale-usage.go --allow-missing-msgids
|
|
||||||
|
|
||||||
.PHONY: lint-md
|
.PHONY: lint-md
|
||||||
lint-md: node_modules
|
lint-md: node_modules
|
||||||
|
@ -476,7 +479,7 @@ lint-spell: lint-codespell
|
||||||
lint-spell-fix: lint-codespell-fix
|
lint-spell-fix: lint-codespell-fix
|
||||||
@go run $(MISSPELL_PACKAGE) -w $(SPELLCHECK_FILES)
|
@go run $(MISSPELL_PACKAGE) -w $(SPELLCHECK_FILES)
|
||||||
|
|
||||||
RUN_DEADCODE = $(GO) run $(DEADCODE_PACKAGE) -generated=false -f='{{println .Path}}{{range .Funcs}}{{printf "\t%s\n" .Name}}{{end}}{{println}}' -test forgejo.org
|
RUN_DEADCODE = $(GO) run $(DEADCODE_PACKAGE) -generated=false -f='{{println .Path}}{{range .Funcs}}{{printf "\t%s\n" .Name}}{{end}}{{println}}' -test code.gitea.io/gitea
|
||||||
|
|
||||||
.PHONY: lint-go
|
.PHONY: lint-go
|
||||||
lint-go:
|
lint-go:
|
||||||
|
@ -490,6 +493,13 @@ lint-go-fix:
|
||||||
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix
|
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix
|
||||||
$(RUN_DEADCODE) > .deadcode-out
|
$(RUN_DEADCODE) > .deadcode-out
|
||||||
|
|
||||||
|
# workaround step for the lint-go-windows CI task because 'go run' can not
|
||||||
|
# have distinct GOOS/GOARCH for its build and run steps
|
||||||
|
.PHONY: lint-go-windows
|
||||||
|
lint-go-windows:
|
||||||
|
@GOOS= GOARCH= $(GO) install $(GOLANGCI_LINT_PACKAGE)
|
||||||
|
golangci-lint run
|
||||||
|
|
||||||
.PHONY: lint-go-vet
|
.PHONY: lint-go-vet
|
||||||
lint-go-vet:
|
lint-go-vet:
|
||||||
@echo "Running go vet..."
|
@echo "Running go vet..."
|
||||||
|
@ -519,7 +529,7 @@ lint-templates: .venv node_modules
|
||||||
|
|
||||||
.PHONY: lint-yaml
|
.PHONY: lint-yaml
|
||||||
lint-yaml: .venv
|
lint-yaml: .venv
|
||||||
@poetry run yamllint -s .
|
@poetry run yamllint .
|
||||||
|
|
||||||
.PHONY: security-check
|
.PHONY: security-check
|
||||||
security-check:
|
security-check:
|
||||||
|
@ -610,7 +620,7 @@ tidy-check: tidy
|
||||||
go-licenses: $(GO_LICENSE_FILE)
|
go-licenses: $(GO_LICENSE_FILE)
|
||||||
|
|
||||||
$(GO_LICENSE_FILE): go.mod go.sum
|
$(GO_LICENSE_FILE): go.mod go.sum
|
||||||
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --ignore forgejo.org --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
|
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --ignore code.gitea.io/gitea --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
|
||||||
$(GO) run build/generate-go-licenses.go $(GO_LICENSE_TMP_DIR) $(GO_LICENSE_FILE)
|
$(GO) run build/generate-go-licenses.go $(GO_LICENSE_TMP_DIR) $(GO_LICENSE_FILE)
|
||||||
@rm -rf $(GO_LICENSE_TMP_DIR)
|
@rm -rf $(GO_LICENSE_TMP_DIR)
|
||||||
|
|
||||||
|
@ -740,33 +750,33 @@ integration-test-coverage-sqlite: integrations.cover.sqlite.test generate-ini-sq
|
||||||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.cover.sqlite.test -test.coverprofile=integration.coverage.out
|
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.cover.sqlite.test -test.coverprofile=integration.coverage.out
|
||||||
|
|
||||||
integrations.mysql.test: git-check $(GO_SOURCES)
|
integrations.mysql.test: git-check $(GO_SOURCES)
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.mysql.test
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test
|
||||||
|
|
||||||
integrations.pgsql.test: git-check $(GO_SOURCES)
|
integrations.pgsql.test: git-check $(GO_SOURCES)
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.pgsql.test
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test
|
||||||
|
|
||||||
integrations.sqlite.test: git-check $(GO_SOURCES)
|
integrations.sqlite.test: git-check $(GO_SOURCES)
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)'
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)'
|
||||||
|
|
||||||
integrations.cover.test: git-check $(GO_SOURCES)
|
integrations.cover.test: git-check $(GO_SOURCES)
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test
|
||||||
|
|
||||||
integrations.cover.sqlite.test: git-check $(GO_SOURCES)
|
integrations.cover.sqlite.test: git-check $(GO_SOURCES)
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
|
||||||
|
|
||||||
.PHONY: migrations.mysql.test
|
.PHONY: migrations.mysql.test
|
||||||
migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql
|
migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.mysql.test
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test
|
||||||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.mysql.test $(GOTESTCOMPILEDRUNSUFFIX)
|
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.mysql.test $(GOTESTCOMPILEDRUNSUFFIX)
|
||||||
|
|
||||||
.PHONY: migrations.pgsql.test
|
.PHONY: migrations.pgsql.test
|
||||||
migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql
|
migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.pgsql.test
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test
|
||||||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX)
|
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX)
|
||||||
|
|
||||||
.PHONY: migrations.sqlite.test
|
.PHONY: migrations.sqlite.test
|
||||||
migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
|
migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
|
||||||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX)
|
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX)
|
||||||
|
|
||||||
.PHONY: migrations.individual.mysql.test
|
.PHONY: migrations.individual.mysql.test
|
||||||
|
@ -777,7 +787,7 @@ migrations.individual.mysql.test: $(GO_SOURCES)
|
||||||
|
|
||||||
.PHONY: migrations.individual.sqlite.test\#%
|
.PHONY: migrations.individual.sqlite.test\#%
|
||||||
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
|
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
|
||||||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
|
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
|
||||||
|
|
||||||
.PHONY: migrations.individual.pgsql.test
|
.PHONY: migrations.individual.pgsql.test
|
||||||
migrations.individual.pgsql.test: $(GO_SOURCES)
|
migrations.individual.pgsql.test: $(GO_SOURCES)
|
||||||
|
@ -787,7 +797,7 @@ migrations.individual.pgsql.test: $(GO_SOURCES)
|
||||||
|
|
||||||
.PHONY: migrations.individual.pgsql.test\#%
|
.PHONY: migrations.individual.pgsql.test\#%
|
||||||
migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql
|
migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql
|
||||||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
|
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
|
||||||
|
|
||||||
.PHONY: migrations.individual.sqlite.test
|
.PHONY: migrations.individual.sqlite.test
|
||||||
migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
|
migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
|
||||||
|
@ -797,16 +807,16 @@ migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
|
||||||
|
|
||||||
.PHONY: migrations.individual.sqlite.test\#%
|
.PHONY: migrations.individual.sqlite.test\#%
|
||||||
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
|
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
|
||||||
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
|
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
|
||||||
|
|
||||||
e2e.mysql.test: $(GO_SOURCES)
|
e2e.mysql.test: $(GO_SOURCES)
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.mysql.test
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test
|
||||||
|
|
||||||
e2e.pgsql.test: $(GO_SOURCES)
|
e2e.pgsql.test: $(GO_SOURCES)
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.pgsql.test
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test
|
||||||
|
|
||||||
e2e.sqlite.test: $(GO_SOURCES)
|
e2e.sqlite.test: $(GO_SOURCES)
|
||||||
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)'
|
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)'
|
||||||
|
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check: test
|
check: test
|
||||||
|
@ -817,7 +827,7 @@ check: test
|
||||||
|
|
||||||
.PHONY: install $(TAGS_PREREQ)
|
.PHONY: install $(TAGS_PREREQ)
|
||||||
install: $(wildcard *.go)
|
install: $(wildcard *.go)
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)'
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: frontend backend
|
build: frontend backend
|
||||||
|
@ -845,13 +855,13 @@ merge-locales:
|
||||||
@echo "NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY"
|
@echo "NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY"
|
||||||
|
|
||||||
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
|
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
||||||
|
|
||||||
forgejo: $(EXECUTABLE)
|
forgejo: $(EXECUTABLE)
|
||||||
ln -f $(EXECUTABLE) forgejo
|
ln -f $(EXECUTABLE) forgejo
|
||||||
|
|
||||||
static-executable: $(GO_SOURCES) $(TAGS_PREREQ)
|
static-executable: $(GO_SOURCES) $(TAGS_PREREQ)
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE)
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE)
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: frontend generate release-linux release-copy release-compress vendor release-sources release-check
|
release: frontend generate release-linux release-copy release-compress vendor release-sources release-check
|
||||||
|
@ -862,6 +872,10 @@ sources-tarbal: frontend generate vendor release-sources release-check
|
||||||
$(DIST_DIRS):
|
$(DIST_DIRS):
|
||||||
mkdir -p $(DIST_DIRS)
|
mkdir -p $(DIST_DIRS)
|
||||||
|
|
||||||
|
.PHONY: release-windows
|
||||||
|
release-windows: | $(DIST_DIRS)
|
||||||
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
|
||||||
|
|
||||||
.PHONY: release-linux
|
.PHONY: release-linux
|
||||||
release-linux: | $(DIST_DIRS)
|
release-linux: | $(DIST_DIRS)
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out forgejo-$(VERSION) .
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out forgejo-$(VERSION) .
|
||||||
|
@ -1013,7 +1027,7 @@ generate-gitignore:
|
||||||
|
|
||||||
.PHONY: generate-gomock
|
.PHONY: generate-gomock
|
||||||
generate-gomock:
|
generate-gomock:
|
||||||
$(GO) run $(GOMOCK_PACKAGE) -package mock -destination ./modules/queue/mock/redisuniversalclient.go forgejo.org/modules/nosql RedisClient
|
$(GO) run $(GOMOCK_PACKAGE) -package mock -destination ./modules/queue/mock/redisuniversalclient.go code.gitea.io/gitea/modules/nosql RedisClient
|
||||||
|
|
||||||
.PHONY: generate-images
|
.PHONY: generate-images
|
||||||
generate-images: | node_modules
|
generate-images: | node_modules
|
||||||
|
|
|
@ -1590,7 +1590,7 @@ this situation, [follow the instructions in the companion blog post](https://for
|
||||||
|
|
||||||
The most prominent ones are described here, others can be found in the list of commits included in the release as described above.
|
The most prominent ones are described here, others can be found in the list of commits included in the release as described above.
|
||||||
|
|
||||||
* [Fix links to pull request reviews sent via mail](https://codeberg.org/forgejo/forgejo/commit/88e179d5ef8ee41f71d068195685ff098b38ca31). The pull request link was correct but it did not go the review and stayed at the beginning of the page
|
* [Fix links to pull request reviews sent via mail](https://codeberg.org/forgejo/forgejo/commit/88e179d5ef8ee41f71d068195685ff098b38ca31). The pull request link was correct but it did not go the the review and stayed at the beginning of the page
|
||||||
* [Recognize OGG as an audio format](https://codeberg.org/forgejo/forgejo/commit/622ec5c79f299c32ac2667a1aa7b4bf5d7c2d6cf)
|
* [Recognize OGG as an audio format](https://codeberg.org/forgejo/forgejo/commit/622ec5c79f299c32ac2667a1aa7b4bf5d7c2d6cf)
|
||||||
* [Consistently show the last time a cron job was run in the admin panel](https://codeberg.org/forgejo/forgejo/commit/5f769ef20)
|
* [Consistently show the last time a cron job was run in the admin panel](https://codeberg.org/forgejo/forgejo/commit/5f769ef20)
|
||||||
* [Fix NuGet registry v2 & v3 API search endpoints](https://codeberg.org/forgejo/forgejo/commit/471138829b0c24fe8c621dbb866ae8bb45ebc674)
|
* [Fix NuGet registry v2 & v3 API search endpoints](https://codeberg.org/forgejo/forgejo/commit/471138829b0c24fe8c621dbb866ae8bb45ebc674)
|
||||||
|
@ -1609,7 +1609,7 @@ this situation, [follow the instructions in the companion blog post](https://for
|
||||||
* [Fix pull request check list when there are more than 30](https://codeberg.org/forgejo/forgejo/commit/e226b9646)
|
* [Fix pull request check list when there are more than 30](https://codeberg.org/forgejo/forgejo/commit/e226b9646)
|
||||||
* [Fix attachment clipboard copy on insecure origin](https://codeberg.org/forgejo/forgejo/commit/12ac84c26)
|
* [Fix attachment clipboard copy on insecure origin](https://codeberg.org/forgejo/forgejo/commit/12ac84c26)
|
||||||
* [Fix the profile README rendering](https://codeberg.org/forgejo/forgejo/commit/84c3b60a4) that [was inconsistent with other markdown files renderings](https://codeberg.org/forgejo/forgejo/issues/833)
|
* [Fix the profile README rendering](https://codeberg.org/forgejo/forgejo/commit/84c3b60a4) that [was inconsistent with other markdown files renderings](https://codeberg.org/forgejo/forgejo/issues/833)
|
||||||
* [Fix API leaking the user email when the caller is not authenticated](https://codeberg.org/forgejo/forgejo/commit/d89003cc1)
|
* [Fix API leaking the user email when the caller is not authentified](https://codeberg.org/forgejo/forgejo/commit/d89003cc1)
|
||||||
|
|
||||||
## 1.20.2-0
|
## 1.20.2-0
|
||||||
|
|
||||||
|
@ -1667,7 +1667,7 @@ $ git -C forgejo log --oneline --no-merges origin/v1.19/forgejo..origin/v1.20/fo
|
||||||
The semantic version was updated to `5.0.0+0-gitea-1.20.1` because it contains breaking changes.
|
The semantic version was updated to `5.0.0+0-gitea-1.20.1` because it contains breaking changes.
|
||||||
- **Breaking:**
|
- **Breaking:**
|
||||||
- [Scoped access tokens](https://codeberg.org/forgejo/forgejo/commit/18de83b2a3fc120922096b7348d6375094ae1532) or (Personal Access Tokens), were refactored and although existing tokens are still valid, they may have a different scope than before. To ensure that no tokens have a larger scope than expected they must be removed and recreated.
|
- [Scoped access tokens](https://codeberg.org/forgejo/forgejo/commit/18de83b2a3fc120922096b7348d6375094ae1532) or (Personal Access Tokens), were refactored and although existing tokens are still valid, they may have a different scope than before. To ensure that no tokens have a larger scope than expected they must be removed and recreated.
|
||||||
- If your `app.ini` has one of the following `[indexer].ISSUE_INDEXER_QUEUE_TYPE`, `[indexer].ISSUE_INDEXER_QUEUE_BATCH_NUMBER`, `[indexer].`, `[indexer].ISSUE_INDEXER_QUEUE_DIR`, `[indexer].ISSUE_INDEXER_QUEUE_CONN_STR`, `[indexer].UPDATE_BUFFER_LEN`, `[mailer].SEND_BUFFER_LEN`, `[repository].PULL_REQUEST_QUEUE_LENGTH` or `[repository].MIRROR_QUEUE_LENGTH`, Forgejo will abort immediately. Unless you know exactly what you're doing, you must comment them out so the default values are used.
|
- If your `app.ini` has one of the the following `[indexer].ISSUE_INDEXER_QUEUE_TYPE`, `[indexer].ISSUE_INDEXER_QUEUE_BATCH_NUMBER`, `[indexer].`, `[indexer].ISSUE_INDEXER_QUEUE_DIR`, `[indexer].ISSUE_INDEXER_QUEUE_CONN_STR`, `[indexer].UPDATE_BUFFER_LEN`, `[mailer].SEND_BUFFER_LEN`, `[repository].PULL_REQUEST_QUEUE_LENGTH` or `[repository].MIRROR_QUEUE_LENGTH`, Forgejo will abort immediately. Unless you know exactly what you're doing, you must comment them out so the default values are used.
|
||||||
- The `-p` option of `environment-to-ini` is [no longer supported](https://codeberg.org/forgejo/forgejo/commit/fa0b5b14c2faa6a5f76bb2e7bc9241a5e4354189)
|
- The `-p` option of `environment-to-ini` is [no longer supported](https://codeberg.org/forgejo/forgejo/commit/fa0b5b14c2faa6a5f76bb2e7bc9241a5e4354189)
|
||||||
- The ".png" suffix for [user and organizations is now reserved](https://codeberg.org/forgejo/forgejo/commit/2b91841cd3e1213ff3e4ed4209d6a4be89c2fa79)
|
- The ".png" suffix for [user and organizations is now reserved](https://codeberg.org/forgejo/forgejo/commit/2b91841cd3e1213ff3e4ed4209d6a4be89c2fa79)
|
||||||
- The section `[git.reflog]` is [now obsolete and its keys have been moved](https://codeberg.org/forgejo/forgejo/commit/2f149c5c9db97f20fbbc65e32d1f3133048b11a2) to the following replacements:
|
- The section `[git.reflog]` is [now obsolete and its keys have been moved](https://codeberg.org/forgejo/forgejo/commit/2f149c5c9db97f20fbbc65e32d1f3133048b11a2) to the following replacements:
|
||||||
|
@ -1761,7 +1761,7 @@ $ git -C forgejo log --oneline --no-merges origin/v1.19/forgejo..origin/v1.20/fo
|
||||||
- [The repository migration can be canceled](https://codeberg.org/forgejo/forgejo/commit/f6e029e6c7849d4361abf7f1d749b5d528364ac4)
|
- [The repository migration can be canceled](https://codeberg.org/forgejo/forgejo/commit/f6e029e6c7849d4361abf7f1d749b5d528364ac4)
|
||||||
- [Add button on the diff header to copy the file name](https://codeberg.org/forgejo/forgejo/commit/c5ede35124c8d5280219c24049bb0ad7da9f02ed)
|
- [Add button on the diff header to copy the file name](https://codeberg.org/forgejo/forgejo/commit/c5ede35124c8d5280219c24049bb0ad7da9f02ed)
|
||||||
- [Add --quiet option to the dump CLI](https://codeberg.org/forgejo/forgejo/commit/cb1536471bcef4d78a3fe5cbd738b9f60fabbcc2)
|
- [Add --quiet option to the dump CLI](https://codeberg.org/forgejo/forgejo/commit/cb1536471bcef4d78a3fe5cbd738b9f60fabbcc2)
|
||||||
- [Support searching for an issue with its number in the list of issues](https://codeberg.org/forgejo/forgejo/commit/1144b1d129de530b2c07dfdfaf55de383cd82212)
|
- [Support searching for an issue with its number in the the list of issues](https://codeberg.org/forgejo/forgejo/commit/1144b1d129de530b2c07dfdfaf55de383cd82212)
|
||||||
- [Improve the list of notifications](https://codeberg.org/forgejo/forgejo/commit/f7ede92f82f7f3ec7bb31a1249f9524e5b728f34)
|
- [Improve the list of notifications](https://codeberg.org/forgejo/forgejo/commit/f7ede92f82f7f3ec7bb31a1249f9524e5b728f34)
|
||||||
- [When editing a file in the web UI, allow for a preview whenever possible](https://codeberg.org/forgejo/forgejo/commit/ac64c8297444ade63a2a364c4afb7e6c1de5a75f)
|
- [When editing a file in the web UI, allow for a preview whenever possible](https://codeberg.org/forgejo/forgejo/commit/ac64c8297444ade63a2a364c4afb7e6c1de5a75f)
|
||||||
- [Make release download URLs human readable](https://codeberg.org/forgejo/forgejo/commit/42919ccb7cd32ab67d0878baf2bac6cd007899a8)
|
- [Make release download URLs human readable](https://codeberg.org/forgejo/forgejo/commit/42919ccb7cd32ab67d0878baf2bac6cd007899a8)
|
||||||
|
@ -1798,7 +1798,7 @@ $ git -C forgejo log --oneline --no-merges origin/v1.19/forgejo..origin/v1.20/fo
|
||||||
- [Add API for gitignore templates](https://codeberg.org/forgejo/forgejo/commit/36a5d4c2f3b5670e5e921034cd5d25817534a6d4)
|
- [Add API for gitignore templates](https://codeberg.org/forgejo/forgejo/commit/36a5d4c2f3b5670e5e921034cd5d25817534a6d4)
|
||||||
- [Add API to upuload a file to an empty repository](https://codeberg.org/forgejo/forgejo/commit/cf465b472166ccf6d3e001e3043e4bf43e16e6b3)
|
- [Add API to upuload a file to an empty repository](https://codeberg.org/forgejo/forgejo/commit/cf465b472166ccf6d3e001e3043e4bf43e16e6b3)
|
||||||
- [Allow for --not when listing the commits of a repo](https://codeberg.org/forgejo/forgejo/commit/f766b002938b5c81e343c81fda3c0669fa09809f)
|
- [Allow for --not when listing the commits of a repo](https://codeberg.org/forgejo/forgejo/commit/f766b002938b5c81e343c81fda3c0669fa09809f)
|
||||||
- [Add `files` and `verification` parameters to improve performances when listing the commits of a repo](https://codeberg.org/forgejo/forgejo/commit/1dd83dbb917d55bd253001646d6743f247a4d98b)
|
- [Add `files` and `verification` parameters to improve performances when listing the commits of a a repo](https://codeberg.org/forgejo/forgejo/commit/1dd83dbb917d55bd253001646d6743f247a4d98b)
|
||||||
- [Allow for listing a single commit in a repository](https://codeberg.org/forgejo/forgejo/commit/5930ab5fdf7a970fcca3cd50b44cf1cacb615a54)
|
- [Allow for listing a single commit in a repository](https://codeberg.org/forgejo/forgejo/commit/5930ab5fdf7a970fcca3cd50b44cf1cacb615a54)
|
||||||
- [Create a branch directly from commit on the create branch API](https://codeberg.org/forgejo/forgejo/commit/cd9a13ebb47d32f46b38439a524e3b2e0c619490)
|
- [Create a branch directly from commit on the create branch API](https://codeberg.org/forgejo/forgejo/commit/cd9a13ebb47d32f46b38439a524e3b2e0c619490)
|
||||||
- [Add API for Label templates](https://codeberg.org/forgejo/forgejo/commit/25dc1556cd70b567a4920beb002a0addfbfd6ef2)
|
- [Add API for Label templates](https://codeberg.org/forgejo/forgejo/commit/25dc1556cd70b567a4920beb002a0addfbfd6ef2)
|
||||||
|
|
|
@ -1,33 +1,27 @@
|
||||||
<!--
|
<svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
|
||||||
This logo was created by Michael Hanke <mih@ngln.eu> from
|
<style type="text/css">
|
||||||
the original Forgejo logo by Caesar Schinas and the git-annex
|
circle {
|
||||||
logo by Henrik Nyh <http://henrik.nyh.se/>, Joey Hess <id@joeyh.name>,
|
fill: none;
|
||||||
John Lawrence, and Yann Büchau <nobodyinperson at posteo de>.
|
stroke: #000;
|
||||||
|
stroke-width: 15;
|
||||||
It is licensed under the Creative Commons Attribution-ShareAlike 4.0
|
}
|
||||||
International (CC BY-SA 4.0) license.
|
path {
|
||||||
-->
|
fill: none;
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="212" height="212"
|
stroke: #000;
|
||||||
viewBox="0 0 56.092 56.092" xmlns:v="https://vecta.io/nano">
|
stroke-width: 25;
|
||||||
<g transform="matrix(1.003855 0 0 1.003855 -155.52693 -24.929635)"
|
}
|
||||||
fill="none">
|
.orange {
|
||||||
<g stroke-width="6.615">
|
stroke:#ff6600;
|
||||||
<path d="M168.804 70.908V44.979a13.229 13.229 0 0 1 13.229-13.229h5.292"
|
}
|
||||||
stroke="#f60" />
|
.red {
|
||||||
<path d="M168.804 70.908v-7.937a13.229 13.229 0 0 1 13.229-13.229h5.292"
|
stroke:#d40000;
|
||||||
stroke="#d40000" />
|
}
|
||||||
</g>
|
</style>
|
||||||
<g stroke-width="3.969">
|
<g transform="translate(6,6)">
|
||||||
<circle cx="191.029" cy="31.75" r="4.762" stroke="#f60" />
|
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
|
||||||
<g stroke="#d40000">
|
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
|
||||||
<circle cx="191.029" cy="49.742" r="4.762" />
|
<circle cx="142" cy="20" r="18" class="orange" />
|
||||||
<circle cx="168.804" cy="74.083" r="4.762" />
|
<circle cx="142" cy="88" r="18" class="red" />
|
||||||
</g>
|
<circle cx="58" cy="180" r="18" class="red" />
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g fill="#777">
|
|
||||||
<path d="M34.648 56.182c-2.089-.269-4.238-2.244-4.538-4.561-.288-1.937.128-4.198 1.729-5.476.702-.479 1.658-1.015 2.5-.951v2.757c-1.003.112-1.975 1.252-1.954 2.296.025 1.359.626 2.607 1.933 3.014 1.446.487 3.102.348 4.44-.461 1.106-.862 1.208-2.466.63-3.687-.26-.672-.821-1.165-1.582-1.163v2.392H35.66v-5.149h6.5v1.852l-1.78.016c1.661.947 1.832 2.991 1.747 4.409.06 2.436-2.347 4.422-4.734 4.688-.864.065-1.594.068-2.743.023zm-4.644-12.011l-.014-2.702h12.185l-.001 2.715-12.17-.013zm4.645-3.651v-2.892h-4.724v-2.516h4.724v-3.245h2.826v3.245h4.702v2.516h-4.702l-.047 2.886-2.779.006z" />
|
|
||||||
<path d="M22.23 24.801l-2.819 3.94h1.565a9.01 9.01 0 0 0 .103 1.283l2.488-.377c-.044-.296-.071-.599-.075-.906h1.556zm1.531 5.732l-2.405.724a8.9 8.9 0 0 0 .447 1.18l2.281-1.055a6.36 6.36 0 0 1-.323-.848zm.753 1.622L22.4 33.518a8.99 8.99 0 0 0 3.949 3.365l1.006-2.305a6.45 6.45 0 0 1-2.839-2.421zm3.675 2.715l-.679 2.425a8.94 8.94 0 0 0 1.18.244l.348-2.492a6.52 6.52 0 0 1-.848-.178zm21.673-10.069l-2.819 3.94h1.565c-.003.308-.03.61-.075.906l2.488.377a9.01 9.01 0 0 0 .103-1.283h1.556zm-1.523 5.732a6.36 6.36 0 0 1-.323.848l2.281 1.055c.176-.379.325-.774.447-1.18zm-.753 1.622a6.45 6.45 0 0 1-2.839 2.421l1.006 2.305a8.99 8.99 0 0 0 3.949-3.365zm-3.675 2.715a6.52 6.52 0 0 1-.848.178l.348 2.492a8.94 8.94 0 0 0 1.18-.244z"
|
|
||||||
fill-rule="evenodd" />
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 677 B |
57
assets/go-licenses.json
generated
57
assets/go-licenses.json
generated
File diff suppressed because one or more lines are too long
|
@ -1,33 +1,27 @@
|
||||||
<!--
|
<svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
|
||||||
This logo was created by Michael Hanke <mih@ngln.eu> from
|
<style type="text/css">
|
||||||
the original Forgejo logo by Caesar Schinas and the git-annex
|
circle {
|
||||||
logo by Henrik Nyh <http://henrik.nyh.se/>, Joey Hess <id@joeyh.name>,
|
fill: none;
|
||||||
John Lawrence, and Yann Büchau <nobodyinperson at posteo de>.
|
stroke: #000;
|
||||||
|
stroke-width: 15;
|
||||||
It is licensed under the Creative Commons Attribution-ShareAlike 4.0
|
}
|
||||||
International (CC BY-SA 4.0) license.
|
path {
|
||||||
-->
|
fill: none;
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="212" height="212"
|
stroke: #000;
|
||||||
viewBox="0 0 56.092 56.092" xmlns:v="https://vecta.io/nano">
|
stroke-width: 25;
|
||||||
<g transform="matrix(1.003855 0 0 1.003855 -155.52693 -24.929635)"
|
}
|
||||||
fill="none">
|
.orange {
|
||||||
<g stroke-width="6.615">
|
stroke:#ff6600;
|
||||||
<path d="M168.804 70.908V44.979a13.229 13.229 0 0 1 13.229-13.229h5.292"
|
}
|
||||||
stroke="#f60" />
|
.red {
|
||||||
<path d="M168.804 70.908v-7.937a13.229 13.229 0 0 1 13.229-13.229h5.292"
|
stroke:#d40000;
|
||||||
stroke="#d40000" />
|
}
|
||||||
</g>
|
</style>
|
||||||
<g stroke-width="3.969">
|
<g transform="translate(6,6)">
|
||||||
<circle cx="191.029" cy="31.75" r="4.762" stroke="#f60" />
|
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
|
||||||
<g stroke="#d40000">
|
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
|
||||||
<circle cx="191.029" cy="49.742" r="4.762" />
|
<circle cx="142" cy="20" r="18" class="orange" />
|
||||||
<circle cx="168.804" cy="74.083" r="4.762" />
|
<circle cx="142" cy="88" r="18" class="red" />
|
||||||
</g>
|
<circle cx="58" cy="180" r="18" class="red" />
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g fill="#777">
|
|
||||||
<path d="M34.648 56.182c-2.089-.269-4.238-2.244-4.538-4.561-.288-1.937.128-4.198 1.729-5.476.702-.479 1.658-1.015 2.5-.951v2.757c-1.003.112-1.975 1.252-1.954 2.296.025 1.359.626 2.607 1.933 3.014 1.446.487 3.102.348 4.44-.461 1.106-.862 1.208-2.466.63-3.687-.26-.672-.821-1.165-1.582-1.163v2.392H35.66v-5.149h6.5v1.852l-1.78.016c1.661.947 1.832 2.991 1.747 4.409.06 2.436-2.347 4.422-4.734 4.688-.864.065-1.594.068-2.743.023zm-4.644-12.011l-.014-2.702h12.185l-.001 2.715-12.17-.013zm4.645-3.651v-2.892h-4.724v-2.516h4.724v-3.245h2.826v3.245h4.702v2.516h-4.702l-.047 2.886-2.779.006z" />
|
|
||||||
<path d="M22.23 24.801l-2.819 3.94h1.565a9.01 9.01 0 0 0 .103 1.283l2.488-.377c-.044-.296-.071-.599-.075-.906h1.556zm1.531 5.732l-2.405.724a8.9 8.9 0 0 0 .447 1.18l2.281-1.055a6.36 6.36 0 0 1-.323-.848zm.753 1.622L22.4 33.518a8.99 8.99 0 0 0 3.949 3.365l1.006-2.305a6.45 6.45 0 0 1-2.839-2.421zm3.675 2.715l-.679 2.425a8.94 8.94 0 0 0 1.18.244l.348-2.492a6.52 6.52 0 0 1-.848-.178zm21.673-10.069l-2.819 3.94h1.565c-.003.308-.03.61-.075.906l2.488.377a9.01 9.01 0 0 0 .103-1.283h1.556zm-1.523 5.732a6.36 6.36 0 0 1-.323.848l2.281 1.055c.176-.379.325-.774.447-1.18zm-.753 1.622a6.45 6.45 0 0 1-2.839 2.421l1.006 2.305a8.99 8.99 0 0 0 3.949-3.365zm-3.675 2.715a6.52 6.52 0 0 1-.848.178l.348 2.492a8.94 8.94 0 0 0 1.18-.244z"
|
|
||||||
fill-rule="evenodd" />
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 677 B |
|
@ -12,8 +12,8 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/build/codeformat"
|
"code.gitea.io/gitea/build/codeformat"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Windows has a limitation for command line arguments, the size can not exceed 32KB.
|
// Windows has a limitation for command line arguments, the size can not exceed 32KB.
|
||||||
|
|
|
@ -13,8 +13,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var importPackageGroupOrders = map[string]int{
|
var importPackageGroupOrders = map[string]int{
|
||||||
"": 1, // internal
|
"": 1, // internal
|
||||||
"forgejo.org/": 2,
|
"code.gitea.io/gitea/": 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
var errInvalidCommentBetweenImports = errors.New("comments between imported packages are invalid, please move comments to the end of the package line")
|
var errInvalidCommentBetweenImports = errors.New("comments between imported packages are invalid, please move comments to the end of the package line")
|
||||||
|
|
|
@ -58,8 +58,8 @@ import (
|
||||||
|
|
||||||
"code.gitea.io/other/package"
|
"code.gitea.io/other/package"
|
||||||
|
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"xorm.io/the/package"
|
"xorm.io/the/package"
|
||||||
|
|
||||||
|
@ -82,8 +82,8 @@ import (
|
||||||
_ "image/jpeg" // for processing jpeg images
|
_ "image/jpeg" // for processing jpeg images
|
||||||
_ "image/png" // for processing png images
|
_ "image/png" // for processing png images
|
||||||
|
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"code.gitea.io/other/package"
|
"code.gitea.io/other/package"
|
||||||
"github.com/issue9/identicon"
|
"github.com/issue9/identicon"
|
||||||
|
|
|
@ -20,7 +20,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"forgejo.org/modules/json"
|
"code.gitea.io/gitea/modules/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
)
|
)
|
||||||
|
|
||||||
// regexp is based on go-license, excluding README and NOTICE
|
// regexp is based on go-license, excluding README and NOTICE
|
||||||
|
@ -102,9 +102,9 @@ func main() {
|
||||||
pkgName := path.Dir(pkgPath)
|
pkgName := path.Dir(pkgPath)
|
||||||
|
|
||||||
// There might be a bug somewhere in go-licenses that sometimes interprets the
|
// There might be a bug somewhere in go-licenses that sometimes interprets the
|
||||||
// root package as "." and sometimes as "forgejo.org". Workaround by
|
// root package as "." and sometimes as "code.gitea.io/gitea". Workaround by
|
||||||
// removing both of them for the sake of stable output.
|
// removing both of them for the sake of stable output.
|
||||||
if pkgName == "." || pkgName == "forgejo.org" {
|
if pkgName == "." || pkgName == "code.gitea.io/gitea" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -1,331 +0,0 @@
|
||||||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
||||||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"go/ast"
|
|
||||||
goParser "go/parser"
|
|
||||||
"go/token"
|
|
||||||
"io/fs"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
"text/template"
|
|
||||||
tmplParser "text/template/parse"
|
|
||||||
|
|
||||||
"forgejo.org/modules/container"
|
|
||||||
"forgejo.org/modules/locale"
|
|
||||||
fjTemplates "forgejo.org/modules/templates"
|
|
||||||
"forgejo.org/modules/util"
|
|
||||||
)
|
|
||||||
|
|
||||||
// this works by first gathering all valid source string IDs from `en-US` reference files
|
|
||||||
// and then checking if all used source strings are actually defined
|
|
||||||
|
|
||||||
type OnMsgidHandler func(fset *token.FileSet, pos token.Pos, msgid string)
|
|
||||||
|
|
||||||
type LocatedError struct {
|
|
||||||
Location string
|
|
||||||
Kind string
|
|
||||||
Err error
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e LocatedError) Error() string {
|
|
||||||
var sb strings.Builder
|
|
||||||
|
|
||||||
sb.WriteString(e.Location)
|
|
||||||
sb.WriteString(":\t")
|
|
||||||
if e.Kind != "" {
|
|
||||||
sb.WriteString(e.Kind)
|
|
||||||
sb.WriteString(": ")
|
|
||||||
}
|
|
||||||
sb.WriteString("ERROR: ")
|
|
||||||
sb.WriteString(e.Err.Error())
|
|
||||||
|
|
||||||
return sb.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func isLocaleTrFunction(funcname string) bool {
|
|
||||||
return funcname == "Tr" || funcname == "TrN"
|
|
||||||
}
|
|
||||||
|
|
||||||
// the `Handle*File` functions follow the following calling convention:
|
|
||||||
// * `fname` is the name of the input file
|
|
||||||
// * `src` is either `nil` (then the function invokes `ReadFile` to read the file)
|
|
||||||
// or the contents of the file as {`[]byte`, or a `string`}
|
|
||||||
|
|
||||||
func (omh OnMsgidHandler) HandleGoFile(fname string, src any) error {
|
|
||||||
fset := token.NewFileSet()
|
|
||||||
node, err := goParser.ParseFile(fset, fname, src, goParser.SkipObjectResolution)
|
|
||||||
if err != nil {
|
|
||||||
return LocatedError{
|
|
||||||
Location: fname,
|
|
||||||
Kind: "Go parser",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ast.Inspect(node, func(n ast.Node) bool {
|
|
||||||
// search for function calls of the form `anything.Tr(any-string-lit)`
|
|
||||||
|
|
||||||
call, ok := n.(*ast.CallExpr)
|
|
||||||
if !ok || len(call.Args) != 1 {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
funSel, ok := call.Fun.(*ast.SelectorExpr)
|
|
||||||
if (!ok) || !isLocaleTrFunction(funSel.Sel.Name) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
argLit, ok := call.Args[0].(*ast.BasicLit)
|
|
||||||
if (!ok) || argLit.Kind != token.STRING {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// extract string content
|
|
||||||
arg, err := strconv.Unquote(argLit.Value)
|
|
||||||
if err != nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// found interesting string
|
|
||||||
omh(fset, argLit.ValuePos, arg)
|
|
||||||
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// derived from source: modules/templates/scopedtmpl/scopedtmpl.go, L169-L213
|
|
||||||
func (omh OnMsgidHandler) handleTemplateNode(fset *token.FileSet, node tmplParser.Node) {
|
|
||||||
switch node.Type() {
|
|
||||||
case tmplParser.NodeAction:
|
|
||||||
omh.handleTemplatePipeNode(fset, node.(*tmplParser.ActionNode).Pipe)
|
|
||||||
case tmplParser.NodeList:
|
|
||||||
nodeList := node.(*tmplParser.ListNode)
|
|
||||||
omh.handleTemplateFileNodes(fset, nodeList.Nodes)
|
|
||||||
case tmplParser.NodePipe:
|
|
||||||
omh.handleTemplatePipeNode(fset, node.(*tmplParser.PipeNode))
|
|
||||||
case tmplParser.NodeTemplate:
|
|
||||||
omh.handleTemplatePipeNode(fset, node.(*tmplParser.TemplateNode).Pipe)
|
|
||||||
case tmplParser.NodeIf:
|
|
||||||
nodeIf := node.(*tmplParser.IfNode)
|
|
||||||
omh.handleTemplateBranchNode(fset, nodeIf.BranchNode)
|
|
||||||
case tmplParser.NodeRange:
|
|
||||||
nodeRange := node.(*tmplParser.RangeNode)
|
|
||||||
omh.handleTemplateBranchNode(fset, nodeRange.BranchNode)
|
|
||||||
case tmplParser.NodeWith:
|
|
||||||
nodeWith := node.(*tmplParser.WithNode)
|
|
||||||
omh.handleTemplateBranchNode(fset, nodeWith.BranchNode)
|
|
||||||
|
|
||||||
case tmplParser.NodeCommand:
|
|
||||||
nodeCommand := node.(*tmplParser.CommandNode)
|
|
||||||
|
|
||||||
omh.handleTemplateFileNodes(fset, nodeCommand.Args)
|
|
||||||
|
|
||||||
if len(nodeCommand.Args) != 2 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeChain, ok := nodeCommand.Args[0].(*tmplParser.ChainNode)
|
|
||||||
if !ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeString, ok := nodeCommand.Args[1].(*tmplParser.StringNode)
|
|
||||||
if !ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeIdent, ok := nodeChain.Node.(*tmplParser.IdentifierNode)
|
|
||||||
if !ok || nodeIdent.Ident != "ctx" {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(nodeChain.Field) != 2 || nodeChain.Field[0] != "Locale" || !isLocaleTrFunction(nodeChain.Field[1]) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// found interesting string
|
|
||||||
// the column numbers are a bit "off", but much better than nothing
|
|
||||||
omh(fset, token.Pos(nodeString.Pos), nodeString.Text)
|
|
||||||
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (omh OnMsgidHandler) handleTemplatePipeNode(fset *token.FileSet, pipeNode *tmplParser.PipeNode) {
|
|
||||||
if pipeNode == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: we can't pass `pipeNode.Cmds` to handleTemplateFileNodes due to incompatible argument types
|
|
||||||
for _, node := range pipeNode.Cmds {
|
|
||||||
omh.handleTemplateNode(fset, node)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (omh OnMsgidHandler) handleTemplateBranchNode(fset *token.FileSet, branchNode tmplParser.BranchNode) {
|
|
||||||
omh.handleTemplatePipeNode(fset, branchNode.Pipe)
|
|
||||||
omh.handleTemplateFileNodes(fset, branchNode.List.Nodes)
|
|
||||||
if branchNode.ElseList != nil {
|
|
||||||
omh.handleTemplateFileNodes(fset, branchNode.ElseList.Nodes)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (omh OnMsgidHandler) handleTemplateFileNodes(fset *token.FileSet, nodes []tmplParser.Node) {
|
|
||||||
for _, node := range nodes {
|
|
||||||
omh.handleTemplateNode(fset, node)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (omh OnMsgidHandler) HandleTemplateFile(fname string, src any) error {
|
|
||||||
var tmplContent []byte
|
|
||||||
switch src2 := src.(type) {
|
|
||||||
case nil:
|
|
||||||
var err error
|
|
||||||
tmplContent, err = os.ReadFile(fname)
|
|
||||||
if err != nil {
|
|
||||||
return LocatedError{
|
|
||||||
Location: fname,
|
|
||||||
Kind: "ReadFile",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case []byte:
|
|
||||||
tmplContent = src2
|
|
||||||
case string:
|
|
||||||
// SAFETY: we do not modify tmplContent below
|
|
||||||
tmplContent = util.UnsafeStringToBytes(src2)
|
|
||||||
default:
|
|
||||||
panic("invalid type for 'src'")
|
|
||||||
}
|
|
||||||
|
|
||||||
fset := token.NewFileSet()
|
|
||||||
fset.AddFile(fname, 1, len(tmplContent)).SetLinesForContent(tmplContent)
|
|
||||||
// SAFETY: we do not modify tmplContent2 below
|
|
||||||
tmplContent2 := util.UnsafeBytesToString(tmplContent)
|
|
||||||
|
|
||||||
tmpl := template.New(fname)
|
|
||||||
tmpl.Funcs(fjTemplates.NewFuncMap())
|
|
||||||
tmplParsed, err := tmpl.Parse(tmplContent2)
|
|
||||||
if err != nil {
|
|
||||||
return LocatedError{
|
|
||||||
Location: fname,
|
|
||||||
Kind: "Template parser",
|
|
||||||
Err: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
omh.handleTemplateFileNodes(fset, tmplParsed.Tree.Root.Nodes)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// This command assumes that we get started from the project root directory
|
|
||||||
//
|
|
||||||
// Possible command line flags:
|
|
||||||
//
|
|
||||||
// --allow-missing-msgids don't return an error code if missing message IDs are found
|
|
||||||
//
|
|
||||||
// EXIT CODES:
|
|
||||||
//
|
|
||||||
// 0 success, no issues found
|
|
||||||
// 1 unable to walk directory tree
|
|
||||||
// 2 unable to parse locale ini/json files
|
|
||||||
// 3 unable to parse go or text/template files
|
|
||||||
// 4 found missing message IDs
|
|
||||||
//
|
|
||||||
//nolint:forbidigo
|
|
||||||
func main() {
|
|
||||||
allowMissingMsgids := false
|
|
||||||
for _, arg := range os.Args[1:] {
|
|
||||||
if arg == "--allow-missing-msgids" {
|
|
||||||
allowMissingMsgids = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onError := func(err error) {
|
|
||||||
if err == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Println(err.Error())
|
|
||||||
os.Exit(3)
|
|
||||||
}
|
|
||||||
|
|
||||||
msgids := make(container.Set[string])
|
|
||||||
onMsgid := func(trKey, trValue string) error {
|
|
||||||
msgids[trKey] = struct{}{}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
localeFile := filepath.Join(filepath.Join("options", "locale"), "locale_en-US.ini")
|
|
||||||
localeContent, err := os.ReadFile(localeFile)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
|
|
||||||
os.Exit(2)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = locale.IterateMessagesContent(localeContent, onMsgid); err != nil {
|
|
||||||
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
|
|
||||||
os.Exit(2)
|
|
||||||
}
|
|
||||||
|
|
||||||
localeFile = filepath.Join(filepath.Join("options", "locale_next"), "locale_en-US.json")
|
|
||||||
localeContent, err = os.ReadFile(localeFile)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
|
|
||||||
os.Exit(2)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := locale.IterateMessagesNextContent(localeContent, onMsgid); err != nil {
|
|
||||||
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
|
|
||||||
os.Exit(2)
|
|
||||||
}
|
|
||||||
|
|
||||||
gotAnyMsgidError := false
|
|
||||||
|
|
||||||
omh := OnMsgidHandler(func(fset *token.FileSet, pos token.Pos, msgid string) {
|
|
||||||
if !msgids.Contains(msgid) {
|
|
||||||
gotAnyMsgidError = true
|
|
||||||
fmt.Printf("%s:\tmissing msgid: %s\n", fset.Position(pos).String(), msgid)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if err := filepath.WalkDir(".", func(fpath string, d fs.DirEntry, err error) error {
|
|
||||||
if err != nil {
|
|
||||||
if os.IsNotExist(err) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
name := d.Name()
|
|
||||||
if d.IsDir() {
|
|
||||||
if name == "docker" || name == ".git" || name == "node_modules" {
|
|
||||||
return fs.SkipDir
|
|
||||||
}
|
|
||||||
} else if name == "bindata.go" {
|
|
||||||
// skip false positives
|
|
||||||
} else if strings.HasSuffix(name, ".go") {
|
|
||||||
onError(omh.HandleGoFile(fpath, nil))
|
|
||||||
} else if strings.HasSuffix(name, ".tmpl") {
|
|
||||||
if strings.HasPrefix(fpath, "tests") && strings.HasSuffix(name, ".ini.tmpl") {
|
|
||||||
// skip false positives
|
|
||||||
} else {
|
|
||||||
onError(omh.HandleTemplateFile(fpath, nil))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}); err != nil {
|
|
||||||
fmt.Printf("walkdir ERROR: %s\n", err.Error())
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !allowMissingMsgids && gotAnyMsgidError {
|
|
||||||
os.Exit(4)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go/token"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
|
||||||
|
|
||||||
func HandleGoFileWrapped(t *testing.T, fname, src string) []string {
|
|
||||||
var ret []string
|
|
||||||
omh := OnMsgidHandler(func(fset *token.FileSet, pos token.Pos, msgid string) {
|
|
||||||
ret = append(ret, msgid)
|
|
||||||
})
|
|
||||||
require.NoError(t, omh.HandleGoFile(fname, src))
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
|
|
||||||
func HandleTemplateFileWrapped(t *testing.T, fname, src string) []string {
|
|
||||||
var ret []string
|
|
||||||
omh := OnMsgidHandler(func(fset *token.FileSet, pos token.Pos, msgid string) {
|
|
||||||
ret = append(ret, msgid)
|
|
||||||
})
|
|
||||||
require.NoError(t, omh.HandleTemplateFile(fname, src))
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestUsagesParser(t *testing.T) {
|
|
||||||
t.Run("go, simple", func(t *testing.T) {
|
|
||||||
assert.EqualValues(t,
|
|
||||||
[]string{"what.an.example"},
|
|
||||||
HandleGoFileWrapped(t, "<g1>", "package main\nfunc Render(ctx *context.Context) string { return ctx.Tr(\"what.an.example\"); }\n"))
|
|
||||||
})
|
|
||||||
|
|
||||||
t.Run("template, simple", func(t *testing.T) {
|
|
||||||
assert.EqualValues(t,
|
|
||||||
[]string{"what.an.example"},
|
|
||||||
HandleTemplateFileWrapped(t, "<t1>", "{{ ctx.Locale.Tr \"what.an.example\" }}\n"))
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -14,10 +14,9 @@ import (
|
||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/locale"
|
|
||||||
|
|
||||||
"github.com/microcosm-cc/bluemonday"
|
"github.com/microcosm-cc/bluemonday"
|
||||||
"github.com/sergi/go-diff/diffmatchpatch"
|
"github.com/sergi/go-diff/diffmatchpatch"
|
||||||
|
"gopkg.in/ini.v1" //nolint:depguard
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -27,8 +26,6 @@ var (
|
||||||
|
|
||||||
// Matches href="", href="#", href="%s", href="#%s", href="%[1]s" and href="#%[1]s".
|
// Matches href="", href="#", href="%s", href="#%s", href="%[1]s" and href="#%[1]s".
|
||||||
placeHolderRegex = regexp.MustCompile(`href="#?(%s|%\[\d\]s)?"`)
|
placeHolderRegex = regexp.MustCompile(`href="#?(%s|%\[\d\]s)?"`)
|
||||||
|
|
||||||
dmp = diffmatchpatch.New()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func initBlueMondayPolicy() {
|
func initBlueMondayPolicy() {
|
||||||
|
@ -82,44 +79,41 @@ func preprocessTranslationValue(value string) string {
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkValue(trKey, value string) []string {
|
|
||||||
keyValue := preprocessTranslationValue(value)
|
|
||||||
|
|
||||||
if html.UnescapeString(policy.Sanitize(keyValue)) == keyValue {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a nice diff of the difference.
|
|
||||||
diffs := dmp.DiffMain(keyValue, html.UnescapeString(policy.Sanitize(keyValue)), false)
|
|
||||||
diffs = dmp.DiffCleanupSemantic(diffs)
|
|
||||||
diffs = dmp.DiffCleanupEfficiency(diffs)
|
|
||||||
|
|
||||||
return []string{trKey + ": " + dmp.DiffPrettyText(diffs)}
|
|
||||||
}
|
|
||||||
|
|
||||||
func checkLocaleContent(localeContent []byte) []string {
|
func checkLocaleContent(localeContent []byte) []string {
|
||||||
errors := []string{}
|
// Same configuration as Forgejo uses.
|
||||||
|
cfg := ini.Empty(ini.LoadOptions{
|
||||||
|
IgnoreContinuation: true,
|
||||||
|
})
|
||||||
|
cfg.NameMapper = ini.SnackCase
|
||||||
|
|
||||||
if err := locale.IterateMessagesContent(localeContent, func(trKey, trValue string) error {
|
if err := cfg.Append(localeContent); err != nil {
|
||||||
errors = append(errors, checkValue(trKey, trValue)...)
|
|
||||||
return nil
|
|
||||||
}); err != nil {
|
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors
|
dmp := diffmatchpatch.New()
|
||||||
}
|
|
||||||
|
|
||||||
func checkLocaleNextContent(localeContent []byte) []string {
|
|
||||||
errors := []string{}
|
errors := []string{}
|
||||||
|
|
||||||
if err := locale.IterateMessagesNextContent(localeContent, func(trKey, trValue string) error {
|
for _, section := range cfg.Sections() {
|
||||||
errors = append(errors, checkValue(trKey, trValue)...)
|
for _, key := range section.Keys() {
|
||||||
return nil
|
var trKey string
|
||||||
}); err != nil {
|
if section.Name() == "" || section.Name() == "DEFAULT" || section.Name() == "common" {
|
||||||
panic(err)
|
trKey = key.Name()
|
||||||
}
|
} else {
|
||||||
|
trKey = section.Name() + "." + key.Name()
|
||||||
|
}
|
||||||
|
|
||||||
|
keyValue := preprocessTranslationValue(key.Value())
|
||||||
|
|
||||||
|
if html.UnescapeString(policy.Sanitize(keyValue)) != keyValue {
|
||||||
|
// Create a nice diff of the difference.
|
||||||
|
diffs := dmp.DiffMain(keyValue, html.UnescapeString(policy.Sanitize(keyValue)), false)
|
||||||
|
diffs = dmp.DiffCleanupSemantic(diffs)
|
||||||
|
diffs = dmp.DiffCleanupEfficiency(diffs)
|
||||||
|
|
||||||
|
errors = append(errors, trKey+": "+dmp.DiffPrettyText(diffs))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return errors
|
return errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +127,6 @@ func main() {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Safety check that we are not reading the wrong directory.
|
|
||||||
if !slices.ContainsFunc(localeFiles, func(e fs.DirEntry) bool { return strings.HasSuffix(e.Name(), ".ini") }) {
|
if !slices.ContainsFunc(localeFiles, func(e fs.DirEntry) bool { return strings.HasSuffix(e.Name(), ".ini") }) {
|
||||||
fmt.Println("No locale files found")
|
fmt.Println("No locale files found")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -147,7 +140,6 @@ func main() {
|
||||||
|
|
||||||
localeContent, err := os.ReadFile(filepath.Join(localeDir, localeFile.Name()))
|
localeContent, err := os.ReadFile(filepath.Join(localeDir, localeFile.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(localeFile.Name())
|
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,33 +151,5 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the locale next.
|
|
||||||
localeDir = filepath.Join("options", "locale_next")
|
|
||||||
localeFiles, err = os.ReadDir(localeDir)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Safety check that we are not reading the wrong directory.
|
|
||||||
if !slices.ContainsFunc(localeFiles, func(e fs.DirEntry) bool { return strings.HasSuffix(e.Name(), ".json") }) {
|
|
||||||
fmt.Println("No locale_next files found")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, localeFile := range localeFiles {
|
|
||||||
localeContent, err := os.ReadFile(filepath.Join(localeDir, localeFile.Name()))
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(localeFile.Name())
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := checkLocaleNextContent(localeContent); len(err) > 0 {
|
|
||||||
fmt.Println(localeFile.Name())
|
|
||||||
fmt.Println(strings.Join(err, "\n"))
|
|
||||||
fmt.Println()
|
|
||||||
exitCode = 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
os.Exit(exitCode)
|
os.Exit(exitCode)
|
||||||
}
|
}
|
|
@ -63,32 +63,3 @@ func TestLocalizationPolicy(t *testing.T) {
|
||||||
assert.EqualValues(t, []string{"key: و\x1b[31m \x1b[0m\x1b[32m\u00a0\x1b[0m"}, checkLocaleContent([]byte(`key = و `)))
|
assert.EqualValues(t, []string{"key: و\x1b[31m \x1b[0m\x1b[32m\u00a0\x1b[0m"}, checkLocaleContent([]byte(`key = و `)))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNextLocalizationPolicy(t *testing.T) {
|
|
||||||
initBlueMondayPolicy()
|
|
||||||
initRemoveTags()
|
|
||||||
|
|
||||||
t.Run("Nested locales", func(t *testing.T) {
|
|
||||||
assert.Empty(t, checkLocaleNextContent([]byte(`{
|
|
||||||
"settings": {
|
|
||||||
"hidden_comment_types_description": "Comment types checked here will not be shown inside issue pages. Checking \"Label\" for example removes all \"<user> added/removed <label>\" comments."
|
|
||||||
}
|
|
||||||
}`)))
|
|
||||||
|
|
||||||
assert.EqualValues(t, []string{"settings.hidden_comment_types_description: \"\x1b[31m<not-an-allowed-key>\x1b[0m REPLACED-TAG\""}, checkLocaleNextContent([]byte(`{
|
|
||||||
"settings": {
|
|
||||||
"hidden_comment_types_description": "\"<not-an-allowed-key> <label>\""
|
|
||||||
}
|
|
||||||
}`)))
|
|
||||||
})
|
|
||||||
|
|
||||||
t.Run("Flat locales", func(t *testing.T) {
|
|
||||||
assert.Empty(t, checkLocaleNextContent([]byte(`{
|
|
||||||
"settings.hidden_comment_types_description": "Comment types checked here will not be shown inside issue pages. Checking \"Label\" for example removes all \"<user> added/removed <label>\" comments."
|
|
||||||
}`)))
|
|
||||||
|
|
||||||
assert.EqualValues(t, []string{"settings.hidden_comment_types_description: \"\x1b[31m<not-an-allowed-key>\x1b[0m REPLACED-TAG\""}, checkLocaleNextContent([]byte(`{
|
|
||||||
"settings.hidden_comment_types_description": "\"<not-an-allowed-key> <label>\""
|
|
||||||
}`)))
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -6,8 +6,8 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
12
cmd/admin.go
12
cmd/admin.go
|
@ -8,12 +8,12 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
repo_model "forgejo.org/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
"forgejo.org/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"forgejo.org/modules/gitrepo"
|
"code.gitea.io/gitea/modules/gitrepo"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
repo_module "forgejo.org/modules/repository"
|
repo_module "code.gitea.io/gitea/modules/repository"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
auth_model "forgejo.org/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
auth_service "forgejo.org/services/auth"
|
auth_service "code.gitea.io/gitea/services/auth"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/models/auth"
|
"code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/services/auth/source/ldap"
|
"code.gitea.io/gitea/services/auth/source/ldap"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forgejo.org/models/auth"
|
"code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/services/auth/source/ldap"
|
"code.gitea.io/gitea/services/auth/source/ldap"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
auth_model "forgejo.org/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/services/auth/source/oauth2"
|
"code.gitea.io/gitea/services/auth/source/oauth2"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
auth_model "forgejo.org/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
"forgejo.org/services/auth/source/smtp"
|
"code.gitea.io/gitea/services/auth/source/smtp"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
asymkey_model "forgejo.org/models/asymkey"
|
asymkey_model "code.gitea.io/gitea/models/asymkey"
|
||||||
"forgejo.org/modules/graceful"
|
"code.gitea.io/gitea/modules/graceful"
|
||||||
repo_service "forgejo.org/services/repository"
|
repo_service "code.gitea.io/gitea/services/repository"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,11 +7,11 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"forgejo.org/modules/auth/password"
|
"code.gitea.io/gitea/modules/auth/password"
|
||||||
"forgejo.org/modules/optional"
|
"code.gitea.io/gitea/modules/optional"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
user_service "forgejo.org/services/user"
|
user_service "code.gitea.io/gitea/services/user"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,12 +7,12 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
auth_model "forgejo.org/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
pwd "forgejo.org/modules/auth/password"
|
pwd "code.gitea.io/gitea/modules/auth/password"
|
||||||
"forgejo.org/modules/optional"
|
"code.gitea.io/gitea/modules/optional"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
@ -69,10 +69,6 @@ var microcmdUserCreate = &cli.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func runCreateUser(c *cli.Context) error {
|
func runCreateUser(c *cli.Context) error {
|
||||||
// this command highly depends on the many setting options (create org, visibility, etc.), so it must have a full setting load first
|
|
||||||
// duplicate setting loading should be safe at the moment, but it should be refactored & improved in the future.
|
|
||||||
setting.LoadSettings()
|
|
||||||
|
|
||||||
if err := argsSet(c, "email"); err != nil {
|
if err := argsSet(c, "email"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"forgejo.org/modules/storage"
|
"code.gitea.io/gitea/modules/storage"
|
||||||
user_service "forgejo.org/services/user"
|
user_service "code.gitea.io/gitea/services/user"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
auth_model "forgejo.org/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,10 +15,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,13 +11,13 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/models/migrations"
|
"code.gitea.io/gitea/models/migrations"
|
||||||
migrate_base "forgejo.org/models/migrations/base"
|
migrate_base "code.gitea.io/gitea/models/migrations/base"
|
||||||
"forgejo.org/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/services/doctor"
|
"code.gitea.io/gitea/services/doctor"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
|
|
|
@ -6,9 +6,9 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/services/doctor"
|
"code.gitea.io/gitea/services/doctor"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
56
cmd/dump.go
56
cmd/dump.go
|
@ -13,12 +13,12 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/modules/json"
|
"code.gitea.io/gitea/modules/json"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/storage"
|
"code.gitea.io/gitea/modules/storage"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"code.forgejo.org/go-chi/session"
|
"code.forgejo.org/go-chi/session"
|
||||||
"github.com/mholt/archiver/v3"
|
"github.com/mholt/archiver/v3"
|
||||||
|
@ -133,12 +133,12 @@ It can be used for backup and capture Forgejo server image to send to maintainer
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "skip-repository",
|
Name: "skip-repository",
|
||||||
Aliases: []string{"R"},
|
Aliases: []string{"R"},
|
||||||
Usage: "Skip repositories",
|
Usage: "Skip the repository dumping",
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "skip-log",
|
Name: "skip-log",
|
||||||
Aliases: []string{"L"},
|
Aliases: []string{"L"},
|
||||||
Usage: "Skip logs",
|
Usage: "Skip the log dumping",
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "skip-custom-dir",
|
Name: "skip-custom-dir",
|
||||||
|
@ -160,10 +160,6 @@ It can be used for backup and capture Forgejo server image to send to maintainer
|
||||||
Name: "skip-index",
|
Name: "skip-index",
|
||||||
Usage: "Skip bleve index data",
|
Usage: "Skip bleve index data",
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
|
||||||
Name: "skip-repo-archives",
|
|
||||||
Usage: "Skip repository archives",
|
|
||||||
},
|
|
||||||
&cli.GenericFlag{
|
&cli.GenericFlag{
|
||||||
Name: "type",
|
Name: "type",
|
||||||
Value: outputTypeEnum,
|
Value: outputTypeEnum,
|
||||||
|
@ -237,7 +233,7 @@ func runDump(ctx *cli.Context) error {
|
||||||
if file == nil {
|
if file == nil {
|
||||||
file, err = os.Create(fileName)
|
file, err = os.Create(fileName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatal("Failed to open %s: %v", fileName, err)
|
fatal("Unable to open %s: %v", fileName, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
@ -254,7 +250,7 @@ func runDump(ctx *cli.Context) error {
|
||||||
iface, err = archiver.ByExtension(fileName)
|
iface, err = archiver.ByExtension(fileName)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatal("Failed to get archiver for extension: %v", err)
|
fatal("Unable to get archiver for extension: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w, _ := iface.(archiver.Writer)
|
w, _ := iface.(archiver.Writer)
|
||||||
|
@ -264,7 +260,7 @@ func runDump(ctx *cli.Context) error {
|
||||||
defer w.Close()
|
defer w.Close()
|
||||||
|
|
||||||
if ctx.IsSet("skip-repository") && ctx.Bool("skip-repository") {
|
if ctx.IsSet("skip-repository") && ctx.Bool("skip-repository") {
|
||||||
log.Info("Skipping local repositories")
|
log.Info("Skip dumping local repositories")
|
||||||
} else {
|
} else {
|
||||||
log.Info("Dumping local repositories... %s", setting.RepoRootPath)
|
log.Info("Dumping local repositories... %s", setting.RepoRootPath)
|
||||||
if err := addRecursiveExclude(w, "repos", setting.RepoRootPath, []string{absFileName}, verbose); err != nil {
|
if err := addRecursiveExclude(w, "repos", setting.RepoRootPath, []string{absFileName}, verbose); err != nil {
|
||||||
|
@ -272,9 +268,9 @@ func runDump(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet("skip-lfs-data") && ctx.Bool("skip-lfs-data") {
|
if ctx.IsSet("skip-lfs-data") && ctx.Bool("skip-lfs-data") {
|
||||||
log.Info("Skipping LFS data")
|
log.Info("Skip dumping LFS data")
|
||||||
} else if !setting.LFS.StartServer {
|
} else if !setting.LFS.StartServer {
|
||||||
log.Info("LFS not enabled - skipping")
|
log.Info("LFS isn't enabled. Skip dumping LFS data")
|
||||||
} else if err := storage.LFS.IterateObjects("", func(objPath string, object storage.Object) error {
|
} else if err := storage.LFS.IterateObjects("", func(objPath string, object storage.Object) error {
|
||||||
info, err := object.Stat()
|
info, err := object.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -299,7 +295,7 @@ func runDump(ctx *cli.Context) error {
|
||||||
defer func() {
|
defer func() {
|
||||||
_ = dbDump.Close()
|
_ = dbDump.Close()
|
||||||
if err := util.Remove(dbDump.Name()); err != nil {
|
if err := util.Remove(dbDump.Name()); err != nil {
|
||||||
log.Warn("Failed to remove temporary file: %s: Error: %v", dbDump.Name(), err)
|
log.Warn("Unable to remove temporary file: %s: Error: %v", dbDump.Name(), err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -335,16 +331,16 @@ func runDump(ctx *cli.Context) error {
|
||||||
fatal("Failed to include custom: %v", err)
|
fatal("Failed to include custom: %v", err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Info("Custom dir %s is inside data dir %s, skipping", setting.CustomPath, setting.AppDataPath)
|
log.Info("Custom dir %s is inside data dir %s, skipped", setting.CustomPath, setting.AppDataPath)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Info("Custom dir %s does not exist, skipping", setting.CustomPath)
|
log.Info("Custom dir %s doesn't exist, skipped", setting.CustomPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isExist, err := util.IsExist(setting.AppDataPath)
|
isExist, err := util.IsExist(setting.AppDataPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed to check if %s exists: %v", setting.AppDataPath, err)
|
log.Error("Unable to check if %s exists. Error: %v", setting.AppDataPath, err)
|
||||||
}
|
}
|
||||||
if isExist {
|
if isExist {
|
||||||
log.Info("Packing data directory...%s", setting.AppDataPath)
|
log.Info("Packing data directory...%s", setting.AppDataPath)
|
||||||
|
@ -359,16 +355,10 @@ func runDump(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet("skip-index") && ctx.Bool("skip-index") {
|
if ctx.IsSet("skip-index") && ctx.Bool("skip-index") {
|
||||||
log.Info("Skipping bleve index data")
|
|
||||||
excludes = append(excludes, setting.Indexer.RepoPath)
|
excludes = append(excludes, setting.Indexer.RepoPath)
|
||||||
excludes = append(excludes, setting.Indexer.IssuePath)
|
excludes = append(excludes, setting.Indexer.IssuePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet("skip-repo-archives") && ctx.Bool("skip-repo-archives") {
|
|
||||||
log.Info("Skipping repository archives data")
|
|
||||||
excludes = append(excludes, setting.RepoArchive.Storage.Path)
|
|
||||||
}
|
|
||||||
|
|
||||||
excludes = append(excludes, setting.RepoRootPath)
|
excludes = append(excludes, setting.RepoRootPath)
|
||||||
excludes = append(excludes, setting.LFS.Storage.Path)
|
excludes = append(excludes, setting.LFS.Storage.Path)
|
||||||
excludes = append(excludes, setting.Attachment.Storage.Path)
|
excludes = append(excludes, setting.Attachment.Storage.Path)
|
||||||
|
@ -381,7 +371,7 @@ func runDump(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet("skip-attachment-data") && ctx.Bool("skip-attachment-data") {
|
if ctx.IsSet("skip-attachment-data") && ctx.Bool("skip-attachment-data") {
|
||||||
log.Info("Skipping attachment data")
|
log.Info("Skip dumping attachment data")
|
||||||
} else if err := storage.Attachments.IterateObjects("", func(objPath string, object storage.Object) error {
|
} else if err := storage.Attachments.IterateObjects("", func(objPath string, object storage.Object) error {
|
||||||
info, err := object.Stat()
|
info, err := object.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -394,9 +384,9 @@ func runDump(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet("skip-package-data") && ctx.Bool("skip-package-data") {
|
if ctx.IsSet("skip-package-data") && ctx.Bool("skip-package-data") {
|
||||||
log.Info("Skipping package data")
|
log.Info("Skip dumping package data")
|
||||||
} else if !setting.Packages.Enabled {
|
} else if !setting.Packages.Enabled {
|
||||||
log.Info("Package registry not enabled - skipping")
|
log.Info("Packages isn't enabled. Skip dumping package data")
|
||||||
} else if err := storage.Packages.IterateObjects("", func(objPath string, object storage.Object) error {
|
} else if err := storage.Packages.IterateObjects("", func(objPath string, object storage.Object) error {
|
||||||
info, err := object.Stat()
|
info, err := object.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -412,11 +402,11 @@ func runDump(ctx *cli.Context) error {
|
||||||
// ensuring that it's clear the dump is skipped whether the directory's initialized
|
// ensuring that it's clear the dump is skipped whether the directory's initialized
|
||||||
// yet or not.
|
// yet or not.
|
||||||
if ctx.IsSet("skip-log") && ctx.Bool("skip-log") {
|
if ctx.IsSet("skip-log") && ctx.Bool("skip-log") {
|
||||||
log.Info("Skipping log files")
|
log.Info("Skip dumping log files")
|
||||||
} else {
|
} else {
|
||||||
isExist, err := util.IsExist(setting.Log.RootPath)
|
isExist, err := util.IsExist(setting.Log.RootPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed to check if %s exists: %v", setting.Log.RootPath, err)
|
log.Error("Unable to check if %s exists. Error: %v", setting.Log.RootPath, err)
|
||||||
}
|
}
|
||||||
if isExist {
|
if isExist {
|
||||||
if err := addRecursiveExclude(w, "log", setting.Log.RootPath, []string{absFileName}, verbose); err != nil {
|
if err := addRecursiveExclude(w, "log", setting.Log.RootPath, []string{absFileName}, verbose); err != nil {
|
||||||
|
@ -466,7 +456,7 @@ func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeA
|
||||||
currentInsidePath := path.Join(insidePath, file.Name())
|
currentInsidePath := path.Join(insidePath, file.Name())
|
||||||
|
|
||||||
if util.SliceContainsString(excludeAbsPath, currentAbsPath) {
|
if util.SliceContainsString(excludeAbsPath, currentAbsPath) {
|
||||||
log.Debug("Skipping %q (matched an excluded path)", currentAbsPath)
|
log.Debug("Skipping %q because matched an excluded path.", currentAbsPath)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,14 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
base "forgejo.org/modules/migration"
|
base "code.gitea.io/gitea/modules/migration"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/structs"
|
"code.gitea.io/gitea/modules/structs"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
"forgejo.org/services/convert"
|
"code.gitea.io/gitea/services/convert"
|
||||||
"forgejo.org/services/migrations"
|
"code.gitea.io/gitea/services/migrations"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,13 +10,13 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/assetfs"
|
"code.gitea.io/gitea/modules/assetfs"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/options"
|
"code.gitea.io/gitea/modules/options"
|
||||||
"forgejo.org/modules/public"
|
"code.gitea.io/gitea/modules/public"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/templates"
|
"code.gitea.io/gitea/modules/templates"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"github.com/gobwas/glob"
|
"github.com/gobwas/glob"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
|
@ -11,10 +11,10 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
actions_model "forgejo.org/models/actions"
|
actions_model "code.gitea.io/gitea/models/actions"
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
private_routers "forgejo.org/routers/private"
|
private_routers "code.gitea.io/gitea/routers/private"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forgejo.org/services/context"
|
"code.gitea.io/gitea/services/context"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
|
@ -8,14 +8,14 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"forgejo.org/models"
|
"code.gitea.io/gitea/models"
|
||||||
"forgejo.org/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/storage"
|
"code.gitea.io/gitea/modules/storage"
|
||||||
"forgejo.org/services/f3/util"
|
"code.gitea.io/gitea/services/f3/util"
|
||||||
|
|
||||||
_ "forgejo.org/services/f3/driver" // register the driver
|
_ "code.gitea.io/gitea/services/f3/driver" // register the driver
|
||||||
|
|
||||||
f3_cmd "code.forgejo.org/f3/gof3/v3/cmd"
|
f3_cmd "code.forgejo.org/f3/gof3/v3/cmd"
|
||||||
f3_logger "code.forgejo.org/f3/gof3/v3/logger"
|
f3_logger "code.forgejo.org/f3/gof3/v3/logger"
|
||||||
|
|
|
@ -11,10 +11,10 @@ import (
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"forgejo.org/modules/generate"
|
"code.gitea.io/gitea/modules/generate"
|
||||||
|
|
||||||
"github.com/mattn/go-isatty"
|
"github.com/mattn/go-isatty"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
12
cmd/hook.go
12
cmd/hook.go
|
@ -14,12 +14,12 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forgejo.org/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"forgejo.org/modules/git/pushoptions"
|
"code.gitea.io/gitea/modules/git/pushoptions"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
repo_module "forgejo.org/modules/repository"
|
repo_module "code.gitea.io/gitea/modules/repository"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,6 +6,7 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
|
@ -14,8 +15,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/test"
|
"code.gitea.io/gitea/modules/test"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
@ -41,7 +42,7 @@ func captureOutput(t *testing.T, stdFD *os.File) (finish func() (output string))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPktLine(t *testing.T) {
|
func TestPktLine(t *testing.T) {
|
||||||
ctx := t.Context()
|
ctx := context.Background()
|
||||||
|
|
||||||
t.Run("Read", func(t *testing.T) {
|
t.Run("Read", func(t *testing.T) {
|
||||||
s := strings.NewReader("0000")
|
s := strings.NewReader("0000")
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,8 +6,8 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,9 +10,9 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/cmd/forgejo"
|
"code.gitea.io/gitea/cmd/forgejo"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
@ -206,7 +206,6 @@ func innerNewMainApp(version, versionExtra string, subCmdsStandaloneArgs, subCmd
|
||||||
app.Commands = append(app.Commands, subCmdWithConfig...)
|
app.Commands = append(app.Commands, subCmdWithConfig...)
|
||||||
app.Commands = append(app.Commands, subCmdStandalone...)
|
app.Commands = append(app.Commands, subCmdStandalone...)
|
||||||
|
|
||||||
setting.InitGiteaEnvVars()
|
|
||||||
return app
|
return app
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,14 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forgejo.org/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/test"
|
"code.gitea.io/gitea/modules/test"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
@ -113,17 +114,37 @@ func TestCliCmd(t *testing.T) {
|
||||||
_, _ = fmt.Fprint(ctx.App.Writer, makePathOutput(setting.AppWorkPath, setting.CustomPath, setting.CustomConf))
|
_, _ = fmt.Fprint(ctx.App.Writer, makePathOutput(setting.AppWorkPath, setting.CustomPath, setting.CustomConf))
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
for _, c := range cases {
|
var envBackup []string
|
||||||
t.Run(c.cmd, func(t *testing.T) {
|
for _, s := range os.Environ() {
|
||||||
for k, v := range c.env {
|
if strings.HasPrefix(s, "GITEA_") && strings.Contains(s, "=") {
|
||||||
t.Setenv(k, v)
|
envBackup = append(envBackup, s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clearGiteaEnv := func() {
|
||||||
|
for _, s := range os.Environ() {
|
||||||
|
if strings.HasPrefix(s, "GITEA_") {
|
||||||
|
_ = os.Unsetenv(s)
|
||||||
}
|
}
|
||||||
args := strings.Split(c.cmd, " ") // for test only, "split" is good enough
|
}
|
||||||
r, err := runTestApp(app, args...)
|
}
|
||||||
require.NoError(t, err, c.cmd)
|
defer func() {
|
||||||
assert.NotEmpty(t, c.exp, c.cmd)
|
clearGiteaEnv()
|
||||||
assert.Contains(t, r.Stdout, c.exp, c.cmd)
|
for _, s := range envBackup {
|
||||||
})
|
k, v, _ := strings.Cut(s, "=")
|
||||||
|
_ = os.Setenv(k, v)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
for _, c := range cases {
|
||||||
|
clearGiteaEnv()
|
||||||
|
for k, v := range c.env {
|
||||||
|
_ = os.Setenv(k, v)
|
||||||
|
}
|
||||||
|
args := strings.Split(c.cmd, " ") // for test only, "split" is good enough
|
||||||
|
r, err := runTestApp(app, args...)
|
||||||
|
require.NoError(t, err, c.cmd)
|
||||||
|
assert.NotEmpty(t, c.exp, c.cmd)
|
||||||
|
assert.Contains(t, r.Stdout, c.exp, c.cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,10 +6,10 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/models/migrations"
|
"code.gitea.io/gitea/models/migrations"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,17 +10,17 @@ import (
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
actions_model "forgejo.org/models/actions"
|
actions_model "code.gitea.io/gitea/models/actions"
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
git_model "forgejo.org/models/git"
|
git_model "code.gitea.io/gitea/models/git"
|
||||||
"forgejo.org/models/migrations"
|
"code.gitea.io/gitea/models/migrations"
|
||||||
packages_model "forgejo.org/models/packages"
|
packages_model "code.gitea.io/gitea/models/packages"
|
||||||
repo_model "forgejo.org/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
packages_module "forgejo.org/modules/packages"
|
packages_module "code.gitea.io/gitea/modules/packages"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/storage"
|
"code.gitea.io/gitea/modules/storage"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,21 +4,22 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forgejo.org/models/actions"
|
"code.gitea.io/gitea/models/actions"
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/models/packages"
|
"code.gitea.io/gitea/models/packages"
|
||||||
"forgejo.org/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
packages_module "forgejo.org/modules/packages"
|
packages_module "code.gitea.io/gitea/modules/packages"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/modules/storage"
|
"code.gitea.io/gitea/modules/storage"
|
||||||
"forgejo.org/modules/test"
|
"code.gitea.io/gitea/modules/test"
|
||||||
packages_service "forgejo.org/services/packages"
|
packages_service "code.gitea.io/gitea/services/packages"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
@ -30,7 +31,7 @@ func createLocalStorage(t *testing.T) (storage.ObjectStorage, string) {
|
||||||
p := t.TempDir()
|
p := t.TempDir()
|
||||||
|
|
||||||
storage, err := storage.NewLocalStorage(
|
storage, err := storage.NewLocalStorage(
|
||||||
t.Context(),
|
context.Background(),
|
||||||
&setting.Storage{
|
&setting.Storage{
|
||||||
Path: p,
|
Path: p,
|
||||||
})
|
})
|
||||||
|
@ -71,7 +72,7 @@ func TestMigratePackages(t *testing.T) {
|
||||||
assert.NotNil(t, v)
|
assert.NotNil(t, v)
|
||||||
assert.NotNil(t, f)
|
assert.NotNil(t, f)
|
||||||
|
|
||||||
ctx := t.Context()
|
ctx := context.Background()
|
||||||
|
|
||||||
dstStorage, p := createLocalStorage(t)
|
dstStorage, p := createLocalStorage(t)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
26
cmd/serv.go
26
cmd/serv.go
|
@ -18,18 +18,18 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
asymkey_model "forgejo.org/models/asymkey"
|
asymkey_model "code.gitea.io/gitea/models/asymkey"
|
||||||
git_model "forgejo.org/models/git"
|
git_model "code.gitea.io/gitea/models/git"
|
||||||
"forgejo.org/models/perm"
|
"code.gitea.io/gitea/models/perm"
|
||||||
"forgejo.org/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"forgejo.org/modules/json"
|
"code.gitea.io/gitea/modules/json"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/pprof"
|
"code.gitea.io/gitea/modules/pprof"
|
||||||
"forgejo.org/modules/private"
|
"code.gitea.io/gitea/modules/private"
|
||||||
"forgejo.org/modules/process"
|
"code.gitea.io/gitea/modules/process"
|
||||||
repo_module "forgejo.org/modules/repository"
|
repo_module "code.gitea.io/gitea/modules/repository"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/services/lfs"
|
"code.gitea.io/gitea/services/lfs"
|
||||||
|
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
"github.com/kballard/go-shellquote"
|
"github.com/kballard/go-shellquote"
|
||||||
|
@ -80,7 +80,7 @@ var (
|
||||||
"git-upload-archive": perm.AccessModeRead,
|
"git-upload-archive": perm.AccessModeRead,
|
||||||
"git-receive-pack": perm.AccessModeWrite,
|
"git-receive-pack": perm.AccessModeWrite,
|
||||||
lfsAuthenticateVerb: perm.AccessModeNone,
|
lfsAuthenticateVerb: perm.AccessModeNone,
|
||||||
gitAnnexShellVerb: perm.AccessModeRead, // annex permissions are enforced by GIT_ANNEX_SHELL_READONLY, rather than the Gitea API, but read permissions are required at a minimum
|
gitAnnexShellVerb: perm.AccessModeNone, // annex permissions are enforced by GIT_ANNEX_SHELL_READONLY, rather than the Gitea API
|
||||||
}
|
}
|
||||||
alphaDashDotPattern = regexp.MustCompile(`[^\w-\.]`)
|
alphaDashDotPattern = regexp.MustCompile(`[^\w-\.]`)
|
||||||
)
|
)
|
||||||
|
|
29
cmd/web.go
29
cmd/web.go
|
@ -13,18 +13,17 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
|
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
|
||||||
|
|
||||||
"forgejo.org/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
"forgejo.org/modules/graceful"
|
"code.gitea.io/gitea/modules/graceful"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/process"
|
"code.gitea.io/gitea/modules/process"
|
||||||
"forgejo.org/modules/public"
|
"code.gitea.io/gitea/modules/public"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"forgejo.org/routers"
|
"code.gitea.io/gitea/routers"
|
||||||
"forgejo.org/routers/install"
|
"code.gitea.io/gitea/routers/install"
|
||||||
|
|
||||||
"github.com/felixge/fgprof"
|
"github.com/felixge/fgprof"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
@ -117,16 +116,6 @@ func showWebStartupMessage(msg string) {
|
||||||
log.Info("* CustomPath: %s", setting.CustomPath)
|
log.Info("* CustomPath: %s", setting.CustomPath)
|
||||||
log.Info("* ConfigFile: %s", setting.CustomConf)
|
log.Info("* ConfigFile: %s", setting.CustomConf)
|
||||||
log.Info("%s", msg) // show startup message
|
log.Info("%s", msg) // show startup message
|
||||||
|
|
||||||
if setting.CORSConfig.Enabled {
|
|
||||||
log.Info("CORS Service Enabled")
|
|
||||||
}
|
|
||||||
if setting.DefaultUILocation != time.Local {
|
|
||||||
log.Info("Default UI Location is %v", setting.DefaultUILocation.String())
|
|
||||||
}
|
|
||||||
if setting.MailService != nil {
|
|
||||||
log.Info("Mail Service Enabled: RegisterEmailConfirm=%v, Service.EnableNotifyMail=%v", setting.Service.RegisterEmailConfirm, setting.Service.EnableNotifyMail)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func serveInstall(ctx *cli.Context) error {
|
func serveInstall(ctx *cli.Context) error {
|
||||||
|
@ -196,7 +185,7 @@ func serveInstalled(ctx *cli.Context) error {
|
||||||
publicFilesSet.Remove(".well-known")
|
publicFilesSet.Remove(".well-known")
|
||||||
publicFilesSet.Remove("assets")
|
publicFilesSet.Remove("assets")
|
||||||
publicFilesSet.Remove("robots.txt")
|
publicFilesSet.Remove("robots.txt")
|
||||||
for fn := range publicFilesSet.Seq() {
|
for _, fn := range publicFilesSet.Values() {
|
||||||
log.Error("Found legacy public asset %q in CustomPath. Please move it to %s/public/assets/%s", fn, setting.CustomPath, fn)
|
log.Error("Found legacy public asset %q in CustomPath. Please move it to %s/public/assets/%s", fn, setting.CustomPath, fn)
|
||||||
}
|
}
|
||||||
if _, err := os.Stat(filepath.Join(setting.CustomPath, "robots.txt")); err == nil {
|
if _, err := os.Stat(filepath.Join(setting.CustomPath, "robots.txt")); err == nil {
|
||||||
|
|
|
@ -12,10 +12,10 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/graceful"
|
"code.gitea.io/gitea/modules/graceful"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/process"
|
"code.gitea.io/gitea/modules/process"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/caddyserver/certmagic"
|
"github.com/caddyserver/certmagic"
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"net/http/fcgi"
|
"net/http/fcgi"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/graceful"
|
"code.gitea.io/gitea/modules/graceful"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runHTTP(network, listenAddr, name string, m http.Handler, useProxyProtocol bool) error {
|
func runHTTP(network, listenAddr, name string, m http.Handler, useProxyProtocol bool) error {
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forgejo.org/modules/graceful"
|
"code.gitea.io/gitea/modules/graceful"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/klauspost/cpuid/v2"
|
"github.com/klauspost/cpuid/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,8 +6,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1941,7 +1941,7 @@ LEVEL = Info
|
||||||
;ENABLED = true
|
;ENABLED = true
|
||||||
;;
|
;;
|
||||||
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||||
;ALLOWED_TYPES = .avif,.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.webp,.xls,.xlsx,.zip
|
;ALLOWED_TYPES = .avif,.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
|
||||||
;;
|
;;
|
||||||
;; Max size of each file. Defaults to 2048MB
|
;; Max size of each file. Defaults to 2048MB
|
||||||
;MAX_SIZE = 2048
|
;MAX_SIZE = 2048
|
||||||
|
@ -2407,8 +2407,8 @@ LEVEL = Info
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; The first locale will be used as the default if user browser's language doesn't match any locale in the list.
|
;; The first locale will be used as the default if user browser's language doesn't match any locale in the list.
|
||||||
;LANGS = en-US,zh-CN,zh-HK,zh-TW,da,de-DE,nds,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg,it-IT,fi-FI,fil,eo,tr-TR,cs-CZ,sl,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID
|
;LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,nds,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg,it-IT,fi-FI,fil,eo,tr-TR,cs-CZ,sl,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID
|
||||||
;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Dansk,Deutsch,Plattdüütsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Filipino,Esperanto,Türkçe,Čeština,Slovenščina,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia
|
;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,Plattdüütsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Filipino,Esperanto,Türkçe,Čeština,Slovenščina,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
@ -37,5 +37,5 @@ done
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
exec "$@"
|
exec "$@"
|
||||||
else
|
else
|
||||||
exec /usr/bin/s6-svscan /etc/s6
|
exec /bin/s6-svscan /etc/s6
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -14,7 +14,6 @@ import wc from 'eslint-plugin-wc';
|
||||||
import globals from 'globals';
|
import globals from 'globals';
|
||||||
import vue from 'eslint-plugin-vue';
|
import vue from 'eslint-plugin-vue';
|
||||||
import vueScopedCss from 'eslint-plugin-vue-scoped-css';
|
import vueScopedCss from 'eslint-plugin-vue-scoped-css';
|
||||||
import toml from 'eslint-plugin-toml';
|
|
||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
export default tseslint.config(
|
export default tseslint.config(
|
||||||
|
@ -29,13 +28,13 @@ export default tseslint.config(
|
||||||
'@stylistic/js': stylisticEslintPluginJs,
|
'@stylistic/js': stylisticEslintPluginJs,
|
||||||
'@vitest': vitest,
|
'@vitest': vitest,
|
||||||
'array-func': arrayFunc,
|
'array-func': arrayFunc,
|
||||||
|
'import-x': eslintPluginImportX,
|
||||||
'no-jquery': noJquery,
|
'no-jquery': noJquery,
|
||||||
'no-use-extend-native': noUseExtendNative,
|
'no-use-extend-native': noUseExtendNative,
|
||||||
regexp,
|
regexp,
|
||||||
sonarjs,
|
sonarjs,
|
||||||
unicorn,
|
unicorn,
|
||||||
playwright,
|
playwright,
|
||||||
toml,
|
|
||||||
'vitest-globals': vitestGlobals,
|
'vitest-globals': vitestGlobals,
|
||||||
vue,
|
vue,
|
||||||
'vue-scoped-css': vueScopedCss,
|
'vue-scoped-css': vueScopedCss,
|
||||||
|
@ -722,8 +721,6 @@ export default tseslint.config(
|
||||||
'unicode-bom': [2, 'never'],
|
'unicode-bom': [2, 'never'],
|
||||||
'unicorn/better-regex': [0],
|
'unicorn/better-regex': [0],
|
||||||
'unicorn/catch-error-name': [0],
|
'unicorn/catch-error-name': [0],
|
||||||
'unicorn/consistent-assert': [0],
|
|
||||||
'unicorn/consistent-date-clone': [2],
|
|
||||||
'unicorn/consistent-destructuring': [2],
|
'unicorn/consistent-destructuring': [2],
|
||||||
'unicorn/consistent-empty-array-spread': [2],
|
'unicorn/consistent-empty-array-spread': [2],
|
||||||
'unicorn/consistent-existence-index-check': [2],
|
'unicorn/consistent-existence-index-check': [2],
|
||||||
|
@ -738,7 +735,6 @@ export default tseslint.config(
|
||||||
'unicorn/import-index': [0],
|
'unicorn/import-index': [0],
|
||||||
'unicorn/import-style': [0],
|
'unicorn/import-style': [0],
|
||||||
'unicorn/new-for-builtins': [2],
|
'unicorn/new-for-builtins': [2],
|
||||||
'unicorn/no-accessor-recursion': [2],
|
|
||||||
'unicorn/no-abusive-eslint-disable': [0],
|
'unicorn/no-abusive-eslint-disable': [0],
|
||||||
'unicorn/no-anonymous-default-export': [0],
|
'unicorn/no-anonymous-default-export': [0],
|
||||||
'unicorn/no-array-callback-reference': [0],
|
'unicorn/no-array-callback-reference': [0],
|
||||||
|
@ -753,14 +749,13 @@ export default tseslint.config(
|
||||||
'unicorn/no-empty-file': [2],
|
'unicorn/no-empty-file': [2],
|
||||||
'unicorn/no-for-loop': [0],
|
'unicorn/no-for-loop': [0],
|
||||||
'unicorn/no-hex-escape': [0],
|
'unicorn/no-hex-escape': [0],
|
||||||
'unicorn/no-instanceof-builtins': [0],
|
'unicorn/no-instanceof-array': [0],
|
||||||
'unicorn/no-invalid-fetch-options': [2],
|
'unicorn/no-invalid-fetch-options': [2],
|
||||||
'unicorn/no-invalid-remove-event-listener': [2],
|
'unicorn/no-invalid-remove-event-listener': [2],
|
||||||
'unicorn/no-keyword-prefix': [0],
|
'unicorn/no-keyword-prefix': [0],
|
||||||
'unicorn/no-length-as-slice-end': [2],
|
'unicorn/no-length-as-slice-end': [2],
|
||||||
'unicorn/no-lonely-if': [2],
|
'unicorn/no-lonely-if': [2],
|
||||||
'unicorn/no-magic-array-flat-depth': [0],
|
'unicorn/no-magic-array-flat-depth': [0],
|
||||||
'unicorn/no-named-default': [2],
|
|
||||||
'unicorn/no-negated-condition': [0],
|
'unicorn/no-negated-condition': [0],
|
||||||
'unicorn/no-negation-in-equality-check': [2],
|
'unicorn/no-negation-in-equality-check': [2],
|
||||||
'unicorn/no-nested-ternary': [0],
|
'unicorn/no-nested-ternary': [0],
|
||||||
|
@ -837,6 +832,7 @@ export default tseslint.config(
|
||||||
'unicorn/prefer-structured-clone': [2],
|
'unicorn/prefer-structured-clone': [2],
|
||||||
'unicorn/prefer-switch': [0],
|
'unicorn/prefer-switch': [0],
|
||||||
'unicorn/prefer-ternary': [0],
|
'unicorn/prefer-ternary': [0],
|
||||||
|
'unicorn/prefer-text-content': [2],
|
||||||
'unicorn/prefer-top-level-await': [0],
|
'unicorn/prefer-top-level-await': [0],
|
||||||
'unicorn/prefer-type-error': [0],
|
'unicorn/prefer-type-error': [0],
|
||||||
'unicorn/prevent-abbreviations': [0],
|
'unicorn/prevent-abbreviations': [0],
|
||||||
|
@ -1170,5 +1166,5 @@ export default tseslint.config(
|
||||||
'vue-scoped-css/enforce-style-type': [0],
|
'vue-scoped-css/enforce-style-type': [0],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
...toml.configs['flat/recommended'],
|
|
||||||
);
|
);
|
||||||
|
|
195
go.mod
195
go.mod
|
@ -1,39 +1,38 @@
|
||||||
module forgejo.org
|
module code.gitea.io/gitea
|
||||||
|
|
||||||
go 1.24
|
go 1.23
|
||||||
|
|
||||||
toolchain go1.24.3
|
toolchain go1.23.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
code.forgejo.org/f3/gof3/v3 v3.10.6
|
code.forgejo.org/f3/gof3/v3 v3.10.2
|
||||||
code.forgejo.org/forgejo-contrib/go-libravatar v0.0.0-20191008002943-06d1c002b251
|
code.forgejo.org/forgejo-contrib/go-libravatar v0.0.0-20191008002943-06d1c002b251
|
||||||
code.forgejo.org/forgejo/levelqueue v1.0.0
|
|
||||||
code.forgejo.org/forgejo/reply v1.0.2
|
code.forgejo.org/forgejo/reply v1.0.2
|
||||||
code.forgejo.org/go-chi/binding v1.0.0
|
code.forgejo.org/go-chi/binding v1.0.0
|
||||||
code.forgejo.org/go-chi/cache v1.0.0
|
code.forgejo.org/go-chi/cache v1.0.0
|
||||||
code.forgejo.org/go-chi/captcha v1.0.1
|
code.forgejo.org/go-chi/captcha v1.0.1
|
||||||
code.forgejo.org/go-chi/session v1.0.1
|
code.forgejo.org/go-chi/session v1.0.1
|
||||||
code.gitea.io/actions-proto-go v0.4.0
|
code.gitea.io/actions-proto-go v0.4.0
|
||||||
code.gitea.io/sdk/gitea v0.20.0
|
code.gitea.io/sdk/gitea v0.17.1
|
||||||
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
|
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
|
||||||
connectrpc.com/connect v1.17.0
|
connectrpc.com/connect v1.17.0
|
||||||
github.com/42wim/httpsig v1.2.2
|
gitea.com/lunny/levelqueue v0.4.2-0.20230414023320-3c0159fe0fe4
|
||||||
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121
|
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121
|
||||||
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
|
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
|
||||||
github.com/ProtonMail/go-crypto v1.1.6
|
github.com/ProtonMail/go-crypto v1.1.3
|
||||||
github.com/PuerkitoBio/goquery v1.10.2
|
github.com/PuerkitoBio/goquery v1.10.0
|
||||||
github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.7.2
|
github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.7.2
|
||||||
github.com/alecthomas/chroma/v2 v2.15.0
|
github.com/alecthomas/chroma/v2 v2.15.0
|
||||||
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
|
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
|
||||||
github.com/blevesearch/bleve/v2 v2.5.2
|
github.com/blevesearch/bleve/v2 v2.4.4
|
||||||
github.com/buildkite/terminal-to-html/v3 v3.16.8
|
github.com/buildkite/terminal-to-html/v3 v3.16.4
|
||||||
github.com/caddyserver/certmagic v0.22.2
|
github.com/caddyserver/certmagic v0.21.4
|
||||||
github.com/chi-middleware/proxy v1.1.1
|
github.com/chi-middleware/proxy v1.1.1
|
||||||
github.com/djherbis/buffer v1.2.0
|
github.com/djherbis/buffer v1.2.0
|
||||||
github.com/djherbis/nio/v3 v3.0.1
|
github.com/djherbis/nio/v3 v3.0.1
|
||||||
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
|
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
|
||||||
github.com/dustin/go-humanize v1.0.1
|
github.com/dustin/go-humanize v1.0.1
|
||||||
github.com/editorconfig/editorconfig-core-go/v2 v2.6.3
|
github.com/editorconfig/editorconfig-core-go/v2 v2.6.2
|
||||||
github.com/emersion/go-imap v1.2.1
|
github.com/emersion/go-imap v1.2.1
|
||||||
github.com/felixge/fgprof v0.9.5
|
github.com/felixge/fgprof v0.9.5
|
||||||
github.com/fsnotify/fsnotify v1.8.0
|
github.com/fsnotify/fsnotify v1.8.0
|
||||||
|
@ -43,48 +42,50 @@ require (
|
||||||
github.com/go-chi/chi/v5 v5.2.0
|
github.com/go-chi/chi/v5 v5.2.0
|
||||||
github.com/go-chi/cors v1.2.1
|
github.com/go-chi/cors v1.2.1
|
||||||
github.com/go-co-op/gocron v1.37.0
|
github.com/go-co-op/gocron v1.37.0
|
||||||
github.com/go-enry/go-enry/v2 v2.9.2
|
github.com/go-enry/go-enry/v2 v2.9.1
|
||||||
github.com/go-git/go-git/v5 v5.13.2
|
github.com/go-fed/httpsig v1.1.1-0.20201223112313-55836744818e
|
||||||
|
github.com/go-git/go-git/v5 v5.13.1
|
||||||
github.com/go-ldap/ldap/v3 v3.4.6
|
github.com/go-ldap/ldap/v3 v3.4.6
|
||||||
github.com/go-openapi/spec v0.20.14
|
github.com/go-openapi/spec v0.20.14
|
||||||
github.com/go-sql-driver/mysql v1.9.1
|
github.com/go-sql-driver/mysql v1.8.1
|
||||||
github.com/go-webauthn/webauthn v0.12.2
|
github.com/go-testfixtures/testfixtures/v3 v3.14.0
|
||||||
|
github.com/go-webauthn/webauthn v0.11.2
|
||||||
github.com/gobwas/glob v0.2.3
|
github.com/gobwas/glob v0.2.3
|
||||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
|
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
|
||||||
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
|
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
|
||||||
github.com/golang-jwt/jwt/v5 v5.2.2
|
github.com/golang-jwt/jwt/v5 v5.2.1
|
||||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
|
||||||
github.com/google/go-github/v64 v64.0.0
|
github.com/google/go-github/v64 v64.0.0
|
||||||
github.com/google/pprof v0.0.0-20241017200806-017d972448fc
|
github.com/google/pprof v0.0.0-20241017200806-017d972448fc
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/gorilla/feeds v1.2.0
|
github.com/gorilla/feeds v1.2.0
|
||||||
github.com/gorilla/sessions v1.4.0
|
github.com/gorilla/sessions v1.4.0
|
||||||
github.com/hashicorp/go-version v1.7.0
|
github.com/hashicorp/go-version v1.6.0
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||||
github.com/huandu/xstrings v1.5.0
|
github.com/huandu/xstrings v1.5.0
|
||||||
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
|
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
|
||||||
github.com/jhillyerd/enmime/v2 v2.1.0
|
github.com/jhillyerd/enmime/v2 v2.0.0
|
||||||
github.com/json-iterator/go v1.1.12
|
github.com/json-iterator/go v1.1.12
|
||||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||||
github.com/klauspost/compress v1.17.11
|
github.com/klauspost/compress v1.17.11
|
||||||
github.com/klauspost/cpuid/v2 v2.2.10
|
github.com/klauspost/cpuid/v2 v2.2.8
|
||||||
github.com/lib/pq v1.10.9
|
github.com/lib/pq v1.10.9
|
||||||
github.com/markbates/goth v1.80.0
|
github.com/markbates/goth v1.80.0
|
||||||
github.com/mattn/go-isatty v0.0.20
|
github.com/mattn/go-isatty v0.0.20
|
||||||
github.com/mattn/go-sqlite3 v1.14.28
|
github.com/mattn/go-sqlite3 v1.14.24
|
||||||
github.com/meilisearch/meilisearch-go v0.31.0
|
github.com/meilisearch/meilisearch-go v0.29.0
|
||||||
github.com/mholt/archiver/v3 v3.5.1
|
github.com/mholt/archiver/v3 v3.5.1
|
||||||
github.com/microcosm-cc/bluemonday v1.0.27
|
github.com/microcosm-cc/bluemonday v1.0.27
|
||||||
github.com/minio/minio-go/v7 v7.0.88
|
github.com/minio/minio-go/v7 v7.0.78
|
||||||
github.com/msteinert/pam/v2 v2.1.0
|
github.com/msteinert/pam v1.2.0
|
||||||
github.com/nektos/act v0.2.52
|
github.com/nektos/act v0.2.52
|
||||||
github.com/niklasfasching/go-org v1.7.0
|
github.com/niklasfasching/go-org v1.7.0
|
||||||
github.com/olivere/elastic/v7 v7.0.32
|
github.com/olivere/elastic/v7 v7.0.32
|
||||||
github.com/opencontainers/go-digest v1.0.0
|
github.com/opencontainers/go-digest v1.0.0
|
||||||
github.com/opencontainers/image-spec v1.1.1
|
github.com/opencontainers/image-spec v1.1.0
|
||||||
github.com/pquerna/otp v1.4.0
|
github.com/pquerna/otp v1.4.0
|
||||||
github.com/prometheus/client_golang v1.21.1
|
github.com/prometheus/client_golang v1.20.5
|
||||||
github.com/redis/go-redis/v9 v9.7.3
|
github.com/redis/go-redis/v9 v9.7.0
|
||||||
github.com/robfig/cron/v3 v3.0.1
|
github.com/robfig/cron/v3 v3.0.1
|
||||||
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1
|
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1
|
||||||
github.com/sassoftware/go-rpmutils v0.4.0
|
github.com/sassoftware/go-rpmutils v0.4.0
|
||||||
|
@ -93,21 +94,22 @@ require (
|
||||||
github.com/stretchr/testify v1.10.0
|
github.com/stretchr/testify v1.10.0
|
||||||
github.com/syndtr/goleveldb v1.0.0
|
github.com/syndtr/goleveldb v1.0.0
|
||||||
github.com/ulikunitz/xz v0.5.12
|
github.com/ulikunitz/xz v0.5.12
|
||||||
github.com/urfave/cli/v2 v2.27.6
|
github.com/urfave/cli/v2 v2.27.5
|
||||||
github.com/valyala/fastjson v1.6.4
|
github.com/valyala/fastjson v1.6.4
|
||||||
|
github.com/xanzy/go-gitlab v0.109.0
|
||||||
github.com/yohcop/openid-go v1.0.1
|
github.com/yohcop/openid-go v1.0.1
|
||||||
github.com/yuin/goldmark v1.7.8
|
github.com/yuin/goldmark v1.7.8
|
||||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
||||||
gitlab.com/gitlab-org/api/client-go v0.126.0
|
go.uber.org/mock v0.4.0
|
||||||
go.uber.org/mock v0.5.0
|
golang.org/x/crypto v0.31.0
|
||||||
golang.org/x/crypto v0.36.0
|
golang.org/x/image v0.23.0
|
||||||
golang.org/x/image v0.25.0
|
golang.org/x/net v0.33.0
|
||||||
golang.org/x/net v0.38.0
|
golang.org/x/oauth2 v0.23.0
|
||||||
golang.org/x/oauth2 v0.28.0
|
golang.org/x/sync v0.10.0
|
||||||
golang.org/x/sync v0.12.0
|
golang.org/x/sys v0.28.0
|
||||||
golang.org/x/sys v0.31.0
|
golang.org/x/text v0.21.0
|
||||||
golang.org/x/text v0.23.0
|
google.golang.org/grpc v1.69.2
|
||||||
google.golang.org/protobuf v1.36.4
|
google.golang.org/protobuf v1.36.1
|
||||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
||||||
gopkg.in/ini.v1 v1.67.0
|
gopkg.in/ini.v1 v1.67.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
|
@ -117,42 +119,55 @@ require (
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute/metadata v0.6.0 // indirect
|
cel.dev/expr v0.16.2 // indirect
|
||||||
|
cloud.google.com/go v0.116.0 // indirect
|
||||||
|
cloud.google.com/go/auth v0.9.9 // indirect
|
||||||
|
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
|
||||||
|
cloud.google.com/go/compute/metadata v0.5.2 // indirect
|
||||||
|
cloud.google.com/go/iam v1.2.1 // indirect
|
||||||
|
cloud.google.com/go/longrunning v0.6.1 // indirect
|
||||||
|
cloud.google.com/go/monitoring v1.21.1 // indirect
|
||||||
|
cloud.google.com/go/spanner v1.73.0 // indirect
|
||||||
dario.cat/mergo v1.0.0 // indirect
|
dario.cat/mergo v1.0.0 // indirect
|
||||||
filippo.io/edwards25519 v1.1.0 // indirect
|
filippo.io/edwards25519 v1.1.0 // indirect
|
||||||
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
|
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
|
||||||
|
github.com/42wim/httpsig v1.2.2 // indirect
|
||||||
github.com/DataDog/zstd v1.5.5 // indirect
|
github.com/DataDog/zstd v1.5.5 // indirect
|
||||||
|
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.0 // indirect
|
||||||
|
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.2 // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||||
github.com/RoaringBitmap/roaring/v2 v2.4.5 // indirect
|
github.com/RoaringBitmap/roaring v1.9.3 // indirect
|
||||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
github.com/andybalholm/brotli v1.1.1 // indirect
|
||||||
github.com/andybalholm/cascadia v1.3.3 // indirect
|
github.com/andybalholm/cascadia v1.3.2 // indirect
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
|
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
|
||||||
github.com/aymerick/douceur v0.2.0 // indirect
|
github.com/aymerick/douceur v0.2.0 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/bits-and-blooms/bitset v1.22.0 // indirect
|
github.com/bits-and-blooms/bitset v1.13.0 // indirect
|
||||||
github.com/blevesearch/bleve_index_api v1.2.8 // indirect
|
github.com/blevesearch/bleve_index_api v1.1.12 // indirect
|
||||||
github.com/blevesearch/geo v0.2.3 // indirect
|
github.com/blevesearch/geo v0.1.20 // indirect
|
||||||
github.com/blevesearch/go-faiss v1.0.25 // indirect
|
github.com/blevesearch/go-faiss v1.0.24 // indirect
|
||||||
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
|
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
|
||||||
github.com/blevesearch/gtreap v0.1.1 // indirect
|
github.com/blevesearch/gtreap v0.1.1 // indirect
|
||||||
github.com/blevesearch/mmap-go v1.0.4 // indirect
|
github.com/blevesearch/mmap-go v1.0.4 // indirect
|
||||||
github.com/blevesearch/scorch_segment_api/v2 v2.3.10 // indirect
|
github.com/blevesearch/scorch_segment_api/v2 v2.2.16 // indirect
|
||||||
github.com/blevesearch/segment v0.9.1 // indirect
|
github.com/blevesearch/segment v0.9.1 // indirect
|
||||||
github.com/blevesearch/snowballstem v0.9.0 // indirect
|
github.com/blevesearch/snowballstem v0.9.0 // indirect
|
||||||
github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
|
github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
|
||||||
github.com/blevesearch/vellum v1.1.0 // indirect
|
github.com/blevesearch/vellum v1.0.10 // indirect
|
||||||
github.com/blevesearch/zapx/v11 v11.4.2 // indirect
|
github.com/blevesearch/zapx/v11 v11.3.10 // indirect
|
||||||
github.com/blevesearch/zapx/v12 v12.4.2 // indirect
|
github.com/blevesearch/zapx/v12 v12.3.10 // indirect
|
||||||
github.com/blevesearch/zapx/v13 v13.4.2 // indirect
|
github.com/blevesearch/zapx/v13 v13.3.10 // indirect
|
||||||
github.com/blevesearch/zapx/v14 v14.4.2 // indirect
|
github.com/blevesearch/zapx/v14 v14.3.10 // indirect
|
||||||
github.com/blevesearch/zapx/v15 v15.4.2 // indirect
|
github.com/blevesearch/zapx/v15 v15.3.16 // indirect
|
||||||
github.com/blevesearch/zapx/v16 v16.2.4 // indirect
|
github.com/blevesearch/zapx/v16 v16.1.9-0.20241217210638-a0519e7caf3b // indirect
|
||||||
github.com/boombuler/barcode v1.0.1 // indirect
|
github.com/boombuler/barcode v1.0.1 // indirect
|
||||||
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 // indirect
|
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 // indirect
|
||||||
github.com/caddyserver/zerossl v0.1.3 // indirect
|
github.com/caddyserver/zerossl v0.1.3 // indirect
|
||||||
|
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
|
||||||
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
|
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/cloudflare/circl v1.6.1 // indirect
|
github.com/cloudflare/circl v1.3.8 // indirect
|
||||||
|
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
||||||
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
|
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
|
@ -161,28 +176,37 @@ require (
|
||||||
github.com/dlclark/regexp2 v1.11.4 // indirect
|
github.com/dlclark/regexp2 v1.11.4 // indirect
|
||||||
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 // indirect
|
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 // indirect
|
||||||
github.com/emirpasic/gods v1.18.1 // indirect
|
github.com/emirpasic/gods v1.18.1 // indirect
|
||||||
|
github.com/envoyproxy/go-control-plane v0.13.1 // indirect
|
||||||
|
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
|
||||||
github.com/fatih/color v1.16.0 // indirect
|
github.com/fatih/color v1.16.0 // indirect
|
||||||
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
|
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||||
github.com/go-ap/errors v0.0.0-20231003111023-183eef4b31b7 // indirect
|
github.com/go-ap/errors v0.0.0-20231003111023-183eef4b31b7 // indirect
|
||||||
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
|
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
|
||||||
github.com/go-enry/go-oniguruma v1.2.1 // indirect
|
github.com/go-enry/go-oniguruma v1.2.1 // indirect
|
||||||
github.com/go-fed/httpsig v1.1.0 // indirect
|
|
||||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||||
github.com/go-git/go-billy/v5 v5.6.2 // indirect
|
github.com/go-git/go-billy/v5 v5.6.1 // indirect
|
||||||
github.com/go-ini/ini v1.67.0 // indirect
|
github.com/go-ini/ini v1.67.0 // indirect
|
||||||
|
github.com/go-logr/logr v1.4.2 // indirect
|
||||||
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.20.2 // indirect
|
github.com/go-openapi/jsonpointer v0.20.2 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.4 // indirect
|
github.com/go-openapi/jsonreference v0.20.4 // indirect
|
||||||
github.com/go-openapi/swag v0.22.7 // indirect
|
github.com/go-openapi/swag v0.22.7 // indirect
|
||||||
github.com/go-webauthn/x v0.1.20 // indirect
|
github.com/go-webauthn/x v0.1.14 // indirect
|
||||||
github.com/goccy/go-json v0.10.5 // indirect
|
github.com/goccy/go-json v0.10.3 // indirect
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
|
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
|
||||||
|
github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/protobuf v1.5.4 // indirect
|
github.com/golang/protobuf v1.5.4 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/btree v1.1.2 // indirect
|
github.com/google/btree v1.1.2 // indirect
|
||||||
github.com/google/go-cmp v0.7.0 // indirect
|
github.com/google/go-cmp v0.6.0 // indirect
|
||||||
github.com/google/go-querystring v1.1.0 // indirect
|
github.com/google/go-querystring v1.1.0 // indirect
|
||||||
github.com/google/go-tpm v0.9.3 // indirect
|
github.com/google/go-tpm v0.9.1 // indirect
|
||||||
|
github.com/google/s2a-go v0.1.8 // indirect
|
||||||
|
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
|
||||||
|
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
|
||||||
|
github.com/googleapis/go-sql-spanner v1.7.4 // indirect
|
||||||
github.com/gorilla/css v1.0.1 // indirect
|
github.com/gorilla/css v1.0.1 // indirect
|
||||||
github.com/gorilla/mux v1.8.1 // indirect
|
github.com/gorilla/mux v1.8.1 // indirect
|
||||||
github.com/gorilla/securecookie v1.1.2 // indirect
|
github.com/gorilla/securecookie v1.1.2 // indirect
|
||||||
|
@ -192,14 +216,13 @@ require (
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||||
github.com/klauspost/pgzip v1.2.6 // indirect
|
github.com/klauspost/pgzip v1.2.6 // indirect
|
||||||
github.com/libdns/libdns v0.2.3 // indirect
|
github.com/libdns/libdns v0.2.2 // indirect
|
||||||
github.com/mailru/easyjson v0.9.0 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/markbates/going v1.0.3 // indirect
|
github.com/markbates/going v1.0.3 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||||
github.com/mholt/acmez/v3 v3.1.1 // indirect
|
github.com/mholt/acmez/v2 v2.0.3 // indirect
|
||||||
github.com/miekg/dns v1.1.63 // indirect
|
github.com/miekg/dns v1.1.62 // indirect
|
||||||
github.com/minio/crc64nvme v1.0.1 // indirect
|
|
||||||
github.com/minio/md5-simd v1.1.2 // indirect
|
github.com/minio/md5-simd v1.1.2 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
|
@ -211,15 +234,15 @@ require (
|
||||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||||
github.com/onsi/ginkgo v1.16.5 // indirect
|
github.com/onsi/ginkgo v1.16.5 // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
||||||
github.com/pjbgf/sha1cd v0.3.2 // indirect
|
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/prometheus/client_model v0.6.1 // indirect
|
github.com/prometheus/client_model v0.6.1 // indirect
|
||||||
github.com/prometheus/common v0.62.0 // indirect
|
github.com/prometheus/common v0.55.0 // indirect
|
||||||
github.com/prometheus/procfs v0.15.1 // indirect
|
github.com/prometheus/procfs v0.15.1 // indirect
|
||||||
github.com/rhysd/actionlint v1.6.27 // indirect
|
github.com/rhysd/actionlint v1.6.27 // indirect
|
||||||
github.com/rivo/uniseg v0.4.7 // indirect
|
github.com/rivo/uniseg v0.4.7 // indirect
|
||||||
github.com/rogpeppe/go-internal v1.13.1 // indirect
|
|
||||||
github.com/rs/xid v1.6.0 // indirect
|
github.com/rs/xid v1.6.0 // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
|
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
|
||||||
|
@ -230,16 +253,28 @@ require (
|
||||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
|
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
|
||||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
|
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
|
||||||
github.com/zeebo/assert v1.3.0 // indirect
|
|
||||||
github.com/zeebo/blake3 v0.2.4 // indirect
|
github.com/zeebo/blake3 v0.2.4 // indirect
|
||||||
go.etcd.io/bbolt v1.4.0 // indirect
|
gitlab.com/gitlab-org/api/client-go v0.116.0 // indirect
|
||||||
|
go.etcd.io/bbolt v1.3.9 // indirect
|
||||||
|
go.opencensus.io v0.24.0 // indirect
|
||||||
|
go.opentelemetry.io/contrib/detectors/gcp v1.31.0 // indirect
|
||||||
|
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
|
||||||
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
|
||||||
|
go.opentelemetry.io/otel v1.31.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/metric v1.31.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/trace v1.31.0 // indirect
|
||||||
go.uber.org/atomic v1.11.0 // indirect
|
go.uber.org/atomic v1.11.0 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
go.uber.org/zap v1.27.0 // indirect
|
go.uber.org/zap v1.27.0 // indirect
|
||||||
go.uber.org/zap/exp v0.3.0 // indirect
|
golang.org/x/mod v0.22.0 // indirect
|
||||||
golang.org/x/mod v0.24.0 // indirect
|
golang.org/x/time v0.7.0 // indirect
|
||||||
golang.org/x/time v0.10.0 // indirect
|
golang.org/x/tools v0.28.0 // indirect
|
||||||
golang.org/x/tools v0.31.0 // indirect
|
google.golang.org/api v0.203.0 // indirect
|
||||||
|
google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
|
||||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||||
)
|
)
|
||||||
|
@ -248,10 +283,10 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
|
||||||
|
|
||||||
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
|
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
|
||||||
|
|
||||||
replace github.com/nektos/act => code.forgejo.org/forgejo/act v1.25.1
|
replace github.com/nektos/act => code.forgejo.org/forgejo/act v1.22.0
|
||||||
|
|
||||||
replace github.com/mholt/archiver/v3 => code.forgejo.org/forgejo/archiver/v3 v3.5.1
|
replace github.com/mholt/archiver/v3 => code.forgejo.org/forgejo/archiver/v3 v3.5.1
|
||||||
|
|
||||||
replace github.com/gliderlabs/ssh => code.forgejo.org/forgejo/ssh v0.0.0-20241211213324-5fc306ca0616
|
replace github.com/goccy/go-json => github.com/grafana/go-json v0.0.0-20241210211703-a119ee5a0a3b
|
||||||
|
|
||||||
replace git.sr.ht/~mariusor/go-xsd-duration => code.forgejo.org/forgejo/go-xsd-duration v0.0.0-20220703122237-02e73435a078
|
replace github.com/gliderlabs/ssh => code.forgejo.org/forgejo/ssh v0.0.0-20241211213324-5fc306ca0616
|
||||||
|
|
16
main.go
16
main.go
|
@ -10,16 +10,16 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forgejo.org/cmd"
|
"code.gitea.io/gitea/cmd"
|
||||||
"forgejo.org/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"forgejo.org/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
// register supported doc types
|
// register supported doc types
|
||||||
_ "forgejo.org/modules/markup/asciicast"
|
_ "code.gitea.io/gitea/modules/markup/asciicast"
|
||||||
_ "forgejo.org/modules/markup/console"
|
_ "code.gitea.io/gitea/modules/markup/console"
|
||||||
_ "forgejo.org/modules/markup/csv"
|
_ "code.gitea.io/gitea/modules/markup/csv"
|
||||||
_ "forgejo.org/modules/markup/markdown"
|
_ "code.gitea.io/gitea/modules/markup/markdown"
|
||||||
_ "forgejo.org/modules/markup/orgmode"
|
_ "code.gitea.io/gitea/modules/markup/orgmode"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,9 +11,9 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/modules/timeutil"
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"crypto/subtle"
|
"crypto/subtle"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
auth_model "forgejo.org/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
gouuid "github.com/google/uuid"
|
gouuid "github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"crypto/subtle"
|
"crypto/subtle"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
auth_model "forgejo.org/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
|
@ -6,7 +6,7 @@ package actions
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forgejo.org/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
|
|
|
@ -10,15 +10,15 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
repo_model "forgejo.org/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"forgejo.org/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"forgejo.org/modules/json"
|
"code.gitea.io/gitea/modules/json"
|
||||||
api "forgejo.org/modules/structs"
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
"forgejo.org/modules/timeutil"
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
webhook_module "forgejo.org/modules/webhook"
|
webhook_module "code.gitea.io/gitea/modules/webhook"
|
||||||
|
|
||||||
"github.com/nektos/act/pkg/jobparser"
|
"github.com/nektos/act/pkg/jobparser"
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
|
|
|
@ -9,10 +9,9 @@ import (
|
||||||
"slices"
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/modules/container"
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
"forgejo.org/modules/timeutil"
|
"code.gitea.io/gitea/modules/util"
|
||||||
"forgejo.org/modules/util"
|
|
||||||
|
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
)
|
)
|
||||||
|
@ -72,15 +71,6 @@ func (job *ActionRunJob) LoadAttributes(ctx context.Context) error {
|
||||||
return job.Run.LoadAttributes(ctx)
|
return job.Run.LoadAttributes(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (job *ActionRunJob) ItRunsOn(labels []string) bool {
|
|
||||||
if len(labels) == 0 || len(job.RunsOn) == 0 {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
labelSet := make(container.Set[string])
|
|
||||||
labelSet.AddMultiple(labels...)
|
|
||||||
return labelSet.IsSubset(job.RunsOn)
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetRunJobByID(ctx context.Context, id int64) (*ActionRunJob, error) {
|
func GetRunJobByID(ctx context.Context, id int64) (*ActionRunJob, error) {
|
||||||
var job ActionRunJob
|
var job ActionRunJob
|
||||||
has, err := db.GetEngine(ctx).Where("id=?", id).Get(&job)
|
has, err := db.GetEngine(ctx).Where("id=?", id).Get(&job)
|
||||||
|
|
|
@ -6,9 +6,9 @@ package actions
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"forgejo.org/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
"forgejo.org/modules/timeutil"
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
|
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
package actions
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestActionRunJob_ItRunsOn(t *testing.T) {
|
|
||||||
actionJob := ActionRunJob{RunsOn: []string{"ubuntu"}}
|
|
||||||
agentLabels := []string{"ubuntu", "node-20"}
|
|
||||||
|
|
||||||
assert.True(t, actionJob.ItRunsOn(agentLabels))
|
|
||||||
assert.False(t, actionJob.ItRunsOn([]string{}))
|
|
||||||
|
|
||||||
actionJob.RunsOn = append(actionJob.RunsOn, "node-20")
|
|
||||||
|
|
||||||
assert.True(t, actionJob.ItRunsOn(agentLabels))
|
|
||||||
|
|
||||||
agentLabels = []string{"ubuntu"}
|
|
||||||
|
|
||||||
assert.False(t, actionJob.ItRunsOn(agentLabels))
|
|
||||||
|
|
||||||
actionJob.RunsOn = []string{}
|
|
||||||
|
|
||||||
assert.False(t, actionJob.ItRunsOn(agentLabels))
|
|
||||||
}
|
|
|
@ -6,12 +6,11 @@ package actions
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
repo_model "forgejo.org/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"forgejo.org/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
"forgejo.org/modules/translation"
|
webhook_module "code.gitea.io/gitea/modules/webhook"
|
||||||
webhook_module "forgejo.org/modules/webhook"
|
|
||||||
|
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
)
|
)
|
||||||
|
@ -113,14 +112,14 @@ type StatusInfo struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetStatusInfoList returns a slice of StatusInfo
|
// GetStatusInfoList returns a slice of StatusInfo
|
||||||
func GetStatusInfoList(ctx context.Context, lang translation.Locale) []StatusInfo {
|
func GetStatusInfoList(ctx context.Context) []StatusInfo {
|
||||||
// same as those in aggregateJobStatus
|
// same as those in aggregateJobStatus
|
||||||
allStatus := []Status{StatusSuccess, StatusFailure, StatusWaiting, StatusRunning}
|
allStatus := []Status{StatusSuccess, StatusFailure, StatusWaiting, StatusRunning}
|
||||||
statusInfoList := make([]StatusInfo, 0, 4)
|
statusInfoList := make([]StatusInfo, 0, 4)
|
||||||
for _, s := range allStatus {
|
for _, s := range allStatus {
|
||||||
statusInfoList = append(statusInfoList, StatusInfo{
|
statusInfoList = append(statusInfoList, StatusInfo{
|
||||||
Status: int(s),
|
Status: int(s),
|
||||||
DisplayedStatus: s.LocaleString(lang),
|
DisplayedStatus: s.String(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return statusInfoList
|
return statusInfoList
|
||||||
|
|
|
@ -11,15 +11,15 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
auth_model "forgejo.org/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
"forgejo.org/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
repo_model "forgejo.org/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
"forgejo.org/models/shared/types"
|
"code.gitea.io/gitea/models/shared/types"
|
||||||
user_model "forgejo.org/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"forgejo.org/modules/optional"
|
"code.gitea.io/gitea/modules/optional"
|
||||||
"forgejo.org/modules/timeutil"
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
"forgejo.org/modules/translation"
|
"code.gitea.io/gitea/modules/translation"
|
||||||
"forgejo.org/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
|
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue