Skip to content

Commit 6714dc2

Browse files
committed
feat: full background activity tasks
1 parent 0768353 commit 6714dc2

127 files changed

Lines changed: 6050 additions & 712 deletions

File tree

Some content is hidden

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

backend/internal/bootstrap/jobs_bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func registerJobs(appCtx context.Context, newScheduler *pkg_scheduler.JobSchedul
2828
// Send initial heartbeat on startup without blocking bootstrap.
2929
go analyticsJob.Run(appCtx)
3030

31-
eventCleanupJob := pkg_scheduler.NewEventCleanupJob(appServices.Event, appServices.Settings)
31+
eventCleanupJob := pkg_scheduler.NewEventCleanupJob(appServices.Event, appServices.Activity, appServices.Settings)
3232
newScheduler.RegisterJob(eventCleanupJob)
3333

3434
scheduledPruneJob := pkg_scheduler.NewScheduledPruneJob(appServices.System, appServices.Settings, appServices.Notification)

backend/internal/bootstrap/router_bootstrap.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ func setupRouter(ctx context.Context, cfg *config.Config, appServices *Services)
144144
Font: appServices.Font,
145145
Project: appServices.Project,
146146
Event: appServices.Event,
147+
Activity: appServices.Activity,
147148
Version: appServices.Version,
148149
Environment: appServices.Environment,
149150
Settings: appServices.Settings,

backend/internal/bootstrap/services_bootstrap.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type Services struct {
3939
SystemUpgrade *services.SystemUpgradeService
4040
Updater *services.UpdaterService
4141
Event *services.EventService
42+
Activity *services.ActivityService
4243
Version *services.VersionService
4344
Notification *services.NotificationService
4445
Apprise *services.AppriseService //nolint:staticcheck // Apprise still functional, deprecated in favor of Shoutrrr
@@ -55,6 +56,7 @@ func initializeServices(ctx context.Context, db *database.DB, cfg *config.Config
5556
svcs = &Services{}
5657

5758
svcs.Event = services.NewEventService(db, cfg, httpClient)
59+
svcs.Activity = services.NewActivityService(db)
5860
svcs.Settings, err = services.NewSettingsService(ctx, db)
5961
if err != nil {
6062
return nil, nil, fmt.Errorf("failed to settings service: %w", err)
@@ -76,8 +78,8 @@ func initializeServices(ctx context.Context, db *database.DB, cfg *config.Config
7678
svcs.Version = services.NewVersionService(httpClient, cfg.UpdateCheckDisabled, config.Version, config.Revision, svcs.ContainerRegistry, svcs.Docker)
7779
svcs.Notification = services.NewNotificationService(db, cfg, svcs.Environment)
7880
svcs.Apprise = services.NewAppriseService(db, cfg)
79-
svcs.Vulnerability = services.NewVulnerabilityService(db, svcs.Docker, svcs.Event, svcs.Settings, svcs.Notification)
80-
svcs.ImageUpdate = services.NewImageUpdateService(db, svcs.Settings, svcs.ContainerRegistry, svcs.Docker, svcs.Event, svcs.Notification)
81+
svcs.Vulnerability = services.NewVulnerabilityService(db, svcs.Docker, svcs.Event, svcs.Settings, svcs.Notification, svcs.Activity)
82+
svcs.ImageUpdate = services.NewImageUpdateService(db, svcs.Settings, svcs.ContainerRegistry, svcs.Docker, svcs.Event, svcs.Notification, svcs.Activity)
8183
svcs.Image = services.NewImageService(db, svcs.Docker, svcs.ContainerRegistry, svcs.ImageUpdate, svcs.Vulnerability, svcs.Event)
8284
svcs.GitRepository = services.NewGitRepositoryService(db, cfg.GitWorkDir, svcs.Event, svcs.Settings)
8385
svcs.Build = services.NewBuildService(db, svcs.Settings, svcs.Docker, svcs.ContainerRegistry, svcs.GitRepository)
@@ -102,9 +104,9 @@ func initializeServices(ctx context.Context, db *database.DB, cfg *config.Config
102104
svcs.Template = services.NewTemplateService(ctx, db, httpClient, svcs.Settings)
103105
svcs.Auth = services.NewAuthService(svcs.User, svcs.Settings, svcs.Event, cfg.JWTSecret, cfg)
104106
svcs.Oidc = services.NewOidcService(svcs.Auth, cfg, httpClient)
105-
svcs.System = services.NewSystemService(db, svcs.Docker, svcs.Container, svcs.Image, svcs.Volume, svcs.Network, svcs.Settings)
107+
svcs.System = services.NewSystemService(db, svcs.Docker, svcs.Container, svcs.Image, svcs.Volume, svcs.Network, svcs.Settings, svcs.Activity)
106108
svcs.SystemUpgrade = services.NewSystemUpgradeService(svcs.Docker, svcs.Version, svcs.Event, svcs.Settings)
107-
svcs.Updater = services.NewUpdaterService(db, svcs.Settings, svcs.Docker, svcs.Project, svcs.ImageUpdate, svcs.ContainerRegistry, svcs.Event, svcs.Image, svcs.Notification, svcs.SystemUpgrade)
109+
svcs.Updater = services.NewUpdaterService(db, svcs.Settings, svcs.Docker, svcs.Project, svcs.ImageUpdate, svcs.ContainerRegistry, svcs.Event, svcs.Image, svcs.Notification, svcs.SystemUpgrade, svcs.Activity)
108110
svcs.GitOpsSync = services.NewGitOpsSyncService(db, svcs.GitRepository, svcs.Project, svcs.Swarm, svcs.Event, svcs.Settings)
109111
svcs.Webhook = services.NewWebhookService(db, svcs.Container, svcs.Updater, svcs.Project, svcs.GitOpsSync, svcs.Event)
110112

backend/internal/configschema/schema_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ var expectedEnvConfigVars = []string{
245245

246246
var expectedSettingOverrideKeys = []string{
247247
"accentColor",
248+
"activityHistoryMaxEntries",
249+
"activityHistoryRetentionDays",
248250
"applicationTheme",
249251
"authLocalEnabled",
250252
"authOidcConfig",

0 commit comments

Comments
 (0)