Skip to content

Instantly share code, notes, and snippets.

@revolunet
Last active September 14, 2023 02:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save revolunet/22a8add0ac2f383f0b4519bb5fe392bb to your computer and use it in GitHub Desktop.
Save revolunet/22a8add0ac2f383f0b4519bb5fe392bb to your computer and use it in GitHub Desktop.
Setup private IPFS node
// IPFS in the browser
const ipfs = await IPFS.create({
preload: { enabled: false },
//repo: "./ipfs",
EXPERIMENTAL: { pubsub: true },
config: {
Bootstrap: [
"/dns4/ipfs-ws.xxx.com/tcp/443/wss/ipfs/QmSEbJSiVabcyaG9oBJRs2sJ5sttrNQJvbSeGe7Vt8ZBqt",
],
Addresses: { Swarm: [] },
},
...options,
});
#!/bin/sh
docker rm -f ipfs || true;
docker run -d --restart=always \
--name ipfs \
-e IPFS_PROFILE=server \
-v $PWD/ipfs_staging:/export \
-v $PWD/ipfs_data:/data/ipfs \
--label traefik.http.routers.ipfs.rule="Host(\`ipfs.xxx.com\`)" \
--label traefik.http.routers.ipfs.middlewares="https-redirect@file" \
--label traefik.http.routers.ipfs.service=svc_ipfs \
--label traefik.http.services.svc_ipfs.loadbalancer.server.port=8080 \
--label traefik.http.routers.ipfsws.rule="Host(\`ipfs.xxx.com\`)" \
--label traefik.http.routers.ipfsws.service=svc_ipfs_ws \
--label traefik.http.services.svc_ipfs_ws.loadbalancer.server.port=9999 \
--network traefik \
ipfs/go-ipfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment