Skip to content

Commit 67da1d5

Browse files
Merge branch 'main' into techknowlogick-patch-8
2 parents 05a666e + ca6c0de commit 67da1d5

Some content is hidden

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

74 files changed

+1416
-891
lines changed

.github/workflows/pull-db-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
minio:
3232
# as github actions doesn't support "entrypoint", we need to use a non-official image
3333
# that has a custom entrypoint set to "minio server /data"
34-
image: bitnami/minio:2023.8.31
34+
image: bitnamilegacy/minio:2023.8.31
3535
env:
3636
MINIO_ROOT_USER: 123456
3737
MINIO_ROOT_PASSWORD: 12345678
@@ -113,7 +113,7 @@ jobs:
113113
ports:
114114
- 6379:6379
115115
minio:
116-
image: bitnami/minio:2021.3.17
116+
image: bitnamilegacy/minio:2021.3.17
117117
env:
118118
MINIO_ACCESS_KEY: 123456
119119
MINIO_SECRET_KEY: 12345678
@@ -155,7 +155,7 @@ jobs:
155155
services:
156156
mysql:
157157
# the bitnami mysql image has more options than the official one, it's easier to customize
158-
image: bitnami/mysql:8.0
158+
image: bitnamilegacy/mysql:8.0
159159
env:
160160
ALLOW_EMPTY_PASSWORD: true
161161
MYSQL_DATABASE: testgitea

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
3131
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/[email protected]
32-
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected].12
32+
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected].15
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]
3535
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest

assets/go-licenses.json

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

cmd/dump.go

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"code.gitea.io/gitea/modules/util"
2121

2222
"gitea.com/go-chi/session"
23-
"github.com/mholt/archiver/v3"
2423
"github.com/urfave/cli/v3"
2524
)
2625

@@ -146,22 +145,18 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
146145
return err
147146
}
148147

149-
archiverGeneric, err := archiver.ByExtension("." + outType)
148+
dumper, err := dump.NewDumper(ctx, outType, outFile)
150149
if err != nil {
151-
fatal("Unable to get archiver for extension: %v", err)
152-
}
153-
154-
archiverWriter := archiverGeneric.(archiver.Writer)
155-
if err := archiverWriter.Create(outFile); err != nil {
156-
fatal("Creating archiver.Writer failed: %v", err)
157-
}
158-
defer archiverWriter.Close()
159-
160-
dumper := &dump.Dumper{
161-
Writer: archiverWriter,
162-
Verbose: verbose,
150+
fatal("Failed to create archive %q: %v", outFile, err)
151+
return err
163152
}
153+
dumper.Verbose = verbose
164154
dumper.GlobalExcludeAbsPath(outFileName)
155+
defer func() {
156+
if err := dumper.Close(); err != nil {
157+
fatal("Failed to save archive %q: %v", outFileName, err)
158+
}
159+
}()
165160

166161
if cmd.IsSet("skip-repository") && cmd.Bool("skip-repository") {
167162
log.Info("Skip dumping local repositories")
@@ -180,7 +175,7 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
180175
if err != nil {
181176
return err
182177
}
183-
return dumper.AddReader(object, info, path.Join("data", "lfs", objPath))
178+
return dumper.AddFileByReader(object, info, path.Join("data", "lfs", objPath))
184179
}); err != nil {
185180
fatal("Failed to dump LFS objects: %v", err)
186181
}
@@ -218,13 +213,13 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
218213
fatal("Failed to dump database: %v", err)
219214
}
220215

221-
if err = dumper.AddFile("gitea-db.sql", dbDump.Name()); err != nil {
216+
if err = dumper.AddFileByPath("gitea-db.sql", dbDump.Name()); err != nil {
222217
fatal("Failed to include gitea-db.sql: %v", err)
223218
}
224219
}
225220

226221
log.Info("Adding custom configuration file from %s", setting.CustomConf)
227-
if err = dumper.AddFile("app.ini", setting.CustomConf); err != nil {
222+
if err = dumper.AddFileByPath("app.ini", setting.CustomConf); err != nil {
228223
fatal("Failed to include specified app.ini: %v", err)
229224
}
230225

@@ -283,7 +278,7 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
283278
if err != nil {
284279
return err
285280
}
286-
return dumper.AddReader(object, info, path.Join("data", "attachments", objPath))
281+
return dumper.AddFileByReader(object, info, path.Join("data", "attachments", objPath))
287282
}); err != nil {
288283
fatal("Failed to dump attachments: %v", err)
289284
}
@@ -297,7 +292,7 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
297292
if err != nil {
298293
return err
299294
}
300-
return dumper.AddReader(object, info, path.Join("data", "packages", objPath))
295+
return dumper.AddFileByReader(object, info, path.Join("data", "packages", objPath))
301296
}); err != nil {
302297
fatal("Failed to dump packages: %v", err)
303298
}
@@ -322,10 +317,6 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
322317
if outFileName == "-" {
323318
log.Info("Finish dumping to stdout")
324319
} else {
325-
if err = archiverWriter.Close(); err != nil {
326-
_ = os.Remove(outFileName)
327-
fatal("Failed to save %q: %v", outFileName, err)
328-
}
329320
if err = os.Chmod(outFileName, 0o600); err != nil {
330321
log.Info("Can't change file access permissions mask to 0600: %v", err)
331322
}

contrib/backport/backport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"strconv"
1717
"strings"
1818

19-
"github.com/google/go-github/v71/github"
19+
"github.com/google/go-github/v74/github"
2020
"github.com/urfave/cli/v3"
2121
"gopkg.in/yaml.v3"
2222
)

0 commit comments

Comments
 (0)