Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #12533
Closed
Open
Issue created Jul 03, 2014 by Trac@tracbot

multiple hidden services and get_conf_map('HiddenServiceOptions') response format

Hi, I'm trying to add a new hidden service to a client which is already running one (or more) service. The naive approach,

    controller.set_options([
        ('HiddenServiceDir', hs_dir),
        ('HiddenServicePort', hs_port)
    ])

clobbers the existing services. Since there doesn't seem to be an API call expressly for adding (not replacing) hidden services, I started investigating the idea of fetching the existing hidden services from the client, then re-adding those in addition to the new service.

However, the data returned from get_conf_map('HiddenServiceOptions') isn't appropriate for that, as far as I can tell. That call returns two flat lists (associated with HiddenServiceDir and HiddenServicePort), which leaves us in the dark about which ports are associated with which dirs.

    >>> controller.set_options([('HiddenServiceDir','/tmp/hiddenservice2/'),
                                ('HiddenServicePort','1235 127.0.0.1:1235'),
                                ('HiddenServicePort','1236 127.0.0.1:1236'),
                                ('HiddenServiceDir','/tmp/hiddenservice3/'),
                                ('HiddenServicePort','1237 127.0.0.1:1237')])

    >>> controller.get_conf_map('HiddenServiceOptions')
    {'HiddenServiceDir': ['/tmp/hiddenservice2/', '/tmp/hiddenservice3/'],
     'HiddenServicePort': ['1235 127.0.0.1:1235', '1236 127.0.0.1:1236', '1237 127.0.0.1:1237']}

More useful in this case would be a list of Dir->[Port] mappings:


    >>> controller.get_conf_map('HiddenServiceOptionsMap')
    {'/tmp/hiddenservice2/': ['1235 127.0.0.1:1235','1236 127.0.0.1:1236'],
     '/tmp/hiddenservice3/': ['1237 127.0.0.1:1237']}

With that data, then, it would be easy to make the appropriate SetOptions calls not only to add a new service, but to re-add the existing services.

I'm not very familiar with Tor's control protocol, so perhaps this isn't a limitation of Stem but of the protocol in general.

Trac:
Username: jthayer

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking