stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Allow for automatic setup of TLS for HTTPS
In #948, users expressed that they wished to be able to use the webui using HTTPS. This PR enables a user to enable TLS, and effectively HTTPS, by adding one command line switch.
If --self-sign is passed with no arguments, it will attempt to generate a key/cert pair for the user and will also add the newly generated certificate to the certifi trust store. This means that, in most cases, the user can simply add --self-sign, and use TLS/HTTPS. Additionally, one can pass in their own key/cert pair using --tls-certfile and --tls-keyfile in order to add their own certificate to the certifi trust store without having to manually edit it themselves.
I rarely ever pull into my local before Auto approves, but this one I need. I've tried to figure out how to add HTTPS on my own and ran into all sort of noob issues that will take me longer to learn. Thanks for this!
I'd very much prefer if this was an extension.
Converting to -> extension
@36DB Could you add my extension implementation for this PR to the extensions index?
@papuSpartan Sure but I would need the basic template. I have the permissions to add but have little knowledge to write it myself 😅 Reply me with the content that you would like to add to the json.
@papuSpartan Sure but I would need the basic template. I have the permissions to add but have little knowledge to write it myself sweat_smile Reply me with the content that you would like to add to the json.
{
"name": "Auto TLS/HTTPS",
"url": "https://github.com/papuSpartan/stable-diffusion-webui-auto-tls-https.git",
"description": "Automatically(Default) or semi-automatically enable HTTPS",
"tags": [
"script"
]
}
You would need to add that object to the main extensions array. For testing I just put it right at the end after "old localizations".

Tested on my machine by loading the modified index in the webui and it seemed to work properly.
This is the modified version I was able to load in the webui: https://gist.github.com/papuSpartan/c32cb0f3c59ec15a7bbb7de56c056389.
Also, It might be helpful to save the extensions index file in a prettified format just so that it is easier to read straight from the wiki without something parsing it. (I used jq for this but any other json prettifier should work)
@ClashSAN Mind if you add this? I got some RL issues and probably can't add edit the file for few days.
@ClashSAN Mind if you add this? I got some RL issues and probably can't add edit the file for few days.
Looks like someone added it to the list. Thanks