notAI-tech / NudeNet

Lightweight nudity detection
https://nudenet.notai.tech/
GNU Affero General Public License v3.0
1.76k stars 342 forks source link

CORS control for classifier & detector docker images? #95

Closed ghost closed 3 years ago

ghost commented 3 years ago

I noticed that the classifier and detector images don't allow the user to control cors settings for the api.

Would it be possible to expose cors controls to the user in the form of an env var or flag on the run command?

Otherwise, I have to keep a modified version of the _app.py file from each image and then build my own images FROM the ones provided, with that patch applied.

It works, but is pretty brittle, like if the _app.py file were to change significantly

bedapudi6788 commented 3 years ago

@ousideti https://github.com/notAI-tech/fastDeploy/blob/9dc181610e3a7691e216475bff007c1aca013f6b/service/_app.py#L397 you can now configure alowed cors via this environment variable.