summaryrefslogtreecommitdiff
path: root/pcr/zeronet-git/zeronet.install
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/zeronet-git/zeronet.install')
-rw-r--r--pcr/zeronet-git/zeronet.install37
1 files changed, 37 insertions, 0 deletions
diff --git a/pcr/zeronet-git/zeronet.install b/pcr/zeronet-git/zeronet.install
new file mode 100644
index 000000000..659e8e0c6
--- /dev/null
+++ b/pcr/zeronet-git/zeronet.install
@@ -0,0 +1,37 @@
+post_install() {
+ getent passwd zeronet &>/dev/null || {
+ echo -n ">>> Creating zeronet user... "
+ useradd --system --user-group --home /var/lib/zeronet zeronet
+ echo "done"
+ } # NOTE: we do not autoremove user due to security concerns (Arch policy)
+ post_upgrade
+ # Don't run thesre operations automatically, because they are security-sensitive
+ echo ">>> Default mode is clearnet+Tor. Give zeronet permissions to configure hidden service:"
+ echo ">>> sudo usermod -a -G tor zeronet"
+ echo ">>> sudo mkdir -m 750 /var/lib/tor-auth && sudo chown tor:tor /var/lib/tor-auth"
+ echo ">>> Add/edit the following options in /etc/tor/torrc:"
+ echo ">>> ControlPort 9051"
+ echo ">>> CookieAuthentication 1"
+ echo ">>> CookieAuthFileGroupReadable 1"
+ echo ">>> CookieAuthFile /var/lib/tor-auth/control_auth_cookie"
+ echo ">>> Restart tor (reload not enough):"
+ echo ">>> sudo systemctl restart tor"
+ echo ">>> Run daemon and check status and view log:"
+ echo ">>> sudo systemctl start zeronet"
+ echo ">>> sudo systemctl status zeronet"
+ echo ">>> sudo journalctl -u zeronet"
+ echo ">>> NOTE: all operations including editing zerosite files,"
+ echo ">>> should be done as user zeronet and config must be passed"
+ echo ">>> for data directory to be selected to /var/lib/zeronet: "
+ echo ">>> sudo -u zeronet python2 zeronet.py --config_file /etc/zeronet.conf ..."
+ echo ">>> OR"
+ echo ">>> sudo su - zeronet"
+ echo ">>> cd /opt/zeronet"
+ echo ">>> python2 zeronet.py --config_file /etc/zeronet.conf ..."
+}
+
+post_upgrade() {
+ chown -R zeronet:zeronet /opt/zeronet
+ chown zeronet:zeronet /var/lib/zeronet
+ chown zeronet:zeronet /var/log/zeronet
+}