shell-things/conf/systemd/user/ipfs.service

67 lines
3.0 KiB
SYSTEMD
Raw Normal View History

[Unit]
Description=IPFS daemon
After=network.target protonvpn-user.service
Wants=protonvpn-user.service
# IMPORTANT! If you are running on a VPS/dedicated/similar
# `ipfs init --profile=server` or immediately after setting it up
# `ipfs profile apply server`.
# I would probably recommend `ipfs init --profile=badgerds && ipfs profile apply server`
# REF: https://github.com/ipfs/go-ipfs/issues/4343 "Running IPFS on VPS
# (closed in favour of https://github.com/ipfs/go-ipfs/issues/6932
# "[META] Private Addresses In Public")
# providers triggers netscan detection, risking account termination"
[Service]
ExecStart=/home/mikaela/go/bin/ipfs daemon --routing=dht --enable-gc --enable-namesys-pubsub
# My attempts at explaining flags above + --mount for fuse
# --mount - fuse for /ipfs and /ipns, see
# https://github.com/ipfs/go-ipfs/blob/master/docs/fuse.md as it requires
# some specific config, I am not setting it as default here.
# --routing=dht - if the IPFS node is publicly accessible, it serves as
# `dhtserver` to the network possibly using more bandwidth, but also making
# hosted content more findable. Otherwise it will work as `dhtclient` not
# serving the network, but also saving bandwidth
# --enable-gc - automatic cleaning of unpinned files per rules in ipfs
# config, I think by default two hours or when the repo gets bigger than
# 10G
# --enable-namesys-pubsub - real time previously cached ipns updates
#
# My specific config:
# ipfs config Reprovider.Strategy pinned - advertise only pinned files
# to the network to reduce connections instead of also cached content
# (which they will still be able to download, see ipfs/go-ipfs#4145)
# ipfs config Swarm.ConnMgr.GracePeriod 1s - to get rid of excess
# connections quickly
# ipfs config --json Swarm.ConnMgr.HighWater 40 - attempt to stay below 40
# connections
# ipfs config --json Swarm.ConnMgr.LowWater 20 - attempt to keep at least
# 20 connections
# ipfs config --json Swarm.EnableAutoRelay true - if impassable NAT is
# detected, connect to the network through relays that have configured
# themselves as open (EnableAutoNATService & EnableRelayHop?)
# ipfs config --json Experimental.QUIC true - QUIC support, remember to
# edit swarm addresses to include /ip4/0.0.0.0/udp/4001/quic
# /ip6/::/udp/4001/quic
# ipfs config --json Experimental.FilestoreEnabled true - for ipfs add
# --nocopy to not store the content twice on disc
#
2019-05-01 22:30:12 +02:00
# Routing note: dhtclient may cause problems making the content findable
# even if it uses less bandwitdh, so it may be better to use
# dht everywhere if that isn't a problem. dht also breaks
# LowWater/HighWater limits.
#
# I am using badger datastore.
#
# Extra: to disable IPv4 connections:
# ipfs swarm filters add /ip4/0.0.0.0/ipcidr/0
# However I think this may do more harm than good, especially if the
# other config options above (especially Reprovider.Strategy pinned) keep
# amount of connection tolerable and won't cause issues.
#
Restart=on-failure
[Install]
WantedBy=default.target