Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Rewrite documentation around reader tasks

d1f44d838966c0a4762073f12375ec7562582fdf · Keenan Nemetz · 21h ago · parent 9103f6a8

docs/lfs.md +81−55

@@ -1,101 +1,127 @@
1 1 # LFS and file locking
2 2
3 Git LFS keeps large file contents outside Git history while leaving small
4 pointer files in each commit. Vole stores the contents on your instance and
5 shares identical objects across repositories. File locks prevent concurrent
6 edits to binary files that Git cannot merge.
3 Use Git LFS for large assets and Vole's server-enforced locks for files that
4 cannot be merged. LFS objects use the repository's existing access rules, and
5 writes use the same SSH key as Git pushes.
7 6
8 ## Track large files
7 ## Before you start
9 8
10 Install Git LFS once per machine, then track file patterns from a repository
11 clone:
9 Install Git LFS on each machine that works with large files:
12 10
13 11 ```sh
14 12 git lfs install
15 git lfs track "*.psd"
16 git add .gitattributes art/hero.psd
17 git commit -m "Add the hero art"
18 git push origin main
13 git lfs version
19 14 ```
20 15
21 Clone through the repository's normal URL. Use HTTPS for an anonymous,
22 read-only checkout, or SSH if you will take file locks (see below):
16 Clone through the repository's normal URL. Use HTTPS for anonymous, read-only
17 access to a public repository. Use SSH when you need to upload objects or manage
18 locks:
23 19
24 20 ```sh
25 21 git clone https://forge.example.com/demo.git
26 22 git clone ssh://git@forge.example.com/demo.git
27 23 ```
28 24
29 LFS reads over an HTTPS clone use the same service as anonymous Git reads.
30 Writes authenticate with the SSH key used for Git pushes; no separate token or
31 storage server is required. An SSH clone carries both reads and writes over
32 the same key.
25 No separate LFS token or storage server is required.
33 26
34 A repository can download only objects referenced by its own history. Knowing an
35 object hash does not grant access to another repository's file.
27 ## Track large files
36 28
37 ## Limits and warnings
29 From the repository clone, track each filename pattern you want LFS to manage:
38 30
39 The instance configuration controls object size and raw-binary warnings:
31 ```sh
32 git lfs track "*.psd"
33 ```
40 34
41 ```toml
42 lfs_object_max_bytes = 2147483648
43 lfs_warn_bytes = 5242880
35 `git lfs track` updates `.gitattributes`. Commit that file together with the
36 asset, replacing `<large-file>` with a path such as `art/hero.psd`:
37
38 ```sh
39 git add .gitattributes <large-file>
40 git commit -m "Add the hero art"
41 git push origin main
44 42 ```
45 43
46 - Objects above `lfs_object_max_bytes` are refused.
47 - A raw binary above `lfs_warn_bytes` is accepted with a warning suggesting
48 `git lfs track`.
49 - A commit containing an LFS pointer whose object was not uploaded is refused so
50 the commit remains checkoutable.
51 - `lfs_warn_bytes = 0` disables the raw-binary warning.
52 - A release source archive contains the stored contents, not pointer files.
44 Confirm that Git LFS now manages the file:
45
46 ```sh
47 git lfs ls-files
48 ```
53 49
54 See [Set resource limits](configuration.md#set-resource-limits) for per-repository
55 storage quotas.
50 Vole accepts an LFS upload only from an account that may write the repository.
51 A push containing a pointer whose object was not uploaded is refused, so the
52 resulting commit remains checkoutable. A repository can download only objects
53 referenced by its own history; knowing another object's hash does not grant
54 access to it.
56 55
57 ## Lock binary files
56 ## Lock a file before editing
58 57
59 Lock a path before editing artwork, audio, models, levels, or other files that
60 cannot be merged:
58 Lock artwork, audio, models, levels, and other files that cannot be merged:
61 59
62 60 ```sh
63 61 git lfs lock art/hero.psd
64 62 git lfs locks
63 ```
64
65 While the lock exists, Vole rejects any push that changes that path, even from a
66 client with no local hook installed. Current locks also appear on the
67 repository's **Locks** page at `/<repo>/locks`.
68
69 Unlock the path after committing and pushing your work:
70
71 ```sh
65 72 git lfs unlock art/hero.psd
66 73 ```
67 74
68 The locking commands need an SSH remote. git-lfs asks the remote for the locking
69 API, and Vole offers it only over SSH, so a clone whose `origin` is HTTPS can
70 read and fetch but cannot take or list locks. Clone with the SSH URL above, or
71 point `origin` at it, when you will lock files.
75 !!! warning "Locks require an SSH remote"
76 The Git LFS client discovers Vole's locking API over SSH. An HTTPS clone can
77 read and fetch objects, but it cannot take or list locks. Use the SSH clone
78 URL, or change `origin` to that URL, before managing locks.
79
80 A repository admin can override a lock, for example after its owner leaves. Vole
81 records the override in `data/audit.log`. Locks are server state in
82 `data/instance.db`; they do not travel with clones and are covered by an
83 [instance backup](backup-and-restore.md#back-up-an-instance).
84
85 ## Configure limits and warnings
72 86
73 While a lock exists, Vole rejects any push that changes that path. The server
74 enforces the rule even when a client has no hook installed. Current locks also
75 appear on `/<repo>/locks`.
87 The instance configuration controls two safeguards:
76 88
77 An admin can override a lock, for example after its owner leaves. Vole records
78 the override in `data/audit.log`. Locks are temporary server state in
79 `data/instance.db`; they do not travel with clones and are covered by a database
80 backup.
89 - `lfs_object_max_bytes` refuses objects above the configured size.
90 - `lfs_warn_bytes` warns when a large raw binary is committed outside LFS. Set
91 it to `0` to disable the warning.
92
93 See [Set resource limits](configuration.md#set-resource-limits) for the defaults
94 and per-repository storage quotas.
95
96 A [release source archive](releases.md#download-source-archives) contains the
97 stored LFS contents, not pointer files.
81 98
82 99 ## Clean up unused objects
83 100
84 Preview and run storage garbage collection from the instance host:
101 From the instance host, preview garbage collection before removing anything:
85 102
86 103 ```sh
87 104 vole admin gc --dry-run
88 vole admin gc
89 105 ```
90 106
91 Vole retains objects reachable from repositories, archived CI logs, and published
92 build artifacts. The default one-hour grace period protects recent uploads not
93 yet referenced by a push. See [Clean up stored files](operations.md#clean-up-stored-files).
107 Then run it with a grace period that protects recent uploads:
108
109 ```sh
110 vole admin gc --grace 24h
111 ```
112
113 Vole retains objects reachable from repositories, archived CI logs, and
114 published build artifacts. The grace period protects uploads that have not yet
115 been referenced by a push. CI logs under `data/logs/` are ordinary files and are
116 not swept.
117
118 Garbage collection can run while people push. Schedule it when storage growth
119 requires it rather than as a mandatory daily job.
94 120
95 121 ## Next
96 122
97 - [Operations](operations.md#back-up-an-instance) — back up shared objects and
98 lock state.
123 - [Backup and restore](backup-and-restore.md#back-up-an-instance) — back up shared
124 objects and lock state.
99 125 - [Releases](releases.md) — attach large versioned downloads.
100 - [Workflows](workflows.md#artifacts) — store CI outputs in the same object
126 - [Workflows](workflows.md#run-artifacts) — store CI outputs in the same object
101 127 store.