Skip to content

Commit 411703c

Browse files
authored
Merge branch 'main' into migration-credentials
2 parents 23b1d1e + e39e79d commit 411703c

File tree

20 files changed

+129
-52
lines changed

20 files changed

+129
-52
lines changed

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ update: $(THEME)
3131
$(THEME): $(THEME)/theme.toml
3232
$(THEME)/theme.toml:
3333
mkdir -p $$(dirname $@)
34-
curl -s $(ARCHIVE) | tar xz -C $$(dirname $@)
34+
curl -L -s $(ARCHIVE) | tar xz -C $$(dirname $@)

integrations/pull_merge_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,8 @@ func TestCantMergeWorkInProgress(t *testing.T) {
197197
text := strings.TrimSpace(htmlDoc.doc.Find(".merge-section > .item").Last().Text())
198198
assert.NotEmpty(t, text, "Can't find WIP text")
199199

200-
// remove <strong /> from lang
201-
expected := i18n.Tr("en", "repo.pulls.cannot_merge_work_in_progress", "[wip]")
202-
replacer := strings.NewReplacer("<strong>", "", "</strong>", "")
203-
assert.Equal(t, replacer.Replace(expected), text, "Unable to find WIP text")
200+
assert.Contains(t, text, i18n.Tr("en", "repo.pulls.cannot_merge_work_in_progress"), "Unable to find WIP text")
201+
assert.Contains(t, text, "[wip]", "Unable to find WIP text")
204202
})
205203
}
206204

