Stop merging multiple torrc options with the same name
If sbws is configured with a default torrc option and an extra torrc option with the same name, then it merges the arguments in both options: https://gitweb.torproject.org/sbws.git/tree/sbws/util/stem.py#n175
This is wrong in different ways, depending on the option
- "SocksPort auto 9050" is not a valid torrc option, the correct syntax is "SocksPort auto\nSocksPort 9050"
- "ExitPolicy accept *:80 accept *:443" is not a valid torrc option, the correct syntax is "ExitPolicy accept *:80,accept *:443" or "ExitPolicy accept *:80\nExitPolicy accept *:443"
Instead of trying to understand torrc options, sbws should just set them all at once, and let Tor sort out the details. The stem.control.set_options() function takes a list of options, and applies them all at the same time.
There are a few issues with this approach:
- Operators can't override some of sbws' default torrc options (we can fix this in legacy/trac#28737 (moved))
- Some torrc options need to be set after tor has bootstrapped:
- DisablePredictedCircuits, but we might remove it in legacy/trac#28701 (moved)
- LeaveStreamsUnattached, but I think it can be set on the command-line
- Some torrc options aren't supported by all tor versions (legacy/trac#28646 (moved), legacy/trac#28692 (moved)), so they need to be set at runtime, and allowed to fail