Sewer is a programmatic Lets Encrypt(ACME) client
Project description
Sewer
Installation:
Usage:
import sewer
# 1. to create a new certificate:
client = sewer.Client(domain_name='example.com',
CLOUDFLARE_DNS_ZONE_ID='random',
CLOUDFLARE_EMAIL='example@example.com',
CLOUDFLARE_API_KEY='nsa-grade-api-key')
certificate = client.cert()
certificate_key = client.certificate_key
account_key = client.account_key
print "your certicate is:", certificate
print "your certificate's key is:", certificate_key
print "\n\n"
print "you can write them to a file then add that file to your favourite webserver."
with open('certificate.crt', 'w') as certificate_file:
certificate_file.write(certificate)
with open('certificate.key', 'w') as certificate_key_file:
certificate_key_file.write(certificate_key)
print "your account key is:", account_key
print "IMPORTANT: keep your account key in a very safe and secure place."
with open('account_key.key', 'w') as account_key_file:
account_key_file.write(account_key)
# 2. to renew a certificate:
import sewer
with open('account_key.key', 'r') as account_key_file:
account_key = account_key_file.read()
client = sewer.Client(domain_name='example.com',
CLOUDFLARE_DNS_ZONE_ID='random',
CLOUDFLARE_EMAIL='example@example.com',
CLOUDFLARE_API_KEY='nsa-grade-api-key',
account_key=account_key)
certificate = client.renew()
certificate_key = client.certificate_key
with open('certificate.crt', 'w') as certificate_file:
certificate_file.write(certificate)
with open('certificate.key', 'w') as certificate_key_file:
certificate_key_file.write(certificate_key)
CLI:
The cerrtificate, certificate key and account key will be saved in the directory that you run sewer from.
The commandline interface(app) is called sewer or alternatively you could use, sewer-cli.
TODO:
make it DNS provider agnostic
support more DNS providers
add robust tests
be able to handle SAN(subject alternative names)
add ci
FAQ:
Why another ACME client? I wanted an ACME client that I could use to programmatically(as a library) acquire/get certificates. However I could not find anything satisfactory for use in Python code.
Why is it called Sewer? Because, for the longest time now, getting certificates has felt like wading through sewers. That was before Let’s Encrypt showed up. Also, I really like the Kenyan hip hop artiste going by the name of Kitu Sewer.
Development setup:
fork this repo.
cd sewer
sudo apt-get install pandoc
open an issue on this repo. In your issue, outline what it is you want to add and why.
install pre-requiste software: apt-get install pandoc && pip install twine wheel pypandoc coverage yapf flake8
make the changes you want on your fork.
your changes should have backward compatibility in mind unless it is impossible to do so.
add your name and contact(optional) to
add tests
run tests to make sure they are passing
format your code using yapf: yapf --in-place --style "google" -r .
run flake8 on the code and fix any issues: flake8 .
open a pull request on this repo.
NB: I make no commitment of accepting your pull requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sewer-0.0.5.tar.gz
.
File metadata
- Download URL: sewer-0.0.5.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5c87bc1c6652abfc407e0f452c30b090dcc57be597ff43709e2b5efe2ccc61e |
|
MD5 | c050cc8d562799dee700f08d26cd3ce9 |
|
BLAKE2b-256 | 3b4f2f5c0a1b574479c2eee8e768e8390738d7fcfb5d75bc5597acf6392ef41c |
File details
Details for the file sewer-0.0.5-py2-none-any.whl
.
File metadata
- Download URL: sewer-0.0.5-py2-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe60b12e538b3021bfd4172582ae86efd3d4d03d2a8bdf1a24d3942048bfa2a9 |
|
MD5 | bb350592eeefc237b70a55c68b2a3fee |
|
BLAKE2b-256 | 400ebe29465c07fcad0ba2b1c380b84abd61bd4aa71925ad4426734c598e7dc3 |