mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Merge pull request #616 from plebbit/master
refactor(electron): change IPFS API port to 50019
This commit is contained in:
+2
-2
@@ -168,7 +168,7 @@ const createMainWindow = () => {
|
|||||||
let serializedUrl = '';
|
let serializedUrl = '';
|
||||||
|
|
||||||
// make an exception for ipfs stats
|
// make an exception for ipfs stats
|
||||||
if (validatedUrl.toString() === 'http://localhost:5001/webui/') {
|
if (validatedUrl.toString() === 'http://localhost:50019/webui/') {
|
||||||
serializedUrl = validatedUrl.toString();
|
serializedUrl = validatedUrl.toString();
|
||||||
} else if (validatedUrl.protocol === 'https:') {
|
} else if (validatedUrl.protocol === 'https:') {
|
||||||
// open serialized url to prevent remote execution
|
// open serialized url to prevent remote execution
|
||||||
@@ -198,7 +198,7 @@ const createMainWindow = () => {
|
|||||||
let serializedUrl = '';
|
let serializedUrl = '';
|
||||||
|
|
||||||
// make an exception for ipfs stats
|
// make an exception for ipfs stats
|
||||||
if (validatedUrl.toString() === 'http://localhost:5001/webui/') {
|
if (validatedUrl.toString() === 'http://localhost:50019/webui/') {
|
||||||
serializedUrl = validatedUrl.toString();
|
serializedUrl = validatedUrl.toString();
|
||||||
} else if (validatedUrl.protocol === 'https:') {
|
} else if (validatedUrl.protocol === 'https:') {
|
||||||
// open serialized url to prevent remote execution
|
// open serialized url to prevent remote execution
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ const startIpfs = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// use different port with proxy for debugging during env
|
// use different port with proxy for debugging during env
|
||||||
let apiAddress = '/ip4/127.0.0.1/tcp/5001';
|
let apiAddress = '/ip4/127.0.0.1/tcp/50019';
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
apiAddress = apiAddress.replace('5001', '5002');
|
apiAddress = apiAddress.replace('50019', '50029');
|
||||||
proxyServer.start({ proxyPort: 5001, targetPort: 5002 });
|
proxyServer.start({ proxyPort: 50019, targetPort: 50029 });
|
||||||
}
|
}
|
||||||
await spawnAsync(ipfsPath, ['config', 'Addresses.API', apiAddress], { env, hideWindows: true });
|
await spawnAsync(ipfsPath, ['config', 'Addresses.API', apiAddress], { env, hideWindows: true });
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ const start = async () => {
|
|||||||
}
|
}
|
||||||
pendingStart = true;
|
pendingStart = true;
|
||||||
try {
|
try {
|
||||||
const started = await tcpPortUsed.check(isDev ? 5002 : 5001, '127.0.0.1');
|
const started = await tcpPortUsed.check(isDev ? 50029 : 50019, '127.0.0.1');
|
||||||
if (started) {
|
if (started) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const port = 9138;
|
|||||||
const defaultPlebbitOptions = {
|
const defaultPlebbitOptions = {
|
||||||
// find the user's OS data path
|
// find the user's OS data path
|
||||||
dataPath: !isDev ? envPaths.data : path.join(dirname, '..', '.plebbit'),
|
dataPath: !isDev ? envPaths.data : path.join(dirname, '..', '.plebbit'),
|
||||||
ipfsHttpClientsOptions: ['http://localhost:5001/api/v0'],
|
ipfsHttpClientsOptions: ['http://localhost:50019/api/v0'],
|
||||||
httpRoutersOptions: ['https://routing.lol', 'https://peers.pleb.bot'],
|
httpRoutersOptions: ['https://routing.lol', 'https://peers.pleb.bot'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ export const Footer = () => {
|
|||||||
v{packageJson.version}
|
v{packageJson.version}
|
||||||
</a>
|
</a>
|
||||||
{isElectron && (
|
{isElectron && (
|
||||||
<a className={styles.fullNodeStats} href='http://localhost:5001/webui/' target='_blank' rel='noreferrer'>
|
<a className={styles.fullNodeStats} href='http://localhost:50019/webui/' target='_blank' rel='noreferrer'>
|
||||||
node stats
|
node stats
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user