modules/auth/sso/basic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (b *Basic) IsEnabled() bool {
5151
func (b *Basic) VerifyAuthData(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) *models.User {
5252

5353
// Basic authentication should only fire on API, Download or on Git or LFSPaths
54-
if middleware.IsInternalPath(req) || !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitOrLFSPath(req) {
54+
if middleware.IsInternalPath(req) || !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitRawOrLFSPath(req) {
5555
return nil
5656
}
5757

modules/auth/sso/reverseproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (r *ReverseProxy) VerifyAuthData(req *http.Request, w http.ResponseWriter,
7878
}
7979

8080
// Make sure requests to API paths, attachment downloads, git and LFS do not create a new session
81-
if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitOrLFSPath(req) {
81+
if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitRawOrLFSPath(req) {
8282
if sess.Get("uid").(int64) != user.ID {
8383
handleSignIn(w, req, sess, user)
8484
}

modules/auth/sso/sso.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ func isAttachmentDownload(req *http.Request) bool {
104104
return strings.HasPrefix(req.URL.Path, "/attachments/") && req.Method == "GET"
105105
}
106106

107-
var gitPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/))`)
107+
var gitRawPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/)|raw/)`)
108108
var lfsPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/info/lfs/`)
109109

110-
func isGitOrLFSPath(req *http.Request) bool {
111-
if gitPathRe.MatchString(req.URL.Path) {
110+
func isGitRawOrLFSPath(req *http.Request) bool {
111+
if gitRawPathRe.MatchString(req.URL.Path) {
112112
return true
113113
}
114114
if setting.LFS.StartServer {

modules/auth/sso/sso_test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"code.gitea.io/gitea/modules/setting"
1313
)
1414

15-
func Test_isGitOrLFSPath(t *testing.T) {
15+
func Test_isGitRawOrLFSPath(t *testing.T) {
1616

1717
tests := []struct {
1818
path string
@@ -63,6 +63,10 @@ func Test_isGitOrLFSPath(t *testing.T) {
6363
"/owner/repo/objects/pack/pack-0123456789abcdef0123456789abcdef0123456.idx",
6464
true,
6565
},
66+
{
67+
"/owner/repo/raw/branch/foo/fanaso",
68+
true,
69+
},
6670
{
6771
"/owner/repo/stars",
6872
false,
@@ -98,11 +102,11 @@ func Test_isGitOrLFSPath(t *testing.T) {
98102
t.Run(tt.path, func(t *testing.T) {
99103
req, _ := http.NewRequest("POST", "http://localhost"+tt.path, nil)
100104
setting.LFS.StartServer = false
101-
if got := isGitOrLFSPath(req); got != tt.want {
105+
if got := isGitRawOrLFSPath(req); got != tt.want {
102106
t.Errorf("isGitOrLFSPath() = %v, want %v", got, tt.want)
103107
}
104108
setting.LFS.StartServer = true
105-
if got := isGitOrLFSPath(req); got != tt.want {
109+
if got := isGitRawOrLFSPath(req); got != tt.want {
106110
t.Errorf("isGitOrLFSPath() = %v, want %v", got, tt.want)
107111
}
108112
})
@@ -111,11 +115,11 @@ func Test_isGitOrLFSPath(t *testing.T) {
111115
t.Run(tt, func(t *testing.T) {
112116
req, _ := http.NewRequest("POST", tt, nil)
113117
setting.LFS.StartServer = false
114-
if got := isGitOrLFSPath(req); got != setting.LFS.StartServer {
115-
t.Errorf("isGitOrLFSPath(%q) = %v, want %v, %v", tt, got, setting.LFS.StartServer, gitPathRe.MatchString(tt))
118+
if got := isGitRawOrLFSPath(req); got != setting.LFS.StartServer {
119+
t.Errorf("isGitOrLFSPath(%q) = %v, want %v, %v", tt, got, setting.LFS.StartServer, gitRawPathRe.MatchString(tt))
116120
}
117121
setting.LFS.StartServer = true
118-
if got := isGitOrLFSPath(req); got != setting.LFS.StartServer {
122+
if got := isGitRawOrLFSPath(req); got != setting.LFS.StartServer {
119123
t.Errorf("isGitOrLFSPath(%q) = %v, want %v", tt, got, setting.LFS.StartServer)
120124
}
121125
})

modules/setting/indexer.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package setting
66

77
import (
8-
"path"
98
"path/filepath"
109
"strings"
1110
"time"
@@ -68,23 +67,23 @@ var (
6867
func newIndexerService() {
6968
sec := Cfg.Section("indexer")
7069
Indexer.IssueType = sec.Key("ISSUE_INDEXER_TYPE").MustString("bleve")
71-
Indexer.IssuePath = sec.Key("ISSUE_INDEXER_PATH").MustString(path.Join(AppDataPath, "indexers/issues.bleve"))
70+
Indexer.IssuePath = filepath.ToSlash(sec.Key("ISSUE_INDEXER_PATH").MustString(filepath.ToSlash(filepath.Join(AppDataPath, "indexers/issues.bleve"))))
7271
if !filepath.IsAbs(Indexer.IssuePath) {
73-
Indexer.IssuePath = path.Join(AppWorkPath, Indexer.IssuePath)
72+
Indexer.IssuePath = filepath.ToSlash(filepath.Join(AppWorkPath, Indexer.IssuePath))
7473
}
7574
Indexer.IssueConnStr = sec.Key("ISSUE_INDEXER_CONN_STR").MustString(Indexer.IssueConnStr)
7675
Indexer.IssueIndexerName = sec.Key("ISSUE_INDEXER_NAME").MustString(Indexer.IssueIndexerName)
7776

7877
Indexer.IssueQueueType = sec.Key("ISSUE_INDEXER_QUEUE_TYPE").MustString(LevelQueueType)
79-
Indexer.IssueQueueDir = sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(path.Join(AppDataPath, "queues/common"))
78+
Indexer.IssueQueueDir = filepath.ToSlash(sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(filepath.ToSlash(filepath.Join(AppDataPath, "queues/common"))))
8079
Indexer.IssueQueueConnStr = sec.Key("ISSUE_INDEXER_QUEUE_CONN_STR").MustString("")
8180
Indexer.IssueQueueBatchNumber = sec.Key("ISSUE_INDEXER_QUEUE_BATCH_NUMBER").MustInt(20)
8281

8382
Indexer.RepoIndexerEnabled = sec.Key("REPO_INDEXER_ENABLED").MustBool(false)
8483
Indexer.RepoType = sec.Key("REPO_INDEXER_TYPE").MustString("bleve")
85-
Indexer.RepoPath = sec.Key("REPO_INDEXER_PATH").MustString(path.Join(AppDataPath, "indexers/repos.bleve"))
84+
Indexer.RepoPath = filepath.ToSlash(sec.Key("REPO_INDEXER_PATH").MustString(filepath.ToSlash(filepath.Join(AppDataPath, "indexers/repos.bleve"))))
8685
if !filepath.IsAbs(Indexer.RepoPath) {
87-
Indexer.RepoPath = path.Join(AppWorkPath, Indexer.RepoPath)
86+
Indexer.RepoPath = filepath.ToSlash(filepath.Join(AppWorkPath, Indexer.RepoPath))
8887
}
8988
Indexer.RepoConnStr = sec.Key("REPO_INDEXER_CONN_STR").MustString("")
9089
Indexer.RepoIndexerName = sec.Key("REPO_INDEXER_NAME").MustString("gitea_codes")

modules/setting/queue.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func GetQueueSettings(name string) QueueSettings {
4848
q.Name = name
4949

5050
// DataDir is not directly inheritable
51-
q.DataDir = filepath.Join(Queue.DataDir, "common")
51+
q.DataDir = filepath.ToSlash(filepath.Join(Queue.DataDir, "common"))
5252
// QueueName is not directly inheritable either
5353
q.QueueName = name + Queue.QueueName
5454
for _, key := range sec.Keys() {
@@ -91,9 +91,9 @@ func GetQueueSettings(name string) QueueSettings {
9191
// This is exported for tests to be able to use the queue
9292
func NewQueueService() {
9393
sec := Cfg.Section("queue")
94-
Queue.DataDir = sec.Key("DATADIR").MustString("queues/")
94+
Queue.DataDir = filepath.ToSlash(sec.Key("DATADIR").MustString("queues/"))
9595
if !filepath.IsAbs(Queue.DataDir) {
96-
Queue.DataDir = filepath.Join(AppDataPath, Queue.DataDir)
96+
Queue.DataDir = filepath.ToSlash(filepath.Join(AppDataPath, Queue.DataDir))
9797
}
9898
Queue.QueueLength = sec.Key("LENGTH").MustInt(20)
9999
Queue.BatchLength = sec.Key("BATCH_LENGTH").MustInt(20)

modules/web/middleware/cookie.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func SetCookie(resp http.ResponseWriter, name string, value string, others ...in
149149
if len(others) > 2 {
150150
if v, ok := others[2].(string); ok && len(v) > 0 {
151151
cookie.Domain = v
152-
} else if v, ok := others[1].(func(*http.Cookie)); ok {
152+
} else if v, ok := others[2].(func(*http.Cookie)); ok {
153153
v(&cookie)
154154
}
155155
}
@@ -170,7 +170,7 @@ func SetCookie(resp http.ResponseWriter, name string, value string, others ...in
170170
if len(others) > 4 {
171171
if v, ok := others[4].(bool); ok && v {
172172
cookie.HttpOnly = true
173-
} else if v, ok := others[1].(func(*http.Cookie)); ok {
173+
} else if v, ok := others[4].(func(*http.Cookie)); ok {
174174
v(&cookie)
175175
}
176176
}
@@ -179,7 +179,7 @@ func SetCookie(resp http.ResponseWriter, name string, value string, others ...in
179179
if v, ok := others[5].(time.Time); ok {
180180
cookie.Expires = v
181181
cookie.RawExpires = v.Format(time.UnixDate)
182-
} else if v, ok := others[1].(func(*http.Cookie)); ok {
182+
} else if v, ok := others[5].(func(*http.Cookie)); ok {
183183
v(&cookie)
184184
}
185185
}

options/locale/locale_de-DE.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,8 @@ issues.review.resolved_by=markierte diese Unterhaltung als gelöst
12851285
issues.assignee.error=Aufgrund eines unerwarteten Fehlers konnten nicht alle Beauftragten hinzugefügt werden.
12861286
issues.reference_issue.body=Beschreibung
12871287

1288+
compare.compare_base=Basis
1289+
compare.compare_head=vergleichen
12881290

12891291
pulls.desc=Pull-Requests und Code-Reviews aktivieren.
12901292
pulls.new=Neuer Pull-Request
@@ -1547,6 +1549,7 @@ settings.email_notifications.disable=E-Mail Benachrichtigungen deaktivieren
15471549
settings.email_notifications.submit=E-Mail-Einstellungen festlegen
15481550
settings.site=Webseite
15491551
settings.update_settings=Einstellungen speichern
1552+
settings.branches.update_default_branch=Standardbranch aktualisieren
15501553
settings.advanced_settings=Erweiterte Einstellungen
15511554
settings.wiki_desc=Repository-Uncyclo aktivieren
15521555
settings.use_internal_wiki=Eingebautes Uncyclo verwenden
@@ -1887,6 +1890,7 @@ diff.file_image_width=Breite
18871890
diff.file_image_height=Höhe
18881891
diff.file_byte_size=Größe
18891892
diff.file_suppressed=Datei-Diff unterdrückt, da er zu groß ist
1893+
diff.file_suppressed_line_too_long=Dateidiff unterdrückt, weil mindestens eine Zeile zu lang ist
18901894
diff.too_many_files=Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.
18911895
diff.comment.placeholder=Kommentieren...
18921896
diff.comment.markdown_info=Styling mit Markdown wird unterstützt.
@@ -1972,6 +1976,10 @@ branch.restore=Branch „%s“ wiederherstellen
19721976
branch.download=Branch „%s“ herunterladen
19731977
branch.included_desc=Dieser Branch ist im Standard-Branch enthalten
19741978
branch.included=Enthalten
1979+
branch.create_new_branch=Branch aus Branch erstellen:
1980+
branch.confirm_create_branch=Branch erstellen
1981+
branch.new_branch=Neue Branch erstellen
1982+
branch.new_branch_from=Neue Branch von '%s' erstellen
19751983

19761984
tag.create_tag=Tag <strong>%s</strong> erstellen
19771985
tag.create_success=Tag "%s" wurde erstellt.
@@ -2308,6 +2316,7 @@ auths.allowed_domains_helper=Leer lassen, um alle Domains zuzulassen. Trenne meh
23082316
auths.enable_tls=TLS-Verschlüsselung aktivieren
23092317
auths.skip_tls_verify=TLS-Verifikation überspringen
23102318
auths.pam_service_name=PAM-Dienstname
2319+
auths.pam_email_domain=PAM E-Mail-Domain (optional)
23112320
auths.oauth2_provider=OAuth2-Anbieter
23122321
auths.oauth2_icon_url=Icon URL
23132322
auths.oauth2_clientID=Client-ID (Schlüssel)

options/locale/locale_en-US.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,10 @@ pulls.manually_merged_as = The pull request has been manually merged as <a rel="
13161316
pulls.is_closed = The pull request has been closed.
13171317
pulls.has_merged = The pull request has been merged.
13181318
pulls.title_wip_desc = `<a href="#">Start the title with <strong>%s</strong></a> to prevent the pull request from being merged accidentally.`
1319-
pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress. Remove the <strong>%s</strong> prefix from the title when it's ready
1319+
pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress.
1320+
pulls.still_in_progress = Still in progress?
1321+
pulls.add_prefix = Add <strong>%s</strong> prefix
1322+
pulls.remove_prefix = Remove <strong>%s</strong> prefix
13201323
pulls.data_broken = This pull request is broken due to missing fork information.
13211324
pulls.files_conflicted = This pull request has changes conflicting with the target branch.
13221325
pulls.is_checking = "Merge conflict checking is in progress. Try again in few moments."

options/locale/locale_it-IT.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ users=Utenti
240240
organizations=Organizzazioni
241241
search=Cerca
242242
code=Codice
243+
search.fuzzy=Fuzzy
243244
search.match=Corrispondenze
244245
repo_no_results=Nessuna repository corrispondente.
245246
user_no_results=Nessun utente corrispondente.
@@ -366,6 +367,7 @@ password_not_match=Le password non corrispondono.
366367
lang_select_error=Selezionare una lingua dall'elenco.
367368
368369
username_been_taken=Il Nome utente esiste già.
370+
username_change_not_local_user=Gli utenti non locali non sono autorizzati a modificare il proprio nome utente.
369371
repo_name_been_taken=Il nome del repository esiste già.
370372
repository_files_already_exist=File già esistenti per questo repository. Contatta l'amministratore di sistema.
371373
repository_files_already_exist.adopt=I file esistono già per questo repository e possono essere solo Adottati.
@@ -455,6 +457,7 @@ update_language_not_found=La lingua '%s' non è disponibile.
455457
update_profile_success=Il tuo profilo è stato aggiornato.
456458
change_username=Il tuo nome utente è stato modificato.
457459
change_username_prompt=Nota: i cambiamenti al nome utente vanno a modificare anche l'URL del tuo account.
460+
change_username_redirect_prompt=Il vecchio nome utente verrà reindirizzato fino a quando non verrà richiesto da un nuovo utente.
458461
continue=Continua
459462
cancel=Annulla
460463
language=Lingua
@@ -542,6 +545,7 @@ add_principal_success=Il certificato SSH '%s' è stato aggiunto.
542545
delete_key=Rimuovi
543546
ssh_key_deletion=Rimuovi chiave SSH
544547
gpg_key_deletion=Rimuovi chiave GPG
548+
ssh_principal_deletion=Rimuovi certificato SSH principale
545549
ssh_key_deletion_desc=Rimuovere una chiave SSH ne revoca l'accesso al tuo account. Continuare?
546550
gpg_key_deletion_desc=La rimozione di una chiave GPG invalida i commits firmati da essa. Continuare?
547551
ssh_key_deletion_success=La chiave SSH è stata rimossa.
@@ -687,6 +691,7 @@ license=Licenza
687691
license_helper=Seleziona un file di licenza.
688692
readme=LEGGIMI
689693
readme_helper=Seleziona un template per il file LEGGIMI.
694+
readme_helper_desc=Qui puoi scrivere una descrizione completa del progetto.
690695
auto_init=Inizializza Repository (Aggiungi .gitignore, Licenza e LEGGIMI)
691696
trust_model_helper=Seleziona il modello di fiducia per la verifica della firma. Le opzioni possibili sono:
692697
trust_model_helper_collaborator=Collaboratore: Fidati delle firme da parte dei collaboratori
@@ -1024,6 +1029,7 @@ issues.filter_type.all_issues=Tutti i problemi
10241029
issues.filter_type.assigned_to_you=Assegnati a te
10251030
issues.filter_type.created_by_you=Creati da te
10261031
issues.filter_type.mentioning_you=Che ti riguardano
1032+
issues.filter_type.review_requested=Richiesta revisione
10271033
issues.filter_sort=Ordina
10281034
issues.filter_sort.latest=Più recenti
10291035
issues.filter_sort.oldest=Più vecchi
@@ -1229,6 +1235,7 @@ pulls.reopen_to_merge=Riapri questa pull request per effettuare l'unione.
12291235
pulls.cant_reopen_deleted_branch=Questa pull request non può essere riaperta perché il branch è stato eliminato.
12301236
pulls.merged=Unito
12311237
pulls.merged_as=La pull request è stata unita come <a rel="nofollow" class="ui sha" href="%[1]s"><code>%[2]s</code></a>.
1238+
pulls.manually_merged=Unito manualmente
12321239
pulls.is_closed=La pull request è stata chiusa.
12331240
pulls.has_merged=La pull request è stata unita.
12341241
pulls.title_wip_desc=`<a href="#">Inizia il titolo con <strong>%s</strong></a> per evitare che la pull request venga unita accidentalmente.`
@@ -1424,6 +1431,7 @@ activity.git_stats_deletion_n=%d cancellazioni
14241431
14251432
search=Ricerca
14261433
search.search_repo=Ricerca repository
1434+
search.fuzzy=Fuzzy
14271435
search.results=Risultati della ricerca per "%s" in <a href="%s">%s</a>
14281436
14291437
settings=Impostazioni
@@ -1766,10 +1774,12 @@ diff.protected=Protetto
17661774

17671775
releases.desc=Tenere traccia di versioni e download del progetto.
17681776
release.releases=Rilasci
1777+
release.detail=Dettagli rilascio
17691778
release.new_release=Nuovo Rilascio
17701779
release.draft=Bozza
17711780
release.prerelease=Pre-Rilascio
17721781
release.stable=Stabile
1782+
release.compare=Confronta
17731783
release.edit=modifica
17741784
release.source_code=Codice Sorgente
17751785
release.new_subheader=Le release organizzano le versioni del progetto.

0 commit comments

Comments
 (0)