Merge branch 'forgejo' into repocard

This commit is contained in:
JakobDev 2024-12-18 19:27:24 +00:00
commit df570a1d71
29 changed files with 782 additions and 1947 deletions

View file

@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v4
- id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v1.0.1
uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.4
with:
user: root
password: admin1234

View file

@ -158,7 +158,7 @@ jobs:
- name: build container & release
if: ${{ secrets.TOKEN != '' }}
uses: https://code.forgejo.org/forgejo/forgejo-build-publish/build@v5.1.1
uses: https://code.forgejo.org/forgejo/forgejo-build-publish/build@v5.2.1
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
@ -177,7 +177,7 @@ jobs:
- name: build rootless container
if: ${{ secrets.TOKEN != '' }}
uses: https://code.forgejo.org/forgejo/forgejo-build-publish/build@v5.1.1
uses: https://code.forgejo.org/forgejo/forgejo-build-publish/build@v5.2.1
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
@ -195,7 +195,7 @@ jobs:
- name: end-to-end tests
if: ${{ secrets.TOKEN != '' && vars.ROLE == 'forgejo-integration' && vars.SKIP_END_TO_END != 'true' }}
uses: https://code.forgejo.org/actions/cascading-pr@v2
uses: https://code.forgejo.org/actions/cascading-pr@v2.2.0
with:
origin-url: ${{ env.GITHUB_SERVER_URL }}
origin-repo: ${{ github.repository }}

View file

@ -41,7 +41,7 @@ jobs:
with:
fetch-depth: '0'
show-progress: 'false'
- uses: actions/cascading-pr@v2
- uses: https://code.forgejo.org/actions/cascading-pr@v2.1.1
with:
origin-url: ${{ env.GITHUB_SERVER_URL }}
origin-repo: ${{ github.repository }}

View file

@ -25,7 +25,7 @@ jobs:
runs-on: docker
container:
image: code.forgejo.org/forgejo-contrib/renovate:39.57.4
image: code.forgejo.org/forgejo-contrib/renovate:39.69.2
steps:
- name: Load renovate repo cache

View file

@ -39,7 +39,7 @@ XGO_VERSION := go-1.21.x
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.0.3 # 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.62.0 # 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
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
@ -49,7 +49,7 @@ GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 # renovate: datasour
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
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.17.0 # renovate: datasource=go
RENOVATE_NPM_PACKAGE ?= renovate@39.57.4 # renovate: datasource=docker packageName=code.forgejo.org/forgejo-contrib/renovate
RENOVATE_NPM_PACKAGE ?= renovate@39.69.2 # renovate: datasource=docker packageName=code.forgejo.org/forgejo-contrib/renovate
# https://github.com/disposable-email-domains/disposable-email-domains/commits/main/
DISPOSABLE_EMAILS_SHA ?= 0c27e671231d27cf66370034d7f6818037416989 # renovate: ...

10
go.mod
View file

