Skip to content

Commit c104e50

Browse files
committed
Merge remote-tracking branch 'origin/master' into must_change_password_cli
2 parents d2bc4de + 378af8e commit c104e50

Some content is hidden

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

46 files changed

+1001
-241
lines changed

Gopkg.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ Peter Žeby <[email protected]> (@morlinest)
2222
Matti Ranta <[email protected]> (@techknowlogick)
2323
Michael Lustfield <[email protected]> (@MTecknology)
2424
Jonas Franz <[email protected]> (@JonasFranzDEV)
25-
Flynn Lufmons <[email protected]> (@flufmonster)
2625
Alexey Terentyev <[email protected]> (@axifive)
2726
Lanre Adelowo <[email protected]> (@adelowo)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This project has been
2929

3030
From the root of the source tree, run:
3131

32-
make generate all
32+
TAGS="bindata" make generate all
3333

3434
More info: https://docs.gitea.io/en-us/install-from-source/
3535

custom/conf/app.ini.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ DEFAULT_THEME = gitea
9191
USER_PAGING_NUM = 50
9292
; Number of repos that are displayed on one page
9393
REPO_PAGING_NUM = 50
94-
; Number of notices that are displayed on in one page
94+
; Number of notices that are displayed on one page
9595
NOTICE_PAGING_NUM = 25
9696
; Number of organizations that are displayed on one page
9797
ORG_PAGING_NUM = 50

docs/content/doc/installation/with-docker.en-us.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ image as a service. Since there is no database available one can be initialized
3030
Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`.
3131
Note that the volume should be owned by the user/group with the UID/GID specified in the config file.
3232
If you don't give the volume correct permissions, the container may not start.
33+
Also be aware that the tag `:latest` will install the current development version.
34+
For a stable release you can use `:1` or specify a certain release like `:1.5.1`.
3335

3436
```yaml
3537
version: "2"
@@ -103,6 +105,11 @@ services:
103105
environment:
104106
- USER_UID=1000
105107
- USER_GID=1000
108+
+ - DB_TYPE=mysql
109+
+ - DB_HOST=db:3306
110+
+ - DB_NAME=gitea
111+
+ - DB_USER=gitea
112+
+ - DB_PASSWD=gitea
106113
restart: always
107114
networks:
108115
- gitea
@@ -146,6 +153,11 @@ services:
146153
environment:
147154
- USER_UID=1000
148155
- USER_GID=1000
156+
+ - DB_TYPE=postgres
157+
+ - DB_HOST=db:5432
158+
+ - DB_NAME=gitea
159+
+ - DB_USER=gitea
160+
+ - DB_PASSWD=gitea
149161
restart: always
150162
networks:
151163
- gitea

models/fixtures/comment.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@
4141
tree_path: "README.md"
4242
created_unix: 946684812
4343
invalidated: false
44+
45+
-
46+
id: 6
47+
type: 21 # code comment
48+
poster_id: 1
49+
issue_id: 2
50+
content: "it's already invalidated. boring..."
51+
line: -4
52+
tree_path: "README.md"
53+
created_unix: 946684812
54+
invalidated: true

