Skip to content

Commit

Permalink
chore: missed renames (api→rpc, .io→.tech)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Apr 7, 2024
1 parent b560f5c commit 51b2952
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ In separate shells run the following:
> npm run storybook
```

### Configure IPFS API CORS headers
### Configure Kubo RPC API CORS headers

You must configure your IPFS API at http://127.0.0.1:5001 to allow [cross-origin (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) requests from your dev server at http://localhost:3000
You must configure your Kubo RPC endpoint at http://127.0.0.1:5001 to allow [cross-origin (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) requests from your dev server at http://localhost:3000

Similarly if you want to try out pre-release versions at https://dev.webui.ipfs.io you need to add that as an allowed domain too.

Expand Down Expand Up @@ -117,7 +117,7 @@ To create an optimized static build of the app, output to the `build` directory:

## Test

The following command will run all tests: unit one for React and E2E against real HTTP API:
The following command will run all tests: unit one for React and E2E against real Kubo RPC:

```sh
> npm test
Expand All @@ -135,7 +135,7 @@ The WebUI uses Jest to run the isolated unit tests. Unit test files are located

## E2E tests

The end-to-end tests (E2E) test the full app in a headless Chromium browser. They spawn real IPFS node for HTTP API and a static HTTP server to serve the app.
The end-to-end tests (E2E) test the full app in a headless Chromium browser. They spawn real Kubo node for HTTP RPC and a static HTTP server to serve the app.
The purpose of those tests is not being comprehensible, but act as a quick regression and integration suite.
Test files are located in `test/e2e/`.

Expand All @@ -162,13 +162,13 @@ One can also override the binary used in e2e tests by providing a path to an alt

#### `E2E_API_URL`

Instead of spawning a disposable node and repo for tests, one can point the E2E test suite at arbitrary HTTP API running on localhost:
Instead of spawning a disposable node and repo for tests, one can point the E2E test suite at arbitrary Kubo-compatible RPC API running on localhost:

```sh
> E2E_API_URL=http://127.0.0.1:5001 npm run test:e2e
```

**Caveat 1:** HTTP API used in tests needs to run on the local machine for Peers screen to pass (they test manual swarm connect to ephemeral `/ip4/120.0.0.1/..` multiaddr)
**Caveat 1:** HTTP RPC API used in tests needs to run on the local machine for Peers screen to pass (they test manual swarm connect to ephemeral `/ip4/120.0.0.1/..` multiaddr)

**Caveat 2:** CORS requests from `http://localhost:3001` (static server hosting dev version of webui) need to be added to `Access-Control-Allow-Origin` whitelist array in node's config:

