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

#### meta start
#### project Whonix
#### category tor-control
#### description
## Shipped but not enabled by default onion-grater profile.
#### meta end

## TODO: restrict number of ports / instances
##       https://github.com/ricochet-im/ricochet/issues/30#issuecomment-271646818

---
- exe-paths:
    - '*'
  users:
    - '*'
  hosts:
    - '*'
  commands:
    GETINFO:
      - pattern: 'status/circuit-established status/bootstrap-phase net/listeners/socks'
        response:
        - pattern:     '250-status/bootstrap-phase=*'
          replacement: '250-status/bootstrap-phase=NOTICE BOOTSTRAP PROGRESS=100 TAG=done SUMMARY="Done"'
        - pattern:     '250-net/listeners/socks=".*"'
          replacement: '250-net/listeners/socks="127.0.0.1:9150"'
    GETCONF:
      - 'DisableNetwork'
    ADD_ONION:
      - pattern:     'NEW:(\S+) Port=9878,\S+:(\S+)'
        replacement: 'NEW:{} Port=9878,{client-address}:{}'
      - pattern:     '(\S+):(\S+) Port=9878,\S+:(\S+)'
        replacement: '{}:{} Port=9878,{client-address}:{}'
    DEL_ONION:
      - '.+'
  events:
    STATUS_CLIENT:
      suppress: true
