A fork of the Cocoon PDS but being made more distributed.
11

Configure Feed

Select the types of activity you want to include in your feed.

add configuration for setting blockstore variant

Hailey (Jul 19, 2025, 10:02 AM -0700) 39dfab1e d3734e62

+24
+15
cmd/cocoon/main.go
··· 136 136 EnvVars: []string{"COCOON_DEFAULT_ATPROTO_PROXY"}, 137 137 Value: "did:web:api.bsky.app#bsky_appview", 138 138 }, 139 + &cli.StringFlag{ 140 + Name: "blockstore-variant", 141 + EnvVars: []string{"COCOON_BLOCKSTORE_VARIANT"}, 142 + Value: "sqlite", 143 + }, 139 144 }, 140 145 Commands: []*cli.Command{ 141 146 runServe, ··· 158 163 Usage: "Start the cocoon PDS", 159 164 Flags: []cli.Flag{}, 160 165 Action: func(cmd *cli.Context) error { 166 + var bsv server.BlockstoreVariant 167 + maybeBsv := cmd.String("blockstore-variant") 168 + switch maybeBsv { 169 + case "sqlite": 170 + bsv = server.BlockstoreVariantSqlite 171 + default: 172 + panic("invalid blockstore variant!") 173 + } 174 + 161 175 s, err := server.New(&server.Args{ 162 176 Addr: cmd.String("addr"), 163 177 DbName: cmd.String("db-name"), ··· 185 199 }, 186 200 SessionSecret: cmd.String("session-secret"), 187 201 DefaultAtprotoProxy: cmd.String("default-atproto-proxy"), 202 + BlockstoreVariant: bsv, 188 203 }) 189 204 if err != nil { 190 205 fmt.Printf("error creating cocoon: %v", err)
+7
server/blockstore_variant.go
··· 1 + package server 2 + 3 + type BlockstoreVariant int 4 + 5 + const ( 6 + BlockstoreVariantSqlite = iota 7 + )
+2
server/server.go
··· 107 107 SessionSecret string 108 108 109 109 DefaultAtprotoProxy string 110 + 111 + BlockstoreVariant BlockstoreVariant 110 112 } 111 113 112 114 type config struct {