You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When lfs-snapshot-enabled is true, cachew generates a separate LFS object
snapshot (lfs-snapshot.tar.zst) alongside the regular git snapshot. This
archives .git/lfs/objects/ after running git lfs fetch, and serves it at
GET /git/{repo}/lfs-snapshot.tar.zst.
Adds snapshot.CreateSubdir for archiving a named subdirectory with its
path prefix preserved in the tar. LFS snapshot jobs are scheduled on both
startup discovery and first clone of new repos.
Copy file name to clipboardExpand all lines: internal/strategy/git/git.go
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ type Config struct {
38
38
SnapshotInterval time.Duration`hcl:"snapshot-interval,optional" help:"How often to generate tar.zstd workstation snapshots. 0 disables snapshots." default:"0"`
39
39
MirrorSnapshotInterval time.Duration`hcl:"mirror-snapshot-interval,optional" help:"How often to generate mirror snapshots for pod bootstrap. 0 uses snapshot-interval. Defaults to 2h." default:"2h"`
40
40
RepackInterval time.Duration`hcl:"repack-interval,optional" help:"How often to run full repack. 0 disables." default:"0"`
41
+
LFSSnapshotEnabledbool`hcl:"lfs-snapshot-enabled,optional" help:"When true, also generate a separate LFS object snapshot at /git/{repo}/lfs-snapshot.tar.zst on each snapshot interval. Requires git-lfs and a configured GitHub App." default:"false"`
41
42
// ServerURL is embedded as remote.origin.url in snapshots so git pull goes through cachew.
42
43
ServerURLstring`hcl:"server-url,optional" help:"Base URL of this cachew instance, embedded in snapshot remote URLs." default:"${CACHEW_URL}"`
43
44
ZstdThreadsint`hcl:"zstd-threads,optional" help:"Threads for zstd compression/decompression (0 = all CPU cores)." default:"0"`
@@ -151,6 +152,9 @@ func New(
151
152
152
153
ifs.config.SnapshotInterval>0 {
153
154
s.scheduleSnapshotJobs(repo)
155
+
ifs.config.LFSSnapshotEnabled {
156
+
s.scheduleLFSSnapshotJobs(repo)
157
+
}
154
158
}
155
159
ifs.config.RepackInterval>0 {
156
160
s.scheduleRepackJobs(repo)
@@ -219,6 +223,11 @@ func (s *Strategy) handleRequest(w http.ResponseWriter, r *http.Request) {
0 commit comments