Skip to content

Commit

Permalink
refactor: rename to kubo - systemd part
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenKelevra committed Jul 23, 2022
1 parent ab25bce commit b4783a9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
3 changes: 0 additions & 3 deletions misc/systemd/ipfs-sysusers.conf

This file was deleted.

4 changes: 2 additions & 2 deletions misc/systemd/ipfs-api.socket → misc/systemd/kubo-api.socket
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# config.

[Unit]
Description=IPFS API Socket
Description=Kubo's API Socket

[Socket]
Service=ipfs.service
Service=kubo.service
FileDescriptorName=io.ipfs.api
BindIPv6Only=true
ListenStream=127.0.0.1:5001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# your config.

[Unit]
Description=IPFS Gateway Socket
Description=Kubo's Gateway Socket

[Socket]
Service=ipfs.service
Service=kubo.service
FileDescriptorName=io.ipfs.gateway
BindIPv6Only=true
ListenStream=127.0.0.1:8080
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# This file will be overwritten on package upgrades, avoid customizations here.
#
# To make persistent changes, create file in
# "/etc/systemd/system/ipfs.service.d/overwrite.conf" with
# `systemctl edit ipfs.service`. This file will be parsed after this
# "/etc/systemd/system/kubo.service.d/overwrite.conf" with
# `systemctl edit kubo.service`. This file will be parsed after this
# file has been parsed.
#
# To overwrite a variable, like ExecStart you have to specify it once
# blank and a second time with a new value, like:
# ExecStart=
# ExecStart=/usr/bin/ipfs daemon --flag1 --flag2
# ExecStart=/usr/bin/kubo daemon --flag1 --flag2
#
# For more info about custom unit files see systemd.unit(5).

# This service file enables systemd-hardening features compatible with IPFS,
# This service file enables systemd-hardening features compatible with Kubo,
# while breaking compatibility with the fuse-mount function. Use this one only
# if you don't need the fuse-mount functionality.

[Unit]
Description=InterPlanetary File System (IPFS) daemon
Description=Kubo daemon for the InterPlanetary File System (IPFS)
Documentation=https://docs.ipfs.io/
After=network.target

[Service]
# hardening
ReadWritePaths="/var/lib/ipfs/"
ReadWritePaths="/var/lib/kubo/"
NoNewPrivileges=true
ProtectSystem=strict
ProtectKernelTunables=true
Expand Down Expand Up @@ -51,26 +51,26 @@ CapabilityBoundingSet=CAP_NET_BIND_SERVICE
# enable for 1-1024 port listening
#AmbientCapabilities=CAP_NET_BIND_SERVICE
# enable to specify a custom path see docs/environment-variables.md for further documentations
#Environment=IPFS_PATH=/custom/ipfs/path
#Environment=IPFS_PATH=/custom/kubo/path
# enable to specify a higher limit for open files/connections
#LimitNOFILE=1000000

#don't use swap
MemorySwapMax=0

# Don't timeout on startup. Opening the IPFS repo can take a long time in some cases (e.g., when
# badger is recovering) and migrations can delay startup.
# Don't timeout on startup. Opening the Kubo repo can take a long time in some cases (e.g., when
# badger is recovering).
#
# Ideally, we'd be a bit smarter about this but there's no good way to do that without hooking
# systemd dependencies deeper into go-ipfs.
# systemd dependencies deeper into Kubo.
TimeoutStartSec=infinity

Type=notify
User=ipfs
Group=ipfs
StateDirectory=ipfs
User=kubo
Group=kubo
StateDirectory=kubo
Environment=IPFS_PATH="${HOME}"
ExecStart=/usr/bin/ipfs daemon --init --migrate
ExecStart=/usr/bin/kubo daemon --enable-gc
Restart=on-failure
KillSignal=SIGINT

Expand Down
3 changes: 3 additions & 0 deletions misc/systemd/kubo-sysusers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
u kubo - "Kubo daemon for ipfs" /var/lib/kubo
g kubo -
m kubo kubo
24 changes: 12 additions & 12 deletions misc/systemd/ipfs.service → misc/systemd/kubo.service
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# This file will be overwritten on package upgrades, avoid customizations here.
#
# To make persistent changes, create file in
# "/etc/systemd/system/ipfs.service.d/overwrite.conf" with
# `systemctl edit ipfs.service`. This file will be parsed after this
# "/etc/systemd/system/kubo.service.d/overwrite.conf" with
# `systemctl edit kubo.service`. This file will be parsed after this
# file has been parsed.
#
# To overwrite a variable, like ExecStart you have to specify it once
# blank and a second time with a new value, like:
# ExecStart=
# ExecStart=/usr/bin/ipfs daemon --flag1 --flag2
# ExecStart=/usr/bin/kubo daemon --flag1 --flag2
#
# For more info about custom unit files see systemd.unit(5).

[Unit]
Description=InterPlanetary File System (IPFS) daemon
Description=Kubo daemon for the InterPlanetary File System (IPFS)
Documentation=https://docs.ipfs.io/
After=network.target

Expand All @@ -22,26 +22,26 @@ After=network.target
# enable for 1-1024 port listening
#AmbientCapabilities=CAP_NET_BIND_SERVICE
# enable to specify a custom path see docs/environment-variables.md for further documentations
#Environment=IPFS_PATH=/custom/ipfs/path
#Environment=IPFS_PATH=/custom/kubo/path
# enable to specify a higher limit for open files/connections
#LimitNOFILE=1000000

#don't use swap
MemorySwapMax=0

# Don't timeout on startup. Opening the IPFS repo can take a long time in some cases (e.g., when
# badger is recovering) and migrations can delay startup.
# Don't timeout on startup. Opening the Kubo repo can take a long time in some cases (e.g., when
# badger is recovering).
#
# Ideally, we'd be a bit smarter about this but there's no good way to do that without hooking
# systemd dependencies deeper into go-ipfs.
# systemd dependencies deeper into Kubo.
TimeoutStartSec=infinity

Type=notify
User=ipfs
Group=ipfs
StateDirectory=ipfs
User=kubo
Group=kubo
StateDirectory=kubo
Environment=IPFS_PATH="${HOME}"
ExecStart=/usr/bin/ipfs daemon --init --migrate
ExecStart=/usr/bin/kubo daemon --enable-gc
Restart=on-failure
KillSignal=SIGINT

Expand Down

0 comments on commit b4783a9

Please sign in to comment.