models/gpg_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func verifySign(s *packet.Signature, h hash.Hash, k *GPGKey) error {
360360

361361
// ParseCommitWithSignature check if signature is good against keystore.
362362
func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
363-
if c.Signature != nil {
363+
if c.Signature != nil && c.Committer != nil {
364364
//Parsing signature
365365
sig, err := extractSignature(c.Signature.Signature)
366366
if err != nil { //Skipping failed to extract sign

models/issue_comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ func fetchCodeCommentsByReview(e Engine, issue *Issue, currentUser *User, review
10841084
}
10851085
conds := opts.toConds()
10861086
if review.ID == 0 {
1087-
conds.And(builder.Eq{"invalidated": false})
1087+
conds = conds.And(builder.Eq{"invalidated": false})
10881088
}
10891089

10901090
var comments []*Comment

models/issue_milestone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (milestones MilestoneList) getMilestoneIDs() []int64 {
181181
// GetMilestonesByRepoID returns all milestones of a repository.
182182
func GetMilestonesByRepoID(repoID int64) (MilestoneList, error) {
183183
miles := make([]*Milestone, 0, 10)
184-
return miles, x.Where("repo_id = ?", repoID).Find(&miles)
184+
return miles, x.Where("repo_id = ?", repoID).Asc("deadline_unix").Find(&miles)
185185
}
186186

187187
// GetMilestones returns a list of milestones of given repository and status.

modules/base/tool.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,22 @@ func DetectEncoding(content []byte) (string, error) {
5959
return "UTF-8", nil
6060
}
6161

62-
result, err := chardet.NewTextDetector().DetectBest(content)
62+
textDetector := chardet.NewTextDetector()
63+
var detectContent []byte
64+
if len(content) < 1024 {
65+
// Check if original content is valid
66+
if _, err := textDetector.DetectBest(content); err != nil {
67+
return "", err
68+
}
69+
times := 1024 / len(content)
70+
detectContent = make([]byte, 0, times*len(content))
71+
for i := 0; i < times; i++ {
72+
detectContent = append(detectContent, content...)
73+
}
74+
} else {
75+
detectContent = content
76+
}
77+
result, err := textDetector.DetectBest(detectContent)
6378
if err != nil {
6479
return "", err
6580
}

modules/templates/helper.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Copyright 2018 The Gitea Authors. All rights reserved.
12
// Copyright 2014 The Gogs Authors. All rights reserved.
23
// Use of this source code is governed by a MIT-style
34
// license that can be found in the LICENSE file.
@@ -275,7 +276,7 @@ func ToUTF8WithErr(content []byte) (string, error) {
275276
}
276277

277278
// If there is an error, we concatenate the nicely decoded part and the
278-
// original left over. This way we won't loose data.
279+
// original left over. This way we won't lose data.
279280
result, n, err := transform.String(encoding.NewDecoder(), string(content))
280281
if err != nil {
281282
result = result + string(content[n:])
@@ -284,6 +285,28 @@ func ToUTF8WithErr(content []byte) (string, error) {
284285
return result, err
285286
}
286287

288+
// ToUTF8WithFallback detects the encoding of content and coverts to UTF-8 if possible
289+
func ToUTF8WithFallback(content []byte) []byte {
290+
charsetLabel, err := base.DetectEncoding(content)
291+
if err != nil || charsetLabel == "UTF-8" {
292+
return content
293+
}
294+
295+
encoding, _ := charset.Lookup(charsetLabel)
296+
if encoding == nil {
297+
return content
298+
}
299+
300+
// If there is an error, we concatenate the nicely decoded part and the
301+
// original left over. This way we won't lose data.
302+
result, n, err := transform.Bytes(encoding.NewDecoder(), content)
303+
if err != nil {
304+
return append(result, content[n:]...)
305+
}
306+
307+
return result
308+
}
309+
287310
// ToUTF8 converts content to UTF8 encoding and ignore error
288311
func ToUTF8(content string) string {
289312
res, _ := ToUTF8WithErr([]byte(content))

options/locale/locale_de-DE.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ loading=Laden…
8080
install=Installation
8181
title=Erstkonfiguration
8282
docker_helper=Wenn du Gitea in einem Docker-Container nutzt, lies bitte die <a target="_blank" rel="noopener noreferrer" href="%s">Dokumentation</a>, bevor du irgendwelche Einstellungen veränderst.
83+
requite_db_desc=Gitea benötigt MySQL, PostgreSQL, MSSQL oder SQLite3.
8384
db_title=Datenbankeinstellungen
8485
db_type=Datenbanktyp
8586
host=Host
@@ -89,6 +90,8 @@ db_name=Datenbankname
8990
db_helper=Hinweis für MySQL-Benutzer: Bitte verwende das InnoDB-Speichersubsystem und den Zeichensatz „utf8_general_ci“.
9091
ssl_mode=SSL
9192
path=Pfad
93+
sqlite_helper=Dateipfad zur SQLite3 Datenbank.<br>Gebe einen absoluten Pfad an, wenn Gitea als Service gestartet wird.
94+
err_empty_db_path=Der SQLite3 Datenbankpfad darf nicht leer sein.
9295
no_admin_and_disable_registration=Du kannst Selbst-Registrierungen nicht deaktivieren, ohne ein Administratorkonto zu erstellen.
9396
err_empty_admin_password=Das Administrator-Passwort darf nicht leer sein.
9497

@@ -202,6 +205,8 @@ forgot_password=Passwort vergessen?
202205
sign_up_now=Noch kein Konto? Jetzt registrieren.
203206
sign_up_successful=Konto wurde erfolgreich erstellt.
204207
confirmation_mail_sent_prompt=Eine neue Bestätigungs-E-Mail wurde an <b>%s</b> gesendet. Bitte überprüfe dein Postfach innerhalb der nächsten %s, um die Registrierung abzuschließen.
208+
must_change_password=Aktualisiere dein Passwort
209+
allow_password_change=Verlange vom Benutzer das Passwort zu ändern (empfohlen)
205210
reset_password_mail_sent_prompt=Eine E-Mail wurde an <b>%s</b> gesendet. Bitte überprüfe dein Postfach innerhalb der nächsten %s, um das Passwort zurückzusetzen.
206211
active_your_account=Aktiviere dein Konto
207212
account_activated=Konto wurde aktiviert
@@ -790,6 +795,7 @@ issues.dependency.pr_no_dependencies=Dieser Pull-Request hat momentan keine Abh
790795
issues.dependency.add=Abhängigkeit hinzufügen…
791796
issues.dependency.cancel=Abbrechen
792797
issues.dependency.remove=Entfernen
798+
issues.dependency.remove_info=Abhängigkeit löschen
793799
issues.dependency.added_dependency=`<a href="%[1]s">%[2]s</a> hat %[3]s eine neue Abhängigkeit hinzugefügt`
794800
issues.dependency.removed_dependency=`<a href="%[1]s">%[2]s</a> hat %[3]s eine Abhängigkeit entfernt`
795801
issues.dependency.issue_closing_blockedby=Das Schließen dieses Pull-Requests wird von den folgenden Issues blockiert
@@ -1039,6 +1045,7 @@ settings.search_user_placeholder=Benutzer suchen…
10391045
settings.org_not_allowed_to_be_collaborator=Organisationen können nicht als Mitarbeiter hinzugefügt werden.
10401046
settings.user_is_org_member=Der Benutzer ist ein Organisationsmitglied und kann nicht als Mitarbeiter hinzugefügt werden.
10411047
settings.add_webhook=Webhook hinzufügen
1048+
settings.add_webhook.invalid_channel_name=Der Name des Webhook-Kanals darf nicht leer sein und darf nicht nur das Zeichen # enthalten.
10421049
settings.hooks_desc=Webhooks senden bei bestimmten Gitea-Events automatisch „HTTP POST“-Anfragen an einen Server. Lies mehr in unserer <a target="_blank" rel="noopener noreferrer" href="%s">Anleitung zu Webhooks (auf Englisch)</a>.
10431050
settings.webhook_deletion=Webhook löschen
10441051
settings.webhook_deletion_desc=Das Entfernen eines Webhooks löscht seine Einstellungen und Zustellungsverlauf. Fortfahren?
@@ -1645,6 +1652,7 @@ notices.delete_success=Diese Systemmeldung wurde gelöscht.
16451652
[action]
16461653
create_repo=hat das Repository <a href="%s">%s</a> erstellt
16471654
rename_repo=hat das Repository von <code>%[1]s</code> zu <a href="%[2]s">%[3]s</a> umbenannt
1655+
commit_repo=hat auf <a href="%[1]s/src/branch/%[2]s">%[3]s</a> in <a href="%[1]s">%[4]s</a> gepusht
16481656
create_issue=`hat das Issue <a href="%s/issues/%s">%s#%[2]s</a> geöffnet`
16491657
close_issue=`hat das Issue <a href="%s/issues/%s">%s#%[2]s</a> geschlossen`
16501658
reopen_issue=`hat das Issue <a href="%s/issues/%s">%s#%[2]s</a> erneut geöffnet`
@@ -1654,9 +1662,13 @@ reopen_pull_request=`hat den Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> wie
16541662
comment_issue=`hat das Issue <a href="%s/issues/%s">%s#%[2]s</a> kommentiert`
16551663
merge_pull_request=`hat den Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> zusammengeführt`
16561664
transfer_repo=hat Repository <code>%s</code> transferiert an <a href="%s">%s</a>
1665+
push_tag=hat Tag <a href="%s/src/tag/%s">%[2]s</a> auf <a href="%[1]s">%[3]s</a> gepusht
16571666
delete_tag=hat Tag %[2]s in <a href="%[1]s">%[3]s</a> gelöscht
16581667
delete_branch=hat Branch %[2]s in <a href="%[1]s">%[3]s</a> gelöscht
16591668
compare_commits=Vergleiche %d Commits
1669+
mirror_sync_push=hat Commits des Mirrors mit <a href="%[1]s/src/%[2]s">%[3]s</a> in <a href="%[1]s">%[4]s</a> synchronisiert
1670+
mirror_sync_create=hat eine neue Referenz des Mirrors <a href="%s/src/%s">%[2]s</a> mit <a href="%[1]s">%[3]s</a> synchronisiert
1671+
mirror_sync_delete=hat die Referenz des Mirrors <code>%[2]s</code> in <a href="%[1]s">%[3]s</a> synchronisiert und gelöscht
16601672

16611673
[tool]
16621674
ago=vor %s

options/locale/locale_en-US.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ loading = Loading…
8080
install = Installation
8181
title = Initial Configuration
8282
docker_helper = If you run Gitea inside Docker, please read the <a target="_blank" rel="noopener noreferrer" href="%s">documentation</a> before changing any settings.
83-
requite_db_desc = Gitea requires MySQL, PostgreSQL, MSSQL, or SQLite3.
83+
requite_db_desc = Gitea requires MySQL, PostgreSQL, MSSQL or SQLite3.
8484
db_title = Database Settings
8585
db_type = Database Type
8686
host = Host
@@ -792,7 +792,7 @@ issues.due_date_invalid = "The due date is invalid or out of range. Please use t
792792
issues.dependency.title = Dependencies
793793
issues.dependency.issue_no_dependencies = This issue currently doesn't have any dependencies.
794794
issues.dependency.pr_no_dependencies = This pull request currently doesn't have any dependencies.
795-
issues.dependency.add = Add dependency...
795+
issues.dependency.add = Add dependency
796796
issues.dependency.cancel = Cancel
797797
issues.dependency.remove = Remove
798798
issues.dependency.remove_info = Remove this dependency

options/locale/locale_fr-FR.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,6 @@ issues.due_date_invalid=La date d’échéance est invalide ou hors plage. Veuil
781781
issues.dependency.title=Dépendances
782782
issues.dependency.issue_no_dependencies=Ce ticket n'a actuellement pas de dépendance.
783783
issues.dependency.pr_no_dependencies=La demande de fusion n'a actuellement pas de dépendance.
784-
issues.dependency.add=Ajouter une dépendance...
785784
issues.dependency.cancel=Annuler
786785
issues.dependency.remove=Supprimer
787786
issues.dependency.added_dependency=<a href="%[1]s">%[2]s</a> a ajouté une nouvelle dépendance %[3]s`

options/locale/locale_ja-JP.ini

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ loading=読み込み中…
8080
install=インストール
8181
title=初期設定
8282
docker_helper=GiteaをDocker内で実行する場合は、設定を変更する前に<a target="_blank" rel="noopener noreferrer" href="%s">ドキュメント</a>を読んでください。
83-
requite_db_desc=Giteaには、MySQL、PostgreSQL、MSSQL、またはSQLite3が必要です
83+
requite_db_desc=Giteaには、MySQL、PostgreSQL、MSSQL、SQLite3のいずれかが必要です
8484
db_title=データベース設定
8585
db_type=データベースのタイプ
8686
host=ホスト
@@ -554,8 +554,8 @@ copy_link_error=⌘C または Ctrl-C でコピーしてください。
554554
copied=コピー成功
555555
unwatch=ウォッチ解除
556556
watch=ウォッチ
557-
unstar=スターを取り消す
558-
star=スターをつける
557+
unstar=スター取消
558+
star=スター
559559
fork=フォーク
560560
download_archive=リポジトリをダウンロード
561561

@@ -924,10 +924,10 @@ activity.period.monthly=1ヶ月
924924
activity.overview=概要
925925
activity.active_prs_count_1=<strong>%d</strong>件のアクティブなプルリクエスト
926926
activity.active_prs_count_n=<strong>%d</strong>件のアクティブなプルリクエスト
927-
activity.merged_prs_count_1=件のマージされたプルリクエスト
928-
activity.merged_prs_count_n=件のマージされたプルリクエスト
929-
activity.opened_prs_count_1=件の提案されたプルリクエスト
930-
activity.opened_prs_count_n=件の提案されたプルリクエスト
927+
activity.merged_prs_count_1=マージされたプルリクエスト
928+
activity.merged_prs_count_n=マージされたプルリクエスト
929+
activity.opened_prs_count_1=提案されたプルリクエスト
930+
activity.opened_prs_count_n=提案されたプルリクエスト
931931
activity.title.user_1=%d人のユーザー
932932
activity.title.user_n=%d人のユーザー
933933
activity.title.prs_1=%d件のプルリクエスト
@@ -938,8 +938,8 @@ activity.merged_prs_label=マージ済み
938938
activity.opened_prs_label=提案中
939939
activity.active_issues_count_1=<strong>%d</strong>件のアクティブな課題
940940
activity.active_issues_count_n=<strong>%d</strong>件のアクティブな課題
941-
activity.closed_issues_count_1=件のクローズされた課題
942-
activity.closed_issues_count_n=件のクローズされた課題
941+
activity.closed_issues_count_1=クローズされた課題
942+
activity.closed_issues_count_n=クローズされた課題
943943
activity.title.issues_1=%d件の課題
944944
activity.title.issues_n=%d件の課題
945945
activity.title.issues_closed_by=%sが%sによってクローズされました

0 commit comments

Comments
 (0)