Skip to content

enable/disable mirror from db#2391

Merged
Marketen merged 4 commits intofeat/mirror-content-providerfrom
marc/enable-disable-mirror
Feb 24, 2026
Merged

enable/disable mirror from db#2391
Marketen merged 4 commits intofeat/mirror-content-providerfrom
marc/enable-disable-mirror

Conversation

@Marketen
Copy link
Copy Markdown
Contributor

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:

  • Added mirrorProviderGet and mirrorProviderSet API endpoints, along with their implementations, to allow querying and updating the mirror provider's enabled status at runtime. [1] [2] [3] [4] [5]
  • Persisted the mirror provider's enabled state in the database using a new mirrorProviderEnabled static key, and exported it from the database module. [1] [2]

Repository logic refactor:

  • Refactored DappnodeRepository and DappnodeInstaller to always initialize the mirror provider, but use it only if the mirrorEnabled flag is set. Added a setMirrorEnabled() 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:

  • Updated documentation in DappnodeRepository to reflect that the mirror provider is always configured and can be toggled at runtime, clarifying the provider priority and behavior.
  • Updated repository tests to provide the required mirror option during instantiation.

These changes make the mirror provider's usage more flexible and manageable, improving reliability and operational control.

@Marketen Marketen requested a review from a team as a code owner February 24, 2026 11:36
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 } }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have this configurable? Either as ENV, or extracted in constants?

@github-actions github-actions bot temporarily deployed to commit February 24, 2026 12:17 Inactive
@github-actions
Copy link
Copy Markdown

@Marketen Marketen merged commit 9661776 into feat/mirror-content-provider Feb 24, 2026
6 checks passed
@Marketen Marketen deleted the marc/enable-disable-mirror branch February 24, 2026 12:20
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.

2 participants