Skip to content

Commit 757c395

Browse files
authored
Merge branch 'master' into fix-go-gitea#6946-pass-in-pr-into-hooks
2 parents 46d8b2e + 45f588e commit 757c395

40 files changed

+1244
-625
lines changed

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,7 @@ vet:
9797

9898
.PHONY: generate
9999
generate:
100-
@hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
101-
$(GO) get -u github.com/jteeuwen/go-bindata/go-bindata; \
102-
fi
103-
$(GO) generate $(PACKAGES)
100+
GO111MODULE=on $(GO) generate $(PACKAGES)
104101

105102
.PHONY: generate-swagger
106103
generate-swagger:

cmd/serv.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func checkLFSVersion() {
5353
//Needs at least git v2.1.2
5454
binVersion, err := git.BinVersion()
5555
if err != nil {
56-
fail(fmt.Sprintf("Error retrieving git version: %v", err), fmt.Sprintf("Error retrieving git version: %v", err))
56+
fail("LFS server error", "Error retrieving git version: %v", err)
5757
}
5858

5959
if !version.Compare(binVersion, "2.1.2", ">=") {
@@ -199,12 +199,12 @@ func runServ(c *cli.Context) error {
199199
if private.IsErrServCommand(err) {
200200
errServCommand := err.(private.ErrServCommand)
201201
if errServCommand.StatusCode != http.StatusInternalServerError {
202-
fail("Unauthorized", errServCommand.Error())
202+
fail("Unauthorized", "%s", errServCommand.Error())
203203
} else {
204-
fail("Internal Server Error", errServCommand.Error())
204+
fail("Internal Server Error", "%s", errServCommand.Error())
205205
}
206206
}
207-
fail("Internal Server Error", err.Error())
207+
fail("Internal Server Error", "%s", err.Error())
208208
}
209209
os.Setenv(models.EnvRepoIsWiki, strconv.FormatBool(results.IsWiki))
210210
os.Setenv(models.EnvRepoName, results.RepoName)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ require (
3030
github.com/denisenkom/go-mssqldb v0.0.0-20181014144952-4e0d7dc8888f
3131
github.com/dgrijalva/jwt-go v0.0.0-20161101193935-9ed569b5d1ac
3232
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 // indirect
33-
github.com/elazarl/go-bindata-assetfs v0.0.0-20151224045452-57eb5e1fc594 // indirect
3433
github.com/emirpasic/gods v1.12.0
3534
github.com/etcd-io/bbolt v1.3.2 // indirect
3635
github.com/ethantkoenig/rupture v0.0.0-20180203182544-0a76f03a811a
@@ -44,7 +43,6 @@ require (
4443
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
4544
github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd // indirect
4645
github.com/glycerine/goconvey v0.0.0-20190315024820-982ee783a72e // indirect
47-
github.com/go-macaron/bindata v0.0.0-20161222093048-85786f57eee3
4846
github.com/go-macaron/binding v0.0.0-20160711225916-9440f336b443
4947
github.com/go-macaron/cache v0.0.0-20151013081102-561735312776
5048
github.com/go-macaron/captcha v0.0.0-20151123225153-8aa5919789ab
@@ -103,7 +101,9 @@ require (
103101
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
104102
github.com/satori/go.uuid v1.2.0
105103
github.com/sergi/go-diff v1.0.0
104+
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b // indirect
106105
github.com/shurcooL/sanitized_anchor_name v0.0.0-20160918041101-1dba4b3954bc // indirect
106+
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
107107
github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d // indirect
108108
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff // indirect
109109
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect

go.sum

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ github.com/dgrijalva/jwt-go v0.0.0-20161101193935-9ed569b5d1ac h1:xrQJVwQCGqDvOO
6262
github.com/dgrijalva/jwt-go v0.0.0-20161101193935-9ed569b5d1ac/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
6363
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 h1:aaQcKT9WumO6JEJcRyTqFVq4XUZiUcKR2/GI31TOcz8=
6464
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
65-
github.com/elazarl/go-bindata-assetfs v0.0.0-20151224045452-57eb5e1fc594 h1:McZ/pt/pP/XAbLMDQGzm/iQUwW6OXmKVbFtmH9klWmc=
66-
github.com/elazarl/go-bindata-assetfs v0.0.0-20151224045452-57eb5e1fc594/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
6765
github.com/emirpasic/gods v1.9.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
6866
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
6967
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
@@ -97,8 +95,6 @@ github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd h1:r04M
9795
github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
9896
github.com/glycerine/goconvey v0.0.0-20190315024820-982ee783a72e h1:SiEs4J3BKVIeaWrH3tKaz3QLZhJ68iJ/A4xrzIoE5+Y=
9997
github.com/glycerine/goconvey v0.0.0-20190315024820-982ee783a72e/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
100-
github.com/go-macaron/bindata v0.0.0-20161222093048-85786f57eee3 h1:n0H90987ZwasTc9r/RnuaU1G5ePfzLG6Bkc1cY3KqnY=
101-
github.com/go-macaron/bindata v0.0.0-20161222093048-85786f57eee3/go.mod h1:NkmXhFuAlCOqgV5EWhU1DKLrgztCEIVXGmr2DZv/+sk=
10298
github.com/go-macaron/binding v0.0.0-20160711225916-9440f336b443 h1:i801KPR7j76uRMLLlGVyb0hiYbgX1FM5+ur81TJWzIw=
10399
github.com/go-macaron/binding v0.0.0-20160711225916-9440f336b443/go.mod h1:u+H6rwW+HQwUL+w5uaEJSpIlVZDye1o9MB4Su0JfRfM=
104100
github.com/go-macaron/cache v0.0.0-20151013081102-561735312776 h1:UYIHS1r0WotqB5cIa0PAiV0m6GzD9rDBcn4alp5JgCw=
@@ -282,8 +278,12 @@ github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
282278
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
283279
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE=
284280
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
281+
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b h1:4kg1wyftSKxLtnPAvcRWakIPpokB9w780/KwrNLnfPA=
282+
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
285283
github.com/shurcooL/sanitized_anchor_name v0.0.0-20160918041101-1dba4b3954bc h1:3wIrJvFb3Pf6B/2mDBnN1G5IfUVev4X5apadQlWOczE=
286284
github.com/shurcooL/sanitized_anchor_name v0.0.0-20160918041101-1dba4b3954bc/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
285+
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0=
286+
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
287287
github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d h1:qQWKKOvHN7Q9c6GdmUteCef2F9ubxMpxY1IKwpIKz68=
288288
github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d/go.mod h1:vq0tzqLRu6TS7Id0wMo2N5QzJoKedVeovOpHjnykSzY=
289289
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
@@ -348,6 +348,7 @@ golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e h1:nFYrTHrdrAOpShe27kaFHjsqY
348348
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
349349
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
350350
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
351+
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635 h1:2eB4G6bDQDeP69ZXbOKC00S2Kf6TIiRS+DzfKsKeQU0=
351352
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
352353
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
353354
google.golang.org/appengine v1.2.0 h1:S0iUepdCWODXRvtE+gcRDd15L+k+k1AiHlMiMjefH24=

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import (
2121
_ "code.gitea.io/gitea/modules/markup/markdown"
2222
_ "code.gitea.io/gitea/modules/markup/orgmode"
2323

24+
// for embed
25+
_ "github.com/shurcooL/vfsgen"
26+
2427
"github.com/urfave/cli"
2528
)
2629

modules/options/main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"log"
7+
"net/http"
8+
9+
"github.com/shurcooL/vfsgen"
10+
)
11+
12+
func main() {
13+
var fsTemplates http.FileSystem = http.Dir("../../options")
14+
err := vfsgen.Generate(fsTemplates, vfsgen.Options{
15+
PackageName: "options",
16+
BuildTags: "bindata",
17+
VariableName: "Assets",
18+
Filename: "bindata.go",
19+
})
20+
if err != nil {
21+
log.Fatal("%v", err)
22+
}
23+
}

modules/options/options.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55
package options
66

7-
//go:generate go-bindata -tags "bindata" -ignore "TRANSLATORS" -pkg "options" -o "bindata.go" ../../options/...
7+
//go:generate go run -mod=vendor main.go
88
//go:generate go fmt bindata.go
9-
//go:generate sed -i.bak s/..\/..\/options\/// bindata.go
10-
//go:generate rm -f bindata.go.bak
119

1210
type directorySet map[string][]string
1311

modules/options/static.go

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func Dir(name string) ([]string, error) {
4141
result = append(result, files...)
4242
}
4343

44-
files, err := AssetDir(path.Join("..", "..", "options", name))
44+
files, err := AssetDir(name)
4545

4646
if err != nil {
4747
return []string{}, fmt.Errorf("Failed to read embedded directory. %v", err)
@@ -52,6 +52,24 @@ func Dir(name string) ([]string, error) {
5252
return directories.AddAndGet(name, result), nil
5353
}
5454

55+
func AssetDir(dirName string) ([]string, error) {
56+
d, err := Assets.Open(dirName)
57+
if err != nil {
58+
return nil, err
59+
}
60+
defer d.Close()
61+
62+
files, err := d.Readdir(-1)
63+
if err != nil {
64+
return nil, err
65+
}
66+
var results = make([]string, 0, len(files))
67+
for _, file := range files {
68+
results = append(results, file.Name())
69+
}
70+
return results, nil
71+
}
72+
5573
// Locale reads the content of a specific locale from bindata or custom path.
5674
func Locale(name string) ([]byte, error) {
5775
return fileFromDir(path.Join("locale", name))
@@ -85,5 +103,11 @@ func fileFromDir(name string) ([]byte, error) {
85103
return ioutil.ReadFile(customPath)
86104
}
87105

88-
return Asset(name)
106+
f, err := Assets.Open(name)
107+
if err != nil {
108+
return nil, err
109+
}
110+
defer f.Close()
111+
112+
return ioutil.ReadAll(f)
89113
}

modules/public/main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"log"
7+
"net/http"
8+
9+
"github.com/shurcooL/vfsgen"
10+
)
11+
12+
func main() {
13+
var fsPublic http.FileSystem = http.Dir("../../public")
14+
err := vfsgen.Generate(fsPublic, vfsgen.Options{
15+
PackageName: "public",
16+
BuildTags: "bindata",
17+
VariableName: "Assets",
18+
Filename: "bindata.go",
19+
})
20+
if err != nil {
21+
log.Fatal("%v", err)
22+
}
23+
}

modules/public/public.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ import (
1717
"gopkg.in/macaron.v1"
1818
)
1919

20-
//go:generate go-bindata -tags "bindata" -ignore "\\.go|\\.less" -pkg "public" -o "bindata.go" ../../public/...
20+
//go:generate go run -mod=vendor main.go
2121
//go:generate go fmt bindata.go
22-
//go:generate sed -i.bak s/..\/..\/public\/// bindata.go
23-
//go:generate rm -f bindata.go.bak
2422

2523
// Options represents the available options to configure the macaron handler.
2624
type Options struct {

modules/public/static.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,12 @@
77
package public
88

99
import (
10-
"github.com/go-macaron/bindata"
1110
"gopkg.in/macaron.v1"
1211
)
1312

1413
// Static implements the macaron static handler for serving assets.
1514
func Static(opts *Options) macaron.Handler {
16-
opts.FileSystem = bindata.Static(bindata.Options{
17-
Asset: Asset,
18-
AssetDir: AssetDir,
19-
AssetInfo: AssetInfo,
20-
AssetNames: AssetNames,
21-
Prefix: "",
22-
})
15+
opts.FileSystem = Assets
2316
// we don't need to pass the directory, because the directory var is only
2417
// used when in the options there is no FileSystem.
2518
return opts.staticHandler("")

modules/templates/main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"log"
7+
"net/http"
8+
9+
"github.com/shurcooL/vfsgen"
10+
)
11+
12+
func main() {
13+
var fsTemplates http.FileSystem = http.Dir("../../templates")
14+
err := vfsgen.Generate(fsTemplates, vfsgen.Options{
15+
PackageName: "templates",
16+
BuildTags: "bindata",
17+
VariableName: "Assets",
18+
Filename: "bindata.go",
19+
})
20+
if err != nil {
21+
log.Fatal("%v", err)
22+
}
23+
}

modules/templates/static.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,21 @@ func Mailer() *template.Template {
203203

204204
return templates
205205
}
206+
207+
func Asset(name string) ([]byte, error) {
208+
f, err := Assets.Open("/" + name)
209+
if err != nil {
210+
return nil, err
211+
}
212+
defer f.Close()
213+
return ioutil.ReadAll(f)
214+
}
215+
216+
func AssetNames() []string {
217+
realFS := Assets.(vfsgen۰FS)
218+
var results = make([]string, 0, len(realFS))
219+
for k := range realFS {
220+
results = append(results, k[1:])
221+
}
222+
return results
223+
}

modules/templates/templates.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44

55
package templates
66

7-
//go:generate go-bindata -tags "bindata" -ignore "\\.go" -pkg "templates" -o "bindata.go" ../../templates/...
7+
//go:generate go run -mod=vendor main.go
88
//go:generate go fmt bindata.go
9-
//go:generate sed -i.bak s/..\/..\/templates\/// bindata.go
10-
//go:generate rm -f bindata.go.bak

options/locale/locale_de-DE.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ password_not_match=Die Passwörter stimmen nicht überein.
305305

306306
username_been_taken=Der Benutzername ist bereits vergeben.
307307
repo_name_been_taken=Der Repository-Name wird schon verwendet.
308+
visit_rate_limit=Das Rate-Limit bei der Gegenseite wurde erreicht.
309+
2fa_auth_required=Die Gegenseite benötigt Zweifaktorauthentifikation.
308310
org_name_been_taken=Der Organisationsname ist bereits vergeben.
309311
team_name_been_taken=Der Teamname ist bereits vergeben.
310312
team_no_units_error=Das Team muss auf mindestens einen Bereich Zugriff haben.
@@ -608,6 +610,7 @@ migrate_items_milestones=Meilensteine
608610
migrate_items_labels=Labels
609611
migrate_items_issues=Issues
610612
migrate_items_pullrequests=Pull-Requests
613+
migrate_items_releases=Releases
611614
migrate_repo=Repository migrieren
612615
migrate.clone_address=Migrations- / Klon-URL
613616
migrate.clone_address_desc=Die HTTP(S)- oder „git clone“-URL eines bereits existierenden Repositorys
@@ -1518,6 +1521,8 @@ dashboard.delete_repo_archives=Alle Repository-Archive löschen
15181521
dashboard.delete_repo_archives_success=Alle Repository-Archive wurden gelöscht.
15191522
dashboard.delete_missing_repos=Alle Repository-Datensätze mit verlorenen gegangenen Git-Dateien löschen
15201523
dashboard.delete_missing_repos_success=Alle Repository-Datensätze mit verlorenen Git-Dateien wurden gelöscht.
1524+
dashboard.delete_generated_repository_avatars=Generierte Repository-Avatare löschen
1525+
dashboard.delete_generated_repository_avatars_success=Generierte Repository-Avatare wurden gelöscht.
15211526
dashboard.git_gc_repos=Garbage-Collection auf Repositories ausführen
15221527
dashboard.git_gc_repos_success=Alle Repositories haben Garbage-Collection beendet.
15231528
dashboard.resync_all_sshkeys=„.ssh/authorized_keys“-Datei mit Gitea-SSH-Keys neu schreiben. (Wenn Du den eingebauten SSH-Server nutzt, musst du das nicht ausführen.)
@@ -1576,7 +1581,7 @@ users.auth_source=Authentifizierungsquelle
15761581
users.local=Lokal
15771582
users.auth_login_name=Anmeldename zur Authentifizierung
15781583
users.password_helper=Passwort leer lassen, um es nicht zu verändern.
1579-
users.update_profile_success=Der Account „%s“ wurde aktualisiert.
1584+
users.update_profile_success=Das Benutzerkonto wurde aktualisiert.
15801585
users.edit_account=Benutzerkonto bearbeiten
15811586
users.max_repo_creation=Maximale Anzahl Repositories
15821587
users.max_repo_creation_desc=(Gib -1 ein, um das globale Standardlimit zu verwenden.)

0 commit comments

Comments
 (0)