atagen

vineyard

public
Star0
Watch0
ab6cd8e63410ba088ca5b4d4edb18049022ed8eb
1
ssh://brewery@pls.lobotomise.me:33/atagen/vineyard.git

Blame: README.md

25d14e49ab68atagen2026-09-24 11:07 UTC1
# vineyard
25d14e49ab68atagen2026-09-24 11:07 UTC2
25d14e49ab68atagen2026-09-24 11:07 UTC3
a nostr federation companion for brewery
25d14e49ab68atagen2026-09-24 11:07 UTC4
25d14e49ab68atagen2026-09-24 11:07 UTC5
public repository discovery and signed event exchange between forges
25d14e49ab68atagen2026-09-24 11:07 UTC6
git hosting and signing keys stay with brewery
25d14e49ab68atagen2026-09-24 11:07 UTC7
25d14e49ab68atagen2026-09-24 11:07 UTC8
## run
25d14e49ab68atagen2026-09-24 11:07 UTC9
25d14e49ab68atagen2026-09-24 11:07 UTC10
copy `vineyard.example.toml` and replace `forge_pubkeys` with brewery's public key
25d14e49ab68atagen2026-09-24 11:07 UTC11
database paths are relative to the config file
25d14e49ab68atagen2026-09-24 11:07 UTC12
25d14e49ab68atagen2026-09-24 11:07 UTC13
```sh
25d14e49ab68atagen2026-09-24 11:07 UTC14
nix build
25d14e49ab68atagen2026-09-24 11:07 UTC15
result/bin/vineyard check-config --config vineyard.toml
25d14e49ab68atagen2026-09-24 11:07 UTC16
result/bin/vineyard serve --config vineyard.toml
25d14e49ab68atagen2026-09-24 11:07 UTC17
```
25d14e49ab68atagen2026-09-24 11:07 UTC18
25d14e49ab68atagen2026-09-24 11:07 UTC19
put tls termination in front of the loopback listener
25d14e49ab68atagen2026-09-24 11:07 UTC20
forward websocket upgrades at the path in `public_url`
25d14e49ab68atagen2026-09-24 11:07 UTC21
`/healthz` checks database access
25d14e49ab68atagen2026-09-24 11:07 UTC22
request `application/nostr+json` at the websocket path for relay information
25d14e49ab68atagen2026-09-24 11:07 UTC23
25d14e49ab68atagen2026-09-24 11:07 UTC24
## nixos
25d14e49ab68atagen2026-09-24 11:07 UTC25
25d14e49ab68atagen2026-09-24 11:07 UTC26
import `nixosModules.vineyard` and configure the service
25d14e49ab68atagen2026-09-24 11:07 UTC27
25d14e49ab68atagen2026-09-24 11:07 UTC28
```nix
25d14e49ab68atagen2026-09-24 11:07 UTC29
services.vineyard = {
25d14e49ab68atagen2026-09-24 11:07 UTC30
  enable = true;
25d14e49ab68atagen2026-09-24 11:07 UTC31
  publicUrl = "wss://relay.example.org/";
25d14e49ab68atagen2026-09-24 11:07 UTC32
  forgePubkeys = [ "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798" ];
25d14e49ab68atagen2026-09-24 11:07 UTC33
  peers = [ { url = "wss://peer.example.org/"; } ];
25d14e49ab68atagen2026-09-24 11:07 UTC34
};
25d14e49ab68atagen2026-09-24 11:07 UTC35
```
25d14e49ab68atagen2026-09-24 11:07 UTC36
25d14e49ab68atagen2026-09-24 11:07 UTC37
the module runs vineyard under a dynamic user and stores data in `/var/lib/vineyard`
25d14e49ab68atagen2026-09-24 11:07 UTC38
25d14e49ab68atagen2026-09-24 11:07 UTC39
## peers
25d14e49ab68atagen2026-09-24 11:07 UTC40
25d14e49ab68atagen2026-09-24 11:07 UTC41
add one or more bootstrap relays to connect your forge to the network
25d14e49ab68atagen2026-09-24 11:07 UTC42
25d14e49ab68atagen2026-09-24 11:07 UTC43
```toml
25d14e49ab68atagen2026-09-24 11:07 UTC44
[[peers]]
25d14e49ab68atagen2026-09-24 11:07 UTC45
url = "wss://peer.example.org/"
25d14e49ab68atagen2026-09-24 11:07 UTC46
query_limit = 500
25d14e49ab68atagen2026-09-24 11:07 UTC47
```
25d14e49ab68atagen2026-09-24 11:07 UTC48
25d14e49ab68atagen2026-09-24 11:07 UTC49
use a query limit no larger than the peer supports
25d14e49ab68atagen2026-09-24 11:07 UTC50
peers must accept forge events without nip42 authentication
25d14e49ab68atagen2026-09-24 11:07 UTC51
remote repository announcements retain their signer's identity
25d14e49ab68atagen2026-09-24 11:07 UTC52
brewery publishes its signed nip 65 relay list
25d14e49ab68atagen2026-09-24 11:07 UTC53
peer relay lists are persisted and joined automatically
25d14e49ab68atagen2026-09-24 11:07 UTC54
discovered peers are bounded by `max_discovered_peers`
25d14e49ab68atagen2026-09-24 11:07 UTC55
discovered peers require wss and public dns addresses by default
25d14e49ab68atagen2026-09-24 11:07 UTC56
set `allow_private_discovery` only for trusted private networks or local development
25d14e49ab68atagen2026-09-24 11:07 UTC57
25d14e49ab68atagen2026-09-24 11:07 UTC58
delivery progress and failed-event retries persist in sqlite
25d14e49ab68atagen2026-09-24 11:07 UTC59
incoming history uses a seven-day overlap
25d14e49ab68atagen2026-09-24 11:07 UTC60
set a peer's `rescan_from` to an older unix timestamp for manual recovery
25d14e49ab68atagen2026-09-24 11:07 UTC61
single-second history overflow stops replay without advancing its checkpoint
25d14e49ab68atagen2026-09-24 11:07 UTC62
25d14e49ab68atagen2026-09-24 11:07 UTC63
## brewery
25d14e49ab68atagen2026-09-24 11:07 UTC64
25d14e49ab68atagen2026-09-24 11:07 UTC65
build brewery with its `federation` feature or nix package option
25d14e49ab68atagen2026-09-24 11:07 UTC66
25d14e49ab68atagen2026-09-24 11:07 UTC67
```sh
25d14e49ab68atagen2026-09-24 11:07 UTC68
export BREWERY_FEDERATION=1
25d14e49ab68atagen2026-09-24 11:07 UTC69
export BREWERY_NOSTR_RELAYS=wss://relay.example.org/
25d14e49ab68atagen2026-09-24 11:07 UTC70
export BREWERY_PUBLIC_URL=https://git.example.org
25d14e49ab68atagen2026-09-24 11:07 UTC71
brewery repo issue-mode alice/widget users_and_tokens
25d14e49ab68atagen2026-09-24 11:07 UTC72
brewery repo patch-mode alice/widget tokens
25d14e49ab68atagen2026-09-24 11:07 UTC73
```
25d14e49ab68atagen2026-09-24 11:07 UTC74
25d14e49ab68atagen2026-09-24 11:07 UTC75
repositories must be public
25d14e49ab68atagen2026-09-24 11:07 UTC76
brewery retains git hosting and verifies openpgp binding proofs
25d14e49ab68atagen2026-09-24 11:07 UTC77
the companion brewery changes persist replay progress in `federation.inbox.json`
25d14e49ab68atagen2026-09-24 11:07 UTC78
set `BREWERY_FEDERATION_RESCAN_FROM` to a unix timestamp for an older rescan
25d14e49ab68atagen2026-09-24 11:07 UTC79
25d14e49ab68atagen2026-09-24 11:07 UTC80
## limits
25d14e49ab68atagen2026-09-24 11:07 UTC81
25d14e49ab68atagen2026-09-24 11:07 UTC82
defaults are in `vineyard.example.toml`
25d14e49ab68atagen2026-09-24 11:07 UTC83
merged history is bounded by `max_query_bytes`
25d14e49ab68atagen2026-09-24 11:07 UTC84
queries without an explicit limit fail when history exceeds the result cap
25d14e49ab68atagen2026-09-24 11:07 UTC85
`max_repositories` bounds the shared repository directory
25d14e49ab68atagen2026-09-24 11:07 UTC86
slow subscribers disconnect and must replay
25d14e49ab68atagen2026-09-24 11:07 UTC87
peer limits use the direct socket address, so a proxy shares one allowance
25d14e49ab68atagen2026-09-24 11:07 UTC88
25d14e49ab68atagen2026-09-24 11:07 UTC89
the database budget limits sqlite pages, not total disk usage
25d14e49ab68atagen2026-09-24 11:07 UTC90
leave space for the wal and backups
25d14e49ab68atagen2026-09-24 11:07 UTC91
accepted events are not evicted to make room
25d14e49ab68atagen2026-09-24 11:07 UTC92
25d14e49ab68atagen2026-09-24 11:07 UTC93
## backup
25d14e49ab68atagen2026-09-24 11:07 UTC94
25d14e49ab68atagen2026-09-24 11:07 UTC95
stop vineyard before copying its config and database
25d14e49ab68atagen2026-09-24 11:07 UTC96
preserve any accompanying sqlite wal file
25d14e49ab68atagen2026-09-24 11:07 UTC97
restore with the same forge public keys
25d14e49ab68atagen2026-09-24 11:07 UTC98
25d14e49ab68atagen2026-09-24 11:07 UTC99
use the companion brewery backup command to retain `nostr.key` and federation state
25d14e49ab68atagen2026-09-24 11:07 UTC100
keep the restored key private and restore a custom key path before starting brewery
25d14e49ab68atagen2026-09-24 11:07 UTC101
a new forge key changes every repository's nostr address
25d14e49ab68atagen2026-09-24 11:07 UTC102
25d14e49ab68atagen2026-09-24 11:07 UTC103
## development
25d14e49ab68atagen2026-09-24 11:07 UTC104
25d14e49ab68atagen2026-09-24 11:07 UTC105
```sh
25d14e49ab68atagen2026-09-24 11:07 UTC106
nix develop
25d14e49ab68atagen2026-09-24 11:07 UTC107
nix flake check
25d14e49ab68atagen2026-09-24 11:07 UTC108
```