summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* | Catch Attribute error if object wasn't save in persistent.State.Isis Lovecruft2013-11-16
| | | | | | | | This happens on first run, if a `Conf` isn't saved as state.config.
* | Check that a networkstatus nickname matches tor-spec.Isis Lovecruft2013-11-16
| |
* | Combine message string for two raised exceptions.Isis Lovecruft2013-11-16
| |
* | Remove two rather excessive log statements from Bridges module.Isis Lovecruft2013-11-15
| |
* | Separate lines for lists of updated and new config values.Isis Lovecruft2013-11-15
| |
* | Save config.RUN_IN_DIR, not state.RUN_IN_DIR, so subCommand can access it.Isis Lovecruft2013-11-15
| | | | | | | | | | | | If we save the runtime directory location later in Main.setup() when the persistent.State instance is created, then any options.subCommands which run earlier cannot access it.
* | Don't add the ORAddresses from a networkstatus if an exception was raised.Isis Lovecruft2013-11-15
| |
* | Fix a bug due to misnamed variable RUNDIR → RUN_IN_DIR.Isis Lovecruft2013-11-15
| |
* | I didn't know where to find it, maybe others won't either.Matthew Finkel2013-11-15
| | | | | | | | | | (cherry picked from commit fceee92ad07f3390eab7504ba6d86393b57aeda0) Signed-off-by: Isis Lovecruft <isis@torproject.org>
* | Obtain the fingerprint and add it to the documents/descriptorsMatthew Finkel2013-11-15
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit b4357fe77284d9858a1c71be649cd6cc157002fd) Signed-off-by: Isis Lovecruft <isis@torproject.org> Conflicts: scripts/gen_bridge_descriptors Again, I had to change a few things due to Matt and I both trying to fix something, and both simultaneously catching problems that the other person missed. :)
* | Update the docstring for idkey_digest in generateNetstatusMatthew Finkel2013-11-15
| | | | | | | | | | (cherry picked from commit 65804cd121edc2e140e1e01d6e9762d5d4c9c2d4) Signed-off-by: Isis Lovecruft <isis@torproject.org>
* | The identity is based on the public key of the router.Matthew Finkel2013-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically it is the SHA-1 hash of the DER encoding of an ASN.1 RSA public key. (cherry picked from commit 6b57521a522abaa8f5fdd158708f382293a59e48) Signed-off-by: Isis Lovecruft <isis@torproject.org> Conflicts: scripts/gen_bridge_descriptors Matt and I both fixed the same bug, but it turns out we were both a tiny bit wrong, I believe, in different ways: I was improperly PEM-encoding the OR keys, and wasn't using ASN.1 format. Matt was using a dump of SIDPKey as the OR bridge's public identity key -- PyOpenSSL has this rather odd API where you have to dump the public key from the public cert to access it. Also, it's necessary to base64-encode the digest of the identity key, and strip the '=' character base64 padding. We *might* still be doing it wrong and missing the DER-encoding step.
* | Sometimes we want spacey fingerprintsMatthew Finkel2013-11-15
| | | | | | | | | | | | | | Take a string with 40 characters and add a space after every 4 chars. (cherry picked from commit 63c7e9ca9c7bf8d397437d5c87dff8f73a759317) Signed-off-by: Isis Lovecruft <isis@torproject.org>
* | Parse bridge descriptors in a separate thread.Isis Lovecruft2013-11-15
| | | | | | | | | | | | | | | | | | TODO: In the future, we will probably want to add some secondary, temporary HTTPServer which serves a simple "BridgeDB is down for maintenance and will be back shortly!" page while the descriptors are being parsed. * FIXES #5232: Import bridges into BridgeDB in a separate thread and database transaction.
* | Use a loaded persistent.State in Main.load().Isis Lovecruft2013-11-15
| | | | | | | | * ADD a docstring to Main.load().
* | Add parse.padBase64() function for adding stripped padding '==' back in.Isis Lovecruft2013-11-15
| |
* | Add an XXX about the odd, hardcoded number of "extra hashrings".Isis Lovecruft2013-11-15
| |
* | Make the logs clearly state which distributor bridges are being inserted into.Isis Lovecruft2013-11-15
| |
* | Slight PEP8ification to bridgedb.Bridges.IPBasedDistributor.Isis Lovecruft2013-11-15
| |
* | Refactor Bridges.parseStatusFile() to use bridgedb.parse.networkstatus.Isis Lovecruft2013-11-15
| |
* | Add newly refactored networkstatus parsers and unittests for them.Isis Lovecruft2013-11-15
| |
* | Deepcopy the HMAC factory function's resulting function.Isis Lovecruft2013-11-15
| |
* | Add bridgedb.parse.addr module for parsing IPs and ports.Isis Lovecruft2013-11-15
| | | | | | | | * MOVE class bridgedb.Bridges.PortList to bridgedb.parse.addr.
* | Add docstrings for Dist.IPBasedDistributor.Isis Lovecruft2013-11-15
| |
* | Fix a bug due to parantheses instead of square brackets.Isis Lovecruft2013-11-15
| |
* | Remove unnecessary config parameter coercion.Isis Lovecruft2013-11-15
| | | | | | | | | | FORCE_PORTS and FORCE_FLAGS are already set to lists. We don't need to coerce them if they weren't set anymore.
* | Handle KeyboardInterrupts in Main.startup() loop.Isis Lovecruft2013-11-15
| |
* | Give a warning if no emailDistributor was created.Isis Lovecruft2013-11-15
| |
* | Update startup.reload() docstring.Isis Lovecruft2013-11-15
| |
* | Also change cfg→config after def reload() in startup().Isis Lovecruft2013-11-15
| |
* | Start using bridgedb.persistent.State in bridgedb.Main.Isis Lovecruft2013-11-15
| |
* | Fix Main.reload() function to work with changed parameters.Isis Lovecruft2013-11-15
| |
* | Remove commented out code from bridgedb.persistent.Isis Lovecruft2013-11-15
| |
* | Remove a comment which is no longer helpful.Isis Lovecruft2013-11-15
| |
* | Change pidfile writer to use with(open()).Isis Lovecruft2013-11-15
| |
* | Change cfg→config in Main.startup() to avoid name conflict.Isis Lovecruft2013-11-15
| | | | | | | | | | Otherwise, the cfg variable in Main.startup().reload() would be overriding the parent namespace in potentially bad/buggy ways.
* | Add somewhat of a docstring to Main.startup().Isis Lovecruft2013-11-15
| |
* | Rewrite Main.loadConfig() to only log after the first run.Isis Lovecruft2013-11-15
| | | | | | | | | | | | | | | | | | | | | | | | There is a bit of a chicken-egg problem here, in that we need to parse our config file before we can configure logging, but we should start logging before changing settings, modifying the config file settings, and creating out persistent.State storage. To get around this, loadConfig() is now modified to only make calls to the logging module the second time the function is called (and all the times after). * MOVE all config/setting changing code from Main.startup() to Main.loadConfig() so that it is reparsed on SIGHUP correctly.
* | Move Main.Conf → persistent.Conf.Isis Lovecruft2013-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to store `Conf` config objects persistently, the Conf class must be accessible in the bridgedb.persistent module. However, the bridgedb.persistent module must be importable into bridgedb.Main in order to use it. This creates a circular import dependency. To fix it, I moved Main.Conf to persistent.Conf. Also, there were bugs in the Conf class which caused Conf instances to store __builtin__ classes. To fix this, I changed: for key, value in attrs.items(): if key.upper() == key: self.__dict__[key] = value to for key, value in attrs.items(): if key == key.upper(): if not key.startswith('__'): self.__dict__[key] = value * FIXES a bug in Conf class causing Python's __builtin__ classes to be reloaded into the global scope.
* | Add bridgedb.persistent module for storing persistent state.Isis Lovecruft2013-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ADD bridgedb.persistent.State class (along with load and save utilities) for securely storing serialized s-expressions representing Python objects and instances. * ADD 21 unittests for testing all new methods and classes in the bridgedb.persistent module. The State class can be used to track config file changes. For example, in bridgedb.Main.run(), several attributes on the config `Conf` object are changed, such as various filenames (to point to their absolute paths). When bridgedb is SIGHUPed, it will reread the config file and reapply all settings. However, this overwrites the variables which have been set in the code (for example, pointing back to non-absolute filepaths). The persistent.State class stores the `Conf` attributes as it's own attributes, and stores the `Conf` instance as State().config. This way, any changes to settings can be applied directly to the State instance, and if the `Conf` object changes on SIGHUP, BridgeDB will understand that a human (hopefully) has changed the file, rather than its own code. Thus, it is smarter about which settings to reapply.
* | Add encoding specification to bridgedb.Main module.Isis Lovecruft2013-11-15
| |
* | Keep a counter on total bridges inserted into a hashring.Isis Lovecruft2013-11-15
| |
* | Change asserts to validations in FilteredBridgeSplitter.insert().Isis Lovecruft2013-11-15
| | | | | | | | | | The asserts will be stripped if Python is run with -O2, thus they are not the best idea for production code.
* | Make loop varnames in FilteredBridgeSplitter.addRing() more descriptive.Isis Lovecruft2013-11-15
| |
* | Rename `ring` → `subring` in FilteredBridgeSplitter.addRing().Isis Lovecruft2013-11-15
| |
* | Sphinxify and improve docstring for FilteredBridgeSplitter.addRing().Isis Lovecruft2013-11-15
| |
* | Make log message in FixedBridgeSplitter.insert more understandable.Isis Lovecruft2013-11-15
| |
* | Add docstring to FilteredBridgeSplitter.insert().Isis Lovecruft2013-11-15
| |
* | Rename `index` and `ring` in FixedBridgeSplitter.dumpAssignments().Isis Lovecruft2013-11-15
| | | | | | | | | | Because `i` and `r` weren't immediately clear to me what they were referring to.
* | Add docstring to FixedBridgeSplitter.dumpAssignments().Isis Lovecruft2013-11-15
| |