Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Allow local use and UploadFile use in streamlit. Fix #310 #311

Merged
merged 1 commit into from
May 28, 2024

Conversation

enryH
Copy link
Member

@enryH enryH commented May 27, 2024

  • default is a BufferIO like object from streamlit.

Closes #310

- default is a BufferIO like object from streamlit.
@enryH enryH requested a review from mlocardpaulet May 27, 2024 16:20
@mlocardpaulet
Copy link
Contributor

mlocardpaulet commented May 27, 2024

When I try locally I have the same issue as issue #308 (was corrected by @Julian, works well now when uploading a file on cubimed).
It says that the file is too big.
image

@enryH
Copy link
Member Author

enryH commented May 27, 2024

It worked for me without any issues.

It's probably the local configuration issue I wrote about before. Modify the webinterface/.streamlit/config.toml the following way. @julianu Did you add a maximum file size item?

[theme]
base = "light"

[server]
enableStaticServing = true
# added: 
enableXsrfProtection = false
enableCORS = false
# julians addition in #308 ?
maxUploadSize = 500

It's a security feature for local execution to increase security.

@julianu
Copy link
Contributor

julianu commented May 28, 2024

Yes, I set the maxUploadSizeto 2 GB on the server for now.

What are these two for?

enableXsrfProtection = false
enableCORS = false

@mlocardpaulet
Copy link
Contributor

Thanks Henry, it works very nicely :)
image

@mlocardpaulet
Copy link
Contributor

@enryH should we change the webinterface/.streamlit/config.toml file in the repo?

@enryH
Copy link
Member Author

enryH commented May 28, 2024

@enryH should we change the webinterface/.streamlit/config.toml file in the repo?

This is a question for @julianu . I think we should rather document it as it's a security feature for local execution which should not be deactivate when published. So it will depend on how the server is configured now.

@enryH enryH merged commit 7ca8331 into main May 28, 2024
8 checks passed
@enryH enryH deleted the fix310_load_alphapept_parameters branch May 28, 2024 07:49
@enryH
Copy link
Member Author

enryH commented May 28, 2024

Yes, I set the maxUploadSizeto 2 GB on the server for now.

What are these two for?

enableXsrfProtection = false
enableCORS = false

If I do not set it, my browser does not allow to load files from the local disk. It's probably a security feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

issue with alphapept parameter parsing
3 participants