-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: switch default URLs to 'localhost'
- longer hostnames are truncated and no longer break status popup - `127.0.0.1` is normalized to `localhost` when Preferences are saved - IPFS resources on localhost are excluded from gateway redirect (this solves problems with multiple nodes running locally) - closes #291
- Loading branch information
Showing
6 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ const optionDefaults = Object.freeze({ | |
preloadAtPublicGateway: true, | ||
catchUnhandledProtocols: true, | ||
displayNotifications: true, | ||
customGatewayUrl: 'http://127.0.0.1:8080', | ||
ipfsApiUrl: 'http://127.0.0.1:5001', | ||
customGatewayUrl: 'http://localhost:8080', | ||
ipfsApiUrl: 'http://localhost:5001', | ||
ipfsApiPollMs: 3000 | ||
}) | ||
|
||
|
@@ -42,3 +42,12 @@ function storeMissingOptions (read, defaults, storage) { | |
} | ||
|
||
exports.storeMissingOptions = storeMissingOptions | ||
|
||
function normalizeGatewayURL (url) { | ||
// https://github.com/ipfs/ipfs-companion/issues/291 | ||
return url | ||
.replace('/127.0.0.1:', '/localhost:') | ||
.replace('/gateway.ipfs.io', '/ipfs.io') | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lidel
Author
Member
|
||
} | ||
|
||
exports.normalizeGatewayURL = normalizeGatewayURL |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ module.exports = function gatewayStatus ({ | |
<ul class="list mv3 ph3"> | ||
<li class="flex mb1"> | ||
<span class="w-50 f6 ttu">${browser.i18n.getMessage('panel_statusGatewayAddress')}</span> | ||
<span class="w-50 f6 ttu tr">${gatewayAddress == null ? 'unknown' : gatewayAddress}</span> | ||
<span class="w-50 f6 truncate tr">${gatewayAddress == null ? 'unknown' : gatewayAddress}</span> | ||
This comment has been minimized.
Sorry, something went wrong.
lidel
Author
Member
|
||
</li> | ||
<li class="flex mb1"> | ||
<span class="w-50 f6 ttu">${browser.i18n.getMessage('panel_statusGatewayVersion')}</span> | ||
|
This file contains 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
gateway.ipfs.io can be redirected to 127.0.0.1 in hosts file and continue work as gateway. If ipfs.io will be redirected to 127.0.0.1 it stop work as gateway. Use gateway.ipfs.io.