# this will start `/usr/local/bin/copyparty-sfx.py` # and share '/mnt' with anonymous read+write # # installation: # cp -pv copyparty.service /etc/systemd/system && systemctl enable --now copyparty # restorecon -vr /etc/systemd/system/copyparty.service # firewall-cmd --permanent --add-port={80,443,3923}/tcp # firewall-cmd --reload # # you may want to: # change '/usr/bin/python3' to another interpreter # change '/mnt::rw' to another location or permission-set # remove '-p 80,443,3923' to only listen on port 3923 # add '-i 127.0.0.1' to only allow local connections # add '-e2dsa' to enable filesystem scanning + indexing # add '-e2ts' to enable metadata indexing # # with `Type=notify`, copyparty will signal systemd when it is ready to # accept connections; correctly delaying units depending on copyparty. # But note that journalctl will get the timestamps wrong due to # python disabling line-buffering, so messages are out-of-order: # https://user-images.githubusercontent.com/241032/126040249-cb535cc7-c599-4931-a796-a5d9af691bad.png # # if you remove -q to enable logging, you may also want to remove the # following line to enable buffering (slightly better performance): # Environment=PYTHONUNBUFFERED=x # # keep ExecStartPre before ExecStart, at least on rhel8 [Unit] Description=copyparty file server [Service] Type=notify SyslogIdentifier=copyparty Environment=PYTHONUNBUFFERED=x ExecReload=/bin/kill -s USR1 $MAINPID ExecStartPre=/bin/bash -c 'mkdir -p /run/tmpfiles.d/ && echo "x /tmp/pe-copyparty*" > /run/tmpfiles.d/copyparty.conf' ExecStart=/usr/bin/python3 /usr/local/bin/copyparty-sfx.py -q -p 80,443,3923 -e2d -v /mnt::rw [Install] WantedBy=multi-user.target