Monorepo for Tangled
0

Configure Feed

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

knotmirror: set max size on getBlob

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

author
Seongmin Lee
committer
Tangled
date (May 12, 2026, 11:47 AM +0300) commit 0cf5cbe5 parent 3dae20c5 change-id unnwunrw
+14 -2
+1 -1
knotmirror/xrpc/git_get_blob.go
··· 42 42 pprof.Do(r.Context(), pprof.Labels("repo", repo.String()), func(ctx context.Context) { 43 43 file, err = x.getFile(ctx, repo, ref, path) 44 44 }) 45 - if err != nil { 45 + if err != nil || file.Size > 1000*1000 { 46 46 l.Warn("local mirror failed, trying proxy", "err", err) 47 47 if x.proxyToKnot(w, r, repo) { 48 48 return
+7 -1
nix/modules/knotmirror.nix
··· 30 30 description = "Address to listen on"; 31 31 }; 32 32 33 + metricsListenAddr = mkOption { 34 + type = types.str; 35 + default = "127.0.0.1:7100"; 36 + description = "Address to listen on"; 37 + }; 38 + 33 39 adminListenAddr = mkOption { 34 40 type = types.str; 35 41 default = "127.0.0.1:7200"; ··· 149 155 "MIRROR_KNOT_USE_SSL=${boolToString cfg.knotUseSSL}" 150 156 "MIRROR_KNOT_SSRF=${boolToString cfg.knotSSRF}" 151 157 "MIRROR_RESYNC_PARALLELISM=12" 152 - "MIRROR_METRICS_LISTEN=127.0.0.1:7100" 158 + "MIRROR_METRICS_LISTEN=${cfg.metricsListenAddr}" 153 159 "MIRROR_ADMIN_LISTEN=${cfg.adminListenAddr}" 154 160 "MIRROR_SLURPER_CONCURRENCY=4" 155 161 ];
+6
nix/vm.nix
··· 76 76 host.port = 7200; 77 77 guest.port = 7200; 78 78 } 79 + { 80 + from = "host"; 81 + host.port = 7100; 82 + guest.port = 7100; 83 + } 79 84 ]; 80 85 sharedDirectories = { 81 86 # We can't use the 9p mounts directly for most of these ··· 151 156 services.tangled.knotmirror = { 152 157 enable = true; 153 158 listenAddr = "0.0.0.0:7000"; 159 + metricsListenAddr = "0.0.0.0:7100"; 154 160 adminListenAddr = "0.0.0.0:7200"; 155 161 hostname = "localhost:7000"; 156 162 dbUrl = "postgresql://tnglr@127.0.0.1:5432/mirror";