Skip to content

Commit 302fe1f

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Add button for issue deletion (go-gitea#19032) Fix script compatiable with OpenWrt (go-gitea#19000) Allow users to self-request a PR review (go-gitea#19030) Fix wrong scopes caused by empty scope input (go-gitea#19029) Feature: show issue assignee on project board (go-gitea#15232) bump go deps (go-gitea#19021) Don't show context cancelled errors in attribute reader (go-gitea#19006) Set `rel="nofollow noindex"` on new issue links (go-gitea#19023) update to correct stable version
2 parents db85844 + ea46142 commit 302fe1f

File tree

19 files changed

+1064
-294
lines changed

19 files changed

+1064
-294
lines changed

contrib/init/openwrt/gitea

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh /etc/rc.common
2+
3+
USE_PROCD=1
4+
5+
# PROCD_DEBUG=1
6+
7+
START=90
8+
STOP=10
9+
10+
PROG=/opt/gitea/gitea
11+
GITEA_WORK_DIR=/opt/gitea
12+
CONF_FILE=$GITEA_WORK_DIR/app.ini
13+
14+
start_service(){
15+
procd_open_instance gitea
16+
procd_set_param env GITEA_WORK_DIR=$GITEA_WORK_DIR
17+
procd_set_param env HOME=$GITEA_WORK_DIR
18+
procd_set_param command $PROG web -c $CONF_FILE
19+
procd_set_param file $CONF_FILE
20+
procd_set_param user git
21+
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} # respawn automatically if something died, be careful if you have an alternative process supervisor
22+
procd_close_instance
23+
}
24+
25+
start(){
26+
service_start $PROG
27+
}
28+
29+
stop(){
30+
service_stop $PROG
31+
}
32+
33+
reload(){
34+
service_reload $PROG
35+
}

contrib/update_dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ grep 'git' go.mod | grep '\.com' | grep -v indirect | grep -v replace | cut -f 2
44
go get -u "$line"
55
make vendor
66
git add .
7-
git commit -S -m "update $line"
7+
git commit -m "update $line"
88
done

contrib/upgrade.sh

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/usr/bin/env bash
2-
set -euo pipefail
3-
42
# This is an update script for gitea installed via the binary distribution
53
# from dl.gitea.io on linux as systemd service. It performs a backup and updates
64
# Gitea in place.
@@ -13,41 +11,83 @@ set -euo pipefail
1311
# upgrade.sh 1.15.10
1412
# giteahome=/opt/gitea giteaconf=$giteahome/app.ini upgrade.sh
1513

14+
while true; do
15+
case "$1" in
16+
-v | --version ) ver="$2"; shift 2 ;;
17+
-y | --yes ) no_confirm="yes"; shift ;;
18+
--ignore-gpg) ignore_gpg="yes"; shift ;;
19+
-- ) shift; break ;;
20+
* ) break ;;
21+
esac
22+
done
23+
24+
set -euo pipefail
25+
26+
27+
function require {
28+
for exe in "$@"; do
29+
command -v "$exe" &>/dev/null || (echo "missing dependency '$exe'"; exit 1)
30+
done
31+
}
32+
33+
34+
require curl xz sha256sum gpg
35+
36+
if [[ -f /etc/os-release ]]; then
37+
os_release=$(cat /etc/os-release)
38+
39+
if [[ "$os_release" =~ "OpenWrt" ]]; then
40+
sudocmd="su"
41+
service_start="/etc/init.d/gitea start"
42+
service_stop="/etc/init.d/gitea stop"
43+
service_status="/etc/init.d/gitea status"
44+
else
45+
require systemctl
46+
fi
47+
fi
48+
49+
1650
# apply variables from environment
1751
: "${giteabin:="/usr/local/bin/gitea"}"
1852
: "${giteahome:="/var/lib/gitea"}"
1953
: "${giteaconf:="/etc/gitea/app.ini"}"
2054
: "${giteauser:="git"}"
2155
: "${sudocmd:="sudo"}"
2256
: "${arch:="linux-amd64"}"
57+
: "${service_start:="$sudocmd systemctl start gitea"}"
58+
: "${service_stop:="$sudocmd systemctl stop gitea"}"
59+
: "${service_status:="$sudocmd systemctl status gitea"}"
2360
: "${backupopts:=""}" # see `gitea dump --help` for available options
2461

