|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +############################################################################# |
| 4 | +# Written by BrandyJson, with heavy inspiration from bisq.wiki tails script # |
| 5 | +############################################################################# |
| 6 | +echo "Installing dpkg from persistent, (1.07-1, if this is out of date change the deb path in the script or manually install after running" |
| 7 | +dpkg -i "/home/amnesia/Persistent/haveno_1.0.7-1_amd64.deb" |
| 8 | +echo -e "Allowing amnesia to read tor control port cookie, only run this script when you actually want to use haveno\n\n!!! not secure !!!\n" |
| 9 | +chmod o+r /var/run/tor/control.authcookie |
| 10 | +echo "Updating apparmor-profile" |
| 11 | +echo "--- |
| 12 | +- apparmor-profiles: |
| 13 | + - '/opt/haveno/bin/Haveno' |
| 14 | + users: |
| 15 | + - 'amnesia' |
| 16 | + commands: |
| 17 | + AUTHCHALLENGE: |
| 18 | + - 'SAFECOOKIE .*' |
| 19 | + SETEVENTS: |
| 20 | + - 'CIRC ORCONN INFO NOTICE WARN ERR HS_DESC HS_DESC_CONTENT' |
| 21 | + GETINFO: |
| 22 | + - pattern: 'status/bootstrap-phase' |
| 23 | + response: |
| 24 | + - pattern: '250-status/bootstrap-phase=*' |
| 25 | + replacement: '250-status/bootstrap-phase=NOTICE BOOTSTRAP PROGRESS=100 TAG=done SUMMARY="Done"' |
| 26 | + - 'net/listeners/socks' |
| 27 | + ADD_ONION: |
| 28 | + - pattern: 'NEW:(\S+) Port=9999,(\S+)' |
| 29 | + replacement: 'NEW:{} Port=9999,{client-address}:{}' |
| 30 | + - pattern: '(\S+):(\S+) Port=9999,(\S+)' |
| 31 | + replacement: '{}:{} Port=9999,{client-address}:{}' |
| 32 | + DEL_ONION: |
| 33 | + - '.+' |
| 34 | + HSFETCH: |
| 35 | + - '.+' |
| 36 | + events: |
| 37 | + CIRC: |
| 38 | + suppress: true |
| 39 | + ORCONN: |
| 40 | + suppress: true |
| 41 | + INFO: |
| 42 | + suppress: true |
| 43 | + NOTICE: |
| 44 | + suppress: true |
| 45 | + WARN: |
| 46 | + suppress: true |
| 47 | + ERR: |
| 48 | + suppress: true |
| 49 | + HS_DESC: |
| 50 | + response: |
| 51 | + - pattern: '650 HS_DESC CREATED (\S+) (\S+) (\S+) \S+ (.+)' |
| 52 | + replacement: '650 HS_DESC CREATED {} {} {} redacted {}' |
| 53 | + - pattern: '650 HS_DESC UPLOAD (\S+) (\S+) .*' |
| 54 | + replacement: '650 HS_DESC UPLOAD {} {} redacted redacted' |
| 55 | + - pattern: '650 HS_DESC UPLOADED (\S+) (\S+) .+' |
| 56 | + replacement: '650 HS_DESC UPLOADED {} {} redacted' |
| 57 | + - pattern: '650 HS_DESC REQUESTED (\S+) NO_AUTH' |
| 58 | + replacement: '650 HS_DESC REQUESTED {} NO_AUTH' |
| 59 | + - pattern: '650 HS_DESC REQUESTED (\S+) NO_AUTH \S+ \S+' |
| 60 | + replacement: '650 HS_DESC REQUESTED {} NO_AUTH redacted redacted' |
| 61 | + - pattern: '650 HS_DESC RECEIVED (\S+) NO_AUTH \S+ \S+' |
| 62 | + replacement: '650 HS_DESC RECEIVED {} NO_AUTH redacted redacted' |
| 63 | + - pattern: '.*' |
| 64 | + replacement: '' |
| 65 | + HS_DESC_CONTENT: |
| 66 | + suppress: true" > /etc/onion-grater.d/haveno.yml |
| 67 | +echo "Adding rule to iptables to allow for monero-wallet-rpc to work" |
| 68 | +iptables -I OUTPUT 2 -p tcp -d 127.0.0.1 -m tcp --dport 18081 -m owner --uid-owner 1855 -j ACCEPT |
| 69 | +echo "Updating torsocks to allow for inbound connection" |
| 70 | +sed -i 's/#AllowInbound/AllowInbound/g' /etc/tor/torsocks.conf |
| 71 | + |
| 72 | +echo "Restarting onion-grater service" |
| 73 | + |
| 74 | +systemctl restart onion-grater.service |
| 75 | + |
| 76 | +echo "alias haveno-tails='torsocks /opt/haveno/bin/Haveno --torControlPort 951 --torControlCookieFile=/var/run/tor/control.authcookie --torControlUseSafeCookieAuth --useTorForXmr=ON --userDataDir=/home/amnesia/Persistent/'" >> /home/amnesia/.bashrc |
| 77 | +echo -e "Everything is set up just run\n\nsource ~/.bashrc\n\nThen you can start haveno using haveno-tails" |
0 commit comments