support environment variables mostly everywhere,

useful for docker/systemd stuff

also makes logfiles flush to disk per line by default;
can be disabled for a small performance gain with --no-logflush
This commit is contained in:
ed 2023-11-30 10:22:52 +00:00
parent 0b9b8dbe72
commit c9fd26255b
8 changed files with 51 additions and 23 deletions

View file

@ -13,7 +13,9 @@
# systemctl daemon-reload && systemctl enable --now copyparty
#
# if it fails to start, first check this: systemctl status copyparty
# then try starting it while viewing logs: journalctl -fan 100
# then try starting it while viewing logs:
# journalctl -fan 100
# tail -Fn 100 /var/log/copyparty/$(date +%Y-%m%d.log)
#
# you may want to:
# - change "User=copyparty" and "/var/lib/copyparty/" to another user
@ -27,10 +29,6 @@
# python disabling line-buffering, so messages are out-of-order:
# https://user-images.githubusercontent.com/241032/126040249-cb535cc7-c599-4931-a796-a5d9af691bad.png
#
# unless you add -q to disable logging, you may want to remove the
# following line to allow buffering (slightly better performance):
# Environment=PYTHONUNBUFFERED=x
#
########################################################################
########################################################################
@ -77,6 +75,11 @@ RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
## create a directory for logfiles;
## this defines $LOGS_DIRECTORY which is used in copyparty.conf
##
LogsDirectory=copyparty
## finally, start copyparty and give it the config file:
##
ExecStart=/usr/bin/python3 /usr/local/bin/copyparty-sfx.py -c /etc/copyparty.conf