2025-08-07 21:10:26 +03:00
|
|
|
# this will start `/usr/bin/copyparty`
|
2023-11-25 13:40:21 +00:00
|
|
|
# in a chroot, preventing accidental access elsewhere,
|
2025-08-07 21:10:26 +03:00
|
|
|
# and read copyparty config from `/etc/copyparty/copyparty.conf`
|
2023-02-05 00:07:04 +00:00
|
|
|
#
|
|
|
|
|
# expose additional filesystem locations to copyparty
|
2025-08-07 21:10:26 +03:00
|
|
|
# by listing them between the last `%i` and `--`
|
2023-02-05 00:07:04 +00:00
|
|
|
#
|
2025-08-07 21:10:26 +03:00
|
|
|
# `%i %i` = user/group to run copyparty as; can be IDs (1000 1000)
|
|
|
|
|
# the %i refers to whatever you put after the prisonparty@
|
|
|
|
|
# so with prisonparty@foo.service, %i == foo
|
2023-02-05 00:07:04 +00:00
|
|
|
#
|
|
|
|
|
# unless you add -q to disable logging, you may want to remove the
|
|
|
|
|
# following line to allow buffering (slightly better performance):
|
|
|
|
|
# Environment=PYTHONUNBUFFERED=x
|
|
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=copyparty file server
|
|
|
|
|
|
|
|
|
|
[Service]
|
2025-08-07 21:10:26 +03:00
|
|
|
Type=notify
|
2023-02-05 00:07:04 +00:00
|
|
|
SyslogIdentifier=prisonparty
|
|
|
|
|
WorkingDirectory=/var/lib/copyparty-jail
|
2025-08-07 21:10:26 +03:00
|
|
|
Environment=PYTHONUNBUFFERED=x
|
|
|
|
|
Environment=PRTY_CONFIG=/etc/copyparty/copyparty.conf
|
2023-02-05 00:07:04 +00:00
|
|
|
ExecReload=/bin/kill -s USR1 $MAINPID
|
|
|
|
|
|
2025-08-07 21:10:26 +03:00
|
|
|
# user to run as + where the TLS certificate is (if any)
|
|
|
|
|
User=%i
|
|
|
|
|
Environment=XDG_CONFIG_HOME=/home/%i/.config
|
2023-02-05 00:07:04 +00:00
|
|
|
|
|
|
|
|
# run copyparty
|
2025-08-07 21:10:26 +03:00
|
|
|
ExecStart=/bin/bash /usr/bin/prisonparty /var/lib/copyparty-jail %i %i \
|
|
|
|
|
/etc/copyparty \
|
2023-11-25 13:40:21 +00:00
|
|
|
-- \
|
2025-08-07 21:10:26 +03:00
|
|
|
/usr/bin/python3 /usr/bin/copyparty
|
2023-02-05 00:07:04 +00:00
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|