Vow, uncensorable PDS written in Go

refactor: simplify blockstore package and APIs

+150 -176
+1
LICENSE license
··· 1 1 MIT License 2 2 3 3 Copyright (c) 2025 me@haileyok.com 4 + Copyright (c) 2026 julien@rbrt.fr 4 5 5 6 Permission is hereby granted, free of charge, to any person obtaining a copy 6 7 of this software and associated documentation files (the "Software"), to deal
README.md readme.md
+84
blockstore/recording.go
··· 1 + package blockstore 2 + 3 + import ( 4 + "context" 5 + "fmt" 6 + 7 + boxoblockstore "github.com/ipfs/boxo/blockstore" 8 + blocks "github.com/ipfs/go-block-format" 9 + "github.com/ipfs/go-cid" 10 + ) 11 + 12 + // RecordingBlockstore wraps a Blockstore and records all reads and writes 13 + // performed against it, for later inspection. 14 + type RecordingBlockstore struct { 15 + base boxoblockstore.Blockstore 16 + 17 + inserts map[cid.Cid]blocks.Block 18 + reads map[cid.Cid]blocks.Block 19 + } 20 + 21 + func NewRecording(base boxoblockstore.Blockstore) *RecordingBlockstore { 22 + return &RecordingBlockstore{ 23 + base: base, 24 + inserts: make(map[cid.Cid]blocks.Block), 25 + reads: make(map[cid.Cid]blocks.Block), 26 + } 27 + } 28 + 29 + func (bs *RecordingBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) { 30 + return bs.base.Has(ctx, c) 31 + } 32 + 33 + func (bs *RecordingBlockstore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) { 34 + b, err := bs.base.Get(ctx, c) 35 + if err != nil { 36 + return nil, err 37 + } 38 + bs.reads[c] = b 39 + return b, nil 40 + } 41 + 42 + func (bs *RecordingBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) { 43 + return bs.base.GetSize(ctx, c) 44 + } 45 + 46 + func (bs *RecordingBlockstore) DeleteBlock(ctx context.Context, c cid.Cid) error { 47 + return bs.base.DeleteBlock(ctx, c) 48 + } 49 + 50 + func (bs *RecordingBlockstore) Put(ctx context.Context, block blocks.Block) error { 51 + if err := bs.base.Put(ctx, block); err != nil { 52 + return err 53 + } 54 + bs.inserts[block.Cid()] = block 55 + return nil 56 + } 57 + 58 + func (bs *RecordingBlockstore) PutMany(ctx context.Context, blks []blocks.Block) error { 59 + if err := bs.base.PutMany(ctx, blks); err != nil { 60 + return err 61 + } 62 + for _, b := range blks { 63 + bs.inserts[b.Cid()] = b 64 + } 65 + return nil 66 + } 67 + 68 + func (bs *RecordingBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) { 69 + return nil, fmt.Errorf("iteration not allowed on recording blockstore") 70 + } 71 + 72 + func (bs *RecordingBlockstore) HashOnRead(bool) {} 73 + 74 + func (bs *RecordingBlockstore) GetWriteLog() map[cid.Cid]blocks.Block { 75 + return bs.inserts 76 + } 77 + 78 + func (bs *RecordingBlockstore) GetReadLog() []blocks.Block { 79 + result := make([]blocks.Block, 0, len(bs.reads)) 80 + for _, b := range bs.reads { 81 + result = append(result, b) 82 + } 83 + return result 84 + }
-1
cmd/vow/flags.go
··· 24 24 flagIpfsPinningServiceToken = "ipfs-pinning-service-token" 25 25 flagSessionSecret = "session-secret" 26 26 flagSessionCookieKey = "session-cookie-key" 27 - flagBlockstoreVariant = "blockstore-variant" 28 27 flagFallbackProxy = "fallback-proxy" 29 28 flagLogLevel = "log-level" 30 29 flagDebug = "debug"
+7 -7
cmd/vow/main.go
··· 17 17 "github.com/bluesky-social/indigo/atproto/atcrypto" 18 18 "github.com/bluesky-social/indigo/atproto/syntax" 19 19 "github.com/glebarez/sqlite" 20 - "pkg.rbrt.fr/vow/internal/helpers" 21 - "pkg.rbrt.fr/vow/server" 22 20 _ "github.com/joho/godotenv/autoload" 23 21 "github.com/lestrrat-go/jwx/v2/jwk" 24 22 "github.com/prometheus/client_golang/prometheus/promhttp" ··· 26 24 "github.com/spf13/viper" 27 25 "golang.org/x/crypto/bcrypt" 28 26 "gorm.io/gorm" 27 + "pkg.rbrt.fr/vow/internal/helpers" 28 + "pkg.rbrt.fr/vow/server" 29 29 ) 30 30 31 31 var Version = "dev" ··· 70 70 pf.String(flagIpfsPinningServiceToken, "", "Bearer token for authenticating with the remote IPFS pinning service") 71 71 pf.String(flagSessionSecret, "", "Session secret") 72 72 pf.String(flagSessionCookieKey, "session", "Session cookie key name") 73 - pf.String(flagBlockstoreVariant, "sqlite", "Blockstore variant (sqlite)") 73 + 74 74 pf.String(flagFallbackProxy, "", "Fallback proxy URL") 75 75 pf.String(flagLogLevel, "info", "Log level: debug, info, warn, error") 76 76 pf.Bool(flagDebug, false, "Enable debug logging (shorthand for --log-level=debug)") ··· 179 179 PinningServiceURL: v.GetString(flagIpfsPinningServiceUrl), 180 180 PinningServiceToken: v.GetString(flagIpfsPinningServiceToken), 181 181 }, 182 - SessionSecret: v.GetString(flagSessionSecret), 183 - SessionCookieKey: v.GetString(flagSessionCookieKey), 184 - BlockstoreVariant: server.MustReturnBlockstoreVariant(v.GetString(flagBlockstoreVariant)), 185 - FallbackProxy: v.GetString(flagFallbackProxy), 182 + SessionSecret: v.GetString(flagSessionSecret), 183 + SessionCookieKey: v.GetString(flagSessionCookieKey), 184 + 185 + FallbackProxy: v.GetString(flagFallbackProxy), 186 186 }) 187 187 if err != nil { 188 188 return fmt.Errorf("error creating vow: %w", err)
+1
go.mod
··· 17 17 github.com/gorilla/websocket v1.5.1 18 18 github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b 19 19 github.com/hashicorp/golang-lru/v2 v2.0.7 20 + github.com/ipfs/boxo v0.10.0 20 21 github.com/ipfs/go-block-format v0.2.0 21 22 github.com/ipfs/go-cid v0.4.1 22 23 github.com/ipfs/go-ipfs-blockstore v1.3.1
+8 -5
go.sum
··· 86 86 github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 87 87 github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= 88 88 github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= 89 - github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= 90 - github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= 89 + github.com/google/pprof v0.0.0-20221203041831-ce31453925ec h1:fR20TYVVwhK4O7r7y+McjRYyaTH6/vjwJOajE+XhlzM= 90 + github.com/google/pprof v0.0.0-20221203041831-ce31453925ec/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= 91 91 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 92 92 github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 93 93 github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 94 - github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= 95 94 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 95 + github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= 96 + github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 96 97 github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= 97 98 github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= 98 99 github.com/gorilla/sessions v1.4.0 h1:kpIYOp/oi6MG/p5PgxApU8srsSw9tuFbt46Lt7auzqQ= ··· 119 120 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 120 121 github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= 121 122 github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= 123 + github.com/ipfs/boxo v0.10.0 h1:tdDAxq8jrsbRkYoF+5Rcqyeb91hgWe2hp7iLu7ORZLY= 124 + github.com/ipfs/boxo v0.10.0/go.mod h1:Fg+BnfxZ0RPzR0nOodzdIq3A7KgoWAOWsEIImrIQdBM= 122 125 github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ= 123 126 github.com/ipfs/go-bitswap v0.11.0/go.mod h1:05aE8H3XOU+LXpTedeAS0OZpcO1WFsj5niYQH9a1Tmk= 124 127 github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= ··· 236 239 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= 237 240 github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= 238 241 github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= 239 - github.com/libp2p/go-libp2p v0.25.1 h1:YK+YDCHpYyTvitKWVxa5PfElgIpOONU01X5UcLEwJGA= 240 - github.com/libp2p/go-libp2p v0.25.1/go.mod h1:xnK9/1d9+jeQCVvi/f1g12KqtVi/jP/SijtKV1hML3g= 242 + github.com/libp2p/go-libp2p v0.26.3 h1:6g/psubqwdaBqNNoidbRKSTBEYgaOuKBhHl8Q5tO+PM= 243 + github.com/libp2p/go-libp2p v0.26.3/go.mod h1:x75BN32YbwuY0Awm2Uix4d4KOz+/4piInkp4Wr3yOo8= 241 244 github.com/libp2p/go-libp2p-asn-util v0.2.0 h1:rg3+Os8jbnO5DxkC7K/Utdi+DkY3q/d1/1q+8WeNAsw= 242 245 github.com/libp2p/go-libp2p-asn-util v0.2.0/go.mod h1:WoaWxbHKBymSN41hWSq/lGKJEca7TNm58+gGJi2WsLI= 243 246 github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0=
-85
recording_blockstore/recording_blockstore.go
··· 1 - package recording_blockstore 2 - 3 - import ( 4 - "context" 5 - "fmt" 6 - 7 - blockformat "github.com/ipfs/go-block-format" 8 - "github.com/ipfs/go-cid" 9 - blockstore "github.com/ipfs/go-ipfs-blockstore" //nolint:staticcheck 10 - ) 11 - 12 - type RecordingBlockstore struct { 13 - base blockstore.Blockstore //nolint:staticcheck 14 - 15 - inserts map[cid.Cid]blockformat.Block 16 - reads map[cid.Cid]blockformat.Block 17 - } 18 - 19 - func New(base blockstore.Blockstore) *RecordingBlockstore { //nolint:staticcheck 20 - return &RecordingBlockstore{ 21 - base: base, 22 - inserts: make(map[cid.Cid]blockformat.Block), 23 - reads: make(map[cid.Cid]blockformat.Block), 24 - } 25 - } 26 - 27 - func (bs *RecordingBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) { 28 - return bs.base.Has(ctx, c) 29 - } 30 - 31 - func (bs *RecordingBlockstore) Get(ctx context.Context, c cid.Cid) (blockformat.Block, error) { 32 - b, err := bs.base.Get(ctx, c) 33 - if err != nil { 34 - return nil, err 35 - } 36 - bs.reads[c] = b 37 - return b, nil 38 - } 39 - 40 - func (bs *RecordingBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) { 41 - return bs.base.GetSize(ctx, c) 42 - } 43 - 44 - func (bs *RecordingBlockstore) DeleteBlock(ctx context.Context, c cid.Cid) error { 45 - return bs.base.DeleteBlock(ctx, c) 46 - } 47 - 48 - func (bs *RecordingBlockstore) Put(ctx context.Context, block blockformat.Block) error { 49 - if err := bs.base.Put(ctx, block); err != nil { 50 - return err 51 - } 52 - bs.inserts[block.Cid()] = block 53 - return nil 54 - } 55 - 56 - func (bs *RecordingBlockstore) PutMany(ctx context.Context, blocks []blockformat.Block) error { 57 - if err := bs.base.PutMany(ctx, blocks); err != nil { 58 - return err 59 - } 60 - 61 - for _, b := range blocks { 62 - bs.inserts[b.Cid()] = b 63 - } 64 - 65 - return nil 66 - } 67 - 68 - func (bs *RecordingBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) { 69 - return nil, fmt.Errorf("iteration not allowed on recording blockstore") 70 - } 71 - 72 - func (bs *RecordingBlockstore) HashOnRead(enabled bool) { 73 - } 74 - 75 - func (bs *RecordingBlockstore) GetWriteLog() map[cid.Cid]blockformat.Block { 76 - return bs.inserts 77 - } 78 - 79 - func (bs *RecordingBlockstore) GetReadLog() []blockformat.Block { 80 - var blocks []blockformat.Block 81 - for _, b := range bs.reads { 82 - blocks = append(blocks, b) 83 - } 84 - return blocks 85 - }
-30
server/blockstore_variant.go
··· 1 - package server 2 - 3 - import ( 4 - blockstore "github.com/ipfs/go-ipfs-blockstore" //nolint:staticcheck 5 - "pkg.rbrt.fr/vow/sqlite_blockstore" 6 - ) 7 - 8 - type BlockstoreVariant int 9 - 10 - const ( 11 - BlockstoreVariantSqlite = iota 12 - ) 13 - 14 - func MustReturnBlockstoreVariant(maybeBsv string) BlockstoreVariant { 15 - switch maybeBsv { 16 - case "sqlite": 17 - return BlockstoreVariantSqlite 18 - default: 19 - panic("invalid blockstore variant provided") 20 - } 21 - } 22 - 23 - func (s *Server) getBlockstore(did string) blockstore.Blockstore { //nolint:staticcheck 24 - switch s.config.BlockstoreVariant { 25 - case BlockstoreVariantSqlite: 26 - return sqlite_blockstore.New(did, s.db) 27 - default: 28 - return sqlite_blockstore.New(did, s.db) 29 - } 30 - }
+2 -1
server/handle_import_repo.go
··· 12 12 blocks "github.com/ipfs/go-block-format" 13 13 "github.com/ipfs/go-cid" 14 14 "github.com/ipld/go-car" 15 + vowblockstore "pkg.rbrt.fr/vow/blockstore" 15 16 "pkg.rbrt.fr/vow/internal/helpers" 16 17 "pkg.rbrt.fr/vow/models" 17 18 ) ··· 29 30 return 30 31 } 31 32 32 - bs := s.getBlockstore(urepo.Repo.Did) 33 + bs := vowblockstore.New(urepo.Repo.Did, s.db) 33 34 34 35 cs, err := car.NewCarReader(bytes.NewReader(b)) 35 36 if err != nil {
+2 -1
server/handle_server_create_account.go
··· 19 19 "github.com/bluesky-social/indigo/util" 20 20 "golang.org/x/crypto/bcrypt" 21 21 "gorm.io/gorm" 22 + vowblockstore "pkg.rbrt.fr/vow/blockstore" 22 23 "pkg.rbrt.fr/vow/internal/helpers" 23 24 "pkg.rbrt.fr/vow/models" 24 25 ) ··· 245 246 } 246 247 247 248 if request.Did == nil || *request.Did == "" { 248 - bs := s.getBlockstore(signupDid) 249 + bs := vowblockstore.New(signupDid, s.db) 249 250 250 251 clk := syntax.NewTIDClock(0) 251 252 r := &atp.Repo{
+3 -2
server/handle_sync_get_blocks.go
··· 5 5 "net/http" 6 6 7 7 "github.com/bluesky-social/indigo/carstore" 8 - "pkg.rbrt.fr/vow/internal/helpers" 9 8 "github.com/ipfs/go-cid" 10 9 cbor "github.com/ipfs/go-ipld-cbor" 11 10 "github.com/ipld/go-car" 11 + vowblockstore "pkg.rbrt.fr/vow/blockstore" 12 + "pkg.rbrt.fr/vow/internal/helpers" 12 13 ) 13 14 14 15 type ComAtprotoSyncGetBlocksRequest struct { ··· 71 72 return 72 73 } 73 74 74 - bs := s.getBlockstore(urepo.Repo.Did) 75 + bs := vowblockstore.New(urepo.Repo.Did, s.db) 75 76 76 77 for _, c := range cids { 77 78 b, err := bs.Get(ctx, c)
+11 -10
server/repo.go
··· 19 19 "github.com/bluesky-social/indigo/carstore" 20 20 "github.com/bluesky-social/indigo/events" 21 21 lexutil "github.com/bluesky-social/indigo/lex/util" 22 + blockstore "github.com/ipfs/boxo/blockstore" 22 23 blocks "github.com/ipfs/go-block-format" 23 24 "github.com/ipfs/go-cid" 24 - blockstore "github.com/ipfs/go-ipfs-blockstore" 25 + legacyblockstore "github.com/ipfs/go-ipfs-blockstore" //nolint:staticcheck 25 26 cbor "github.com/ipfs/go-ipld-cbor" 26 27 "github.com/ipld/go-car" 27 28 "github.com/multiformats/go-multihash" 28 29 "gorm.io/gorm/clause" 30 + vowblockstore "pkg.rbrt.fr/vow/blockstore" 29 31 "pkg.rbrt.fr/vow/internal/db" 30 32 "pkg.rbrt.fr/vow/metrics" 31 33 "pkg.rbrt.fr/vow/models" 32 - "pkg.rbrt.fr/vow/recording_blockstore" 33 34 ) 34 35 35 36 type cachedRepo struct { ··· 71 72 defer cr.mu.Unlock() 72 73 73 74 if cr.repo == nil || cr.root != rootCid { 74 - bs := rm.s.getBlockstore(did) 75 + bs := vowblockstore.New(did, rm.s.db) 75 76 r, err := openRepo(ctx, bs, rootCid, did) 76 77 if err != nil { 77 78 return err ··· 144 145 Rev string `json:"rev"` 145 146 } 146 147 147 - func openRepo(ctx context.Context, bs blockstore.Blockstore, rootCid cid.Cid, did string) (*atp.Repo, error) { //nolint:staticcheck 148 + func openRepo(ctx context.Context, bs blockstore.Blockstore, rootCid cid.Cid, did string) (*atp.Repo, error) { 148 149 commitBlock, err := bs.Get(ctx, rootCid) 149 150 if err != nil { 150 151 return nil, fmt.Errorf("reading commit block: %w", err) ··· 169 170 }, nil 170 171 } 171 172 172 - func commitRepo(ctx context.Context, bs blockstore.Blockstore, r *atp.Repo, signingKey []byte) (cid.Cid, string, error) { //nolint:staticcheck 173 - if _, err := r.MST.WriteDiffBlocks(ctx, bs); err != nil { 173 + func commitRepo(ctx context.Context, bs blockstore.Blockstore, r *atp.Repo, signingKey []byte) (cid.Cid, string, error) { 174 + if _, err := r.MST.WriteDiffBlocks(ctx, bs.(legacyblockstore.Blockstore)); err != nil { //nolint:staticcheck 174 175 return cid.Undef, "", fmt.Errorf("writing MST blocks: %w", err) 175 176 } 176 177 ··· 209 210 return commitCid, commit.Rev, nil 210 211 } 211 212 212 - func putRecordBlock(ctx context.Context, bs blockstore.Blockstore, rec *MarshalableMap) (cid.Cid, error) { //nolint:staticcheck 213 + func putRecordBlock(ctx context.Context, bs blockstore.Blockstore, rec *MarshalableMap) (cid.Cid, error) { 213 214 buf := new(bytes.Buffer) 214 215 if err := rec.MarshalCBOR(buf); err != nil { 215 216 return cid.Undef, err ··· 239 240 return nil, err 240 241 } 241 242 242 - dbs := rm.s.getBlockstore(urepo.Did) 243 - bs := recording_blockstore.New(dbs) 243 + dbs := vowblockstore.New(urepo.Did, rm.s.db) 244 + bs := vowblockstore.NewRecording(dbs) 244 245 245 246 var results []ApplyWriteResult 246 247 var ops []*atp.Operation ··· 556 557 return cid.Undef, nil, err 557 558 } 558 559 559 - dbs := rm.s.getBlockstore(urepo.Did) 560 + dbs := vowblockstore.New(urepo.Did, rm.s.db) 560 561 561 562 var proofBlocks []blocks.Block 562 563 var recordCid *cid.Cid
+25 -28
server/server.go
··· 129 129 SessionSecret string 130 130 SessionCookieKey string 131 131 132 - BlockstoreVariant BlockstoreVariant 133 - FallbackProxy string 132 + FallbackProxy string 134 133 } 135 134 136 135 type config struct { 137 - Version string 138 - Did string 139 - Hostname string 140 - ContactEmail string 141 - EnforcePeering bool 142 - Relays []string 143 - AdminPassword string 144 - RequireInvite bool 145 - SmtpEmail string 146 - SmtpName string 147 - SessionCookieKey string 148 - BlockstoreVariant BlockstoreVariant 149 - FallbackProxy string 136 + Version string 137 + Did string 138 + Hostname string 139 + ContactEmail string 140 + EnforcePeering bool 141 + Relays []string 142 + AdminPassword string 143 + RequireInvite bool 144 + SmtpEmail string 145 + SmtpName string 146 + SessionCookieKey string 147 + FallbackProxy string 150 148 } 151 149 152 150 type CustomValidator struct { ··· 402 400 sessions: cookieStore, 403 401 validator: vdtor, 404 402 config: &config{ 405 - Version: args.Version, 406 - Did: args.Did, 407 - Hostname: args.Hostname, 408 - ContactEmail: args.ContactEmail, 409 - EnforcePeering: false, 410 - Relays: args.Relays, 411 - AdminPassword: args.AdminPassword, 412 - RequireInvite: args.RequireInvite, 413 - SmtpName: args.SmtpName, 414 - SmtpEmail: args.SmtpEmail, 415 - SessionCookieKey: args.SessionCookieKey, 416 - BlockstoreVariant: args.BlockstoreVariant, 417 - FallbackProxy: args.FallbackProxy, 403 + Version: args.Version, 404 + Did: args.Did, 405 + Hostname: args.Hostname, 406 + ContactEmail: args.ContactEmail, 407 + EnforcePeering: false, 408 + Relays: args.Relays, 409 + AdminPassword: args.AdminPassword, 410 + RequireInvite: args.RequireInvite, 411 + SmtpName: args.SmtpName, 412 + SmtpEmail: args.SmtpEmail, 413 + SessionCookieKey: args.SessionCookieKey, 414 + FallbackProxy: args.FallbackProxy, 418 415 }, 419 416 evtman: events.NewEventManager(evtPersister), 420 417 passport: identity.NewPassport(h, identity.NewMemCache(10_000)),
+6 -6
sqlite_blockstore/sqlite_blockstore.go blockstore/sqlite.go
··· 1 - package sqlite_blockstore 1 + package blockstore 2 2 3 3 import ( 4 4 "context" 5 5 "fmt" 6 6 7 7 "github.com/bluesky-social/indigo/atproto/syntax" 8 - "pkg.rbrt.fr/vow/internal/db" 9 - "pkg.rbrt.fr/vow/models" 10 8 blocks "github.com/ipfs/go-block-format" 11 9 "github.com/ipfs/go-cid" 12 10 "gorm.io/gorm/clause" 11 + 12 + "pkg.rbrt.fr/vow/internal/db" 13 + "pkg.rbrt.fr/vow/models" 13 14 ) 14 15 16 + // SqliteBlockstore is a blockstore backed by a SQLite database. 15 17 type SqliteBlockstore struct { 16 18 db *db.DB 17 19 did string ··· 132 134 return nil, fmt.Errorf("iteration not allowed on sqlite blockstore") 133 135 } 134 136 135 - func (bs *SqliteBlockstore) HashOnRead(enabled bool) { 136 - panic("not implemented") 137 - } 137 + func (bs *SqliteBlockstore) HashOnRead(bool) {}