Skip to content

Commit

Permalink
Merge branch 'main' into lunny/fix_migrated_branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored Sep 20, 2024
2 parents 5d698f7 + aa9faf8 commit ee36478
Show file tree
Hide file tree
Showing 40 changed files with 161 additions and 265 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pull-db-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ jobs:
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
# some images before 2024-04 can't run on new kernels
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
MSSQL_PID: Standard
Expand Down
2 changes: 1 addition & 1 deletion models/issues/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (r *Review) TooltipContent() string {
}
return "repo.issues.review.official"
case ReviewTypeComment:
return "repo.issues.review.comment"
return "repo.issues.review.commented"
case ReviewTypeReject:
return "repo.issues.review.rejected"
case ReviewTypeRequest:
Expand Down
13 changes: 3 additions & 10 deletions modules/httplib/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ func getRequestScheme(req *http.Request) string {
return ""
}

func getForwardedHost(req *http.Request) string {
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host
return req.Header.Get("X-Forwarded-Host")
}

// GuessCurrentAppURL tries to guess the current full app URL (with sub-path) by http headers. It always has a '/' suffix, exactly the same as setting.AppURL
func GuessCurrentAppURL(ctx context.Context) string {
return GuessCurrentHostURL(ctx) + setting.AppSubURL + "/"
Expand All @@ -81,11 +76,9 @@ func GuessCurrentHostURL(ctx context.Context) string {
if reqScheme == "" {
return strings.TrimSuffix(setting.AppURL, setting.AppSubURL+"/")
}
reqHost := getForwardedHost(req)
if reqHost == "" {
reqHost = req.Host
}
return reqScheme + "://" + reqHost
// X-Forwarded-Host has many problems: non-standard, not well-defined (X-Forwarded-Port or not), conflicts with Host header.
// So do not use X-Forwarded-Host, just use Host header directly.
return reqScheme + "://" + req.Host
}

// MakeAbsoluteURL tries to make a link to an absolute URL:
Expand Down
5 changes: 3 additions & 2 deletions modules/httplib/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestMakeAbsoluteURL(t *testing.T) {
"X-Forwarded-Proto": {"https"},
},
})
assert.Equal(t, "https://forwarded-host/foo", MakeAbsoluteURL(ctx, "/foo"))
assert.Equal(t, "https://user-host/foo", MakeAbsoluteURL(ctx, "/foo"))
}

func TestIsCurrentGiteaSiteURL(t *testing.T) {
Expand Down Expand Up @@ -119,5 +119,6 @@ func TestIsCurrentGiteaSiteURL(t *testing.T) {
},
})
assert.True(t, IsCurrentGiteaSiteURL(ctx, "http://localhost:3000"))
assert.True(t, IsCurrentGiteaSiteURL(ctx, "https://forwarded-host"))
assert.True(t, IsCurrentGiteaSiteURL(ctx, "https://user-host"))
assert.False(t, IsCurrentGiteaSiteURL(ctx, "https://forwarded-host"))
}
4 changes: 1 addition & 3 deletions options/locale/locale_cs-CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ string.desc=Z – A

[error]
occurred=Došlo k chybě
missing_csrf=Špatný požadavek: Neexistuje CSRF token
invalid_csrf=Špatný požadavek: Neplatný CSRF token
not_found=Cíl nebyl nalezen.
network_error=Chyba sítě

Expand Down Expand Up @@ -1701,7 +1699,6 @@ issues.dependency.add_error_dep_not_same_repo=Oba úkoly musí být ve stejném
issues.review.self.approval=Nemůžete schválit svůj pull request.
issues.review.self.rejection=Nemůžete požadovat změny ve svém vlastním pull requestu.
issues.review.approve=schválil tyto změny %s
issues.review.comment=Okomentovat
issues.review.dismissed=zamítl/a posouzení od %s %s
issues.review.dismissed_label=Zamítnuto
issues.review.left_comment=zanechal komentář
Expand All @@ -1726,6 +1723,7 @@ issues.review.hide_resolved=Skrýt vyřešené
issues.review.resolve_conversation=Vyřešit konverzaci
issues.review.un_resolve_conversation=Nevyřešit konverzaci
issues.review.resolved_by=označil tuto konverzaci jako vyřešenou
issues.review.commented=Okomentovat
issues.assignee.error=Ne všichni zpracovatelé byli přidáni z důvodu neočekávané chyby.
issues.reference_issue.body=Tělo zprávy
issues.content_history.deleted=vymazáno
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_de-DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ string.desc=Z–A

