Skip to content

Commit 3a76ba3

Browse files
committed
feat: fully functional deduplicated backups
1 parent 725dd2f commit 3a76ba3

26 files changed

+4359
-1533
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ require (
7272
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
7373
github.com/dustin/go-humanize v1.0.1 // indirect
7474
github.com/felixge/httpsnoop v1.0.4 // indirect
75+
github.com/fsnotify/fsnotify v1.9.0 // indirect
7576
github.com/gammazero/deque v1.1.0 // indirect
7677
github.com/gin-contrib/sse v1.1.0 // indirect
7778
github.com/glebarez/go-sqlite v1.22.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw
112112
github.com/franela/goblin v0.0.0-20211003143422-0a4f594942bf h1:NrF81UtW8gG2LBGkXFQFqlfNnvMt9WdB46sfdJY4oqc=
113113
github.com/franela/goblin v0.0.0-20211003143422-0a4f594942bf/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo=
114114
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
115+
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
116+
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
115117
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
116118
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
117119
github.com/gammazero/deque v1.1.0 h1:OyiyReBbnEG2PP0Bnv1AASLIYvyKqIFN5xfl1t8oGLo=

src/cmd/root.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/pyrohost/elytra/src/internal/cron"
3232
"github.com/pyrohost/elytra/src/internal/database"
3333
"github.com/pyrohost/elytra/src/internal/rustic"
34+
"github.com/pyrohost/elytra/src/jobs"
3435
"github.com/pyrohost/elytra/src/loggers/cli"
3536
"github.com/pyrohost/elytra/src/remote"
3637
"github.com/pyrohost/elytra/src/router"
@@ -339,6 +340,17 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
339340
autotls = false
340341
}
341342

343+
// Initialize job manager for async operations
344+
jobManager := jobs.NewManager(4) // 4 worker threads
345+
jobManager.SetClient(pclient) // Set client for Panel notifications
346+
jobManager.SetServerManager(manager) // Set server manager for WebSocket events
347+
348+
// Register all job types
349+
jobs.SetupJobs(jobManager, manager, pclient)
350+
351+
// Start the job manager
352+
jobManager.Start()
353+
342354
api := config.Get().Api
343355
log.WithFields(log.Fields{
344356
"use_ssl": api.Ssl.Enabled,
@@ -351,7 +363,7 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
351363
// and external clients.
352364
s := &http.Server{
353365
Addr: api.Host + ":" + strconv.Itoa(api.Port),
354-
Handler: router.Configure(manager, pclient),
366+
Handler: router.Configure(manager, pclient, jobManager),
355367
TLSConfig: config.DefaultTLSConfig,
356368
}
357369

src/config/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,6 @@ type S3RepositoryConfig struct {
322322
// S3 bucket name
323323
Bucket string `yaml:"bucket"`
324324

325-
// S3 key prefix for repositories
326-
KeyPrefix string `default:"pterodactyl-backups/" yaml:"key_prefix"`
327-
328325
// Whether to use hot/cold storage setup for S3
329326
UseColdStorage bool `default:"false" yaml:"use_cold_storage"`
330327

0 commit comments

Comments
 (0)