This repository has been archived by the owner on Jan 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use dict, list, set literals and comprehensions where sensible - don't build lists from generators superfluously - don't use dict.keys(), rather the dict var itself where an iterable is expected - sorted() returns a list already - remove Python 2 compat - use f-strings, except for logging, don't use % operator there, for late interpolation - remove u-strings from comments, too Signed-off-by: Nils Philippsen <[email protected]>
- Loading branch information
Showing
27 changed files
with
506 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,38 +17,38 @@ | |
# | ||
# Authors: Ralph Bean <[email protected]> | ||
# | ||
config = dict( | ||
config = { | ||
# Set this to dev if you're hacking on fedmsg or an app. | ||
# Set to stg or prod if running in the Fedora Infrastructure | ||
environment="dev", | ||
'environment': "dev", | ||
|
||
# Default is 0 | ||
high_water_mark=0, | ||
io_threads=1, | ||
'high_water_mark': 0, | ||
'io_threads': 1, | ||
|
||
## For the fedmsg-hub and fedmsg-relay. ## | ||
|
||
# We almost always want the fedmsg-hub to be sending messages with zmq as | ||
# opposed to amqp or stomp. | ||
zmq_enabled=True, | ||
'zmq_enabled': True, | ||
|
||
# When subscribing to messages, we want to allow splats ('*') so we tell | ||
# the hub to not be strict when comparing messages topics to subscription | ||
# topics. | ||
zmq_strict=False, | ||
'zmq_strict': False, | ||
|
||
# Number of seconds to sleep after initializing waiting for sockets to sync | ||
post_init_sleep=0.5, | ||
'post_init_sleep': 0.5, | ||
|
||
# Wait a whole second to kill all the last io threads for messages to | ||
# exit our outgoing queue (if we have any). This is in milliseconds. | ||
zmq_linger=1000, | ||
'zmq_linger': 1000, | ||
|
||
# See the following | ||
# - http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html | ||
# - http://api.zeromq.org/3-2:zmq-setsockopt | ||
zmq_tcp_keepalive=1, | ||
zmq_tcp_keepalive_cnt=3, | ||
zmq_tcp_keepalive_idle=60, | ||
zmq_tcp_keepalive_intvl=5, | ||
) | ||
'zmq_tcp_keepalive': 1, | ||
'zmq_tcp_keepalive_cnt': 3, | ||
'zmq_tcp_keepalive_idle': 60, | ||
'zmq_tcp_keepalive_intvl': 5, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,29 +18,28 @@ | |
# Authors: Ralph Bean <[email protected]> | ||
# | ||
import os | ||
import socket | ||
|
||
SEP = os.path.sep | ||
here = os.getcwd() | ||
|
||
config = dict( | ||
sign_messages=False, | ||
validate_signatures=False, | ||
config = { | ||
'sign_messages': False, | ||
'validate_signatures': False, | ||
|
||
# Use these implementations to sign and validate messages | ||
crypto_backend='x509', | ||
crypto_validate_backends=['x509'], | ||
'crypto_backend': 'x509', | ||
'crypto_validate_backends': ['x509'], | ||
|
||
ssldir="/etc/pki/fedmsg", | ||
crl_location="https://fedoraproject.org/fedmsg/crl.pem", | ||
crl_cache="/var/run/fedmsg/crl.pem", | ||
crl_cache_expiry=10, | ||
'ssldir': "/etc/pki/fedmsg", | ||
'crl_location': "https://fedoraproject.org/fedmsg/crl.pem", | ||
'crl_cache': "/var/run/fedmsg/crl.pem", | ||
'crl_cache_expiry': 10, | ||
|
||
ca_cert_location="https://fedoraproject.org/fedmsg/ca.crt", | ||
ca_cert_cache="/var/run/fedmsg/ca.crt", | ||
ca_cert_cache_expiry=0, # Never expires | ||
'ca_cert_location': "https://fedoraproject.org/fedmsg/ca.crt", | ||
'ca_cert_cache': "/var/run/fedmsg/ca.crt", | ||
'ca_cert_cache_expiry': 0, # Never expires | ||
|
||
certnames={ | ||
'certnames': { | ||
# In prod/stg, map hostname to the name of the cert in ssldir. | ||
# Unfortunately, we can't use socket.getfqdn() | ||
#"app01.stg": "app01.stg.phx2.fedoraproject.org", | ||
|
@@ -49,7 +48,7 @@ | |
# A mapping of fully qualified topics to a list of cert names for which | ||
# a valid signature is to be considered authorized. Messages on topics not | ||
# listed here are considered automatically authorized. | ||
routing_policy={ | ||
'routing_policy': { | ||
# Only allow announcements from production if they're signed by a | ||
# certain certificate. | ||
"org.fedoraproject.prod.announce.announcement": [ | ||
|
@@ -62,5 +61,5 @@ | |
# When this is False, only messages that have a topic in the routing_policy | ||
# but whose cert names aren't in the associated list are dropped; messages | ||
# whose topics do not appear in the routing_policy are not dropped. | ||
routing_nitpicky=False, | ||
) | ||
'routing_nitpicky': False, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.