Skip to main content

Add your description here

Project description

Uvicorn SSL Restarter

This service is intended to be used with any uvicorn application to automatically restart it when new SSL-Certificates are available.

Usage

pip install uvicorn-ssl-restarter

Import the UvicornSSLRestarter class into your entrypoint.py file. (Or wherever you start your Uvicorn server).

from app.uvicorn_ssl_restarter import UvicornSSLRestarter

Start the server using:

uvicorn_ssl_restarter = UvicornSSLRestarter(
    virtual_host="example.com",
    app_path="app.main:app",
    fallback_certs_dir="/app/fallback-certs",
    real_certs_dir="/app/certs",
    renew_check_interval=60*60*2, # Seconds between checks for new certificates
    server_port=443,
)
await uvicorn_ssl_restarter.run()

Change variables as needed.

Publish package

Update the version in the pyproject.toml and then run:

uv sync
uv build
# make sure that UV_PUBLISH_TOKEN is populated with your pypi token
uv publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uvicorn_ssl_restarter-0.1.4.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uvicorn_ssl_restarter-0.1.4-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file uvicorn_ssl_restarter-0.1.4.tar.gz.

File metadata

File hashes

Hashes for uvicorn_ssl_restarter-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e1ac562ea3a4babc17153bb22ff9764415002f6abbe0f2a0d76f4706decb3519
MD5 fd373ebf8bb3065bea0dd7af7eb202e1
BLAKE2b-256 c2347c4bec2cb333a903a798292002306af55832176790bd065fd739949f4ee4

See more details on using hashes here.

File details

Details for the file uvicorn_ssl_restarter-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for uvicorn_ssl_restarter-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 724afd1dbab3148bfc4b05a5cef00b613e1c2a44ba1f6efeaa964f093459f92f
MD5 17de6d8ef9fa3c6f0d1c26e224e7d978
BLAKE2b-256 725d89812fffa744b04c63edd84b72af43d54dbfe203a27c31e42b41888a69c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page