-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ssl support using custom key/cert files #933
base: main
Are you sure you want to change the base?
Conversation
@dahifi if I add those changes to my local, I it will work? or is incomplete ? the added parameters must be provided as environment vars or running paremeters in chainlit executable ? Best regards! |
Thanks for your PR, there is a similar one here: #905 Do you have more background as to why folks who want to create a publicly accessible Chainlit instance without having a proxy in front of it? |
in my case the reverse proxy + chainlit + serving wasm artifacts didnt liked it to iOS devices, so I have solved appliying this PR and removing the nginx reverse proxy for serving the ssl and works fine.... and its a clearer solution for lite infrastructure use cases. |
localhost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, could you add the CHAINLIT_
prefix to env variables?
I've tried to do it myself but I don't have the rights on your fork.
@click.option( | ||
"--ssl-cert", | ||
default=None, | ||
envvar="SSL_CERT", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
envvar="SSL_CERT", | |
envvar="CHAINLIT_SSL_CERT", |
os.environ["SSL_CERT"] = ssl_cert | ||
os.environ["SSL_KEY"] = ssl_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os.environ["SSL_CERT"] = ssl_cert | |
os.environ["SSL_KEY"] = ssl_key | |
os.environ["CHAINLIT_SSL_CERT"] = ssl_cert | |
os.environ["CHAINLIT_SSL_KEY"] = ssl_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dahifi can you update these so we can merge? Nice work!
Co-authored-by: Thibaut Patel <thibaut.patel@gmail.com>
Co-authored-by: Thibaut Patel <thibaut.patel@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two remaining suggestions that needs to be committed for me to merge this PR.
@dahifi Same request, thanks man, good job. Waiting for the merge. |
Someone on the discord asked for a way to run the app behind https, so I added a run config parameters to accept keyfile and cert paths, and pass them to uvicorn.
I was unable to run commit hooks on this, nor did I test, but putting this here to see if anyone can validate or pick it up from here.