enable/disable mirror from db#2391
Merged
Marketen merged 4 commits intofeat/mirror-content-providerfrom Feb 24, 2026
Merged
Conversation
3alpha
reviewed
Feb 24, 2026
| ipfsUrl, | ||
| new ethers.InfuraProvider("mainnet", process.env.INFURA_MAINNET_KEY) | ||
| new ethers.InfuraProvider("mainnet", process.env.INFURA_MAINNET_KEY), | ||
| { mirror: { baseUrl: "https://packages.dappnode.net", timeoutMs: 30_000, maxBytes: 20 * 1024 * 1024 * 1024 } } |
Member
There was a problem hiding this comment.
Can we have this configurable? Either as ENV, or extracted in constants?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to centrally enable or disable the mirror content provider for package downloads, making the mirror provider configurable at runtime. It adds new API endpoints to get and set the mirror provider's status, persists this setting in the database, and refactors the repository logic to always initialize the mirror provider but use it only if enabled. This improves flexibility and allows dynamic switching between IPFS and the mirror without restarting services.
Key changes:
Mirror provider enable/disable feature:
mirrorProviderGetandmirrorProviderSetAPI endpoints, along with their implementations, to allow querying and updating the mirror provider's enabled status at runtime. [1] [2] [3] [4] [5]mirrorProviderEnabledstatic key, and exported it from the database module. [1] [2]Repository logic refactor:
DappnodeRepositoryandDappnodeInstallerto always initialize the mirror provider, but use it only if themirrorEnabledflag is set. Added asetMirrorEnabled()method to control this at runtime, and updated all relevant logic to check this flag instead of presence of the provider. [1] [2] [3] [4] [5] [6] [7]Documentation and testing:
DappnodeRepositoryto reflect that the mirror provider is always configured and can be toggled at runtime, clarifying the provider priority and behavior.mirroroption during instantiation.These changes make the mirror provider's usage more flexible and manageable, improving reliability and operational control.