[error]
occurred=Ein Fehler ist aufgetreten
missing_csrf=Fehlerhafte Anfrage: Kein CSRF Token verfügbar
invalid_csrf=Fehlerhafte Anfrage: Ungültiger CSRF Token
not_found=Das Ziel konnte nicht gefunden werden.
network_error=Netzwerkfehler

Expand Down Expand Up @@ -1681,7 +1679,6 @@ issues.dependency.add_error_dep_not_same_repo=Beide Issues müssen sich im selbe
issues.review.self.approval=Du kannst nicht dein eigenen Pull-Request genehmigen.
issues.review.self.rejection=Du kannst keine Änderungen an deinem eigenen Pull-Request anfragen.
issues.review.approve=hat die Änderungen %s genehmigt
issues.review.comment=Kommentieren
issues.review.dismissed=verwarf %ss Review %s
issues.review.dismissed_label=Verworfen
issues.review.left_comment=hat einen Kommentar hinterlassen
Expand All @@ -1706,6 +1703,7 @@ issues.review.hide_resolved=Gelöste ausblenden
issues.review.resolve_conversation=Diskussion als "erledigt" markieren
issues.review.un_resolve_conversation=Diskussion als "nicht-erledigt" markieren
issues.review.resolved_by=markierte diese Unterhaltung als gelöst
issues.review.commented=Kommentieren
issues.assignee.error=Aufgrund eines unerwarteten Fehlers konnten nicht alle Beauftragten hinzugefügt werden.
issues.reference_issue.body=Beschreibung
issues.content_history.deleted=gelöscht
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_el-GR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ string.desc=Z - A

[error]
occurred=Παρουσιάστηκε ένα σφάλμα
missing_csrf=Bad Request: δεν υπάρχει διακριτικό CSRF
invalid_csrf=Λάθος Αίτημα: μη έγκυρο διακριτικό CSRF
not_found=Ο προορισμός δεν βρέθηκε.
network_error=Σφάλμα δικτύου

Expand Down Expand Up @@ -1603,7 +1601,6 @@ issues.dependency.add_error_dep_not_same_repo=Και τα δύο ζητήματ
issues.review.self.approval=Δεν μπορείτε να εγκρίνετε το δικό σας pull request.
issues.review.self.rejection=Δεν μπορείτε να ζητήσετε αλλαγές στο δικό σας pull request.
issues.review.approve=ενέκρινε αυτές τις αλλαγές %s
issues.review.comment=Σχόλιο
issues.review.dismissed=απέρριψε την αξιολόγηση %s %s
issues.review.dismissed_label=Απορρίφθηκε
issues.review.left_comment=άφησε ένα σχόλιο
Expand All @@ -1628,6 +1625,7 @@ issues.review.hide_resolved=Απόκρυψη επιλυμένων
issues.review.resolve_conversation=Επίλυση συνομιλίας
issues.review.un_resolve_conversation=Ανεπίλυτη συνομιλία
issues.review.resolved_by=σημείωση αυτή την συνομιλία ως επιλυμένη
issues.review.commented=Σχόλιο
issues.assignee.error=Δεν προστέθηκαν όλοι οι παραλήπτες λόγω απροσδόκητου σφάλματος.
issues.reference_issue.body=Σώμα
issues.content_history.deleted=διαγράφηκε
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ string.desc = Z - A
[error]
occurred = An error occurred
report_message = If you believe that this is a Gitea bug, please search for issues on <a href="%s" target="_blank">GitHub</a> or open a new issue if necessary.
missing_csrf = Bad Request: no CSRF token present
invalid_csrf = Bad Request: invalid CSRF token
not_found = The target couldn't be found.
network_error = Network error
Expand Down Expand Up @@ -1759,7 +1757,7 @@ issues.review.hide_resolved = Hide resolved
issues.review.resolve_conversation = Resolve conversation
issues.review.un_resolve_conversation = Unresolve conversation
issues.review.resolved_by = marked this conversation as resolved
issues.review.comment = Comment
issues.review.commented = Comment
issues.review.official = Approved
issues.review.requested = Review pending
issues.review.rejected = Changes requested
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_es-ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ string.desc=Z - A

[error]
occurred=Ha ocurrido un error
missing_csrf=Solicitud incorrecta: sin token CSRF
invalid_csrf=Solicitud incorrecta: el token CSRF no es válido
not_found=El objetivo no pudo ser encontrado.
network_error=Error de red

