Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ func setupGatewayHandler(cfg Config, nd *Node) (http.Handler, error) {
NoDNSLink: len(cfg.DNSLinkGatewayDomains) > 0,
MaxConcurrentRequests: cfg.MaxConcurrentRequests, // When exceeded, returns 429 with Retry-After: 60 (hardcoded in boxo)
RetrievalTimeout: cfg.RetrievalTimeout,
MaxRequestDuration: cfg.MaxRequestDuration,
MaxRangeRequestFileSize: cfg.MaxRangeRequestFileSize,
DiagnosticServiceURL: cfg.DiagnosticServiceURL,
}
Expand Down
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ Generate an identity seed and launch a gateway:
EnvVars: []string{"RAINBOW_RETRIEVAL_TIMEOUT"},
Usage: "Maximum duration for initial content retrieval and time between writes",
},
&cli.DurationFlag{
Name: "max-request-duration",
Value: time.Hour,
EnvVars: []string{"RAINBOW_MAX_REQUEST_DURATION"},
Usage: "Maximum total time a request can take. Zero or negative values use the default (1 hour)",
},
&cli.Int64Flag{
Name: "max-range-request-file-size",
Value: 5368709120, // 5 GiB
Expand Down Expand Up @@ -758,6 +764,7 @@ share the same seed as long as the indexes are different.
// Gateway limits
MaxConcurrentRequests: cctx.Int("max-concurrent-requests"),
RetrievalTimeout: cctx.Duration("retrieval-timeout"),
MaxRequestDuration: cctx.Duration("max-request-duration"),
MaxRangeRequestFileSize: cctx.Int64("max-range-request-file-size"),
DiagnosticServiceURL: cctx.String("diagnostic-service-url"),
}
Expand Down
1 change: 1 addition & 0 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ type Config struct {
// Gateway limits
MaxConcurrentRequests int
RetrievalTimeout time.Duration
MaxRequestDuration time.Duration
MaxRangeRequestFileSize int64
DiagnosticServiceURL string
}
Expand Down
Loading