Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fb10bde
feat(calendar): show local episode airtimes
Quick104 May 28, 2026
bbaea15
Enable DRI passthrough in docker compose
Quick104 May 28, 2026
257a36b
Merge branch 'main' of https://github.com/Silo-Server/silo-server
Quick104 May 28, 2026
aaf73f2
Merge branch 'main' of https://github.com/Silo-Server/silo-server
Quick104 May 28, 2026
d9a7421
docs: add resilient library deletion design spec
Quick104 May 28, 2026
1e38992
docs: add implementation plan for resilient library deletion
Quick104 May 28, 2026
ec8a356
feat(catalog): add deadlock-retry helper for batched deletes
Quick104 May 28, 2026
2411405
test(catalog): clarify cancel-path expectation in retry test
Quick104 May 28, 2026
0ca604b
feat(catalog): add deleteInBatches loop helper
Quick104 May 28, 2026
0a00823
refactor(catalog): make image-dir helpers querier-agnostic
Quick104 May 28, 2026
6f05713
fix(catalog): delete libraries in deadlock-retrying batches
Quick104 May 28, 2026
9abf4ed
refactor(catalog): wrap orphan-batch iteration error
Quick104 May 28, 2026
e6f1df6
fix(catalog): clamp still/poster/logo backdrops to largest cached var…
Quick104 May 28, 2026
48e8e21
perf(startup): defer non-critical init off the HTTP listener path
Quick104 May 28, 2026
9bfc400
fix(migrations): make air_timezone column add idempotent
Quick104 May 28, 2026
ff51a9e
build: stamp git revision via Makefile ldflags
Quick104 May 28, 2026
93e4df2
fix(web): accessibility & UX fixes from visual QA pass
Quick104 May 28, 2026
7f77da4
fix(catalog): re-check orphan status when deleting library items
Quick104 May 29, 2026
9014720
fix(metadata): persist a cleared air_timezone instead of skipping it
Quick104 May 29, 2026
64578d5
fix(startup): sweep open scrobbles before accepting playback
Quick104 May 29, 2026
a93fee3
fix(catalog): scan air_timezone in paginated item queries
Quick104 May 29, 2026
b6c37f5
revert(startup): keep open-scrobble sweep deferred for fast startup
Quick104 May 29, 2026
6df5d94
fix(startup): recover from panics in deferred background init
Quick104 May 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@ endif

JELLYFIN_WEB_OUTPUT_DIR ?= third_party/jellyfin-web

# Build version stamping: inject the git revision so the admin Build panel shows a
# version even when Go's VCS metadata isn't embedded (mirrors the Dockerfile ldflags).
BUILDINFO_PKG := github.com/Silo-Server/silo-server/internal/buildinfo
BUILD_REVISION ?= $(shell git rev-parse HEAD 2>/dev/null)
BUILD_DIRTY ?= $(shell test -n "$$(git status --porcelain 2>/dev/null)" && echo true || echo false)
GO_LDFLAGS := -X $(BUILDINFO_PKG).revisionOverride=$(BUILD_REVISION) -X $(BUILDINFO_PKG).dirtyOverride=$(BUILD_DIRTY)

# Build the frontend (requires pnpm)
frontend:
cd web && pnpm install --frozen-lockfile && pnpm run build

# Build the Go binary (depends on frontend)
build: frontend
go build -o silo ./cmd/silo/
go build -ldflags "$(GO_LDFLAGS)" -o silo ./cmd/silo/

# Run frontend dev server (proxies API to localhost:8080)
dev-frontend:
Expand Down
69 changes: 54 additions & 15 deletions cmd/silo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"os"
"os/signal"
"path/filepath"
"runtime/debug"
"strconv"
"strings"
"syscall"
Expand Down Expand Up @@ -724,6 +725,12 @@ func main() {
pluginService.OnLifecycleChange(appCtx)
}

// backgroundInit collects non-critical startup work (catalog-size-dependent
// seeding, network-bound reconciliation) that must not block the HTTP
// listener. The steps run sequentially in a background goroutine once the
// server is ready to serve. Failures are logged, never fatal.
var backgroundInit []func(context.Context)