Expand Down Expand Up @@ -1593,7 +1591,6 @@ issues.dependency.add_error_dep_not_same_repo=Ambas incidencias deben estar en e
issues.review.self.approval=No puede aprobar su propio pull request.
issues.review.self.rejection=No puede sugerir cambios en su propio pull request.
issues.review.approve=aprobado estos cambios %s
issues.review.comment=Comentario
issues.review.dismissed=descartó la revisión de %s %s
issues.review.dismissed_label=Descartado
issues.review.left_comment=dejó un comentario
Expand All @@ -1618,6 +1615,7 @@ issues.review.hide_resolved=Ocultar resueltos
issues.review.resolve_conversation=Resolver conversación
issues.review.un_resolve_conversation=Marcar conversación sin resolver
issues.review.resolved_by=ha marcado esta conversación como resuelta
issues.review.commented=Comentario
issues.assignee.error=No todos los asignados fueron añadidos debido a un error inesperado.
issues.reference_issue.body=Cuerpo
issues.content_history.deleted=borrado
Expand Down
3 changes: 1 addition & 2 deletions options/locale/locale_fa-IR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ filter.private=خصوصی
[filter]

[error]
missing_csrf=درخواست بد: بلیط CSRF ندارد

[startpage]
app_desc=یک سرویس گیت بی‌درد سر و راحت
Expand Down Expand Up @@ -1235,7 +1234,6 @@ issues.dependency.add_error_dep_not_same_repo=هر دو موضوع باید از
issues.review.self.approval=شما نمی‌توانید تقاضای واکشی خود را تایید کنید.
issues.review.self.rejection=شما نمی‌توانید تقاضا تغییرات تقاضای واکشی خود را تغییر دهید.
issues.review.approve=این تغییرات را تایید شدند %s
issues.review.comment=دیدگاه
issues.review.dismissed=بررسی %s %s را رد شده
issues.review.dismissed_label=رها شده
issues.review.left_comment=یک نظر ثبت کرد
Expand All @@ -1256,6 +1254,7 @@ issues.review.hide_resolved=مخفی کردن حل شده ها
issues.review.resolve_conversation=مکالمه را بعنوان حل شده علامت گذاری کردن
issues.review.un_resolve_conversation=مکالمه را بعنوان حل نشده علامت گذاری کردن
issues.review.resolved_by=علامت گذاری این مکالمه بعنوان حل شده
issues.review.commented=دیدگاه
issues.assignee.error=به دلیل خطای غیرمنتظره همه تکالیف اضافه نشد.
issues.reference_issue.body=Body
issues.content_history.deleted=حذف شده
Expand Down
3 changes: 1 addition & 2 deletions options/locale/locale_fi-FI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ filter.private=Yksityinen

[error]
occurred=Virhe tapahtui
missing_csrf=Virheellinen pyyntö: CSRF-tunnusta ei ole olemassa
invalid_csrf=Virheellinen pyyntö: Virheellinen CSRF-tunniste
not_found=Kohdetta ei löytynyt.
network_error=Verkkovirhe

Expand Down Expand Up @@ -955,6 +953,7 @@ issues.review.left_comment=jätti kommentin
issues.review.pending=Odottaa
issues.review.show_resolved=Näytä ratkaisu
issues.review.hide_resolved=Piilota ratkaisu
issues.review.commented=Kommentoi
issues.reference_issue.body=Kuvaus
issues.content_history.deleted=poistettu
issues.content_history.edited=muokattu
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_fr-FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ string.desc=Z - A
[error]
occurred=Une erreur s’est produite
missing_csrf=Requête incorrecte: aucun jeton CSRF présent
invalid_csrf=Requête incorrecte : jeton CSRF invalide
not_found=La cible n'a pu être trouvée.
network_error=Erreur réseau

