Skip to content

Commit 42f710e

Browse files
committed
Merge branch 'main' of https://github.com/go-gitea/gitea into feature-user-webhooks
2 parents 78772e1 + a1fcb1c commit 42f710e

File tree

499 files changed

+6455
-3432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

499 files changed

+6455
-3432
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ steps:
555555

556556
# TODO: We should probably build all dependencies into a test image
557557
- name: test-e2e
558-
image: mcr.microsoft.com/playwright:v1.29.0-focal
558+
image: mcr.microsoft.com/playwright:v1.29.2-focal
559559
commands:
560560
- curl -sLO https://go.dev/dl/go1.19.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
561561
- groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea

.eslintrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ rules:
8484
id-length: [0]
8585
id-match: [0]
8686
implicit-arrow-linebreak: [0]
87+
import/consistent-type-specifier-style: [0]
8788
import/default: [0]
8889
import/dynamic-import-chunkname: [0]
8990
import/export: [2]
@@ -103,6 +104,7 @@ rules:
103104
import/no-default-export: [0]
104105
import/no-deprecated: [0]
105106
import/no-dynamic-require: [0]
107+
import/no-empty-named-blocks: [2]
106108
import/no-extraneous-dependencies: [2]
107109
import/no-import-module-exports: [0]
108110
import/no-internal-modules: [0]

.gitpod.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ tasks:
77
command: |
88
gp sync-done setup
99
exit 0
10-
- name: Run frontend
11-
command: |
12-
gp sync-await setup
13-
make watch-frontend
1410
- name: Run backend
1511
command: |
1612
gp sync-await setup
@@ -19,9 +15,15 @@ tasks:
1915
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
2016
export TAGS="sqlite sqlite_unlock_notify"
2117
make watch-backend
18+
- name: Run frontend
19+
command: |
20+
gp sync-await setup
21+
make watch-frontend
22+
openMode: split-right
2223
- name: Run docs
2324
before: sudo bash -c "$(grep 'https://github.com/gohugoio/hugo/releases/download' Makefile | tr -d '\')" # install hugo
2425
command: cd docs && make clean update && hugo server -D -F --baseUrl $(gp url 1313) --liveReloadPort=443 --appendPort=false --bind=0.0.0.0
26+
openMode: split-right
2527

