Add new TSA configuration environment variables
All checks were successful
Build image and push it to registry / build (push) Successful in 1m1s
All checks were successful
Build image and push it to registry / build (push) Successful in 1m1s
Included 'TSA_CONFIG_PATH', 'TSA_CERT_CHAIN', and 'TSA_KEY_PASSWORD' to the environment variable check in worker.py. This ensures the script validates these new required configurations before proceeding. Added an exception raise in the error handling block for better error management.
This commit is contained in:
parent
dd8c30787a
commit
77aaf97d7b
@ -5,3 +5,6 @@ TIMESTAMP_URL=http://freetsa.org/tsr
|
|||||||
QUEUE_IN=to_python_sign
|
QUEUE_IN=to_python_sign
|
||||||
EXCHANGE_OUT=signed_docs
|
EXCHANGE_OUT=signed_docs
|
||||||
OUT_ROUTING_KEY=signed_doc
|
OUT_ROUTING_KEY=signed_doc
|
||||||
|
TSA_CONFIG_PATH=/home/julien/dev/chill/sign-pdf-worker/ts-authority/rootca.conf
|
||||||
|
TSA_CERT_CHAIN=/home/julien/dev/chill/sign-pdf-worker/ts-authority/ca/tsa-chain.pem
|
||||||
|
TSA_KEY_PASSWORD=5678
|
@ -12,7 +12,7 @@ logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
|
|||||||
LOGGER = logging.getLogger(__name__)
|
LOGGER = logging.getLogger(__name__)
|
||||||
LOGGER.setLevel(os.environ.get('LOG_LEVEL', logging.INFO))
|
LOGGER.setLevel(os.environ.get('LOG_LEVEL', logging.INFO))
|
||||||
|
|
||||||
for v in ['AMQP_URL', 'PKCS12_PATH', 'TIMESTAMP_URL', 'QUEUE_IN', 'EXCHANGE_OUT', 'OUT_ROUTING_KEY']:
|
for v in ['AMQP_URL', 'PKCS12_PATH', 'TIMESTAMP_URL', 'QUEUE_IN', 'EXCHANGE_OUT', 'OUT_ROUTING_KEY', 'TSA_CONFIG_PATH', 'TSA_CERT_CHAIN', 'TSA_KEY_PASSWORD']:
|
||||||
if v not in os.environ:
|
if v not in os.environ:
|
||||||
LOGGER.error('Missing environment variable: %s', v)
|
LOGGER.error('Missing environment variable: %s', v)
|
||||||
raise ValueError('Missing environment variable: ' + v)
|
raise ValueError('Missing environment variable: ' + v)
|
||||||
@ -76,6 +76,7 @@ def on_message(channel, method_frame, header_frame, body):
|
|||||||
else:
|
else:
|
||||||
LOGGER.warning(f"first try failed, signatureId: {body_content['signatureId']}")
|
LOGGER.warning(f"first try failed, signatureId: {body_content['signatureId']}")
|
||||||
channel.basic_ack(delivery_tag=method_frame.delivery_tag)
|
channel.basic_ack(delivery_tag=method_frame.delivery_tag)
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user