k-l-lambda / stylegan-web

A web porting for NVlabs' StyleGAN.
160 stars 38 forks source link

Clipboard Error on HTTP server #4

Open BarisSari opened 4 years ago

BarisSari commented 4 years ago

Hi,

When I run the project locally, clipboard functionality works fine. However, when I try to run the project on a server (for example, AWS EC2 instance), copy to latent code buttons and hash copy-paste in merger page do not work because of this issue: navigator.clipboard is undefined

resim

What I've learned is clipboard doesn't work with unsecured applications. So, it's necessary to run flask over HTTPS if you would like to use clipboard functionalities. If you think that this functionality is not necessary, at least it might be good to add a note in README.md.

k-l-lambda commented 4 years ago

Yes, the web security issues also annoy me.

When serve on LAN, the simple solution is run the flask as a https server by a self-signed certificate. And then you will encounter "dangerous" warning in browser, then you must click "advance->proceed to insecurity" or something. That should thank to Google's https everywhere policy.

Maybe in future we should design a latent code file format, and offer input by file dragging-dropping, and also easy to storage and sharing.

BarisSari commented 4 years ago

When serve on LAN, the simple solution is run the flask as a https server by a self-signed certificate. And then you will encounter "dangerous" warning in browser, then you must click "advance->proceed to insecurity" or something. That should thank to Google's https everywhere policy.

I've added a dummy self-signed SSL for now. Chrome doesn't let me to proceed but Firefox is more relaxed and it's working there.

Maybe in future we should design a latent code file format, and offer input by file dragging-dropping, and also easy to storage and sharing.

Yes, I think it would be a good solution.