2628
vscode:
2729
extensions:

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,47 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.18.1](https://github.com/go-gitea/gitea/releases/tag/v1.18.1) - 2023-01-17
8+
9+
* API
10+
* Add `sync_on_commit` option for push mirrors api (#22271) (#22292)
11+
* BUGFIXES
12+
* Update `github.com/zeripath/zapx/v15` (#22485)
13+
* Fix pull request API field `closed_at` always being `null` (#22482) (#22483)
14+
* Fix container blob mount (#22226) (#22476)
15+
* Fix error when calculating repository size (#22392) (#22474)
16+
* Fix Operator does not exist bug on explore page with ONLY_SHOW_RELEVANT_REPOS (#22454) (#22472)
17+
* Fix environments for KaTeX and error reporting (#22453) (#22473)
18+
* Remove the netgo tag for Windows build (#22467) (#22468)
19+
* Fix migration from GitBucket (#22477) (#22465)
20+
* Prevent panic on looking at api "git" endpoints for empty repos (#22457) (#22458)
21+
* Fix PR status layout on mobile (#21547) (#22441)
22+
* Fix wechatwork webhook sends empty content in PR review (#21762) (#22440)
23+
* Remove duplicate "Actions" label in mobile view (#21974) (#22439)
24+
* Fix leaving organization bug on user settings -> orgs (#21983) (#22438)
25+
* Fixed colour transparency regex matching in project board sorting (#22092) (#22437)
26+
* Correctly handle select on multiple channels in Queues (#22146) (#22428)
27+
* Prepend refs/heads/ to issue template refs (#20461) (#22427)
28+
* Restore function to "Show more" buttons (#22399) (#22426)
29+
* Continue GCing other repos on error in one repo (#22422) (#22425)
30+
* Allow HOST has no port (#22280) (#22409)
31+
* Fix omit avatar_url in discord payload when empty (#22393) (#22394)
32+
* Don't display stop watch top bar icon when disabled and hidden when click other place (#22374) (#22387)
33+
* Don't lookup mail server when using sendmail (#22300) (#22383)
34+
* Fix gravatar disable bug (#22337)
35+
* Fix update settings table on install (#22326) (#22327)
36+
* Fix sitemap (#22272) (#22320)
37+
* Fix code search title translation (#22285) (#22316)
38+
* Fix due date rendering the wrong date in issue (#22302) (#22306)
39+
* Fix get system setting bug when enabled redis cache (#22298)
40+
* Fix bug of DisableGravatar default value (#22297)
41+
* Fix key signature error page (#22229) (#22230)
42+
* TESTING
43+
* Remove test session cache to reduce possible concurrent problem (#22199) (#22429)
44+
* MISC
45+
* Restore previous official review when an official review is deleted (#22449) (#22460)
46+
* Log STDERR of external renderer when it fails (#22442) (#22444)
47+
748
## [1.18.0](https://github.com/go-gitea/gitea/releases/tag/v1.18.0) - 2022-12-29
849

950
* SECURITY

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,9 @@ $(DIST_DIRS):
758758

759759
.PHONY: release-windows
760760
release-windows: | $(DIST_DIRS)
761-
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
761+
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) .
762762
ifeq (,$(findstring gogit,$(TAGS)))
763-
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo gogit $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION)-gogit .
763+
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'osusergo gogit $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION)-gogit .
764764
endif
765765
ifeq ($(CI),true)
766766
cp /build/* $(DIST)/binaries

build/generate-bindata.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ func needsUpdate(dir, filename string) (bool, []byte) {
3232

3333
hasher := sha1.New()
3434

35-
err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
35+
err = filepath.WalkDir(dir, func(path string, d os.DirEntry, err error) error {
3636
if err != nil {
3737
return err
3838
}
39-
_, _ = hasher.Write([]byte(info.Name()))
39+
info, err := d.Info()
40+
if err != nil {
41+
return err
42+
}
43+
_, _ = hasher.Write([]byte(d.Name()))
4044
_, _ = hasher.Write([]byte(info.ModTime().String()))
4145
_, _ = hasher.Write([]byte(strconv.FormatInt(info.Size(), 16)))
4246
return nil

contrib/gitea-monitoring-mixin/dashboards/overview.libsonnet

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ local addIssueLabelsOverrides(labels) =
2929

3030
grafanaDashboards+:: {
3131

32-
local giteaSelector = 'job="$job", instance="$instance"',
32+
local giteaSelector = 'job=~"$job", instance=~"$instance"',
3333
local giteaStatsPanel =
3434
grafana.statPanel.new(
3535
'Gitea stats',
@@ -399,25 +399,31 @@ local addIssueLabelsOverrides(labels) =
399399
.addTemplate(
400400
{
401401
hide: 0,
402-
label: null,
402+
label: 'job',
403403
name: 'job',
404404
options: [],
405+
datasource: '$datasource',
405406
query: 'label_values(gitea_organizations, job)',
406407
refresh: 1,
407408
regex: '',
408409
type: 'query',
410+
multi: true,
411+
allValue: '.+'
409412
},
410413
)
411414
.addTemplate(
412415
{
413416
hide: 0,
414-
label: null,
417+
label: 'instance',
415418
name: 'instance',
416419
options: [],
420+
datasource: '$datasource',
417421
query: 'label_values(gitea_organizations{job="$job"}, instance)',
418422
refresh: 1,
419423
regex: '',
420424
type: 'query',
425+
multi: true,
426+
allValue: '.+'
421427
},
422428
)
423429
.addTemplate(

custom/conf/app.example.ini

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,28 @@ ROUTER = console
22132213
;SCHEDULE = @every 168h
22142214
;OLDER_THAN = 8760h
22152215

2216+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2217+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2218+
;; Garbage collect LFS pointers in repositories
2219+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2220+
;[cron.gc_lfs]
2221+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2222+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2223+
;ENABLED = false
2224+
;; Garbage collect LFS pointers in repositories (default false)
2225+
;RUN_AT_START = false
2226+
;; Interval as a duration between each gc run (default every 24h)
2227+
;SCHEDULE = @every 24h
2228+
;; Only attempt to garbage collect LFSMetaObjects older than this (default 7 days)
2229+
;OLDER_THAN = 168h
2230+
;; Only attempt to garbage collect LFSMetaObjects that have not been attempted to be garbage collected for this long (default 3 days)
2231+
;LAST_UPDATED_MORE_THAN_AGO = 72h
2232+
; Minimum number of stale LFSMetaObjects to check per repo. Set to `0` to always check all.
2233+
;NUMBER_TO_CHECK_PER_REPO = 100
2234+
;Check at least this proportion of LFSMetaObjects per repo. (This may cause all stale LFSMetaObjects to be checked.)
2235+
;PROPORTION_TO_CHECK_PER_REPO = 0.6
2236+
2237+
22162238
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22172239
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22182240
;; Git Operation timeout in seconds

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.18.0
21+
version: 1.18.1
2222
minGoVersion: 1.18
2323
goVersion: 1.19
2424
minNodeVersion: 16

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,16 @@ Default templates for project boards:
10391039
- `SCHEDULE`: **@every 168h**: Cron syntax to set how often to check.
10401040
- `OLDER_THAN`: **@every 8760h**: any system notice older than this expression will be deleted from database.
10411041

1042+
#### Cron - Garbage collect LFS pointers in repositories ('cron.gc_lfs')
1043+
1044+
- `ENABLED`: **false**: Enable service.
1045+
- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED).
1046+
- `SCHEDULE`: **@every 24h**: Cron syntax to set how often to check.
1047+
- `OLDER_THAN`: **168h**: Only attempt to garbage collect LFSMetaObjects older than this (default 7 days)
1048+
- `LAST_UPDATED_MORE_THAN_AGO`: **72h**: Only attempt to garbage collect LFSMetaObjects that have not been attempted to be garbage collected for this long (default 3 days)
1049+
- `NUMBER_TO_CHECK_PER_REPO`: **100**: Minimum number of stale LFSMetaObjects to check per repo. Set to `0` to always check all.
1050+
- `PROPORTION_TO_CHECK_PER_REPO`: **0.6**: Check at least this proportion of LFSMetaObjects per repo. (This may cause all stale LFSMetaObjects to be checked.)
1051+
10421052
## Git (`git`)
10431053

10441054
- `PATH`: **""**: The path of Git executable. If empty, Gitea searches through the PATH environment.

docs/content/doc/developers/oauth2-provider.en-us.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,42 @@ To use the Authorization Code Grant as a third party application it is required
4242

4343
## Scopes
4444

45-
Currently Gitea does not support scopes (see [#4300](https://github.com/go-gitea/gitea/issues/4300)) and all third party applications will be granted access to all resources of the user and their organizations.
45+
Gitea supports the following scopes for tokens:
46+
47+
| Name | Description |
48+
| ---- | ----------- |
49+
| **(no scope)** | Grants read-only access to public user profile and public repositories. |
50+
| **repo** | Full control over all repositories. |
51+
|     **repo:status** | Grants read/write access to commit status in all repositories. |
52+
|     **public_repo** | Grants read/write access to public repositories only. |
53+
| **admin:repo_hook** | Grants access to repository hooks of all repositories. This is included in the `repo` scope. |
54+
|     **write:repo_hook** | Grants read/write access to repository hooks |
55+
|     **read:repo_hook** | Grants read-only access to repository hooks |
56+
| **admin:org** | Grants full access to organization settings |
57+
|     **write:org** | Grants read/write access to organization settings |
58+
|     **read:org** | Grants read-only access to organization settings |
59+
| **admin:public_key** | Grants full access for managing public keys |
60+
|     **write:public_key** | Grant read/write access to public keys |
61+
|     **read:public_key** | Grant read-only access to public keys |
62+
| **admin:org_hook** | Grants full access to organizational-level hooks |
63+
| **admin:user_hook** | Grants full access to user-level hooks |
64+
| **notification** | Grants full access to notifications |
65+
| **user** | Grants full access to user profile info |
66+
|     **read:user** | Grants read access to user's profile |
67+
|     **user:email** | Grants read access to user's email addresses |
68+
|     **user:follow** | Grants access to follow/un-follow a user |
69+
| **delete_repo** | Grants access to delete repositories as an admin |
70+
| **package** | Grants full access to hosted packages |
71+
|     **write:package** | Grants read/write access to packages |
72+
|     **read:package** | Grants read access to packages |
73+
|     **delete:package** | Grants delete access to packages |
74+
| **admin:gpg_key** | Grants full access for managing GPG keys |
75+
|     **write:gpg_key** | Grants read/write access to GPG keys |
76+
|     **read:gpg_key** | Grants read-only access to GPG keys |
77+
| **admin:application** | Grants full access to manage applications |
78+
|     **write:application** | Grants read/write access for managing applications |
79+
|     **read:application** | Grants read access for managing applications |
80+
| **sudo** | Allows to perform actions as the site admin. |
4681

4782
## Client types
4883

docs/content/doc/help/faq.en-us.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ For more information, refer to Gitea's [API docs]({{< relref "doc/developers/api
138138

139139
You can see the latest API (for example) on <https://try.gitea.io/api/swagger>.
140140

141+
You can also see an example of the `swagger.json` file at <https://try.gitea.io/swagger.v1.json>.
142+
141143
## Adjusting your server for public/private use
142144

143145
### Preventing spammers

docs/content/doc/packages/overview.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ and shows a link to the repository on the package site (as well as a link to the
5555

5656
| Package owner type | User | Organization |
5757
|--------------------|------|--------------|
58-
| **read** access | public, if user is public too; otherwise for this user only | public, if org is public, otherwise org members only |
58+
| **read** access | public, if user is public too; otherwise for this user only | public, if org is public, otherwise for org members only |
5959
| **write** access | owner only | org members with admin or write access to the org |
6060

6161
N.B.: These access restrictions are [subject to change](https://github.com/go-gitea/gitea/issues/19270), where more finegrained control will be added via a dedicated organization team permission.
@@ -83,7 +83,7 @@ To download a package from your repository:
8383

8484
## Delete a package
8585

86-
You cannot edit a package after you published it in the Package Registry. Instead, you
86+
You cannot edit a package after you have published it in the Package Registry. Instead, you
8787
must delete and recreate it.
8888

8989
To delete a package from your repository:

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"code.gitea.io/gitea/modules/setting"
1818

1919
// register supported doc types
20+
_ "code.gitea.io/gitea/modules/markup/asciicast"
2021
_ "code.gitea.io/gitea/modules/markup/console"
2122
_ "code.gitea.io/gitea/modules/markup/csv"
2223
_ "code.gitea.io/gitea/modules/markup/markdown"

models/auth/token.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type AccessToken struct {
6565
TokenHash string `xorm:"UNIQUE"` // sha256 of token
6666
TokenSalt string
6767
TokenLastEight string `xorm:"INDEX token_last_eight"`
68+
Scope AccessTokenScope
6869

6970
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
7071
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`

0 commit comments

Comments
 (0)