Skip to content

Commit 16d2d01

Browse files
authored
Merge branch 'main' into feature/issue_22890
2 parents 37d578c + 52e2416 commit 16d2d01

File tree

488 files changed

+9738
-6007
lines changed

Some content is hidden

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

488 files changed

+9738
-6007
lines changed

.drone.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,9 @@ trigger:
10061006
event:
10071007
exclude:
10081008
- cron
1009+
paths:
1010+
exclude:
1011+
- docs/**
10091012

10101013
steps:
10111014
- name: fetch-tags
@@ -1070,6 +1073,9 @@ trigger:
10701073
event:
10711074
exclude:
10721075
- cron
1076+
paths:
1077+
exclude:
1078+
- docs/**
10731079

10741080
steps:
10751081
- name: fetch-tags
@@ -1298,6 +1304,9 @@ trigger:
12981304
event:
12991305
exclude:
13001306
- cron
1307+
paths:
1308+
exclude:
1309+
- docs/**
13011310

13021311
steps:
13031312
- name: fetch-tags
@@ -1362,6 +1371,9 @@ trigger:
13621371
event:
13631372
exclude:
13641373
- cron
1374+
paths:
1375+
exclude:
1376+
- docs/**
13651377

13661378
steps:
13671379
- name: fetch-tags
@@ -1424,6 +1436,9 @@ trigger:
14241436
event:
14251437
exclude:
14261438
- cron
1439+
paths:
1440+
exclude:
1441+
- docs/**
14271442

14281443
steps:
14291444
- name: fetch-tags
@@ -1571,6 +1586,9 @@ trigger:
15711586
event:
15721587
exclude:
15731588
- cron
1589+
paths:
1590+
exclude:
1591+
- docs/**
15741592

15751593
depends_on:
15761594
- docker-linux-amd64-release-version
@@ -1619,6 +1637,9 @@ trigger:
16191637
event:
16201638
exclude:
16211639
- cron
1640+
paths:
1641+
exclude:
1642+
- docs/**
16221643

16231644
depends_on:
16241645
- docker-linux-amd64-release

.gitpod.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ tasks:
1010
- name: Run backend
1111
command: |
1212
gp sync-await setup
13-
mkdir -p custom/conf/
14-
echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini
15-
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
13+
if [ ! -f custom/conf/app.ini ]
14+
then
15+
mkdir -p custom/conf/
16+
echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini
17+
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
18+
fi
1619
export TAGS="sqlite sqlite_unlock_notify"
1720
make watch-backend
1821
- name: Run frontend

.stylelintrc.yaml

Lines changed: 102 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,133 @@
1-
extends: stylelint-config-standard
2-
31
plugins:
42
- stylelint-declaration-strict-value
53

64
overrides:
75
- files: ["**/*.less"]
86
customSyntax: postcss-less
9-
- files: ["**/*.less"]
10-
rules:
11-
scale-unlimited/declaration-strict-value: [color, {
12-
ignoreValues: /^(inherit|transparent|unset|initial)$/
13-
}]
147
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console/*"]
158
rules:
169
scale-unlimited/declaration-strict-value: null
1710

1811
rules:
1912
alpha-value-notation: null
13+
annotation-no-unknown: true
14+
at-rule-allowed-list: null
15+
at-rule-disallowed-list: null
2016
at-rule-empty-line-before: null
21-
block-closing-brace-empty-line-before: null
17+
at-rule-no-unknown: true
18+
at-rule-no-vendor-prefix: true
19+
at-rule-property-required-list: null
20+
block-no-empty: true
2221
color-function-notation: null
22+
color-hex-alpha: null
2323
color-hex-length: null
24+
color-named: null
25+
color-no-hex: null
26+
color-no-invalid-hex: true
2427
comment-empty-line-before: null
28+
comment-no-empty: true
29+
comment-pattern: null
30+
comment-whitespace-inside: null
31+
comment-word-disallowed-list: null
32+
custom-media-pattern: null
33+
custom-property-empty-line-before: null
34+
custom-property-no-missing-var-function: true
35+
custom-property-pattern: null
36+
declaration-block-no-duplicate-custom-properties: true
37+
declaration-block-no-duplicate-properties: [true, {ignore: [consecutive-duplicates-with-different-values]}]
2538
declaration-block-no-redundant-longhand-properties: null
39+
declaration-block-no-shorthand-property-overrides: null
2640
declaration-block-single-line-max-declarations: null
2741
declaration-empty-line-before: null
42+
declaration-no-important: null
43+
declaration-property-max-values: null
44+
declaration-property-unit-allowed-list: null
45+
declaration-property-unit-disallowed-list: null
46+
declaration-property-value-allowed-list: null
47+
declaration-property-value-disallowed-list: null
48+
declaration-property-value-no-unknown: true
49+
font-family-name-quotes: always-where-recommended
50+
font-family-no-duplicate-names: true
51+
font-family-no-missing-generic-family-keyword: true
52+
font-weight-notation: null
53+
function-allowed-list: null
54+
function-calc-no-unspaced-operator: true
55+
function-disallowed-list: null
56+
function-linear-gradient-no-nonstandard-direction: true
57+
function-name-case: lower
2858
function-no-unknown: null
59+
function-url-no-scheme-relative: null
60+
function-url-quotes: always
61+
function-url-scheme-allowed-list: null
62+
function-url-scheme-disallowed-list: null
2963
hue-degree-notation: null
3064
import-notation: string
31-
indentation: 2
32-
max-line-length: null
65+
keyframe-block-no-duplicate-selectors: true
66+
keyframe-declaration-no-important: true
67+
keyframe-selector-notation: null
68+
keyframes-name-pattern: null
69+
length-zero-no-unit: true
70+
max-nesting-depth: null
71+
media-feature-name-allowed-list: null
72+
media-feature-name-disallowed-list: null
73+
media-feature-name-no-unknown: true
74+
media-feature-name-no-vendor-prefix: true
75+
media-feature-name-unit-allowed-list: null
76+
media-feature-name-value-allowed-list: null
77+
media-feature-range-notation: null
78+
named-grid-areas-no-invalid: true
3379
no-descending-specificity: null
80+
no-duplicate-at-import-rules: true
81+
no-duplicate-selectors: true
82+
no-empty-source: true
83+
no-invalid-double-slash-comments: true
3484
no-invalid-position-at-import-rule: null
35-
number-leading-zero: never
85+
no-irregular-whitespace: true
86+
no-unknown-animations: null
3687
number-max-precision: null
88+
property-allowed-list: null
89+
property-disallowed-list: null
90+
property-no-unknown: true
3791
property-no-vendor-prefix: null
3892
rule-empty-line-before: null
93+
rule-selector-property-disallowed-list: null
94+
scale-unlimited/declaration-strict-value: [color, {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor)$/}]
95+
selector-attribute-name-disallowed-list: null
96+
selector-attribute-operator-allowed-list: null
97+
selector-attribute-operator-disallowed-list: null
98+
selector-attribute-quotes: always
3999
selector-class-pattern: null
100+
selector-combinator-allowed-list: null
101+
selector-combinator-disallowed-list: null
102+
selector-disallowed-list: null
40103
selector-id-pattern: null
104+
selector-max-attribute: null
105+
selector-max-class: null
106+
selector-max-combinators: null
107+
selector-max-compound-selectors: null
108+
selector-max-id: null
109+
selector-max-pseudo-class: null
110+
selector-max-specificity: null
111+
selector-max-type: null
112+
selector-max-universal: null
113+
selector-nested-pattern: null
114+
selector-no-qualifying-type: null
115+
selector-no-vendor-prefix: true
116+
selector-not-notation: null
117+
selector-pseudo-class-allowed-list: null
118+
selector-pseudo-class-disallowed-list: null
119+
selector-pseudo-class-no-unknown: true
120+
selector-pseudo-element-allowed-list: null
41121
selector-pseudo-element-colon-notation: double
122+
selector-pseudo-element-disallowed-list: null
123+
selector-pseudo-element-no-unknown: true
124+
selector-type-case: lower
125+
selector-type-no-unknown: [true, {ignore: [custom-elements]}]
42126
shorthand-property-no-redundant-values: true
43-
string-quotes: null
44-
value-no-vendor-prefix: null
127+
string-no-newline: true
128+
time-min-milliseconds: null
129+
unit-allowed-list: null
130+
unit-disallowed-list: null
131+
unit-no-unknown: true
132+
value-keyword-case: null
133+
value-no-vendor-prefix: [true, {ignoreValues: [box, inline-box]}]

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ 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.5](https://github.com/go-gitea/gitea/releases/tag/v1.18.5) - 2023-02-21
8+
9+
* ENHANCEMENTS
10+
* Hide 2FA status from other members in organization members list (#22999) (#23023)
11+
* BUGFIXES
12+
* Add force_merge to merge request and fix checking mergable (#23010) (#23032)
13+
* Use `--message=%s` for git commit message (#23028) (#23029)
14+
* Render access log template as text instead of HTML (#23013) (#23025)
15+
* Fix the Manually Merged form (#23015) (#23017)
16+
* Use beforeCommit instead of baseCommit (#22949) (#22996)
17+
* Display attachments of review comment when comment content is blank (#23035) (#23046)
18+
* Return empty url for submodule tree entries (#23043) (#23048)
19+
720
## [1.18.4](https://github.com/go-gitea/gitea/releases/tag/1.18.4) - 2023-02-20
821

922
* SECURITY

CONTRIBUTING.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,7 @@ known as the release freeze. All the feature pull requests should be
299299
merged before feature freeze. And, during the frozen period, a corresponding
300300
release branch is open for fixes backported from main branch. Release candidates
301301
are made during this period for user testing to
302-
obtain a final version that is maintained in this branch. A release is
303-
maintained by issuing patch releases to only correct critical problems
304-
such as crashes or security issues.
302+
obtain a final version that is maintained in this branch.
305303

306304
Major release cycles are seasonal. They always begin on the 25th and end on
307305
the 24th (i.e., the 25th of December to March 24th).
@@ -311,6 +309,16 @@ for the previous version. For example, if the latest, published release is
311309
v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are
312310
still possible.
313311

312+
The previous release gets fixes for:
313+
314+
- Security issues
315+
- Critical bugs
316+
- Regressions
317+
- Build issues
318+
- Necessary enhancements (including necessary UI/UX fixes)
319+
320+
The backported fixes should avoid breaking downgrade between minor releases as much as possible.
321+
314322
## Maintainers
315323

316324
To make sure every PR is checked, we have [team

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,7 @@ CMD ["/bin/s6-svscan", "/etc/s6"]
6464
COPY docker/root /
6565
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
6666
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
67+
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
6768
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
6869
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
70+
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh

Dockerfile.rootless

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ RUN chown git:git /var/lib/gitea /etc/gitea
5454
COPY docker/rootless /
5555
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
5656
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
57+
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
5758
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-setup.sh /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
59+
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh
5860

5961
#git:git
6062
USER 1000:1000

MAINTAINERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Steven Kriegler <[email protected]> (@justusbunsi)
4444
Jimmy Praet <[email protected]> (@jpraet)
4545
Leon Hofmeister <[email protected]> (@delvh)
4646
Wim <[email protected]> (@42wim)
47-
Xinyu Zhou <[email protected]> (@xin-u)
4847
Jason Song <[email protected]> (@wolfogre)
4948
Yarden Shoham <[email protected]> (@yardenshoham)
5049
Yu Tian <[email protected]> (@Zettat123)
50+
Eddie Yang <[email protected]> (@yp05327)
51+
Dong Ge <[email protected]> (@sillyguodong)
52+
Xinyi Gong <[email protected]> (@HesterG)

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
3232
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected]
3333
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3434
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/[email protected]
35-
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected].3
35+
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected].4
3636
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3737
GO_LICENSES_PACKAGE ?= github.com/google/[email protected]
3838
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@latest
@@ -859,6 +859,8 @@ fomantic:
859859
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
860860
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
861861
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
862+
# fomantic uses "touchstart" as click event for some browsers, it's not ideal, so we force fomantic to always use "click" as click event
863+
$(SED_INPLACE) -e 's/clickEvent[ \t]*=/clickEvent = "click", unstableClickEvent =/g' $(FOMANTIC_WORK_DIR)/build/semantic.js
862864
$(SED_INPLACE) -e 's/\r//g' $(FOMANTIC_WORK_DIR)/build/semantic.css $(FOMANTIC_WORK_DIR)/build/semantic.js
863865
rm -f $(FOMANTIC_WORK_DIR)/build/*.min.*
864866

assets/go-licenses.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/update-locales.sh

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,50 @@
11
#!/bin/sh
22

3+
# this script runs in alpine image which only has `sh` shell
4+
5+
set +e
6+
if sed --version 2>/dev/null | grep -q GNU; then
7+
SED_INPLACE="sed -i"
8+
else
9+
SED_INPLACE="sed -i ''"
10+
fi
11+
set -e
12+
13+
if [ ! -f ./options/locale/locale_en-US.ini ]; then
14+
echo "please run this script in the root directory of the project"
15+
exit 1
16+
fi
17+
318
mv ./options/locale/locale_en-US.ini ./options/
419

5-
# Make sure to only change lines that have the translation enclosed between quotes
6-
sed -i -r -e '/^[a-zA-Z0-9_.-]+[ ]*=[ ]*".*"$/ {
7-
s/^([a-zA-Z0-9_.-]+)[ ]*="/\1=/
8-
s/\\"/"/g
20+
# the "ini" library for locale has many quirks
21+
# * `a="xx"` gets `xx` (no quote)
22+
# * `a=x\"y` gets `x\"y` (no unescaping)
23+
# * `a="x\"y"` gets `"x\"y"` (no unescaping, the quotes are still there)
24+
# * `a='x\"y'` gets `x\"y` (no unescaping, no quote)
25+
# * `a="foo` gets `"foo` (although the quote is not closed)
26+
# * 'a=`foo`' works like single-quote
27+
# crowdin needs the strings to be quoted correctly and doesn't like incomplete quotes
28+
# crowdin always outputs quoted strings if there are quotes in the strings.
29+
30+
# this script helps to unquote the crowdin outputs for the quirky ini library
31+
# * find all `key="...\"..."` lines
32+
# * remove the leading quote
33+
# * remove the trailing quote
34+
# * unescape the quotes
35+
# * eg: key="...\"..." => key=..."...
36+
$SED_INPLACE -r -e '/^[-.A-Za-z0-9_]+[ ]*=[ ]*".*"$/ {
37+
s/^([-.A-Za-z0-9_]+)[ ]*=[ ]*"/\1=/
938
s/"$//
39+
s/\\"/"/g
1040
}' ./options/locale/*.ini
1141

42+
# * if the escaped line is incomplete like `key="...` or `key=..."`, quote it with backticks
43+
# * eg: key="... => key=`"...`
44+
# * eg: key=..." => key=`..."`
45+
$SED_INPLACE -r -e 's/^([-.A-Za-z0-9_]+)[ ]*=[ ]*(".*[^"])$/\1=`\2`/' ./options/locale/*.ini
46+
$SED_INPLACE -r -e 's/^([-.A-Za-z0-9_]+)[ ]*=[ ]*([^"].*")$/\1=`\2`/' ./options/locale/*.ini
47+
1248
# Remove translation under 25% of en_us
1349
baselines=$(wc -l "./options/locale_en-US.ini" | cut -d" " -f1)
1450
baselines=$((baselines / 4))

0 commit comments

Comments
 (0)