## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

#### meta start
#### project Whonix
#### category networking and tor-control
#### non_qubes_whonix_only yes
#### gateway_only yes
#### description
## onion-grater systemd unit file extension
##
## Run <code>/usr/lib/onion-grater-merger</code> as root to avoid permission
## conflicts.
## <code>ExecStartPre=+/usr/lib/onion-grater-merger</code>
##
## Reconfigure <code>onion-grater</code> to listen on network interface
## <code>eth1</code>.
#### meta end

[Service]
## Extend onion-grater default systemd unit file
## /lib/systemd/system/onion-grater.service with 'ExecStartPre'.
## The plus ("+") sign results in running the following command as root.
## Run /usr/lib/onion-grater-merger as root to avoid permission conflicts.
ExecStartPre=+/usr/lib/onion-grater-merger

## Clear onion-grater default file '/lib/systemd/system/onion-grater.service'.
ExecStart=

## Start onion-grater with listening on interface eth1 explicitly.
ExecStart=/usr/lib/onion-grater --listen-interface eth1 --listen-port 9051

## Same as above but enable debug mode.
#ExecStart=/usr/lib/onion-grater --listen-interface eth1 --listen-port 9051 --debug

## Same as above but enable complain mode which permits everything (insecure in production).
#ExecStart=/usr/lib/onion-grater --listen-interface eth1 --listen-port 9051 --complain