25-
function giteacmd {
26-
"$sudocmd" --user "$giteauser" "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@"
27-
}
2862

29-
function require {
30-
for exe in "$@"; do
31-
command -v "$exe" &>/dev/null || (echo "missing dependency '$exe'"; exit 1)
32-
done
63+
function giteacmd {
64+
if [[ $sudocmd = "su" ]]; then
65+
"$sudocmd" - "$giteauser" -c "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@"
66+
else
67+
"$sudocmd" --user "$giteauser" "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@"
68+
fi
3369
}
34-
require systemctl curl xz sha256sum gpg "$sudocmd"
3570

3671
# select version to install
37-
if [[ -z "${1:-}" ]]; then
72+
if [[ -z "${ver:-}" ]]; then
3873
require jq
3974
giteaversion=$(curl --connect-timeout 10 -sL https://dl.gitea.io/gitea/version.json | jq -r .latest.version)
4075
else
41-
giteaversion="$1"
76+
giteaversion="$ver"
4277
fi
4378

79+
4480
# confirm update
45-
current=$(giteacmd --version | cut --delimiter=' ' --fields=3)
81+
current=$(giteacmd --version | cut -d ' ' -f 3)
4682
[[ "$current" == "$giteaversion" ]] && echo "$current is already installed, stopping." && exit 1
47-
echo "Make sure to read the changelog first: https://github.com/go-gitea/gitea/blob/main/CHANGELOG.md"
48-
echo "Are you ready to update Gitea from ${current} to ${giteaversion}? (y/N)"
49-
read -r confirm
50-
[[ "$confirm" == "y" ]] || [[ "$confirm" == "Y" ]] || exit 1
83+
if [[ -z "${no_confirm:-}" ]]; then
84+
echo "Make sure to read the changelog first: https://github.com/go-gitea/gitea/blob/main/CHANGELOG.md"
85+
echo "Are you ready to update Gitea from ${current} to ${giteaversion}? (y/N)"
86+
read -r confirm
87+
[[ "$confirm" == "y" ]] || [[ "$confirm" == "Y" ]] || exit 1
88+
fi
89+
90+
echo "Upgrading gitea from $current to $giteaversion ..."
5191

5292
pushd "$(pwd)" &>/dev/null
5393
cd "$giteahome" # needed for gitea dump later
@@ -59,9 +99,11 @@ echo "Downloading $binurl..."
5999
curl --connect-timeout 10 --silent --show-error --fail --location -O "$binurl{,.sha256,.asc}"
60100

61101
# validate checksum & gpg signature (exit script if error)
62-
sha256sum --check "${binname}.xz.sha256"
63-
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
64-
gpg --verify "${binname}.xz.asc" "${binname}.xz" || { echo 'Signature does not match'; exit 1; }
102+
sha256sum -c "${binname}.xz.sha256"
103+
if [[ -z "${ignore_gpg:-}" ]]; then
104+
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
105+
gpg --verify "${binname}.xz.asc" "${binname}.xz" || { echo 'Signature does not match'; exit 1; }
106+
fi
65107
rm "${binname}".xz.{sha256,asc}
66108

67109
# unpack binary + make executable
@@ -72,12 +114,14 @@ chmod +x "$binname"
72114
# stop gitea, create backup, replace binary, restart gitea
73115
echo "Stopping gitea at $(date)"
74116
giteacmd manager flush-queues
75-
$sudocmd systemctl stop gitea
117+
$service_stop
76118
echo "Creating backup in $giteahome"
77119
giteacmd dump $backupopts
78120
echo "Updating binary at $giteabin"
79-
mv --force --backup "$binname" "$giteabin"
80-
$sudocmd systemctl start gitea
81-
$sudocmd systemctl status gitea
121+
cp -f "$giteabin" "$giteabin.bak" && mv -f "$binname" "$giteabin"
122+
$service_start
123+
$service_status
124+
125+
echo "Upgrade to $giteaversion successful!"
82126

83127
popd

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.16.0
21+
version: 1.16.3
2222
minGoVersion: 1.16
2323
goVersion: 1.17
2424
minNodeVersion: 12.17

go.mod

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,100 +3,100 @@ module code.gitea.io/gitea
33
go 1.16
44

55
require (
6-
cloud.google.com/go v0.78.0 // indirect
76
code.gitea.io/gitea-vet v0.2.2-0.20220122151748-48ebc902541b
87
code.gitea.io/sdk/gitea v0.15.1
98
gitea.com/go-chi/binding v0.0.0-20211013065440-d16dc407c2be
10-
gitea.com/go-chi/cache v0.0.0-20211013020926-78790b11abf1
9+
gitea.com/go-chi/cache v0.0.0-20211201020628-dcb774c4ffea
1110
gitea.com/go-chi/captcha v0.0.0-20211013065431-70641c1a35d5
1211
gitea.com/go-chi/session v0.0.0-20211218221615-e3605d8b28b8
1312
gitea.com/lunny/levelqueue v0.4.1
1413
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121
15-
github.com/Microsoft/go-winio v0.5.0 // indirect
14+
github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e // indirect
15+
github.com/Microsoft/go-winio v0.5.2 // indirect
1616
github.com/NYTimes/gziphandler v1.1.1
17-
github.com/ProtonMail/go-crypto v0.0.0-20210705153151-cc34b1f6908b // indirect
18-
github.com/PuerkitoBio/goquery v1.7.0
17+
github.com/ProtonMail/go-crypto v0.0.0-20220113124808-70ae35bab23f // indirect
18+
github.com/PuerkitoBio/goquery v1.8.0
1919
github.com/alecthomas/chroma v0.10.0
20-
github.com/andybalholm/brotli v1.0.3 // indirect
21-
github.com/andybalholm/cascadia v1.2.0 // indirect
22-
github.com/blevesearch/bleve/v2 v2.3.0
20+
github.com/andybalholm/brotli v1.0.4 // indirect
21+
github.com/bits-and-blooms/bitset v1.2.1 // indirect
22+
github.com/blevesearch/bleve/v2 v2.3.1
2323
github.com/boombuler/barcode v1.0.1 // indirect
2424
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
25-
github.com/caddyserver/certmagic v0.15.2
25+
github.com/caddyserver/certmagic v0.15.4
2626
github.com/chi-middleware/proxy v1.1.1
2727
github.com/couchbase/go-couchbase v0.0.0-20210224140812-5740cd35f448 // indirect
2828
github.com/couchbase/gomemcached v0.1.2 // indirect
2929
github.com/couchbase/goutils v0.0.0-20210118111533-e33d3ffb5401 // indirect
30-
github.com/denisenkom/go-mssqldb v0.10.0
30+
github.com/denisenkom/go-mssqldb v0.12.0
3131
github.com/djherbis/buffer v1.2.0
3232
github.com/djherbis/nio/v3 v3.0.1
33-
github.com/duo-labs/webauthn v0.0.0-20220122034320-81aea484c951
33+
github.com/duo-labs/webauthn v0.0.0-20220223184316-4d1cf2d34051
3434
github.com/dustin/go-humanize v1.0.0
35-
github.com/editorconfig/editorconfig-core-go/v2 v2.4.2
35+
github.com/editorconfig/editorconfig-core-go/v2 v2.4.3
3636
github.com/emirpasic/gods v1.12.0
37-
github.com/ethantkoenig/rupture v1.0.0
37+
github.com/ethantkoenig/rupture v1.0.1
3838
github.com/gliderlabs/ssh v0.3.3
3939
github.com/go-asn1-ber/asn1-ber v1.5.3 // indirect
40-
github.com/go-chi/chi/v5 v5.0.4
40+
github.com/go-chi/chi/v5 v5.0.7
4141
github.com/go-chi/cors v1.2.0
4242
github.com/go-enry/go-enry/v2 v2.8.0
4343
github.com/go-git/go-billy/v5 v5.3.1
4444
github.com/go-git/go-git/v5 v5.4.3-0.20210630082519-b4368b2a2ca4
45-
github.com/go-ldap/ldap/v3 v3.3.0
46-
github.com/go-redis/redis/v8 v8.11.0
45+
github.com/go-ldap/ldap/v3 v3.4.2
46+
github.com/go-redis/redis/v8 v8.11.4
4747
github.com/go-sql-driver/mysql v1.6.0
48-
github.com/go-swagger/go-swagger v0.27.0
48+
github.com/go-swagger/go-swagger v0.29.0
4949
github.com/go-testfixtures/testfixtures/v3 v3.6.1
5050
github.com/gobwas/glob v0.2.3
51-
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
51+
github.com/goccy/go-json v0.9.5 // indirect
52+
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
5253
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
5354
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
54-
github.com/golang-jwt/jwt/v4 v4.2.0
55+
github.com/golang-jwt/jwt/v4 v4.3.0
56+
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
5557
github.com/golang/snappy v0.0.4 // indirect
5658
github.com/google/go-github/v39 v39.2.0
5759
github.com/google/uuid v1.3.0
5860
github.com/gorilla/feeds v1.1.1
5961
github.com/gorilla/mux v1.8.0 // indirect
6062
github.com/gorilla/sessions v1.2.1
61-
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
6263
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
63-
github.com/hashicorp/go-version v1.3.1
64+
github.com/hashicorp/go-version v1.4.0
6465
github.com/hashicorp/golang-lru v0.5.4
6566
github.com/huandu/xstrings v1.3.2
66-
github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7
67+
github.com/jaytaylor/html2text v0.0.0-20211105163654-bc68cce691ba
6768
github.com/json-iterator/go v1.1.12
6869
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
6970
github.com/kevinburke/ssh_config v1.1.0 // indirect
7071
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
71-
github.com/klauspost/compress v1.13.1
72-
github.com/klauspost/cpuid/v2 v2.0.9
73-
github.com/klauspost/pgzip v1.2.5 // indirect
74-
github.com/lib/pq v1.10.2
72+
github.com/klauspost/compress v1.15.0
73+
github.com/klauspost/cpuid/v2 v2.0.11
74+
github.com/lib/pq v1.10.4
7575
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
76-
github.com/markbates/goth v1.68.0
77-
github.com/mattn/go-isatty v0.0.13
76+
github.com/markbates/goth v1.69.0
77+
github.com/mattn/go-isatty v0.0.14
7878
github.com/mattn/go-runewidth v0.0.13 // indirect
79-
github.com/mattn/go-sqlite3 v1.14.8
80-
github.com/mholt/archiver/v3 v3.5.0
81-
github.com/microcosm-cc/bluemonday v1.0.16
79+
github.com/mattn/go-sqlite3 v1.14.12
80+
github.com/mholt/acmez v1.0.2 // indirect
81+
github.com/mholt/archiver/v3 v3.5.1
82+
github.com/microcosm-cc/bluemonday v1.0.18
83+
github.com/miekg/dns v1.1.46 // indirect
8284
github.com/minio/md5-simd v1.1.2 // indirect
83-
github.com/minio/minio-go/v7 v7.0.12
85+
github.com/minio/minio-go/v7 v7.0.23
8486
github.com/minio/sha256-simd v1.0.0 // indirect
8587
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
86-
github.com/msteinert/pam v0.0.0-20201130170657-e61372126161
88+
github.com/msteinert/pam v1.0.0
8789
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
88-
github.com/niklasfasching/go-org v1.6.1
89-
github.com/olekukonko/tablewriter v0.0.5 // indirect
90+
github.com/niklasfasching/go-org v1.6.2
91+
github.com/nwaples/rardecode v1.1.3 // indirect
9092
github.com/oliamb/cutter v0.2.2
91-
github.com/olivere/elastic/v7 v7.0.25
92-
github.com/pelletier/go-toml v1.9.0 // indirect
93-
github.com/pierrec/lz4/v4 v4.1.8 // indirect
93+
github.com/olivere/elastic/v7 v7.0.31
94+
github.com/pierrec/lz4/v4 v4.1.14 // indirect
9495
github.com/pkg/errors v0.9.1
9596
github.com/pquerna/otp v1.3.0
96-
github.com/prometheus/client_golang v1.11.0
97-
github.com/quasoft/websspi v1.0.0
97+
github.com/prometheus/client_golang v1.12.1
98+
github.com/quasoft/websspi v1.1.2
9899
github.com/rs/xid v1.3.0 // indirect
99-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
100100
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0
101101
github.com/sergi/go-diff v1.2.0
102102
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
@@ -107,34 +107,34 @@ require (
107107
github.com/tstranex/u2f v1.0.0
108108
github.com/ulikunitz/xz v0.5.10 // indirect
109109
github.com/unknwon/com v1.0.1
110-
github.com/unknwon/i18n v0.0.0-20210321134014-0ebbf2df1c44
110+
github.com/unknwon/i18n v0.0.0-20210904045753-ff3a8617e361
111111
github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae
112-
github.com/unrolled/render v1.4.0
112+
github.com/unrolled/render v1.4.1
113113
github.com/urfave/cli v1.22.5
114-
github.com/xanzy/go-gitlab v0.50.1
114+
github.com/xanzy/go-gitlab v0.58.0
115+
github.com/xanzy/ssh-agent v0.3.1 // indirect
115116
github.com/yohcop/openid-go v1.0.0
116-
github.com/yuin/goldmark v1.4.4
117-
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01
118-
github.com/yuin/goldmark-meta v1.0.0
117+
github.com/yuin/goldmark v1.4.8
118+
github.com/yuin/goldmark-highlighting v0.0.0-20220208100518-594be1970594
119+
github.com/yuin/goldmark-meta v1.1.0
119120
go.etcd.io/bbolt v1.3.6 // indirect
120121
go.jolheiser.com/hcaptcha v0.0.4
121122
go.jolheiser.com/pwn v0.0.3
122123
go.uber.org/atomic v1.9.0 // indirect
123-
go.uber.org/multierr v1.7.0 // indirect
124-
go.uber.org/zap v1.19.0 // indirect
125-
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871
126-
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
127-
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
128-
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
124+
go.uber.org/multierr v1.8.0 // indirect
125+
go.uber.org/zap v1.21.0 // indirect
126+
golang.org/x/crypto v0.0.0-20220214200702-86341886e292
127+
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
128+
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b
129+
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9
129130
golang.org/x/text v0.3.7
130-
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
131-
golang.org/x/tools v0.1.0
132-
google.golang.org/protobuf v1.27.1 // indirect
131+
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
132+
golang.org/x/tools v0.1.9
133133
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
134134
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
135-
gopkg.in/ini.v1 v1.62.0
135+
gopkg.in/ini.v1 v1.66.4
136136
gopkg.in/yaml.v2 v2.4.0
137-
mvdan.cc/xurls/v2 v2.2.0
137+
mvdan.cc/xurls/v2 v2.4.0
138138
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
139139
xorm.io/builder v0.3.9
140140
xorm.io/xorm v1.2.5

0 commit comments

Comments
 (0)