| Commit message (Collapse) | Author | Age |
| ... | |
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
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.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
The public key should be used in identity key hash digest creation, so we need
to return `SIDPCert` from the makeOnionKeys() function in
gen_bridge_descriptors, so that we can use it in makeDescriptors().
|
| | |
| |
| |
| |
| |
| |
| | |
* ADD excerpts, from tor-spec.txt and dir-spec.txt, pertaining to encodings
and formats for keys/certs and hash digests, to
gen_bridge_descriptor.makeOnionKeys() function docstring, for clarity,
since the encodings currently used in this function are all kinds of wrong.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
OpenSSL only strictly takes a non-standardized format for timestamps which set
the "Not Valid Before" and "Not Valid After" fields on an x509 certificate. It
*doesn't* take timestamps in Seconds Since Epoch (as I previously had
believed), but only with the strftime format "%Y%m%d%H%M%SZ" (yes, with a
random capital-Z at the end).
OpenSSL *also* doesn't consider the timestamp `0` to be the current time,
contrary to its documentation.
* FIXES a bug in gen_bridge_descriptors where all x509 certificates, and the
signatures which their corresponding OpenSSL.crypto.PKeys created, were
invalid due to crazy timestamps.
|
| | |
| |
| |
| |
| | |
* FIX a bug where the newline after 'router-signature' in an OR extra-info
descriptor was missing.
|
| | |
| |
| |
| |
| | |
* FIX the first line of an OR extra-info document, the fingerprint was being
written without the extra spaces removed.
|
| | |
| |
| |
| |
| | |
Also, minimize imports in scripts/bridgedb to precisely what is needed, so as
not to risk errors caused by something being imported too early.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
* CHANGE the parameters to bridgedb.runner.generateDescriptors() function to
only need specific settings, rather than needing the whole instance of the
MainOptions class.
|
| | |
| |
| |
| |
| |
| | |
* REMOVE cruft code for a bunch of log statements which used str.join()
incorrectly and have been commented out forever anyway.
* ADD warning log message if no HTTPS distributor was created.
|