meejah / txtorcon

Twisted-based asynchronous Tor control protocol implementation. Includes unit-tests, examples, state-tracking code and configuration abstraction.
http://fjblvrw2jrxnhtg67qpbzi45r7ofojaoo3orzykesly2j3c2m3htapid.onion/
MIT License
250 stars 72 forks source link

config object passed to launch_tor doesn't get hooked up to running Tor properly. #20

Closed meejah closed 11 years ago

meejah commented 11 years ago

If one passes in a config object to launch_tor, it is not hooked up properly to the TorControlProtocol object that is speaking to the Tor which got launched. Needs test-case and code fix.

fpietrosanti commented 11 years ago

Imho it's important that when you do a "save()" you are later able to retrieve the config structure without having to save it to a file.

For example GlobaLeaks, based on APAF based on txtorcon, plan to keep all it's data to an encrypted sqlcipher db and at runtime extract the files required for it's components and dependencies (such as tor).

meejah commented 11 years ago

save() doesn't write it to a file. Perhaps I should rename the method, but if there's a connected .protocol save() writes the files to the running Tor. After that it puts them in the self.config hashtable (instead of "unsaved").

In any case, the config structure is always in the .config hashtable.

You can get a torrc-like file by calling "create_torrc()", which also doesn't write a file (it returns a string). Nothing in TorConfig writes to files.

meejah commented 11 years ago

fixed, with test