fileverse/poc/collab-server/ipfs-init.sh

34 lines
1.0 KiB
Bash

#!/bin/sh
# Configure kubo IPFS node for rStack self-hosted deployment
# Runs once on first start via /container-init.d/
set -e
# Allow API access from Docker network (collab-server needs it)
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST", "GET"]'
# Listen on all interfaces (inside container)
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
# Gateway: subdomain mode for CID isolation
ipfs config --json Gateway.PublicGateways '{
"ipfs.rspace.online": {
"Paths": ["/ipfs", "/ipns"],
"UseSubdomains": false
}
}'
# Storage limits — keep it reasonable for Netcup
ipfs config Datastore.StorageMax "50GB"
# Enable GC
ipfs config --json Datastore.GCPeriod '"24h"'
# Reduce swarm connections (server mode, not a public gateway)
ipfs config --json Swarm.ConnMgr.LowWater 50
ipfs config --json Swarm.ConnMgr.HighWater 200
echo "[ipfs-init] Configuration applied"