Expand Down
4 changes: 2 additions & 2 deletions public/locales/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"addresses": "Addresses",
"advanced": "Advanced",
"agent": "Agent",
"api": "API",
"apiAddress": "API address",
"api": "Kubo RPC",
"apiAddress": "RPC API address",
"blocks": "Blocks",
"connection": "Connection",
"downSpeed": "Incoming",
Expand Down
6 changes: 3 additions & 3 deletions public/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"translationProjectIntro": "Add or improve translations and make IPFS better for everyone!",
"translationProjectLink": "Join the IPFS Translation Project"
},
"apiDescription": "<0>If your node is configured with a <1>custom API address</1>, including a port other than the default 5001, enter it here.</0>",
"apiDescription": "<0>If your node is configured with a <1>custom Kubo RPC API address</1>, including a port other than the default 5001, enter it here.</0>",
"publicGatewayDescription": "<0>Choose which <1>public gateway</1> you want to use when generating shareable links.</0>",
"cliDescription": "<0>Enable this option to display a \"view code\" <1></1> icon next to common IPFS commands. Clicking it opens a modal with that command's CLI code, so you can paste it into the IPFS command-line interface in your terminal.</0>",
"cliModal": {
Expand Down Expand Up @@ -132,8 +132,8 @@
"paragraph2": "If you're running IPFS Desktop you'll have some specific settings for it too."
},
"step2": {
"title": "Custom API address",
"paragraph1": "If you've configured your IPFS node with a custom API address, you can update your config file right here instead of editing the JSON by hand."
"title": "Custom Kubo RPC API address",
"paragraph1": "If you've configured your Kubo-compatible IPFS node with a custom RPC API address, you can update your config file right here instead of editing the JSON by hand."
},
"step3": {
"title": "Pinning services",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/en/welcome.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"header": "What is IPFS?",
"paragraph1": "<0><0>A hypermedia distribution protocol</0> that incorporates ideas from Kademlia, BitTorrent, Git, and more</0>",
"paragraph2": "<0><0>A peer-to-peer file transfer network</0> with a completely decentralized architecture and no central point of failure, censorship, or control</0>",
"paragraph3": "<0><0>An on-ramp to tomorrow's web</0> — traditional browsers can access IPFS files through gateways like <2>https://ipfs.io</2> or directly using the <4>IPFS Companion</4> extension</0>",
"paragraph3": "<0><0>An on-ramp to tomorrow's web</0> — traditional browsers can access IPFS files through gateways like <2>https://dweb.link</2> or directly using the <4>IPFS Companion</4> extension</0>",
"paragraph4": "<0><0>A next-gen CDN</0> — just add a file to your node to make it available to the world with cache-friendly content-hash addressing and BitTorrent-style bandwidth distribution</0>",
"paragraph5": "<0><0>A developer toolset</0> for building <2>completely distributed apps and services</2>, backed by a robust open-source community</0>"
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/about-ipfs/AboutIpfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export const AboutIpfs = ({ t }) => {
<li className='mb2'><strong>A peer-to-peer file transfer network</strong> with a completely decentralized architecture and no central point of failure, censorship, or control</li>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph3' t={t}>
<li className='mb2'><strong>An on-ramp to tomorrow's web</strong> &mdash; traditional browsers can access IPFS files through gateways like <code className='f5 bg-light-gray br2 pa1'>https://ipfs.io</code> or directly using the <a className='link blue' target='_blank' rel='noopener noreferrer' href='https://github.com/ipfs-shipyard/ipfs-companion#ipfs-companion'>IFPS Companion</a> extension</li>
<li className='mb2'><strong>An on-ramp to tomorrow's web</strong> &mdash; traditional browsers can access IPFS files through gateways like <code className='f5 bg-light-gray br2 pa1'>https://dweb.link</code> or directly using the <a className='link blue' target='_blank' rel='noopener noreferrer' href='https://github.com/ipfs/ipfs-companion#readme'>IFPS Companion</a> extension</li>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph4' t={t}>
<li className='mb2'><strong>A next-gen CDN</strong> &mdash; just add a file to your node to make it available to the world with cache-friendly content-hash addressing and BitTorrent-style bandwidth distribution</li>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph5' t={t}>
<li className='mb2'><strong>A developer toolset</strong> for building completely <a className='link blue' target='_blank' rel='noopener noreferrer' href='https://awesome.ipfs.io/'>distributed apps and services</a>, backed by a robust open-source community</li>
<li className='mb2'><strong>A developer toolset</strong> for building completely <a className='link blue' target='_blank' rel='noopener noreferrer' href='https://awesome.ipfs.tech/'>distributed apps and services</a>, backed by a robust open-source community</li>
</Trans>
</ul>
</Box>
Expand Down
4 changes: 2 additions & 2 deletions src/components/is-not-connected/IsNotConnected.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const IsNotConnected = ({ t, apiUrl, connected, sameOrigin, ipfsApiAddress, doUp
<h1 className='montserrat fw4 charcoal ma0 f3 red'>{t('app:status.couldNotConnect')}</h1>
</div>
<Trans i18nKey='notConnected.paragraph1' t={t}>
<p className='fw6 mb3'>Check out the installation guide in the <a className='link blue' href='https://docs.ipfs.io/install/command-line-quick-start/' target='_blank' rel='noopener noreferrer'>IPFS Docs</a>, or try these common fixes:</p>
<p className='fw6 mb3'>Check out the installation guide in the <a className='link blue' href='https://docs.ipfs.tech/install/command-line-quick-start/' target='_blank' rel='noopener noreferrer'>IPFS Docs</a>, or try these common fixes:</p>
</Trans>
<ol className='pl3 pt2'>
<Trans i18nKey='notConnected.paragraph2' t={t}>
Expand All @@ -39,7 +39,7 @@ const IsNotConnected = ({ t, apiUrl, connected, sameOrigin, ipfsApiAddress, doUp
{ !sameOrigin && (
<div>
<Trans i18nKey='notConnected.paragraph3' t={t}>
<li className='mb3 mt4'>Is your IPFS API configured to allow <a className='link blue' href='https://github.com/ipfs-shipyard/ipfs-webui#configure-ipfs-api-cors-headers'>cross-origin (CORS) requests</a>? If not, run these commands and then start your daemon from the terminal:</li>
<li className='mb3 mt4'>Is your IPFS API configured to allow <a className='link blue' href='https://github.com/ipfs/ipfs-webui#configure-kubo-rpc-api-cors-headers'>cross-origin (CORS) requests</a>? If not, run these commands and then start your daemon from the terminal:</li>
</Trans>
<div className='br1 overflow-hidden'>
<div className='f7 mb0 sans-serif charcoal pv1 pl2 bg-black-20 flex items-center overflow-x-auto'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const PinningManagerServiceModal = ({ t, onLeave, onSuccess, className, service,
<p className='f6'>
<Trans i18nKey="pinningServiceModal.description" t={t}>
Want to make your custom pinning service available to others?
<a href='https://docs.ipfs.io/how-to/work-with-pinning-services/' rel='noopener noreferrer' target="_blank" className='pv0 dib link' type='link'>Learn how.</a>
<a href='https://docs.ipfs.tech/how-to/work-with-pinning-services/' rel='noopener noreferrer' target="_blank" className='pv0 dib link' type='link'>Learn how.</a>
</Trans>
</p>
</ModalBody>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/tours.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const filesTour = {
<h2 className='f3 fw4'>{t('tour.step1.title')}</h2>
<Trans i18nKey='tour.step1.paragraph1' t={t}>
<p className='tl f6'>
This is where the files on your <a className='teal link' href='https://docs.ipfs.io/concepts/file-systems/' rel='noopener noreferrer' target='_blank'>
This is where the files on your <a className='teal link' href='https://docs.ipfs.tech/concepts/file-systems/' rel='noopener noreferrer' target='_blank'>
Mutable File System (MFS)</a> live. You can add files or folders and manage them from this page.
</p>
</Trans>
Expand Down Expand Up @@ -141,7 +141,7 @@ export const filesTour = {
<p className='tl f6'>{t('tour.step3.paragraph2')}</p>
<Trans i18nKey='tour.step3.paragraph3' t={t}>
<p className='tl f6'>
If you want to add something that is already on IPFS, you can import it to your MFS by passing its <a className='teal link' href='https://docs.ipfs.io/concepts/content-addressing/' rel='noopener noreferrer' target='_blank'>Content
If you want to add something that is already on IPFS, you can import it to your MFS by passing its <a className='teal link' href='https://docs.ipfs.tech/concepts/content-addressing/' rel='noopener noreferrer' target='_blank'>Content
Identifier (CID)</a>.
</p>
</Trans>
Expand Down Expand Up @@ -233,7 +233,7 @@ export const settingsTour = {
content: <div className='montserrat charcoal'>
<h2 className='f3 fw4'>{t('tour.step3.title')}</h2>
<Trans i18nKey='tour.step3.paragraph1' t={t}>
<p className='tl f6'>If you have accounts with third-party remote pinning services, add them here so you can pin/unpin items to those services directly from the Files screen. You can learn more about third-party pinning services in the <a className='teal link' href='https://docs.ipfs.io/how-to/work-with-pinning-services' rel='noopener noreferrer' target='_blank'>IPFS Docs</a>.
<p className='tl f6'>If you have accounts with third-party remote pinning services, add them here so you can pin/unpin items to those services directly from the Files screen. You can learn more about third-party pinning services in the <a className='teal link' href='https://docs.ipfs.tech/how-to/work-with-pinning-services' rel='noopener noreferrer' target='_blank'>IPFS Docs</a>.
</p>
</Trans>
</div>,
Expand Down
8 changes: 4 additions & 4 deletions src/settings/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const SettingsPage = ({
<div className='lh-copy charcoal'>
<Title>{t('app:terms.apiAddress')}</Title>
<Trans i18nKey='apiDescription' t={t}>
<p>If your node is configured with a <a className='link blue' href='https://github.com/ipfs/kubo/blob/master/docs/config.md#addresses' target='_blank' rel='noopener noreferrer'>custom API address</a>, including a port other than the default 5001, enter it here.</p>
<p>If your node is configured with a <a className='link blue' href='https://github.com/ipfs/kubo/blob/master/docs/config.md#addresses' target='_blank' rel='noopener noreferrer'>custom Kubo RPC API address</a>, including a port other than the default 5001, enter it here.</p>
</Trans>
<ApiAddressForm/>
</div>
Expand All @@ -66,7 +66,7 @@ export const SettingsPage = ({
<div className='lh-copy charcoal'>
<Title>{t('app:terms.publicGateway')}</Title>
<Trans i18nKey='publicGatewayDescription' t={t}>
<p>Choose which <a className='link blue' href="http://docs.ipfs.io/concepts/ipfs-gateway/#public-gateways" target='_blank' rel='noopener noreferrer'>public gateway</a> you want to use to open your files.</p>
<p>Choose which <a className='link blue' href="http://docs.ipfs.tech/concepts/ipfs-gateway/#public-gateways" target='_blank' rel='noopener noreferrer'>public gateway</a> you want to use to open your files.</p>
</Trans>
<PublicGatewayForm/>
</div>
Expand All @@ -75,7 +75,7 @@ export const SettingsPage = ({
<Box className='mb3 pa4-l pa2'>
<Title>{t('ipnsPublishingKeys.title')}</Title>
<p className='ma0 mr2 lh-copy charcoal f6'>
{t('ipnsPublishingKeys.description')}&nbsp;<a className='link blue' target='_blank' rel='noopener noreferrer' href='https://docs.ipfs.io/concepts/glossary/#ipns'>{t('learnMoreLink')}</a>
{t('ipnsPublishingKeys.description')}&nbsp;<a className='link blue' target='_blank' rel='noopener noreferrer' href='https://docs.ipfs.tech/concepts/glossary/#ipns'>{t('learnMoreLink')}</a>
</p>
<IpnsManager t={t} />
</Box>
Expand All @@ -86,7 +86,7 @@ export const SettingsPage = ({
{ arePinningServicesSupported
? t('pinningServices.description')
: t('pinningServices.noPinRemoteDescription')
}&nbsp;<a className='link blue' target='_blank' rel='noopener noreferrer' href='https://docs.ipfs.io/how-to/work-with-pinning-services/'>{t('learnMoreLink')}</a>
}&nbsp;<a className='link blue' target='_blank' rel='noopener noreferrer' href='https://docs.ipfs.tech/how-to/work-with-pinning-services/'>{t('learnMoreLink')}</a>
</p>
<PinningManager t={t} />
</Box>
Expand Down
20 changes: 10 additions & 10 deletions test/e2e/remote-api.test.js → test/e2e/remote-rpc-api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { path as getGoIpfsPath } from 'kubo'
import * as kuboRpcModule from 'kubo-rpc-client'
const { createProxyServer } = httpProxy

test.describe('Remote API tests', () => {
test.describe('Remote RPC API tests', () => {
// Basic Auth Proxy Setup
// -----------------------------------
// Why do we support and test Basic Auth?
// Some users choose to access remote API.
// It requires setting up reverse proxy with correct CORS and Basic Auth headers,
// but when done properly, should work. This test sets up a proxy which
// acts as properly protected and configured remote API to ensure there are no
// acts as properly protected and configured remote RPC API to ensure there are no
// regressions for this difficult to test use case.
let ipfsd
let proxyd
Expand All @@ -41,7 +41,7 @@ test.describe('Remote API tests', () => {
const { id } = await ipfsd.api.id()
rpcId = id

// set up proxy in front of remote API to provide CORS and Basic Auth
// set up proxy in front of remote RPC API to provide CORS and Basic Auth
user = 'user'
password = 'pass'

Expand Down Expand Up @@ -88,7 +88,7 @@ test.describe('Remote API tests', () => {
})

test.beforeEach(async ({ page }) => {
// Swap API port for each test, ensure we don't get false-positives
// Swap RPC API port for each test, ensure we don't get false-positives
proxyPort = await getPort()
await proxyd.listen(proxyPort)
// remove default api port set in test/e2e/setup/global-setup.js
Expand Down Expand Up @@ -147,13 +147,13 @@ test.describe('Remote API tests', () => {
}

const basicAuthConnectionConfirmation = async (user, password, proxyPort, page, peerId) => {
// (1) confirm API section on Status page includes expected PeerID and API description
// (1) confirm RPC API section on Status page includes expected PeerID and RPC API description
// account for JSON config, which we hide from status page
await expectHttpApiAddressOnStatusPage('Custom JSON configuration', page)
// confirm webui is actually connected to expected node :^)
await expectPeerIdOnStatusPage(peerId, page)

// (2) go to Settings and confirm API string includes expected JSON config
// (2) go to Settings and confirm RPC API string includes expected JSON config
const apiOptions = JSON.stringify({
url: `http://127.0.0.1:${proxyPort}/`,
headers: {
Expand Down Expand Up @@ -184,7 +184,7 @@ test.describe('Remote API tests', () => {
await page.reload() // instant addr update for faster CI
await page.waitForSelector('input[id="api-address"]')
const apiAddrValue = await page.inputValue('#api-address')
// if API address is defined as JSON, match objects
// if RPC API address is defined as JSON, match objects
try {
const json = JSON.parse(apiAddrValue)
const expectedJson = JSON.parse(value)
Expand All @@ -201,7 +201,7 @@ test.describe('Remote API tests', () => {
// having that out of the way, tests begin below ;^)
// ----------------------------------------------------------------------------

test.describe('API @ multiaddr', () => {
test.describe('RPC @ multiaddr', () => {
test('should be possible to set via Settings page', async ({ page }) => {
await switchIpfsApiEndpointViaSettings(rpcMaddr, page)
await expectPeerIdOnStatusPage(rpcId, page)
Expand All @@ -219,7 +219,7 @@ test.describe('Remote API tests', () => {
})
})

test.describe('API @ URL', () => {
test.describe('RPC @ URL', () => {
test('should be possible to set via Settings page', async ({ page }) => {
await switchIpfsApiEndpointViaSettings(rpcUrl, page)
await expectPeerIdOnStatusPage(rpcId, page)
Expand All @@ -237,7 +237,7 @@ test.describe('Remote API tests', () => {
})
})

test.describe('API with CORS and Basic Auth', () => {
test.describe('RPC with CORS and Basic Auth', () => {
test.afterEach(async ({ page }) => {
await switchIpfsApiEndpointViaLocalStorage(null, page)
})
Expand Down

0 comments on commit 51b2952

Please sign in to comment.