Set ipfsPublicGateway and ipfsApi when opening webui
Current state
-
https://github.com/ipfs/ipfs-webui/pull/1834 introduced an optional
localStoragekey namedipfsPublicGatewaywhich overrides the default URL of public gateway used in ipfs-webui (default beinghttps://dweb.link). -
ipfs-webui already respects
ipfsApikey (if present), but Companion does not keep it in sync with own settings
Improvement
Companion should act as the source of truth. API and Gateway configured in Companion should always be explicitly set to the same value in ipfs-webui opened via Companion's "My Node' button etc.
Prior art
Companion sets ipfsApi and reloads webui (code) in Brave (which uses custom port). We could make this smarter and execute update of ipfsPublicGateway and ipfsApi every time URL in localStorage does not match one configured in Companion's Preferences.