// Step 4b: Create metadata service and match worker (if needed).
var metadataService *metadata.MetadataService
var personRefreshService *metadata.PersonRefreshService
Expand Down Expand Up @@ -830,31 +837,36 @@ func main() {
matchWorker.SetMovieFileClaimer(movieQueueRepo)
}
if seriesQueueRepo != nil {
if cleaned, err := seriesQueueRepo.CleanupLegacySeriesGroupQueue(appCtx); err != nil {
slog.Warn("failed to clean legacy series group queue rows", "error", err)
} else if cleaned > 0 {
slog.Info("cleaned legacy series group queue rows", "count", cleaned)
}
matchWorker.SetSeriesRootClaimer(seriesQueueRepo, cfg.Matcher.TVSeriesRootQueueEnabled())
backgroundInit = append(backgroundInit, func(ctx context.Context) {
if cleaned, err := seriesQueueRepo.CleanupLegacySeriesGroupQueue(ctx); err != nil {
slog.Warn("failed to clean legacy series group queue rows", "error", err)
} else if cleaned > 0 {
slog.Info("cleaned legacy series group queue rows", "count", cleaned)
}
})
}
if deps.FolderRepo != nil {
enabledFolders, err := deps.FolderRepo.GetEnabled(appCtx)
if err != nil {
slog.Warn("failed to seed metadata queues", "error", err)
} else {
backgroundInit = append(backgroundInit, func(ctx context.Context) {
start := time.Now()
enabledFolders, err := deps.FolderRepo.GetEnabled(ctx)
if err != nil {
slog.Warn("failed to seed metadata queues", "error", err)
return
}
seedMovieQueue := func(folderID int) {
if movieQueueRepo == nil {
return
}
if err := movieQueueRepo.SyncForFolder(appCtx, folderID); err != nil {
if err := movieQueueRepo.SyncForFolder(ctx, folderID); err != nil {
slog.Warn("failed to seed movie match queue", "folder_id", folderID, "error", err)
}
}
seedSeriesQueue := func(folderID int) {
if seriesQueueRepo == nil {
return
}
if err := seriesQueueRepo.SyncForFolder(appCtx, folderID); err != nil {
if err := seriesQueueRepo.SyncForFolder(ctx, folderID); err != nil {
slog.Warn("failed to seed series root queue", "folder_id", folderID, "error", err)
}
}
Expand All @@ -872,7 +884,8 @@ func main() {
seedMovieQueue(folder.ID)
}
}
}
slog.Info("deferred init: metadata match queues seeded", "folders", len(enabledFolders), "duration", time.Since(start))
})
}

deps.SkippedRootRepo = skippedRootRepo
Expand Down Expand Up @@ -1011,9 +1024,11 @@ func main() {
WithMatcher(historyimport.NewMatcher(historyRepo)).
WithWatchState(watchstate.NewService(userStoreProvider).WithStableIdentityResolver(historyIdentity)).
WithUserStoreProvider(userStoreProvider)
if err := watchProviderService.SweepOpenScrobbles(appCtx); err != nil {
slog.Warn("failed to sweep open watch provider scrobbles", "error", err)
}
backgroundInit = append(backgroundInit, func(ctx context.Context) {
if err := watchProviderService.SweepOpenScrobbles(ctx); err != nil {
slog.Warn("failed to sweep open watch provider scrobbles", "error", err)
}
})
}
deps.SessionMgr = sessionMgr
deps.PlaybackRealtimeHub = playback.NewRealtimeHub()
Expand Down Expand Up @@ -1653,6 +1668,30 @@ func main() {
compatSrv.IdleTimeout = 120 * time.Second
}

// Run non-critical startup work in the background so it doesn't delay the
// HTTP listener from accepting connections. Steps run sequentially and stop
// early if the app context is cancelled (shutdown).
if len(backgroundInit) > 0 {
go func() {
start := time.Now()
for _, step := range backgroundInit {
if appCtx.Err() != nil {
return
}
func() {
defer func() {
if p := recover(); p != nil {
slog.Error("deferred startup init step panicked; continuing",
"panic", p, "stack", string(debug.Stack()))
}
}()
step(appCtx)
}()
}
slog.Info("deferred startup init completed", "steps", len(backgroundInit), "duration", time.Since(start))
}()
}

errCh := make(chan error, 2)
go func() {
slog.Info("HTTP server listening", "addr", cfg.Server.Listen)
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ services:
env_file:
- path: .env
required: false
devices:
- /dev/dri:/dev/dri

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unconditional GPU device mapping breaks non-GPU deployments

High Severity

The unconditional devices: ["/dev/dri:/dev/dri"] mapping causes container startup failure on hosts without GPU hardware (VMs without passthrough, ARM devices, cloud instances without GPUs). Docker will error when the mapped device doesn't exist on the host. This change is also unrelated to the PR's stated purpose of accessibility and UX fixes and appears to be accidentally included.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 93e4df2. Configure here.

Comment on lines +59 to +60

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make VAAPI device mapping optional

With this unconditional host-device mapping, default docker compose up for the silo service fails on machines without /dev/dri (for example macOS/Windows dev hosts, many cloud VMs, or Linux systems without GPU render nodes) because Docker is asked to attach a host path that does not exist. Since hardware acceleration is environment-specific, gate this behind an override/profile or document a separate compose file instead of requiring every install to have this device.

Useful? React with 👍 / 👎.

Comment on lines +59 to +60

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Make GPU device passthrough opt-in.

Line 59 makes /dev/dri mandatory for every docker compose up; hosts without that device will fail to start the silo service. Gate this behind an optional profile/override so the default stack stays portable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker-compose.yml` around lines 59 - 60, Make the /dev/dri device mapping
opt-in by moving the devices entry for the silo service into a profile so hosts
without GPUs can start the stack; specifically update the silo service to stop
declaring the devices: - /dev/dri:/dev/dri by default and instead add a profile
(e.g., "gpu") and place that devices mapping under that profile (use the
service's profiles: - gpu or an x-override included by a gpu profile) so only
docker compose --profile gpu (or an override file) enables the /dev/dri
passthrough.


# Optional distributed-mode example. Most single-host installs should
# just use the integrated service above.
Expand Down
Loading