| Commit message (Collapse) | Author | Age |
| ... | |
| | |
| |
| |
| | |
This happens on first run, if a `Conf` isn't saved as state.config.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
(cherry picked from commit fceee92ad07f3390eab7504ba6d86393b57aeda0)
Signed-off-by: Isis Lovecruft <isis@torproject.org>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(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. :)
|
| | |
| |
| |
| |
| | |
(cherry picked from commit 65804cd121edc2e140e1e01d6e9762d5d4c9c2d4)
Signed-off-by: Isis Lovecruft <isis@torproject.org>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
* ADD a docstring to Main.load().
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
* MOVE class bridgedb.Bridges.PortList to bridgedb.parse.addr.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
FORCE_PORTS and FORCE_FLAGS are already set to lists. We don't need to coerce
them if they weren't set anymore.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Otherwise, the cfg variable in Main.startup().reload() would be overriding the
parent namespace in potentially bad/buggy ways.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.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.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
The asserts will be stripped if Python is run with -O2, thus they are not the
best idea for production code.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Because `i` and `r` weren't immediately clear to me what they were referring
to.
|
| | | |
|