Expand Down Expand Up @@ -1704,7 +1702,6 @@ issues.dependency.add_error_dep_not_same_repo=Les deux tickets doivent être dan
issues.review.self.approval=Vous ne pouvez approuver vos propres demandes d'ajout.
issues.review.self.rejection=Vous ne pouvez demander de changements sur vos propres demandes de changement.
issues.review.approve=a approuvé ces modifications %s.
issues.review.comment=Commenter
issues.review.dismissed=a révoqué l’évaluation de %s %s.
issues.review.dismissed_label=Révoquée
issues.review.left_comment=laisser un commentaire
Expand All @@ -1729,6 +1726,7 @@ issues.review.hide_resolved=Réduire
issues.review.resolve_conversation=Clore la conversation
issues.review.un_resolve_conversation=Rouvrir la conversation
issues.review.resolved_by=a marqué cette conversation comme résolue.
issues.review.commented=Commenter
issues.assignee.error=Tous les assignés n'ont pas été ajoutés en raison d'une erreur inattendue.
issues.reference_issue.body=Corps
issues.content_history.deleted=a supprimé
Expand Down
2 changes: 1 addition & 1 deletion options/locale/locale_hu-HU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -901,13 +901,13 @@ issues.dependency.add_error_dep_issue_not_exist=Függő hibajegy nem létezik.
issues.dependency.add_error_dep_not_exist=A függőség nem létezik.
issues.dependency.add_error_dep_exists=A függőség már létezik.
issues.dependency.add_error_dep_not_same_repo=Mindkét hibajegynek ugyanabban a tárolóban kell lennie.
issues.review.comment=Hozzászólás
issues.review.reject=%s változtatások kérése
issues.review.pending=Függőben
issues.review.review=Értékelés
issues.review.reviewers=Véleményezők
issues.review.show_outdated=Elavultak mutatása
issues.review.hide_outdated=Elavultak elrejtése
issues.review.commented=Hozzászólás
issues.assignee.error=Nem minden megbízott lett hozzáadva egy nem várt hiba miatt.


Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_is-IS.ini
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ filter.public=Opinbert

[error]
occurred=Villa kom upp
missing_csrf=Slæm beiðni: enginn CSRF lykill
invalid_csrf=Slæm beiðni: ógildur CSRF lykill
not_found=Markmiðið fannst ekki.
network_error=Netkerfisvilla

Expand Down Expand Up @@ -850,13 +848,13 @@ issues.dependency.remove_header=Fjarlægja Kröfu
issues.dependency.add_error_dep_not_exist=Krafa er ekki til.
issues.dependency.add_error_dep_exists=Krafa er nú þegar til.
issues.review.approve=samþykkti þessar breytingar %s
issues.review.comment=Senda Ummæli
issues.review.dismissed_label=Hunsað
issues.review.left_comment=gerði ummæli
issues.review.pending=Í bið
issues.review.outdated=Úrelt
issues.review.show_outdated=Sýna úrelt
issues.review.hide_outdated=Fela úreld
issues.review.commented=Senda Ummæli
issues.reference_issue.body=Meginmál
issues.content_history.deleted=eytt
issues.content_history.edited=breytt
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_it-IT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ filter.private=Privati

[error]
occurred=Si è verificato un errore
missing_csrf=Richiesta errata: nessun token CSRF presente
invalid_csrf=Richiesta errata: token CSRF non valido
not_found=Il bersaglio non è stato trovato.
network_error=Errore di rete

Expand Down Expand Up @@ -1331,7 +1329,6 @@ issues.dependency.add_error_dep_not_same_repo=Entrambi i problemi devono essere
issues.review.self.approval=Non puoi approvare la tua pull request.
issues.review.self.rejection=Non puoi richiedere modifiche sulla tua pull request.
issues.review.approve=hanno approvato queste modifiche %s
issues.review.comment=Commentare
issues.review.dismissed=recensione %s di %s respinta
issues.review.dismissed_label=Respinta
issues.review.left_comment=lascia un commento
Expand All @@ -1352,6 +1349,7 @@ issues.review.hide_resolved=Nascondi risolte
issues.review.resolve_conversation=Risolvi la conversazione
issues.review.un_resolve_conversation=Segnala la conversazione come non risolta
issues.review.resolved_by=ha contrassegnato questa conversazione come risolta
issues.review.commented=Commentare
issues.assignee.error=Non tutte le assegnazioni sono state aggiunte a causa di un errore imprevisto.
issues.reference_issue.body=Corpo
issues.content_history.deleted=eliminato
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_ja-JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ string.desc=Z - A

[error]
occurred=エラーが発生しました
missing_csrf=不正なリクエスト: CSRFトークンがありません
invalid_csrf=不正なリクエスト: CSRFトークンが無効です
not_found=ターゲットが見つかりませんでした。
network_error=ネットワークエラー

