Skip to content

Commit

Permalink
Merge pull request #1 from ipfs/main
Browse files Browse the repository at this point in the history
Fix issue #2244 Share Link incorrectly gives path routed instead of subdomain routed URL
  • Loading branch information
acul71 authored Sep 3, 2024
2 parents cdde888 + b9f622d commit b3cbe79
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ newIssueWelcomeComment: >
- "Status" labels will show if this is ready to be worked on, blocked, or in progress.
- "Need" labels will indicate if additional input or analysis is required.
Finally, remember to use https://discuss.ipfs.io if you just need general
Finally, remember to use https://discuss.ipfs.tech if you just need general
support.
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## [4.3.0](https://github.com/ipfs/ipfs-webui/compare/v4.2.1...v4.3.0) (2024-08-12)


CID `bafybeihatzsgposbr3hrngo42yckdyqcc56yean2rynnwpzxstvdlphxf4`

---



### Features

* **remotepins:** add Functionland Fula ([#2242](https://github.com/ipfs/ipfs-webui/issues/2242)) ([b998f3c](https://github.com/ipfs/ipfs-webui/commit/b998f3c909f4410f0cd03ac080ff67f578fa8858))


### Bug Fixes

* improve app's bootstrap HTML metadata ([#2168](https://github.com/ipfs/ipfs-webui/issues/2168)) ([9c10520](https://github.com/ipfs/ipfs-webui/commit/9c105200708b98bd8b1328398920bdb09c299331))
* loading empty content ([#2237](https://github.com/ipfs/ipfs-webui/issues/2237)) ([e81d132](https://github.com/ipfs/ipfs-webui/commit/e81d132205e965d53b678a31844837be5b476f2f))


### Trivial Changes

* **ci:** dnslink update on .tech tld ([222053a](https://github.com/ipfs/ipfs-webui/commit/222053a738c088a82ff17dd3a502b35af2ee62cd))
* **ci:** stop updating webui.ipfs.io ([5b06c3f](https://github.com/ipfs/ipfs-webui/commit/5b06c3fb555be3022418a3e787a11ce4e6c996ab))
* **deps:** bump actions/checkout from 3.6.0 to 4.1.2 ([#2213](https://github.com/ipfs/ipfs-webui/issues/2213)) ([d028190](https://github.com/ipfs/ipfs-webui/commit/d028190ccf7d6a67755b6b16b4e2eabdca5001e1))
* **deps:** bump actions/github-script from 6 to 7 ([#2197](https://github.com/ipfs/ipfs-webui/issues/2197)) ([7342cfa](https://github.com/ipfs/ipfs-webui/commit/7342cfa2065c6fbc429534d122f71db3afdf1bd8))
* **deps:** bump axios, @storybook/test-runner, bundlesize and wait-on ([#2215](https://github.com/ipfs/ipfs-webui/issues/2215)) ([fbbe5ff](https://github.com/ipfs/ipfs-webui/commit/fbbe5ffdba0794b7b4217c2ee21be5653e78d16c))
* **deps:** bump ip from 1.1.8 to 1.1.9 ([#2211](https://github.com/ipfs/ipfs-webui/issues/2211)) ([d73e798](https://github.com/ipfs/ipfs-webui/commit/d73e79875f7b74754bb08344108e62ffb16008e8))
* **deps:** bump stefanzweifel/git-auto-commit-action from 4.16.0 to 5.0.1 ([#2222](https://github.com/ipfs/ipfs-webui/issues/2222)) ([c6159c3](https://github.com/ipfs/ipfs-webui/commit/c6159c39dda5b01039cc9fa6e482ad8e99eed891))
* pull transifex translations ([#2220](https://github.com/ipfs/ipfs-webui/issues/2220)) ([35f8aae](https://github.com/ipfs/ipfs-webui/commit/35f8aae23f7b0128616b9f3d529db44876a83422))

## [4.2.1](https://github.com/ipfs/ipfs-webui/compare/v4.2.0...v4.2.1) (2024-04-08)


Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ipfs-webui",
"version": "4.2.1",
"version": "4.3.0",
"type": "module",
"private": true,
"files": [
Expand Down
6 changes: 6 additions & 0 deletions src/components/pinning-manager/fixtures/pinningServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ const services = [
totalSize: 4412221323,
bandwidthUsed: '2 GB/mo',
addedAt: new Date(1592491648591)
}, {
name: 'Functionland',
icon: 'https://fx.land/android-chrome-512x512.png',
totalSize: undefined,
bandwidthUsed: undefined,
addedAt: new Date(1687896930567)
}, {
name: 'Eternum',
icon: 'https://www.eternum.io/static/images/icons/favicon-32x32.a2341c8ec160.png',
Expand Down
6 changes: 6 additions & 0 deletions src/constants/pinning.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ const pinningServiceTemplates = [
apiEndpoint: 'https://api.filebase.io/v1/ipfs',
visitServiceUrl: 'https://docs.filebase.com/api-documentation/ipfs-pinning-service-api'
},
{
name: 'Functionland',
icon: 'https://dweb.link/ipfs/QmWYEmdYq9Ry2xtb69oZSPXb8Aos24kWdVecsT3txVe38E?filename=functionland.svg',
apiEndpoint: 'https://api.cloud.fx.land',
visitServiceUrl: 'https://docs.fx.land/pinning-service/ipfs-pinning-service-api'
},
{
name: 'Web3.Storage',
icon: 'https://dweb.link/ipfs/bafybeiaqsdwuwemchbofzok4cq7cuvotfs6bgickxdqr6f7hdt7a64cwwa/Web3.Storage-logo.svg',
Expand Down
24 changes: 20 additions & 4 deletions src/files/file-preview/FilePreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ const Preview = (props) => {
<Drag {...props}>
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
<audio width='100%' controls>
<source src={src} />
<source src={safeSubresourceGwUrl(src)} />
</audio>
</Drag>
)
case 'pdf':
return (
<Drag {...props}>
<object className="FilePreviewPDF w-100" data={src} type='application/pdf'>
<object className="FilePreviewPDF w-100" data={safeSubresourceGwUrl(src)} type='application/pdf'>
{t('noPDFSupport')}
<a href={src} download target='_blank' rel='noopener noreferrer' className='underline-hover navy-muted'>{t('downloadPDF')}</a>
</object>
Expand All @@ -78,14 +78,14 @@ const Preview = (props) => {
<Drag {...props}>
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
<video controls className={className}>
<source src={src} />
<source src={safeSubresourceGwUrl(src)} />
</video>
</Drag>
)
case 'image':
return (
<Drag {...props}>
<img className={className} alt={name} src={src} />
<img className={className} alt={name} src={safeSubresourceGwUrl(src)} />
</Drag>
)
default: {
Expand Down Expand Up @@ -154,3 +154,19 @@ export default connect(
'selectPublicGateway',
withTranslation('files')(Preview)
)

// Potential fix for mixed-content error when redirecting to localhost subdomain
// from https://github.com/ipfs/ipfs-webui/issues/2246#issuecomment-2322192398
// We do it here and not in src/bundles/config.js because we dont want IPLD
// explorer to open links in path gateway, localhost is desired there.
//
// Context: localhost in Kubo is a subdomain gateway, so http://locahost:8080/ipfs/cid will
// redirect to http://cid.ipfs.localhost:8080 – perhaps subdomains are not
// interpreted as secure context correctly and that triggers forced upgrade to
// https. switching to IP should help.
function safeSubresourceGwUrl (url) {
if (url.startsWith('http://localhost:')) {
return url.replace('http://localhost:', 'http://127.0.0.1:')
}
return url
}

0 comments on commit b3cbe79

Please sign in to comment.