Comments (7)
Hi Umut
I currently cannot reproduce your issue. From Go 1.6 (as far as i remember correctly) http2 is standard for the net/http library/package.
I just tested by sending a 90MB file through http and https and both worked. You must however overwrite the values:
ENV MAX_SCAN_SIZE=100M
ENV MAX_FILE_SIZE=100M
To allow the application to accept bigger files.
Did you pull the latest image?
BR
from clamav-rest.
Hello Hermi
Thank you for the fast response. This is not bug/issue. This is a feature request :)
The problem is not on your application level. I know that your GO REST Endpoint can handle files bigger than 32 MB. The problem Happens on Google Cloud Run Level
On Google Cloud Run (GCR) you can deploy container and communicate to a specific port over an GCR Endpoint URL. That means that GCR acts like an reverse proxy in front of your ClamAV Rest Docker container. And this Endpoint URL on GCR level, has the 32 MB file size limitation (Only with HTTP/1.1).
Client <-----request---> GCR Endpoint URL <---------> ClamAV Rest Docker container
It is possible to send files bigger than 32 MB to the GCR Enpoint, if the communication protocol is HTTP/2. This works only if the service in the docker container (Your GO ClamAV Rest Client) speaks also HTTP/2c (h2c).
Important is that the GO Rest API can handle HTTP/2c (h2c) requests.
I'm not a GO developer but for me it looks like that the used libraries (net/http) are not commuicating over HTTP2.
I think there are separate HTTP2 Libraries. https://pkg.go.dev/golang.org/x/net/http2
At least the request is that your GO REST API can handle HTTP/2c Requests additionally to HTTP/1.1. It must be configurable.
from clamav-rest.
Ah ok now I get it :D
Hmm I can take a look at it and see if I find an easy way to implement that.
from clamav-rest.
Hey @umut-saribiyik-acc
Have you tried configuring GCR to use the TLS port instead of the http port? I think that way the http library is forced to run in http2 mode.
from clamav-rest.
Hi @rhermanek
Yes, I tried also the TLS Port (9443) and it doesn't worked. Regarding to the GCR documentation, the Docker Service Endpoint must be HTTP/2c (h2c) which is not TLS / SSL.
HTTP/2c (h2c) is without SSL. You don't need certificates for it.
Google Cloud Run documentation abstract: https://cloud.google.com/run/docs/configuring/http2
from clamav-rest.
Ok understood. I sadly couldn't get it to run in the time I've invested but feel free to try yourself and create a PR!
from clamav-rest.
Hello @rhermanek
No problem and thanks a lot for your time :)
I will try to modify your image by putting a nginx in front of your GO REST API.
from clamav-rest.
Related Issues (19)
- No explicit license file or statement present HOT 1
- Data directory
- Clamav Vulnerability HOT 1
- Authentication
- Security updates needed HOT 2
- Feature: Support proxy in entrypoint for freshclam HOT 1
- Bug: service does not return proper status when file size is greater than `MAX_FILE_SIZE` value
- Is there /health check for this REST API?
- Register scanHandlerBody function
- Dependency Dashboard
- Fail update, and fail create tmp file
- Start Antivirus Service than check for Virus updates
- how to define data directory (Volume)
- The SSL certificate is invalid HOT 2
- Updating the signature database HOT 1
- Freshclam warning about Clamd not being notified of database update HOT 3
- ClamAV vulnerability HOT 2
- Scanned filename in clamd logs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clamav-rest.