Expand Down Expand Up @@ -1714,7 +1712,6 @@ issues.dependency.add_error_dep_not_same_repo=両方とも同じリポジトリ
issues.review.self.approval=自分のプルリクエストを承認することはできません。
issues.review.self.rejection=自分のプルリクエストに対して修正を要求することはできません。
issues.review.approve=が変更を承認 %s
issues.review.comment=コメント
issues.review.dismissed=が %s のレビューを棄却 %s
issues.review.dismissed_label=棄却
issues.review.left_comment=がコメント
Expand All @@ -1739,6 +1736,7 @@ issues.review.hide_resolved=解決済みを隠す
issues.review.resolve_conversation=解決済みにする
issues.review.un_resolve_conversation=未解決にする
issues.review.resolved_by=がこの会話を解決済みにしました
issues.review.commented=コメント
issues.assignee.error=予期しないエラーにより、一部の担当者を追加できませんでした。
issues.reference_issue.body=内容
issues.content_history.deleted=削除しました
Expand Down
2 changes: 1 addition & 1 deletion options/locale/locale_ko-KR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -818,12 +818,12 @@ issues.dependency.add_error_dep_not_same_repo=두 이슈는 같은 레포지토
issues.review.self.approval=자신의 풀 리퀘스트를 승인할 수 없습니다.
issues.review.self.rejection=자신의 풀 리퀘스트에 대한 변경을 요청할 수 없습니다.
issues.review.approve="이 변경사항을 승인하였습니다. %s"
issues.review.comment=댓글
issues.review.pending=보류
issues.review.review=검토
issues.review.reviewers=리뷰어
issues.review.show_outdated=오래된 내역 보기
issues.review.hide_outdated=오래된 내역 숨기기
issues.review.commented=댓글


pulls.new=새 풀 리퀘스트
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_lv-LV.ini
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ string.desc=Z - A

[error]
occurred=Radusies kļūda
missing_csrf=Kļūdains pieprasījums: netika iesūtīta drošības pilnvara
invalid_csrf=Kļūdains pieprasījums: iesūtīta kļūdaina drošības pilnvara
not_found=Pieprasītie dati netika atrasti.
network_error=Tīkla kļūda

Expand Down Expand Up @@ -1609,7 +1607,6 @@ issues.dependency.add_error_dep_not_same_repo=Abām problēmām ir jābūt no vi
issues.review.self.approval=Nevar apstiprināt savu izmaiņu pieprasījumi.
issues.review.self.rejection=Nevar pieprasīt izmaiņas savam izmaiņu pieprasījumam.
issues.review.approve=apstiprināja izmaiņas %s
issues.review.comment=Komentēt
issues.review.dismissed=atmeta %s recenziju %s
issues.review.dismissed_label=Atmesta
issues.review.left_comment=atstāja komentāru
Expand All @@ -1634,6 +1631,7 @@ issues.review.hide_resolved=Paslēpt atrisināto
issues.review.resolve_conversation=Atrisināt sarunu
issues.review.un_resolve_conversation=Atcelt sarunas atrisinājumu
issues.review.resolved_by=atzīmēja sarunu kā atrisinātu
issues.review.commented=Komentēt
issues.assignee.error=Ne visi atbildīgie tika pievienoti, jo radās neparedzēta kļūda.
issues.reference_issue.body=Saturs
issues.content_history.deleted=dzēsts
Expand Down
4 changes: 1 addition & 3 deletions options/locale/locale_nl-NL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ filter.private=Prive

[error]
occurred=Er is een fout opgetreden
missing_csrf=Foutief verzoek: geen CSRF-token aanwezig
invalid_csrf=Verkeerd verzoek: ongeldig CSRF-token
not_found=Het doel kon niet worden gevonden.
network_error=Netwerk fout

Expand Down Expand Up @@ -1328,7 +1326,6 @@ issues.dependency.add_error_dep_not_same_repo=Beide kwesties moeten in dezelfde
issues.review.self.approval=Je kan je eigen pull-aanvraag niet goedkeuren.
issues.review.self.rejection=Je kan geen wijzigingen aanvragen op je eigen pull-aanvraag.
issues.review.approve=heeft deze veranderingen %s goedgekeurd
issues.review.comment=Opmerking
issues.review.dismissed=%s's beoordeling afgewezen %s
issues.review.dismissed_label=Afgewezen
issues.review.left_comment=heeft een reactie achtergelaten
Expand All @@ -1349,6 +1346,7 @@ issues.review.hide_resolved=Verbergen afgehandeld
issues.review.resolve_conversation=Gesprek oplossen
issues.review.un_resolve_conversation=Gesprek niet oplossen
issues.review.resolved_by=markeerde dit gesprek als opgelost
issues.review.commented=Opmerking
issues.assignee.error=Niet alle aangewezen personen zijn toegevoegd vanwege een onverwachte fout.
issues.reference_issue.body=Inhoud
issues.content_history.deleted=verwijderd
Expand Down
Loading

0 comments on commit ee36478

Please sign in to comment.