Monorepo for Tangled
0

Configure Feed

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

appview,nix: add porxie blob store

Signed-off-by: Seongmin Lee <git@boltless.me>

Seongmin Lee (May 23, 2026, 5:37 PM +0900) 5bdabb2c bc5c54c7

+60 -4
+5
appview/config/config.go
··· 150 150 Host string `env:"HOST, default=https://ogre.tangled.network"` 151 151 } 152 152 153 + type PorxieConfig struct { 154 + Url string `env:"URL"` // appview will default to PDS when porxie url is not configured 155 + } 156 + 153 157 func (cfg RedisConfig) ToURL() string { 154 158 u := &url.URL{ 155 159 Scheme: "redis", ··· 183 187 Sites SitesConfig `env:",prefix=TANGLED_SITES_"` 184 188 KnotMirror KnotMirrorConfig `env:",prefix=TANGLED_KNOTMIRROR_"` 185 189 Ogre OgreConfig `env:",prefix=TANGLED_OGRE_"` 190 + Porxie PorxieConfig `env:",prefix=TANGLED_PORXIE_"` 186 191 } 187 192 188 193 func LoadConfig(ctx context.Context) (*Config, error) {
+6 -1
appview/state/state.go
··· 120 120 121 121 mentionsResolver := mentions.New(config, res, d, log.SubLogger(logger, "mentionsResolver")) 122 122 123 - blobStore := blobstore.NewPdsBlobStore(res.Directory()) 123 + var blobStore blobstore.BlobStore 124 + if config.Porxie.Url != "" { 125 + blobStore = blobstore.NewPorxieBlobStore(config.Porxie.Url) 126 + } else { 127 + blobStore = blobstore.NewPdsBlobStore(res.Directory()) 128 + } 124 129 125 130 jc, err := jetstream.NewJetstreamClient( 126 131 config.Jetstream.Endpoint,
+33
blobstore/porxie.go
··· 1 + package blobstore 2 + 3 + import ( 4 + "context" 5 + "fmt" 6 + "io" 7 + "net/http" 8 + 9 + "github.com/bluesky-social/indigo/atproto/syntax" 10 + "github.com/ipfs/go-cid" 11 + ) 12 + 13 + type Porxie struct { 14 + url string 15 + } 16 + 17 + func NewPorxieBlobStore(url string) *Porxie { 18 + return &Porxie{url} 19 + } 20 + 21 + func (s *Porxie) GetBlob(ctx context.Context, did syntax.DID, cid cid.Cid) (io.ReadCloser, error) { 22 + url := fmt.Sprintf("%s/%s/%s", s.url, did, cid) 23 + resp, err := http.Get(url) 24 + if err != nil { 25 + return nil, err 26 + } 27 + 28 + if resp.StatusCode != http.StatusOK { 29 + return nil, fmt.Errorf("unexpected status: %s", resp.Status) 30 + } 31 + 32 + return resp.Body, nil 33 + }
+3 -3
flake.lock
··· 183 183 }, 184 184 "nixpkgs": { 185 185 "locked": { 186 - "lastModified": 1771848320, 187 - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", 186 + "lastModified": 1777954456, 187 + "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", 188 188 "owner": "nixos", 189 189 "repo": "nixpkgs", 190 - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", 190 + "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", 191 191 "type": "github" 192 192 }, 193 193 "original": {
+13
nix/vm.nix
··· 81 81 host.port = 7100; 82 82 guest.port = 7100; 83 83 } 84 + { 85 + from = "host"; 86 + host.port = 6314; 87 + guest.port = 6314; 88 + } 84 89 ]; 85 90 sharedDirectories = { 86 91 # We can't use the 9p mounts directly for most of these ··· 152 157 local all tnglr trust 153 158 host all tnglr 127.0.0.1/32 trust 154 159 ''; 160 + }; 161 + services.porxie = { 162 + enable = true; 163 + settings = { 164 + PORXIE_SERVER_ADDRESS = "ip:0.0.0.0:6314"; 165 + PORXIE_BLOB_ALLOWED_MIMETYPES = ["application/gzip" "image/*" "text/plain"]; 166 + PORXIE_IDENTITY_PLC_URL = plcUrl; 167 + }; 155 168 }; 156 169 services.tangled.knotmirror = { 157 170 enable = true;