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(
    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.2.tar.gz (16.6 MB view hashes)

Uploaded Source

Built Distribution

uvicorn_ssl_restarter-0.1.2-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

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