@ -25,7 +25,7 @@ require (
github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.7.2
github.com/alecthomas/chroma/v2 v2.14.0
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
github.com/blevesearch/bleve/v2 v2.4.3
github.com/blevesearch/bleve/v2 v2.4.4
github.com/buildkite/terminal-to-html/v3 v3.16.4
github.com/caddyserver/certmagic v0.21.4
github.com/chi-middleware/proxy v1.1.1
@ -40,7 +40,7 @@ require (
github.com/gliderlabs/ssh v0.3.8
github.com/go-ap/activitypub v0.0.0-20231114162308-e219254dc5c9
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
github.com/go-chi/chi/v5 v5.1.0
github.com/go-chi/chi/v5 v5.2.0
github.com/go-chi/cors v1.2.1
github.com/go-co-op/gocron v1.37.0
github.com/go-enry/go-enry/v2 v2.9.1
@ -113,7 +113,7 @@ require (
golang.org/x/text v0.21.0
golang.org/x/tools v0.28.0
google.golang.org/grpc v1.68.0
google.golang.org/protobuf v1.35.1
google.golang.org/protobuf v1.36.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v3 v3.0.1
@ -144,7 +144,7 @@ require (
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/blevesearch/bleve_index_api v1.1.12 // indirect
github.com/blevesearch/geo v0.1.20 // indirect
github.com/blevesearch/go-faiss v1.0.23 // indirect
github.com/blevesearch/go-faiss v1.0.24 // indirect
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
github.com/blevesearch/gtreap v0.1.1 // indirect
github.com/blevesearch/mmap-go v1.0.4 // indirect
@ -158,7 +158,7 @@ require (
github.com/blevesearch/zapx/v13 v13.3.10 // indirect
github.com/blevesearch/zapx/v14 v14.3.10 // indirect
github.com/blevesearch/zapx/v15 v15.3.16 // indirect
github.com/blevesearch/zapx/v16 v16.1.8 // indirect
github.com/blevesearch/zapx/v16 v16.1.9-0.20241217210638-a0519e7caf3b // indirect
github.com/boombuler/barcode v1.0.1 // indirect
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 // indirect
github.com/caddyserver/zerossl v0.1.3 // indirect

20
go.sum
View file

@ -100,14 +100,14 @@ github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJR
github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb h1:m935MPodAbYS46DG4pJSv7WO+VECIWUQ7OJYSoTrMh4=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI=
github.com/blevesearch/bleve/v2 v2.4.3 h1:XDYj+1prgX84L2Cf+V3ojrOPqXxy0qxyd2uLMmeuD+4=
github.com/blevesearch/bleve/v2 v2.4.3/go.mod h1:hEPDPrbYw3vyrm5VOa36GyS4bHWuIf4Fflp7460QQXY=
github.com/blevesearch/bleve/v2 v2.4.4 h1:RwwLGjUm54SwyyykbrZs4vc1qjzYic4ZnAnY9TwNl60=
github.com/blevesearch/bleve/v2 v2.4.4/go.mod h1:fa2Eo6DP7JR+dMFpQe+WiZXINKSunh7WBtlDGbolKXk=
github.com/blevesearch/bleve_index_api v1.1.12 h1:P4bw9/G/5rulOF7SJ9l4FsDoo7UFJ+5kexNy1RXfegY=
github.com/blevesearch/bleve_index_api v1.1.12/go.mod h1:PbcwjIcRmjhGbkS/lJCpfgVSMROV6TRubGGAODaK1W8=
github.com/blevesearch/geo v0.1.20 h1:paaSpu2Ewh/tn5DKn/FB5SzvH0EWupxHEIwbCk/QPqM=
github.com/blevesearch/geo v0.1.20/go.mod h1:DVG2QjwHNMFmjo+ZgzrIq2sfCh6rIHzy9d9d0B59I6w=
github.com/blevesearch/go-faiss v1.0.23 h1:Wmc5AFwDLKGl2L6mjLX1Da3vCL0EKa2uHHSorcIS1Uc=
github.com/blevesearch/go-faiss v1.0.23/go.mod h1:OMGQwOaRRYxrmeNdMrXJPvVx8gBnvE5RYrr0BahNnkk=
github.com/blevesearch/go-faiss v1.0.24 h1:K79IvKjoKHdi7FdiXEsAhxpMuns0x4fM0BO93bW5jLI=
github.com/blevesearch/go-faiss v1.0.24/go.mod h1:OMGQwOaRRYxrmeNdMrXJPvVx8gBnvE5RYrr0BahNnkk=
github.com/blevesearch/go-porterstemmer v1.0.3 h1:GtmsqID0aZdCSNiY8SkuPJ12pD4jI+DdXTAn4YRcHCo=
github.com/blevesearch/go-porterstemmer v1.0.3/go.mod h1:angGc5Ht+k2xhJdZi511LtmxuEf0OVpvUUNrwmM1P7M=
github.com/blevesearch/gtreap v0.1.1 h1:2JWigFrzDMR+42WGIN/V2p0cUvn4UP3C4Q5nmaZGW8Y=
@ -134,8 +134,8 @@ github.com/blevesearch/zapx/v14 v14.3.10 h1:SG6xlsL+W6YjhX5N3aEiL/2tcWh3DO75Bnz7
github.com/blevesearch/zapx/v14 v14.3.10/go.mod h1:qqyuR0u230jN1yMmE4FIAuCxmahRQEOehF78m6oTgns=
github.com/blevesearch/zapx/v15 v15.3.16 h1:Ct3rv7FUJPfPk99TI/OofdC+Kpb4IdyfdMH48sb+FmE=
github.com/blevesearch/zapx/v15 v15.3.16/go.mod h1:Turk/TNRKj9es7ZpKK95PS7f6D44Y7fAFy8F4LXQtGg=
github.com/blevesearch/zapx/v16 v16.1.8 h1:Bxzpw6YQpFs7UjoCV1+RvDw6fmAT2GZxldwX8b3wVBM=
github.com/blevesearch/zapx/v16 v16.1.8/go.mod h1:JqQlOqlRVaYDkpLIl3JnKql8u4zKTNlVEa3nLsi0Gn8=
github.com/blevesearch/zapx/v16 v16.1.9-0.20241217210638-a0519e7caf3b h1:ju9Az5YgrzCeK3M1QwvZIpxYhChkXp7/L0RhDYsxXoE=
github.com/blevesearch/zapx/v16 v16.1.9-0.20241217210638-a0519e7caf3b/go.mod h1:BlrYNpOu4BvVRslmIG+rLtKhmjIaRhIbG8sb9scGTwI=
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs=
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
@ -236,8 +236,8 @@ github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73/go.mod h1:jyveZeGw5La
github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA=
github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/go-chi/chi/v5 v5.0.1/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0=
github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
github.com/go-co-op/gocron v1.37.0 h1:ZYDJGtQ4OMhTLKOKMIch+/CY70Brbb1dGdooLEhh7b0=
@ -857,8 +857,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ=
google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View file

@ -36,6 +36,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578000
-
id: 2
@ -74,6 +75,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578010
-
id: 3
@ -111,6 +113,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578020
-
id: 4
@ -148,6 +151,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578030
-
id: 5
@ -185,6 +189,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578040
-
id: 6
@ -222,6 +227,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578050
-
id: 7
@ -259,6 +265,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578060
-
id: 8
@ -296,6 +303,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578070
-
id: 9
@ -333,7 +341,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1730468968
created_unix: 1672578080
-
id: 10
@ -371,6 +379,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578090
-
id: 11
@ -408,6 +417,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578100
-
id: 12
@ -445,6 +455,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578110
-
id: 13
@ -482,6 +493,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578120
-
id: 14
@ -519,6 +531,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578130
-
id: 15
@ -556,6 +569,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578140
-
id: 16
@ -593,6 +607,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578150
-
id: 17
@ -630,6 +645,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578160
-
id: 18
@ -667,6 +683,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578170
-
id: 19
@ -704,6 +721,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578180
-
id: 20
@ -741,6 +759,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578190
-
id: 21
@ -778,6 +797,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578200
-
id: 22
@ -815,6 +835,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578210
-
id: 23
@ -852,6 +873,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578220
-
id: 24
@ -889,6 +911,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578230
-
id: 25
@ -926,6 +949,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578240
-
id: 26
@ -963,6 +987,7 @@
repo_admin_change_team_access: true
theme: ""
keep_activity_private: false
created_unix: 1672578250
-
id: 27
@ -1000,6 +1025,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578260
-
id: 28
@ -1037,6 +1063,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578270
-
id: 29
@ -1074,6 +1101,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578280
-
id: 30
@ -1111,6 +1139,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578290
-
id: 31
@ -1148,6 +1177,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578300
-
id: 32
@ -1185,6 +1215,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578310
-
id: 33
@ -1222,6 +1253,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578320
-
id: 34
@ -1260,6 +1292,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578330
-
id: 35
@ -1297,6 +1330,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578340
-
id: 36
@ -1334,6 +1368,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578350
-
id: 37
@ -1371,6 +1406,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578360
-
id: 38
@ -1408,6 +1444,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578370
-
id: 39
@ -1445,6 +1482,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578380
-
id: 40
@ -1482,6 +1520,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578390
-
id: 41
@ -1519,3 +1558,4 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
created_unix: 1672578400

View file

@ -771,11 +771,11 @@ func TestGetInactiveUsers(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
// all inactive users
// user1's createdunix is 1730468968
// user1's createdunix is 1672578000
users, err := user_model.GetInactiveUsers(db.DefaultContext, 0)
require.NoError(t, err)
assert.Len(t, users, 1)
interval := time.Now().Unix() - 1730468968 + 3600*24
interval := time.Now().Unix() - 1672578000 + 3600*24
users, err = user_model.GetInactiveUsers(db.DefaultContext, time.Duration(interval*int64(time.Second)))
require.NoError(t, err)
require.Empty(t, users)

View file

@ -1,3 +1,5 @@
//go:build !go1.24
// Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

View file

@ -0,0 +1,38 @@
//go:build go1.24
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package log
import "unsafe"
//go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel
func runtime_getProfLabel() unsafe.Pointer //nolint
// Struct definitions copied from: https://github.com/golang/go/blob/ca63101df47a4467bc80faa654fc19d68e583952/src/runtime/pprof/label.go
type label struct {
key string
value string
}
type LabelSet struct {
list []label
}
type labelMap struct {
LabelSet
}
func getGoroutineLabels() map[string]string {
l := (*labelMap)(runtime_getProfLabel())
if l == nil {
return nil
}
m := make(map[string]string, len(l.list))
for _, label := range l.list {
m[label.key] = label.value
}
return m
}

View file

@ -823,7 +823,7 @@ manage_emails = Manage email addresses
manage_themes = Default theme
manage_openid = OpenID addresses
email_desc = Your primary email address will be used for notifications, password recovery and, provided that it is not hidden, web-based Git operations.
theme_desc = This will be your default theme across the site.
theme_desc = This theme will be used for the web interface when you are logged in.
primary = Primary
activated = Activated
requires_activation = Requires activation
@ -1052,7 +1052,7 @@ admin.update_flags = Update flags
admin.failed_to_replace_flags = Failed to replace repository flags
admin.flags_replaced = Repository flags replaced
new_repo_helper = A repository contains all project files, including revision history. Already hosting one elsewhere? <a href="%s">Migrate repository.</a>
new_repo_helper = A repository contains all project files, including revision history. Already hosting one elsewhere? <a href="%s">Migrate repository</a>.
owner = Owner
owner_helper = Some organizations may not show up in the dropdown due to a maximum repository count limit.
repo_name = Repository name
@ -1093,7 +1093,7 @@ issue_labels = Labels
issue_labels_helper = Select a label set
license = License
license_helper = Select a license file
license_helper_desc = A license governs what others can and can't do with your code. Not sure which one is right for your project? See <a target="_blank" rel="noopener noreferrer" href="%s">Choose a license.</a>
license_helper_desc = A license governs what others can and can't do with your code. Not sure which one is right for your project? See <a target="_blank" rel="noopener noreferrer" href="%s">Choose a license</a>.
object_format = Object format
object_format_helper = Object format of the repository. Cannot be changed later. SHA1 is the most compatible.
readme = README
@ -2584,12 +2584,12 @@ settings.archive.text = Archiving the repo will make it entirely read-only. It w
settings.archive.success = The repo was successfully archived.
settings.archive.error = An error occurred while trying to archive the repo. See the log for more details.
settings.archive.error_ismirror = You cannot archive a mirrored repo.
settings.archive.branchsettings_unavailable = Branch settings are not available if the repo is archived.
settings.archive.tagsettings_unavailable = Tag settings are not available if the repo is archived.
settings.archive.mirrors_unavailable = Mirrors are not available if the repo is archived.
settings.archive.branchsettings_unavailable = Branch settings are not available in archived repos.
settings.archive.tagsettings_unavailable = Tag settings are not available in archived repos.
settings.archive.mirrors_unavailable = Mirrors are not available in archived repos.
settings.unarchive.button = Unarchive repo
settings.unarchive.header = Unarchive this repo
settings.unarchive.text = Unarchiving the repo will restore its ability to receive commits and pushes, as well as new issues and pull-requests.
settings.unarchive.text = Unarchiving the repo will restore its ability to receive commits and pushes, as well as new issues and pull requests.
settings.unarchive.success = The repo was successfully unarchived.
settings.unarchive.error = An error occurred while trying to unarchive the repo. See the log for more details.
settings.update_avatar_success = The repository avatar has been updated.
@ -3631,7 +3631,7 @@ alpine.registry = Setup this registry by adding the url in your <code>/etc/apk/r
alpine.registry.key = Download the registry public RSA key into the <code>/etc/apk/keys/</code> folder to verify the index signature:
alpine.registry.info = Choose $branch and $repository from the list below.
alpine.install = To install the package, run the following command:
alpine.repository = Repository Info
alpine.repository = Repository info
alpine.repository.branches = Branches
alpine.repository.repositories = Repositories
alpine.repository.architectures = Architectures
@ -3640,7 +3640,7 @@ arch.pacman.repo.multi = %s has the same version in different distributions.
arch.pacman.repo.multi.item = Configuration for %s
arch.pacman.conf = Add server with related distribution and architecture to <code>/etc/pacman.conf</code> :
arch.pacman.sync = Sync package with pacman:
arch.version.properties = Version Properties
arch.version.properties = Version properties
arch.version.description = Description
arch.version.provides = Provides
arch.version.groups = Group
@ -3658,19 +3658,19 @@ chef.install = To install the package, run the following command:
composer.registry = Setup this registry in your <code>~/.composer/config.json</code> file:
composer.install = To install the package using Composer, run the following command:
composer.dependencies = Dependencies
composer.dependencies.development = Development Dependencies
composer.dependencies.development = Development dependencies
conan.details.repository = Repository
conan.registry = Setup this registry from the command line:
conan.install = To install the package using Conan, run the following command:
conda.registry = Setup this registry as a Conda repository in your <code>.condarc</code> file:
conda.install = To install the package using Conda, run the following command:
container.images.title = Images
container.details.type = Image Type
container.details.type = Image type
container.details.platform = Platform
container.pull = Pull the image from the command line:
container.digest = Digest
container.multi_arch = OS / Arch
container.layers = Image Layers
container.layers = Image layers
container.labels = Labels
container.labels.key = Key
container.labels.value = Value
@ -3698,10 +3698,10 @@ npm.registry = Setup this registry in your project <code>.npmrc</code> file:
npm.install = To install the package using npm, run the following command:
npm.install2 = or add it to the package.json file:
npm.dependencies = Dependencies
npm.dependencies.development = Development Dependencies
npm.dependencies.bundle = Bundled Dependencies
npm.dependencies.peer = Peer Dependencies
npm.dependencies.optional = Optional Dependencies
npm.dependencies.development = Development dependencies
npm.dependencies.bundle = Bundled dependencies
npm.dependencies.peer = Peer dependencies
npm.dependencies.optional = Optional dependencies
npm.details.tag = Tag
pub.install = To install the package using Dart, run the following command:
pypi.requires = Requires Python
@ -3715,8 +3715,8 @@ rpm.repository.architectures = Architectures
rpm.repository.multiple_groups = This package is available in multiple groups.
rubygems.install = To install the package using gem, run the following command:
rubygems.install2 = or add it to the Gemfile:
rubygems.dependencies.runtime = Runtime Dependencies
rubygems.dependencies.development = Development Dependencies
rubygems.dependencies.runtime = Runtime dependencies
rubygems.dependencies.development = Development dependencies
rubygems.required.ruby = Requires Ruby version
rubygems.required.rubygems = Requires RubyGem version
swift.registry = Setup this registry from the command line:

26
options/locale/readme.md Normal file
View file

@ -0,0 +1,26 @@
# Forgejo translations
This directory contains all .INI translations.
## Working on base language
When you work on Forgejo features, you should only modify `locale_en-US.ini`.
* consult https://forgejo.org/docs/next/contributor/localization-english/
* add strings when your change requires doing so
* remove strings when your change renders them unused
## Working on other languages
Translations are done on Codeberg Translate and not via individual pull requests.
* consult https://forgejo.org/docs/next/contributor/localization/
* see the project: https://translate.codeberg.org/projects/forgejo/forgejo/
## Attribution
Forgejo translators are attributed in commit messages and in monthly updates on the website.
Gitea translators are mostly not attributed in this repository because Gitea translation commits are lacking attribution, but it may be preserved on Crowdin.
This directory contains a legacy `TRANSLATORS` file from the Gogs era. It is opt-in and is not actively maintained.

2288
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,7 @@
"@github/relative-time-element": "4.4.4",
"@github/text-expander-element": "2.8.0",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@primer/octicons": "19.13.0",
"@primer/octicons": "19.14.0",
"ansi_up": "6.0.2",
"asciinema-player": "3.8.0",
"chart.js": "4.4.5",
@ -29,7 +29,7 @@
"htmx.org": "1.9.12",
"idiomorph": "0.3.0",
"jquery": "3.7.1",
"katex": "0.16.15",
"katex": "0.16.17",
"mermaid": "11.4.1",
"mini-css-extract-plugin": "2.9.2",
"minimatch": "10.0.1",
@ -42,7 +42,7 @@
"pretty-ms": "9.0.0",
"sortablejs": "1.15.6",
"swagger-ui-dist": "5.17.14",
"tailwindcss": "3.4.16",
"tailwindcss": "3.4.17",
"throttle-debounce": "5.0.0",
"tinycolor2": "1.6.0",
"tippy.js": "6.3.7",
@ -63,41 +63,41 @@
"@eslint-community/eslint-plugin-eslint-comments": "4.4.1",
"@playwright/test": "1.48.2",
"@stoplight/spectral-cli": "6.14.2",
"@stylistic/eslint-plugin-js": "2.10.1",
"@stylistic/eslint-plugin-js": "2.12.1",
"@stylistic/stylelint-plugin": "3.1.1",
"@typescript-eslint/parser": "8.14.0",
"@typescript-eslint/parser": "8.18.1",
"@vitejs/plugin-vue": "5.1.5",
"@vitest/coverage-v8": "2.1.4",
"@vitest/eslint-plugin": "1.1.13",
"@vitest/coverage-v8": "2.1.8",
"@vitest/eslint-plugin": "1.1.16",
"@vue/test-utils": "2.4.6",
"eslint": "9.14.0",
"eslint-import-resolver-typescript": "3.6.3",
"eslint": "9.17.0",
"eslint-import-resolver-typescript": "3.7.0",
"eslint-plugin-array-func": "5.0.2",
"eslint-plugin-import-x": "4.4.2",
"eslint-plugin-no-jquery": "3.0.2",
"eslint-plugin-import-x": "4.5.1",
"eslint-plugin-no-jquery": "3.1.0",
"eslint-plugin-no-use-extend-native": "0.7.2",
"eslint-plugin-playwright": "2.0.1",
"eslint-plugin-regexp": "2.6.0",
"eslint-plugin-sonarjs": "2.0.4",
"eslint-plugin-unicorn": "56.0.0",
"eslint-plugin-playwright": "2.1.0",
"eslint-plugin-regexp": "2.7.0",
"eslint-plugin-sonarjs": "3.0.1",
"eslint-plugin-unicorn": "56.0.1",
"eslint-plugin-vitest-globals": "1.5.0",
"eslint-plugin-vue": "9.31.0",
"eslint-plugin-vue-scoped-css": "2.8.1",
"eslint-plugin-vue": "9.32.0",
"eslint-plugin-vue-scoped-css": "2.9.0",
"eslint-plugin-wc": "2.2.0",
"globals": "15.13.0",
"happy-dom": "15.11.7",
"license-checker-rseidelsohn": "4.4.2",
"markdownlint-cli": "0.42.0",
"markdownlint-cli": "0.43.0",
"postcss-html": "1.7.0",
"stylelint": "16.10.0",
"stylelint": "16.12.0",
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
"stylelint-declaration-strict-value": "1.10.6",
"stylelint-value-no-unknown-custom-properties": "6.0.1",
"svgo": "3.2.0",
"typescript": "5.7.2",
"typescript-eslint": "8.14.0",
"typescript-eslint": "8.18.1",
"vite-string-plugin": "1.3.4",
"vitest": "2.1.4"
"vitest": "2.1.8"
},
"browserslist": [
"defaults"

View file

@ -416,6 +416,11 @@ func SearchUsers(ctx *context.APIContext) {
// in: query
// description: user's login name to search for
// type: string
// - name: sort
// in: query
// description: sort order of results
// type: string
// enum: [oldest, newest, alphabetically, reversealphabetically, recentupdate, leastupdate]
// - name: page
// in: query
// description: page number of results to return (1-based)
@ -431,6 +436,27 @@ func SearchUsers(ctx *context.APIContext) {
// "$ref": "#/responses/forbidden"
listOptions := utils.GetListOptions(ctx)
sort := ctx.FormString("sort")
var orderBy db.SearchOrderBy
switch sort {
case "oldest":
orderBy = db.SearchOrderByOldest
case "newest":
orderBy = db.SearchOrderByNewest
case "alphabetically":
orderBy = db.SearchOrderByAlphabetically
case "reversealphabetically":
orderBy = db.SearchOrderByAlphabeticallyReverse
case "recentupdate":
orderBy = db.SearchOrderByRecentUpdated
case "leastupdate":
orderBy = db.SearchOrderByLeastUpdated
default:
orderBy = db.SearchOrderByAlphabetically
}
intSource, err := strconv.ParseInt(ctx.FormString("source_id"), 10, 64)
var sourceID optional.Option[int64]
if ctx.FormString("source_id") == "" || err != nil {
@ -444,7 +470,7 @@ func SearchUsers(ctx *context.APIContext) {
Type: user_model.UserTypeIndividual,
LoginName: ctx.FormTrim("login_name"),
SourceID: sourceID,
OrderBy: db.SearchOrderByAlphabetically,
OrderBy: orderBy,
ListOptions: listOptions,
})
if err != nil {

View file

@ -1,6 +1,7 @@
{{if .Permission.CanRead $.UnitTypeCode}}
<div id="repo-contributors-chart"
data-repo-link="{{.RepoLink}}"
data-repo-default-branch-name="{{.Repository.DefaultBranch}}"
data-locale-filter-label="{{ctx.Locale.Tr "repo.contributors.contribution_type.filter_label"}}"
data-locale-contribution-type-commits="{{ctx.Locale.Tr "repo.contributors.contribution_type.commits"}}"
data-locale-contribution-type-additions="{{ctx.Locale.Tr "repo.contributors.contribution_type.additions"}}"

View file

@ -90,7 +90,7 @@
{{template "repo/issue/comment_tab" .}}
{{.CsrfTokenHtml}}
<div class="field footer">
<div class="text right">
<div class="right button-sequence">
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}}
{{if .Issue.IsClosed}}
<button id="status-button" class="ui primary basic button" data-status="{{ctx.Locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen">

View file

@ -106,7 +106,7 @@
</div>
{{end}}
</div>
<div class="code-comment-buttons tw-flex tw-items-center tw-flex-wrap tw-mt-2 tw-mb-1 tw-mx-2">
<div class="tw-flex tw-items-center tw-flex-wrap tw-mt-2 tw-mb-1 tw-mx-2">
<div class="tw-flex-1">
{{if $resolved}}
<div class="ui grey text">
@ -115,7 +115,7 @@
</div>
{{end}}
</div>
<div class="code-comment-buttons-buttons button-row">
<div class="right button-sequence">
{{if and $.CanMarkConversation $isNotPending}}
<button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
{{if $resolved}}

View file

@ -1146,6 +1146,20 @@
"name": "login_name",
"in": "query"
},
{
"enum": [
"oldest",
"newest",
"alphabetically",
"reversealphabetically",
"recentupdate",
"leastupdate"
],
"type": "string",
"description": "sort order of results",
"name": "sort",
"in": "query"
},
{
"type": "integer",
"description": "page number of results to return (1-based)",

View file

@ -0,0 +1,17 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
// @watch start
// web_src/js/features/contributors.js
// web_src/js/components/RepoContributors.vue
// templates/repo/*
// @watch end
import {expect} from '@playwright/test';
import {test} from './utils_e2e.ts';
test('Contributor graph', async ({page}) => {
await page.goto('/user2/commits_search_test/activity/contributors');
await page.getByRole('link', {name: '2 Commits'}).click();
await expect(page.getByRole('cell', {name: 'Bob'})).toHaveCount(2);
});

View file

@ -9,12 +9,15 @@ import (
"net/http"
"strconv"
"testing"
"time"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/tests"
"github.com/stretchr/testify/assert"
@ -132,3 +135,64 @@ func TestSourceId(t *testing.T) {
assert.Len(t, users, 1)
assert.Equal(t, "ausersourceid23", users[0].UserName)
}
func TestAdminViewUsersSorted(t *testing.T) {
defer tests.PrepareTestEnv(t)()
createTimestamp := time.Now().Unix() - 1000
updateTimestamp := time.Now().Unix() - 500
sess := db.GetEngine(context.Background())
// Create 10 users with login source 44
for i := int64(1); i <= 10; i++ {
name := "sorttest" + strconv.Itoa(int(i))
user := &user_model.User{
Name: name,
LowerName: name,
LoginName: name,
Email: name + "@example.com",
Passwd: name + ".password",
Type: user_model.UserTypeIndividual,
LoginType: auth_model.OAuth2,
LoginSource: 44,
CreatedUnix: timeutil.TimeStamp(createTimestamp - i),
UpdatedUnix: timeutil.TimeStamp(updateTimestamp - i),
}
if _, err := sess.NoAutoTime().Insert(user); err != nil {
t.Fatalf("Failed to create user: %v", err)
}
}
session := loginUser(t, "user1")
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeReadAdmin)
testCases := []struct {
loginSource int64
sortType string
expectedUsers []string
}{
{0, "alphabetically", []string{"the_34-user.with.all.allowedChars", "user1", "user10", "user11"}},
{0, "reversealphabetically", []string{"user9", "user8", "user5", "user40"}},
{0, "newest", []string{"user40", "user39", "user38", "user37"}},
{0, "oldest", []string{"user1", "user2", "user4", "user5"}},
{44, "recentupdate", []string{"sorttest1", "sorttest2", "sorttest3", "sorttest4"}},
{44, "leastupdate", []string{"sorttest10", "sorttest9", "sorttest8", "sorttest7"}},
}
for _, testCase := range testCases {
req := NewRequest(
t,
"GET",
fmt.Sprintf("/api/v1/admin/users?sort=%s&limit=4&source_id=%d",
testCase.sortType,
testCase.loginSource),
).AddTokenAuth(token)
resp := session.MakeRequest(t, req, http.StatusOK)
var users []api.User
DecodeJSON(t, resp, &users)
assert.Len(t, users, 4)
for i, user := range users {
assert.Equalf(t, testCase.expectedUsers[i], user.UserName, "Sort type: %s, index %d", testCase.sortType, i)
}
}
}

View file

@ -902,7 +902,7 @@ func TestRepoFollowSymlink(t *testing.T) {
symlinkURL, ok := htmlDoc.Find(".file-actions .button[data-kind='follow-symlink']").Attr("href")
if shouldExist {
assert.True(t, ok)
assert.Equal(t, expectedSymlinkURL, symlinkURL) //nolint:testifylint // false positive https://github.com/Antonboom/testifylint/issues/72#issuecomment-2467548358
assert.Equal(t, expectedSymlinkURL, symlinkURL)
} else {
assert.False(t, ok)
}

View file

@ -250,6 +250,20 @@ h1.error-code {
gap: 0.5rem;
}
.button-sequence {
display: flex;
flex-flow: wrap;
gap: 0.5em;
}
.button-sequence.right {
justify-content: end;
}
.button-sequence .ui.button {
margin: 0 !important;
}
.button-row .ui.button {
margin-right: 0;
}

View file

@ -925,16 +925,6 @@ td .commit-summary {
border-radius: var(--border-radius);
}
@media (max-width: 767.98px) {
.repository.view.issue .comment-list .comment .content .form .button {
width: 100%;
margin: 0;
}
.repository.view.issue .comment-list .comment .content .form .button:not(:last-child) {
margin-bottom: 1rem;
}
}
.repository.view.issue .comment-list .comment .merge-section {
background-color: var(--color-box-body);
}

View file

@ -76,19 +76,6 @@
max-width: none;
padding: 0.75rem !important;
}
.comment-code-cloud .code-comment-buttons {
margin: 0.5rem 0 0.25rem !important;
}
.comment-code-cloud .code-comment-buttons .code-comment-buttons-buttons {
width: 100%;
}
.comment-code-cloud .ui.buttons {
width: 100%;
margin: 0 !important;
}
.comment-code-cloud .ui.buttons .button {
flex: 1;
}
}
.comment-code-cloud .comments .comment {
@ -183,14 +170,6 @@
display: block;
}
@media (max-width: 767.98px) {
.comment-code-cloud .button {
width: 100%;
margin: 0 !important;
margin-bottom: 0.75rem !important;
}
}
.diff-file-body .comment-form {
margin: 0 0 0 3em;
}

View file

@ -1,5 +1,6 @@
<script>
import {SvgIcon} from '../svg.js';
import dayjs from 'dayjs';
import {
Chart,
Title,
@ -22,6 +23,7 @@ import {chartJsColors} from '../utils/color.js';
import {sleep} from '../utils.js';
import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm';
import $ from 'jquery';
import {pathEscapeSegments} from '../utils/url.js';
const customEventListener = {
id: 'customEventListener',
@ -61,6 +63,10 @@ export default {
type: String,
required: true,
},
repoDefaultBranchName: {
type: String,
required: true,
},
},
data: () => ({
isLoading: false,
@ -96,6 +102,15 @@ export default {
.slice(0, 100);
},
getContributorSearchQuery(contributorEmail) {
const min = dayjs(this.xAxisMin).format('YYYY-MM-DD');
const max = dayjs(this.xAxisMax).format('YYYY-MM-DD');
const params = new URLSearchParams({
'q': `after:${min}, before:${max}, author:${contributorEmail}`,
});
return `${this.repoLink}/commits/branch/${pathEscapeSegments(this.repoDefaultBranchName)}/search?${params.toString()}`;
},
async fetchGraphData() {
this.isLoading = true;
try {
@ -163,7 +178,7 @@ export default {
// for details.
user.max_contribution_type += 1;
filteredData[key] = {...user, weeks: filteredWeeks};
filteredData[key] = {...user, weeks: filteredWeeks, email: key};
}
return filteredData;
@ -376,7 +391,7 @@ export default {
<div class="ui top attached header tw-flex tw-flex-1">
<b class="ui right">#{{ index + 1 }}</b>
<a :href="contributor.home_link">
<img class="ui avatar tw-align-middle" height="40" width="40" :src="contributor.avatar_link">
<img class="ui avatar tw-align-middle" height="40" width="40" :src="contributor.avatar_link" alt="">
</a>
<div class="tw-ml-2">
<a v-if="contributor.home_link !== ''" :href="contributor.home_link"><h4>{{ contributor.name }}</h4></a>
@ -384,7 +399,11 @@ export default {
{{ contributor.name }}
</h4>
<p class="tw-text-12 tw-flex tw-gap-1">
<strong v-if="contributor.total_commits">{{ contributor.total_commits.toLocaleString() }} {{ locale.contributionType.commits }}</strong>
<strong v-if="contributor.total_commits">
<a class="silenced" :href="getContributorSearchQuery(contributor.email)">
{{ contributor.total_commits.toLocaleString() }} {{ locale.contributionType.commits }}
</a>
</strong>
<strong v-if="contributor.total_additions" class="text green">{{ contributor.total_additions.toLocaleString() }}++ </strong>
<strong v-if="contributor.total_deletions" class="text red">
{{ contributor.total_deletions.toLocaleString() }}--</strong>

View file

@ -8,6 +8,7 @@ export async function initRepoContributors() {
try {
const View = createApp(RepoContributors, {
repoLink: el.getAttribute('data-repo-link'),
repoDefaultBranchName: el.getAttribute('data-repo-default-branch-name'),
locale: {
filterLabel: el.getAttribute('data-locale-filter-label'),
contributionType: {

View file

@ -11,7 +11,7 @@ export async function renderMath() {
if (!els.length) return;
const [{default: katex}] = await Promise.all([
import(/* webpackChunkName: "katex" */'katex'),
import(/* webpackChunkName: "katex" */'katex/dist/katex.js'),
import(/* webpackChunkName: "katex" */'katex/dist/katex.css'),
]);