Skip to content

Commit fb637f0

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Do not allow different storage configurations to point to the same directory (go-gitea#30169) Fix GPG subkey verify (go-gitea#30193) [skip ci] Updated translations via Crowdin Fix unclickable checkboxes (go-gitea#30195) Remove jQuery class from the issue author dropdown (go-gitea#30188) Remove jQuery class from the comment edit history (go-gitea#30186) Remove jQuery class from the repository branch settings (go-gitea#30184) [skip ci] Updated translations via Crowdin Use Crowdin action for translation sync (go-gitea#30054) Remove jQuery class from the project page (go-gitea#30183) Remove jQuery class from the comment context menu (go-gitea#30179)
2 parents 7a8a44a + 6d34ce2 commit fb637f0

Some content is hidden

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

49 files changed

+1064
-1168
lines changed

.github/workflows/cron-translations.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ jobs:
1111
if: github.repository == 'go-gitea/gitea'
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: download from crowdin
15-
uses: docker://jonasfranz/crowdin
14+
- uses: crowdin/github-action@v1
15+
with:
16+
upload_sources: true
17+
upload_translations: false
18+
download_sources: false
19+
download_translations: true
20+
push_translations: false
21+
push_sources: false
22+
create_pull_request: false
23+
config: crowdin.yml
1624
env:
25+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
1726
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
18-
PLUGIN_DOWNLOAD: true
19-
PLUGIN_EXPORT_DIR: options/locale/
20-
PLUGIN_IGNORE_BRANCH: true
21-
PLUGIN_PROJECT_IDENTIFIER: gitea
2227
- name: update locales
2328
run: ./build/update-locales.sh
2429
- name: push translations to repo
@@ -31,19 +36,3 @@ jobs:
3136
commit_message: "[skip ci] Updated translations via Crowdin"
3237
remote: "[email protected]:go-gitea/gitea.git"
3338
ssh_key: ${{ secrets.DEPLOY_KEY }}
34-
crowdin-push:
35-
runs-on: ubuntu-latest
36-
if: github.repository == 'go-gitea/gitea'
37-
steps:
38-
- uses: actions/checkout@v4
39-
- name: push translations to crowdin
40-
uses: docker://jonasfranz/crowdin
41-
env:
42-
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
43-
PLUGIN_UPLOAD: true
44-
PLUGIN_EXPORT_DIR: options/locale/
45-
PLUGIN_IGNORE_BRANCH: true
46-
PLUGIN_PROJECT_IDENTIFIER: gitea
47-
PLUGIN_FILES: |
48-
locale_en-US.ini: options/locale/locale_en-US.ini
49-
PLUGIN_BRANCH: main

crowdin.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
project_id_env: CROWDIN_PROJECT_ID
2+
api_token_env: CROWDIN_KEY
3+
base_path: "."
4+
base_url: "https://api.crowdin.com"
5+
preserve_hierarchy: true
6+
files:
7+
- source: "/options/locale/locale_en-US.ini"
8+
translation: "/options/locale/locale_%locale%.ini"
9+
type: "ini"
10+
skip_untranslated_strings: true
11+
export_only_approved: true
12+
update_option: "update_as_unapproved"

models/asymkey/gpg_key_verify.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ func VerifyGPGKey(ctx context.Context, ownerID int64, keyID, token, signature st
4646
return "", ErrGPGKeyNotExist{}
4747
}
4848

49+
if err := key.LoadSubKeys(ctx); err != nil {
50+
return "", err
51+
}
52+
4953
sig, err := extractSignature(signature)
5054
if err != nil {
5155
return "", ErrGPGInvalidTokenSignature{

modules/setting/indexer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func loadIndexerFrom(rootCfg ConfigProvider) {
5858
if !filepath.IsAbs(Indexer.IssuePath) {
5959
Indexer.IssuePath = filepath.ToSlash(filepath.Join(AppWorkPath, Indexer.IssuePath))
6060
}
61-
fatalDuplicatedPath("issue_indexer", Indexer.IssuePath)
61+
checkOverlappedPath("indexer.ISSUE_INDEXER_PATH", Indexer.IssuePath)
6262
} else {
6363
Indexer.IssueConnStr = sec.Key("ISSUE_INDEXER_CONN_STR").MustString(Indexer.IssueConnStr)
6464
if Indexer.IssueType == "meilisearch" {

modules/setting/path.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,8 @@ func init() {
6666
AppWorkPath = filepath.Dir(AppPath)
6767
}
6868

69-
fatalDuplicatedPath("app_work_path", AppWorkPath)
70-
7169
appWorkPathBuiltin = AppWorkPath
7270
customPathBuiltin = CustomPath
73-
74-
fatalDuplicatedPath("custom_path", CustomPath)
7571
customConfBuiltin = CustomConf
7672
}
7773

modules/setting/repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func loadRepositoryFrom(rootCfg ConfigProvider) {
286286
RepoRootPath = filepath.Clean(RepoRootPath)
287287
}
288288

289-
fatalDuplicatedPath("repository.ROOT", RepoRootPath)
289+
checkOverlappedPath("repository.ROOT", RepoRootPath)
290290

291291
defaultDetectedCharsetsOrder := make([]string, 0, len(Repository.DetectedCharsetsOrder))
292292
for _, charset := range Repository.DetectedCharsetsOrder {

modules/setting/server.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,14 @@ func loadServerFrom(rootCfg ConfigProvider) {
324324
if !filepath.IsAbs(AppDataPath) {
325325
AppDataPath = filepath.ToSlash(filepath.Join(AppWorkPath, AppDataPath))
326326
}
327-
fatalDuplicatedPath("app_data_path", AppDataPath)
328327

329328
EnableGzip = sec.Key("ENABLE_GZIP").MustBool()
330329
EnablePprof = sec.Key("ENABLE_PPROF").MustBool(false)
331330
PprofDataPath = sec.Key("PPROF_DATA_PATH").MustString(filepath.Join(AppWorkPath, "data/tmp/pprof"))
332331
if !filepath.IsAbs(PprofDataPath) {
333332
PprofDataPath = filepath.Join(AppWorkPath, PprofDataPath)
334333
}
335-
fatalDuplicatedPath("pprof_data_path", PprofDataPath)
334+
checkOverlappedPath("server.PPROF_DATA_PATH", PprofDataPath)
336335

337336
landingPage := sec.Key("LANDING_PAGE").MustString("home")
338337
switch landingPage {

modules/setting/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func loadSessionFrom(rootCfg ConfigProvider) {
4646
SessionConfig.ProviderConfig = strings.Trim(sec.Key("PROVIDER_CONFIG").MustString(filepath.Join(AppDataPath, "sessions")), "\" ")
4747
if SessionConfig.Provider == "file" && !filepath.IsAbs(SessionConfig.ProviderConfig) {
4848
SessionConfig.ProviderConfig = filepath.Join(AppWorkPath, SessionConfig.ProviderConfig)
49-
fatalDuplicatedPath("session", SessionConfig.ProviderConfig)
49+
checkOverlappedPath("session.PROVIDER_CONFIG", SessionConfig.ProviderConfig)
5050
}
5151
SessionConfig.CookieName = sec.Key("COOKIE_NAME").MustString("i_like_gitea")
5252
SessionConfig.CookiePath = AppSubURL

modules/setting/setting.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,14 @@ func LoadSettingsForInstall() {
230230
loadMailerFrom(CfgProvider)
231231
}
232232

233-
var uniquePaths = make(map[string]string)
233+
var configuredPaths = make(map[string]string)
234234

235-
func fatalDuplicatedPath(name, p string) {
236-
if targetName, ok := uniquePaths[p]; ok && targetName != name {
237-
log.Fatal("storage path %q is being used by %q and %q and all storage paths must be unique to prevent data loss.", p, targetName, name)
235+
func checkOverlappedPath(name, path string) {
236+
// TODO: some paths shouldn't overlap (storage.xxx.path), while some could (data path is the base path for storage path)
237+
if targetName, ok := configuredPaths[path]; ok && targetName != name {
238+
msg := fmt.Sprintf("Configured path %q is used by %q and %q at the same time. The paths must be unique to prevent data loss.", path, targetName, name)
239+
log.Error("%s", msg)
240+
DeprecatedWarnings = append(DeprecatedWarnings, msg)
238241
}
239-
uniquePaths[p] = name
242+
configuredPaths[path] = name
240243
}

modules/setting/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func getStorageForLocal(targetSec, overrideSec ConfigSection, tp targetSecType,
240240
}
241241
}
242242

243-
fatalDuplicatedPath("storage."+name, storage.Path)
243+
checkOverlappedPath("storage."+name+".PATH", storage.Path)
244244

245245
return &storage, nil
246246
}

0 commit comments

Comments
 (0)