diff options
author | Freemor <freemor@freemor.ca> | 2019-06-27 17:30:01 -0300 |
---|---|---|
committer | Freemor <freemor@freemor.ca> | 2019-06-27 17:30:01 -0300 |
commit | f29385d54a884e735bc7c385e9557b40e6442049 (patch) | |
tree | 504f00245bed38fd66402956644552714a0826e2 /pcr/zeronet-git/zeronet.install | |
parent | 5fb267ccac322db05d23e7fd055b3a07a642823b (diff) | |
download | abslibre-f29385d54a884e735bc7c385e9557b40e6442049.tar.gz abslibre-f29385d54a884e735bc7c385e9557b40e6442049.tar.bz2 abslibre-f29385d54a884e735bc7c385e9557b40e6442049.zip |
Bring [pcr/zeronet-git] closer to current.
Diffstat (limited to 'pcr/zeronet-git/zeronet.install')
-rw-r--r-- | pcr/zeronet-git/zeronet.install | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/pcr/zeronet-git/zeronet.install b/pcr/zeronet-git/zeronet.install index 659e8e0c6..8d94885f9 100644 --- a/pcr/zeronet-git/zeronet.install +++ b/pcr/zeronet-git/zeronet.install @@ -1,19 +1,25 @@ post_install() { getent passwd zeronet &>/dev/null || { echo -n ">>> Creating zeronet user... " - useradd --system --user-group --home /var/lib/zeronet zeronet + useradd --system --user-group -m --home /var/lib/zeronet zeronet echo "done" } # NOTE: we do not autoremove user due to security concerns (Arch policy) - post_upgrade + + mkdir -p /var/log/zeronet + chown zeronet:zeronet /var/log/zeronet + + # This is not usual practice but to editting from web interface + chown zeronet:zeronet /etc/zeronet.conf + # 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 ">>> DataDirectoryGroupReadable 1" echo ">>> CookieAuthentication 1" echo ">>> CookieAuthFileGroupReadable 1" - echo ">>> CookieAuthFile /var/lib/tor-auth/control_auth_cookie" + echo ">>> CookieAuthFile /var/lib/tor/control_auth_cookie" echo ">>> Restart tor (reload not enough):" echo ">>> sudo systemctl restart tor" echo ">>> Run daemon and check status and view log:" @@ -30,8 +36,10 @@ post_install() { echo ">>> python2 zeronet.py --config_file /etc/zeronet.conf ..." } +## each separate version number must be less than 3 digit wide ! +function version { echo "$@" | gawk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }'; } + post_upgrade() { chown -R zeronet:zeronet /opt/zeronet - chown zeronet:zeronet /var/lib/zeronet - chown zeronet:zeronet /var/log/zeronet + chown zeronet:zeronet /etc/zeronet.conf } |