adds Gateway.MaxRangeRequestFileSize configuration to protect against CDN bugs
where range requests over certain sizes return entire files instead of requested
byte ranges, causing unexpected bandwidth costs.
- default: 0 (no limit)
- returns 501 Not Implemented for oversized range requests
- protects against CDNs like Cloudflare that ignore range requests over 5GiB
also introduces OptionalBytes type to reduce code duplication when handling
byte-size configuration values, replacing manual string parsing with humanize.ParseBytes.
migrates existing byte-size configs to use this new type.
Fixes: https://github.com/ipfs/boxo/issues/856
* remove the EnableRelayHop option in the SwarmConfig
* add an option to disable the limited relay
* make the relay service resources configurable
* refactor: use custom types
This enables us to swap defaults in go-ipfs without touching the config
file generated during `ipfs init`
https://github.com/ipfs/go-ipfs-config/pull/146#discussion_r734728162https://github.com/ipfs/go-ipfs-config/pull/146#discussion_r734728019
* use OptionalDuration in RelayService configuration
* fix: *OptionalInteger with omitempty
This removes null values from the config
* fix: Flag does not need to be a pointer
* refactor: flatten RelayService limits
this simplifies consumer code and removes nil footgun
* docs: clarify different relay types
* feat: flag for ForceReachability mode in libp2p (#150)
adds Internal.Libp2pForceReachability
needed for sharness tests in ipfs/go-ipfs#8522
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
* feat: make it possible to define optional durations
* test: empty/default optional durations
does not crash if user restores default value and sets it to empty string ""
* refactor: use null in JSON
* refactor(duration): use JSON null as the default
Rationale:
https://github.com/ipfs/go-ipfs-config/pull/148#discussion_r736975879
* refactor: Duration → OptionalDuration
This makes it possible to use OptionalDuration with `json:",omitempty"`
so the null is not serialized to JSON, and get working WithDefault as well.
Co-authored-by: Marcin Rataj <lidel@lidel.org>