Spaces:
Paused
Paused
Abhinav Bhatia commited on
Deploy CropGuard demo panel
Browse files- Dockerfile +12 -0
Dockerfile
CHANGED
|
@@ -25,7 +25,19 @@ EXPOSE 7860
|
|
| 25 |
|
| 26 |
# fileWatcherType=none because nothing edits the source at runtime, and the watcher costs CPU
|
| 27 |
# that the free tier would rather spend on inference.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
CMD ["streamlit", "run", "app/streamlit_app.py", \
|
| 29 |
"--server.port=7860", "--server.address=0.0.0.0", \
|
| 30 |
"--server.headless=true", "--server.fileWatcherType=none", \
|
|
|
|
|
|
|
| 31 |
"--browser.gatherUsageStats=false"]
|
|
|
|
| 25 |
|
| 26 |
# fileWatcherType=none because nothing edits the source at runtime, and the watcher costs CPU
|
| 27 |
# that the free tier would rather spend on inference.
|
| 28 |
+
#
|
| 29 |
+
# XSRF protection is off, and that is required rather than lazy. Spaces serves the app inside
|
| 30 |
+
# an iframe on huggingface.co, so Streamlit's XSRF cookie is a third-party cookie and modern
|
| 31 |
+
# browsers drop it. The token then never reaches /_stcore/upload_file, which rejects every
|
| 32 |
+
# upload with 403 - the file uploader is simply broken with it on. CORS goes with it because
|
| 33 |
+
# Streamlit ignores enableCORS=false while XSRF is enabled, so the pair has to move together.
|
| 34 |
+
#
|
| 35 |
+
# What that costs: a third-party page could POST a file to this app. There is no auth, no
|
| 36 |
+
# stored state and no cross-user data here - one anonymous visitor cannot reach another's
|
| 37 |
+
# session - so the exposure is an unwanted inference, not a leak.
|
| 38 |
CMD ["streamlit", "run", "app/streamlit_app.py", \
|
| 39 |
"--server.port=7860", "--server.address=0.0.0.0", \
|
| 40 |
"--server.headless=true", "--server.fileWatcherType=none", \
|
| 41 |
+
"--server.enableXsrfProtection=false", "--server.enableCORS=false", \
|
| 42 |
+
"--server.maxUploadSize=10", \
|
| 43 |
"--browser.gatherUsageStats=false"]
|