stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Allow for automatic setup of TLS for HTTPS

Open papuSpartan opened this issue 3 years ago • 2 comments
trafficstars

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.

papuSpartan avatar Nov 07 '22 09:11 papuSpartan

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!

RJSprod avatar Nov 09 '22 14:11 RJSprod

I'd very much prefer if this was an extension.

AUTOMATIC1111 avatar Nov 11 '22 15:11 AUTOMATIC1111

Converting to -> extension

papuSpartan avatar Nov 12 '22 09:11 papuSpartan

@36DB Could you add my extension implementation for this PR to the extensions index?

papuSpartan avatar Nov 13 '22 13:11 papuSpartan

@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.

36DB avatar Nov 13 '22 13:11 36DB

@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".

image

Tested on my machine by loading the modified index in the webui and it seemed to work properly.

papuSpartan avatar Nov 13 '22 19:11 papuSpartan

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)

papuSpartan avatar Nov 13 '22 19:11 papuSpartan

@ClashSAN Mind if you add this? I got some RL issues and probably can't add edit the file for few days.

36DB avatar Nov 14 '22 00:11 36DB

@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

papuSpartan avatar Nov 14 '22 14:11 papuSpartan