Skip to content

Commit 7f56389

Browse files
authored
Merge branch 'main' into main
2 parents 0fd503f + e4e3df6 commit 7f56389

34 files changed

+135
-166
lines changed

.revive.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ warningCode = 1
2424
[rule.indent-error-flow]
2525
[rule.errorf]
2626
[rule.duplicated-imports]
27+
[rule.modifies-value-receiver]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ Certain queues have defaults that override the defaults set in `[queue]` (this o
477477

478478
## Security (`security`)
479479

480-
- `INSTALL_LOCK`: **false**: Disallow access to the install page.
480+
- `INSTALL_LOCK`: **false**: Controls access to the installation page. When set to "true", the installation page is not accessible.
481481
- `SECRET_KEY`: **\<random at every install\>**: Global secret key. This should be changed.
482482
- `LOGIN_REMEMBER_DAYS`: **7**: Cookie lifetime, in days.
483483
- `COOKIE_USERNAME`: **gitea\_awesome**: Name of the cookie used to store the current username.

docs/content/doc/developers/hacking-on-gitea.en-us.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ sudo yum install make
6767
One of these three distributions of Make will run on Windows:
6868

6969
- [Single binary build](http://www.equation.com/servlet/equation.cmd?fa=make). Copy somewhere and add to `PATH`.
70-
- [32-bits version](ftp://ftp.equation.com/make/32/make.exe)
71-
- [64-bits version](ftp://ftp.equation.com/make/64/make.exe)
72-
- [MinGW](http://www.mingw.org/) includes a build.
73-
- The binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to `PATH`.
70+
- [32-bits version](http://www.equation.com/ftpdir/make/32/make.exe)
71+
- [64-bits version](http://www.equation.com/ftpdir/make/64/make.exe)
72+
- [MinGW-w64](https://www.mingw-w64.org) / [MSYS2](https://www.msys2.org/).
73+
- MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software, it includes MinGW-w64.
74+
- In MingGW-w64, the binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to `PATH`.
75+
- In MSYS2, you can use `make` directly. See [MSYS2 Porting](https://www.msys2.org/wiki/Porting/).
7476
- [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make`
7577

7678
**Note**: If you are attempting to build using make with Windows Command Prompt, you may run into issues. The above prompts (Git bash, or MinGW) are recommended, however if you only have command prompt (or potentially PowerShell) you can set environment variables using the [set](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1) command, e.g. `set TAGS=bindata`.

integrations/api_releases_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func TestAPIGetReleaseByTag(t *testing.T) {
207207

208208
var err *api.APIError
209209
DecodeJSON(t, resp, &err)
210-
assert.EqualValues(t, "Not Found", err.Message)
210+
assert.NotEmpty(t, err.Message)
211211
}
212212

213213
func TestAPIDeleteReleaseByTagName(t *testing.T) {

integrations/repo_branch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func TestCreateBranchInvalidCSRF(t *testing.T) {
141141
resp = session.MakeRequest(t, NewRequest(t, "GET", loc), http.StatusOK)
142142
htmlDoc := NewHTMLParser(t, resp.Body)
143143
assert.Equal(t,
144-
"Bad Request: Invalid CSRF token",
144+
"Bad Request: invalid CSRF token",
145145
strings.TrimSpace(htmlDoc.doc.Find(".ui.message").Text()),
146146
)
147147
}

models/issue_comment.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ const (
123123

124124
// WithRole enable a specific tag on the RoleDescriptor.
125125
func (rd RoleDescriptor) WithRole(role RoleDescriptor) RoleDescriptor {
126-
rd |= (1 << role)
127-
return rd
126+
return rd | (1 << role)
128127
}
129128

130129
func stringToRoleDescriptor(role string) RoleDescriptor {

modules/context/api.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ type APIContext struct {
3030
Org *APIOrganization
3131
}
3232

33+
// Currently, we have the following common fields in error response:
34+
// * message: the message for end users (it shouldn't be used for error type detection)
35+
// if we need to indicate some errors, we should introduce some new fields like ErrorCode or ErrorType
36+
// * url: the swagger document URL
37+
3338
// APIError is error format response
3439
// swagger:response error
3540
type APIError struct {
@@ -47,8 +52,8 @@ type APIValidationError struct {
4752
// APIInvalidTopicsError is error format response to invalid topics
4853
// swagger:response invalidTopicsError
4954
type APIInvalidTopicsError struct {
50-
Topics []string `json:"invalidTopics"`
51-
Message string `json:"message"`
55+
Message string `json:"message"`
56+
InvalidTopics []string `json:"invalidTopics"`
5257
}
5358

5459
//APIEmpty is an empty response
@@ -122,9 +127,9 @@ func (ctx *APIContext) InternalServerError(err error) {
122127
})
123128
}
124129

125-
var (
126-
apiContextKey interface{} = "default_api_context"
127-
)
130+
type apiContextKeyType struct{}
131+
132+
var apiContextKey = apiContextKeyType{}
128133

129134
// WithAPIContext set up api context in request
130135
func WithAPIContext(req *http.Request, ctx *APIContext) *http.Request {
@@ -351,7 +356,7 @@ func ReferencesGitRepo(allowEmpty bool) func(http.Handler) http.Handler {
351356
// NotFound handles 404s for APIContext
352357
// String will replace message, errors will be added to a slice
353358
func (ctx *APIContext) NotFound(objs ...interface{}) {
354-
var message = "Not Found"
359+
var message = ctx.Tr("error.not_found")
355360
var errors []string
356361
for _, obj := range objs {
357362
// Ignore nil
@@ -367,9 +372,9 @@ func (ctx *APIContext) NotFound(objs ...interface{}) {
367372
}
368373

369374
ctx.JSON(http.StatusNotFound, map[string]interface{}{
370-
"message": message,
371-
"documentation_url": setting.API.SwaggerURL,
372-
"errors": errors,
375+
"message": message,
376+
"url": setting.API.SwaggerURL,
377+
"errors": errors,
373378
})
374379
}
375380

options/locale/locale_cs-CZ.ini

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,6 @@ desc.archived=Archivováno
817817
template.items=Položky šablony
818818
template.git_content=Obsah gitu (výchozí větev)
819819
template.git_hooks=Háčky Gitu
820-
template.git_hooks_tooltip=Momentálně nemůžete po přidání upravovat nebo odebrat háčky gitu. Vyberte pouze v případě, že důvěřujete šabloně repozitáře.
821820
template.webhooks=Webové háčky
822821
template.topics=Témata
823822
template.avatar=Avatar
@@ -980,8 +979,6 @@ editor.commit_empty_file_text=Soubor, který se chystáte odevzdat, je prázdný
980979
editor.no_changes_to_show=Žádné změny k zobrazení.
981980
editor.fail_to_update_file=Nepodařilo se aktualizovat/vytvořit soubor „%s“.
982981
editor.fail_to_update_file_summary=Chybové hlášení:
983-
editor.push_rejected_no_message=Změna byla serverem zamítnuta bez zprávy. Prosím, zkontrolujte háčky Gitu.
984-
editor.push_rejected=Změna byla serverem zamítnuta. Prosím, zkontrolujte háčky Gitu.
985982
editor.push_rejected_summary=Úplná zpráva o odmítnutí:
986983
editor.add_subdir=Přidat adresář…
987984
editor.unable_to_upload_files=Nepodařilo se nahrát soubor „%s“. Chyba: %v
@@ -1403,9 +1400,7 @@ pulls.rebase_conflict_summary=Chybové hlášení
14031400
; </summary><code>%[2]s<br>%[3]s</code></details>
14041401
pulls.unrelated_histories=Sloučení selhalo: Základní revize nesdílí společnou historii. Tip: Zkuste jinou strategii
14051402
pulls.merge_out_of_date=Sloučení selhalo: Základ byl aktualizován při generování sloučení. Tip: Zkuste to znovu.
1406-
pulls.push_rejected=Sloučení selhalo: Nahrání bylo zamítnuto. Zkontrolujte háčky Gitu pro tento repozitář.
14071403
pulls.push_rejected_summary=Úplná zpráva o odmítnutí
1408-
pulls.push_rejected_no_message=Sloučení se nezdařilo: Nahrání bylo odmítnuto, ale nebyla nalezena žádná vzdálená zpráva.<br>Zkontrolujte háčky gitu pro tento repozitář
14091404
pulls.open_unmerged_pull_exists=`Nemůžete provést operaci znovuotevření protože je tu čekající požadavek na natažení (#%d) s identickými vlastnostmi.`
14101405
pulls.status_checking=Některé kontroly jsou nedořešeny
14111406
pulls.status_checks_success=Všechny kontroly byly úspěšné
@@ -1715,7 +1710,6 @@ settings.webhook.response=Odpověď
17151710
settings.webhook.headers=Hlavičky
17161711
settings.webhook.payload=Obsah
17171712
settings.webhook.body=Tělo zprávy
1718-
settings.githooks_desc=Jelikož háčky Gitu jsou spravovány Gitem samotným, můžete upravit soubory háčků k provádění uživatelských operací.
17191713
settings.githook_edit_desc=Je-li háček neaktivní, bude zobrazen vzorový obsah. Nebude-li zadán žádný obsah, háček bude vypnut.
17201714
settings.githook_name=Název háčku
17211715
settings.githook_content=Obsah háčku

options/locale/locale_de-DE.ini

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,6 @@ desc.archived=Archiviert
856856
template.items=Template-Elemente
857857
template.git_content=Git Inhalt (Standardbranch)
858858
template.git_hooks=Git-Hooks
859-
template.git_hooks_tooltip=Du bist derzeit nicht in der Lage Git-Hooks zu ändern oder zu entfernen, sobald sie hinzugefügt wurden. Wähle das Template-Repository nur wenn du dessen Ersteller(n) vertraust.
860859
template.webhooks=Webhooks
861860
template.topics=Themen
862861
template.avatar=Profilbild
@@ -894,7 +893,6 @@ migrate_items_releases=Releases
894893
migrate_repo=Repository migrieren
895894
migrate.clone_address=Migrations- / Klon-URL
896895
migrate.clone_address_desc=Die HTTP(S)- oder „git clone“-URL eines bereits existierenden Repositorys
897-
migrate.github_token_desc=Sie können ein oder mehrere Token durch Komma getrennt hier einstellen, um die Migration aufgrund der Github API Ratenlimitierung zu beschleunigen. WARNUNG: Der Missbrauch dieser Funktion kann gegen die Richtlinien des Diensteanbieters verstoßen und zur Kontosperrung führen.
898896
migrate.clone_local_path=oder ein lokaler Serverpfad
899897
migrate.permission_denied=Du hast keine Berechtigung zum Importieren lokaler Repositories.
900898
migrate.invalid_local_path=Der lokale Pfad ist ungültig, existiert nicht oder ist kein Ordner.
@@ -908,7 +906,6 @@ migrate.migrating=Migriere von <b>%s</b> ...
908906
migrate.migrating_failed=Migrieren von <b>%s</b> fehlgeschlagen.
909907
migrate.migrating_failed.error=Fehler: %s
910908
migrate.migrating_failed_no_addr=Migration fehlgeschlagen.
911-
migrate.github.description=Daten von github.com oder anderen GitHub Instanzen migrieren.
912909
migrate.git.description=Ein Repository von einem beliebigen Git Service klonen.
913910
migrate.gitlab.description=Daten von gitlab.com oder anderen GitLab Instanzen migrieren.
914911
migrate.gitea.description=Daten von gitea.com oder anderen Gitea Instanzen migrieren.
@@ -1038,8 +1035,6 @@ editor.commit_empty_file_text=Die Datei, die du commiten willst, ist leer. Fortf
10381035
editor.no_changes_to_show=Keine Änderungen vorhanden.
10391036
editor.fail_to_update_file=Fehler beim Aktualisieren/Erstellen der Datei '%s'.
10401037
editor.fail_to_update_file_summary=Fehlermeldung:
1041-
editor.push_rejected_no_message=Die Änderung wurde vom Server ohne Nachricht abgelehnt. Bitte überprüfe die githooks.
1042-
editor.push_rejected=Die Änderung wurde vom Server abgelehnt. Bitte überprüfe die githooks.
10431038
editor.push_rejected_summary=Vollständige Ablehnungsmeldung:
10441039
editor.add_subdir=Verzeichnis erstellen…
10451040
editor.unable_to_upload_files=Fehler beim Hochladen der Dateien nach „%s“. Fehler: %v
@@ -1473,9 +1468,7 @@ pulls.rebase_conflict_summary=Fehlermeldung
14731468
; </summary><code>%[2]s<br>%[3]s</code></details>
14741469
pulls.unrelated_histories=Zusammenführung fehlgeschlagen: Der Head der Zusammenführung und die Basis haben keinen gemeinsamen Verlauf. Hinweis: Versuche eine andere Strategie
14751470
pulls.merge_out_of_date=Zusammenführung fehlgeschlagen: Während der Zusammenführung wurde die Basis aktualisiert. Hinweis: Versuche es erneut.
1476-
pulls.push_rejected=Zusammenführen fehlgeschlagen: Der Push wurde abgelehnt. Überprüfe die githooks für dieses Repository.
14771471
pulls.push_rejected_summary=Vollständige Ablehnungsmeldung
1478-
pulls.push_rejected_no_message=Merge fehlgeschlagen: Der Push wurde abgelehnt, aber es gab keine Fehlermeldung.<br>Überprüfe die Githooks für dieses Repository
14791472
pulls.open_unmerged_pull_exists=`Du kannst diesen Pull-Request nicht erneut öffnen, da noch ein anderer (#%d) mit identischen Eigenschaften offen ist.`
14801473
pulls.status_checking=Einige Prüfungen sind noch ausstehend
14811474
pulls.status_checks_success=Alle Prüfungen waren erfolgreich
@@ -1792,7 +1785,6 @@ settings.webhook.response=Antwort
17921785
settings.webhook.headers=Kopfzeilen
17931786
settings.webhook.payload=Inhalt
17941787
settings.webhook.body=Inhalt
1795-
settings.githooks_desc=Git-Hooks werden von Git selbst bereitgestellt. Du kannst die Dateien der unterstützten Hooks in der Liste unten bearbeiten, um eigene Operationen einzubinden.
17961788
settings.githook_edit_desc=Wenn ein Hook nicht aktiv ist, wird der Standardinhalt benutzt. Lasse den Inhalt leer, um den Hook zu deaktivieren.
17971789
settings.githook_name=Hook-Name
17981790
settings.githook_content=Hook-Inhalt

options/locale/locale_el-GR.ini

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,6 @@ desc.archived=Αρχειοθετημένο
856856
template.items=Αντικείμενα Προτύπου
857857
template.git_content=Περιεχόμενο Git (Προεπιλεγμένος Κλάδος)
858858
template.git_hooks=Git Hooks
859-
template.git_hooks_tooltip=Αυτή τη στιγμή δεν μπορείτε να τροποποιήσετε ή να αφαιρέσετε τα git hooks μόλις προστεθούν. Κάντε αυτή την επιλογή μόνο αν εμπιστεύεστε το πρότυπο αποθετήριο.
860859
template.webhooks=Webhooks
861860
template.topics=Θέματα
862861
template.avatar=Εικόνα
@@ -894,7 +893,6 @@ migrate_items_releases=Εκδόσεις
894893
migrate_repo=Μεταφορά Αποθετηρίου
895894
migrate.clone_address=Μεταφορά / Κλωνοποίηση Από Το URL
896895
migrate.clone_address_desc=Το HTTP(S) ή Git URL 'κλωνοποίησης' ενός υπάρχοντος αποθετηρίου
897-
migrate.github_token_desc=Μπορείτε να βάλετε ένα ή περισσότερα διακριτικά χωρίζοντας τα με κόμμα, ώστε να κάνετε τη μεταφορά γρηγορότερη, επειδή το API του Github έχει όριο ρυθμού. ΠΡΟΣΟΧΗ: Η κατάχρηση αυτής της δυνατότητας μπορεί να παραβιάσει την πολιτική του παρόχου υπηρεσιών και να οδηγήσει σε αποκλεισμό λογαριασμού.
898896
migrate.clone_local_path=ή μια διαδρομή τοπικού διακομιστή
899897
migrate.permission_denied=Δεν επιτρέπεται η εισαγωγή τοπικών αποθετηρίων.
900898
migrate.invalid_local_path=Η τοπική διαδρομή δεν είναι έγκυρη. Δεν υπάρχει ή δεν είναι φάκελος.
@@ -908,7 +906,6 @@ migrate.migrating=Γίνεται μεταφορά από <b>%s</b>...
908906
migrate.migrating_failed=Η μετεγρατάσταση από <b>%s</b> απέτυχε.
909907
migrate.migrating_failed.error=Σφάλμα: %s
910908
migrate.migrating_failed_no_addr=Η μεταφορά απέτυχε.
911-
migrate.github.description=Μεταφορά δεδομένων από το github.com ή άλλες εγκαταστάσεις Github.
912909
migrate.git.description=Μεταφορά μόνο του αποθετηρίου από μια οποιαδήποτε υπηρεσία Git.
913910
migrate.gitlab.description=Μεταφορά δεδομένων από το gitlab.com ή άλλες εγκαταστάσεις GitLab.
914911
migrate.gitea.description=Μεταφορά δεδομένων από το gitea.com ή άλλες εγκαταστάσεις Gitea.
@@ -1036,8 +1033,6 @@ editor.commit_empty_file_text=Το αρχείο που πρόκειται να
10361033
editor.no_changes_to_show=Δεν υπάρχουν αλλαγές για εμφάνιση.
10371034
editor.fail_to_update_file=Απέτυχε η ενημέρωση/δημιουργία του αρχείου '%s'.
10381035
editor.fail_to_update_file_summary=Μήνυμα Σφάλματος:
1039-
editor.push_rejected_no_message=Η αλλαγή απορρίφθηκε από το διακομιστή χωρίς μήνυμα. Παρακαλώ ελέγξτε τα githooks.
1040-
editor.push_rejected=Η αλλαγή απορρίφθηκε από τον διακομιστή. Παρακαλώ ελέγξτε τα githooks.
10411036
editor.push_rejected_summary=Μήνυμα Πλήρους Απόρριψης:
10421037
editor.add_subdir=Προσθήκη φακέλου…
10431038
editor.unable_to_upload_files=Αποτυχία αποστολής αρχείων στο '%s' με σφάλμα: %v
@@ -1467,9 +1462,7 @@ pulls.rebase_conflict_summary=Μήνυμα Σφάλματος
14671462
; </summary><code>%[2]s<br>%[3]s</code></details>
14681463
pulls.unrelated_histories=H Συγχώνευση Απέτυχε: Η κεφαλή και η βάση της συγχώνευσης δεν μοιράζονται μια κοινή ιστορία. Συμβουλή: Δοκιμάστε μια διαφορετική στρατηγική
14691464
pulls.merge_out_of_date=Η συγχώνευση απέτυχε: Κατά τη δημιουργία της συγχώνευσης, η βάση ενημερώθηκε. Συμβουλή: Δοκιμάστε ξανά.
1470-
pulls.push_rejected=Η Συγχώνευση Απέτυχε: Το push απορρίφθηκε. Ελέγξτε τα githooks για αυτό το αποθετήριο.
14711465
pulls.push_rejected_summary=Μήνυμα Πλήρους Απόρριψης
1472-
pulls.push_rejected_no_message=Συγχώνευση Απέτυχε: Η ώθηση απορρίφθηκε, αλλά δεν υπήρχε απομακρυσμένο μήνυμα.<br>Ελέγξτε τα githooks για αυτό το αποθετήριο
14731466
pulls.open_unmerged_pull_exists=`Δεν μπορείτε να ανοίξετε εκ νέου, επειδή υπάρχει ένα εκκρεμές pull request (#%d) με πανομοιότυπες ιδιότητες.`
14741467
pulls.status_checking=Μερικοί έλεγχοι εκκρεμούν
14751468
pulls.status_checks_success=Όλοι οι έλεγχοι ήταν επιτυχείς
@@ -1787,7 +1780,6 @@ settings.webhook.response=Απάντηση
17871780
settings.webhook.headers=Κεφαλίδες
17881781
settings.webhook.payload=Περιεχόμενο
17891782
settings.webhook.body=Σώμα
1790-
settings.githooks_desc=Τα Git hooks χρησιμοποιούνται από το ίδιο το Git. Μπορείτε να επεξεργαστείτε τα παρακάτω αρχεία hook για να ορίσετε προσαρμοσμένες λειτουργίες.
17911783
settings.githook_edit_desc=Αν το hook είναι ανενεργό, θα παρουσιαστεί ένα παράδειγμα. Αφήνοντας το περιεχόμενο του hook κενό θα το απενεργοποιήσετε.
17921784
settings.githook_name=Όνομα Hook
17931785
settings.githook_content=Περιεχόμενο Hook

options/locale/locale_en-US.ini

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ error404 = The page you are trying to reach either <strong>does not exist</stron
104104
never = Never
105105

106106
[error]
107-
occurred = An error has occurred
108-
report_message = If you are sure this is a Gitea bug, please search for issue on <a href="https://github.com/go-gitea/gitea/issues">GitHub</a> and open new issue if necessary.
107+
occurred = An error occurred
108+
report_message = If you are sure this is a Gitea bug, please search for issues on <a href="https://github.com/go-gitea/gitea/issues" target="_blank">GitHub</a> or open a new issue if necessary.
109109
missing_csrf = Bad Request: no CSRF token present
110-
invalid_csrf = Bad Request: Invalid CSRF token
110+
invalid_csrf = Bad Request: invalid CSRF token
111+
not_found = The target couldn't be found.
112+
network_error = Network error
111113
112114
[startpage]
113115
app_desc = A painless, self-hosted Git service

0 commit comments

Comments
 (0)