2021-07-13 12:34:51 -07:00
|
|
|
/*
|
|
|
|
|
This file is used to store unsecure, application-specific data common to all
|
|
|
|
|
environments.
|
2024-01-29 07:57:32 -08:00
|
|
|
|
|
|
|
|
Additional Environent Variables:
|
|
|
|
|
- CONNECT_PREF: should have a value of 'cr' (default), or 'direct'. This is
|
|
|
|
|
used by helia-coord to select a connection preference between peers. Servers
|
|
|
|
|
with an ip4 or ip6 address should use 'direct'.
|
2021-07-13 12:34:51 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* eslint no-unneeded-ternary:0 */
|
|
|
|
|
|
2022-09-17 14:18:16 -07:00
|
|
|
// Hack to get __dirname back.
|
|
|
|
|
// https://blog.logrocket.com/alternatives-dirname-node-js-es-modules/
|
|
|
|
|
import * as url from 'url'
|
|
|
|
|
|
2021-08-03 13:05:45 -07:00
|
|
|
// Get the version from the package.json file.
|
2022-09-08 08:58:39 -07:00
|
|
|
import { readFileSync } from 'fs'
|
2022-09-17 14:18:16 -07:00
|
|
|
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
|
|
|
|
|
const pkgInfo = JSON.parse(readFileSync(`${__dirname.toString()}/../../package.json`))
|
2022-09-08 08:58:39 -07:00
|
|
|
|
2021-08-03 13:05:45 -07:00
|
|
|
const version = pkgInfo.version
|
|
|
|
|
|
2021-07-17 16:19:03 -07:00
|
|
|
const ipfsCoordName = process.env.COORD_NAME
|
|
|
|
|
? process.env.COORD_NAME
|
|
|
|
|
: 'ipfs-bch-wallet-service'
|
|
|
|
|
|
2021-09-08 12:35:00 -07:00
|
|
|
console.log('GET_JWT_AT_STARTUP: ', process.env.GET_JWT_AT_STARTUP)
|
|
|
|
|
|
2022-09-08 08:58:39 -07:00
|
|
|
export default {
|
2021-07-13 12:34:51 -07:00
|
|
|
// Configure TCP port.
|
2022-09-17 10:10:39 -07:00
|
|
|
port: process.env.PORT || 5020,
|
2021-07-13 12:34:51 -07:00
|
|
|
|
|
|
|
|
// Password for HTML UI that displays logs.
|
|
|
|
|
logPass: 'test',
|
|
|
|
|
|
|
|
|
|
// Email server settings if nodemailer email notifications are used.
|
2021-07-13 18:35:08 -07:00
|
|
|
emailServer: process.env.EMAILSERVER
|
|
|
|
|
? process.env.EMAILSERVER
|
|
|
|
|
: 'mail.someserver.com',
|
|
|
|
|
emailUser: process.env.EMAILUSER
|
|
|
|
|
? process.env.EMAILUSER
|
|
|
|
|
: 'noreply@someserver.com',
|
|
|
|
|
emailPassword: process.env.EMAILPASS
|
|
|
|
|
? process.env.EMAILPASS
|
|
|
|
|
: 'emailpassword',
|
2021-07-13 12:34:51 -07:00
|
|
|
|
2021-07-16 17:26:51 -07:00
|
|
|
// FullStack.cash account information, used for automatic JWT handling.
|
2021-09-08 11:58:18 -07:00
|
|
|
getJwtAtStartup: process.env.GET_JWT_AT_STARTUP ? true : false,
|
2021-08-08 07:38:47 -07:00
|
|
|
authServer: process.env.AUTHSERVER
|
2021-07-16 17:26:51 -07:00
|
|
|
? process.env.AUTHSERVER
|
|
|
|
|
: 'https://auth.fullstack.cash',
|
2021-08-08 07:38:47 -07:00
|
|
|
apiServer: process.env.APISERVER
|
2021-07-16 17:26:51 -07:00
|
|
|
? process.env.APISERVER
|
|
|
|
|
: 'https://api.fullstack.cash/v5/',
|
2021-08-08 07:38:47 -07:00
|
|
|
fullstackLogin: process.env.FULLSTACKLOGIN
|
2021-07-16 17:26:51 -07:00
|
|
|
? process.env.FULLSTACKLOGIN
|
|
|
|
|
: 'demo@demo.com',
|
2021-08-08 07:38:47 -07:00
|
|
|
fullstackPassword: process.env.FULLSTACKPASS
|
|
|
|
|
? process.env.FULLSTACKPASS
|
|
|
|
|
: 'demo',
|
2021-07-16 17:26:51 -07:00
|
|
|
|
2021-07-13 12:34:51 -07:00
|
|
|
// IPFS settings.
|
2023-04-10 09:19:51 -07:00
|
|
|
useIpfs: process.env.DISABLE_IPFS ? false : true, // Disable IPFS flag
|
2021-07-13 12:34:51 -07:00
|
|
|
isCircuitRelay: process.env.ENABLE_CIRCUIT_RELAY ? true : false,
|
2021-09-28 17:51:19 -07:00
|
|
|
// SSL domain used for websocket connection via browsers.
|
|
|
|
|
crDomain: process.env.CR_DOMAIN ? process.env.CR_DOMAIN : '',
|
2021-07-13 12:34:51 -07:00
|
|
|
|
|
|
|
|
// Information passed to other IPFS peers about this node.
|
2021-07-17 19:14:11 -07:00
|
|
|
apiInfo: 'https://ipfs-bch-wallet-service.fullstack.cash/',
|
2021-07-13 12:34:51 -07:00
|
|
|
|
2024-03-22 10:59:36 -07:00
|
|
|
ipfsCoordName,
|
2021-07-17 16:19:03 -07:00
|
|
|
|
2021-07-13 12:34:51 -07:00
|
|
|
// JSON-LD and Schema.org schema with info about this app.
|
|
|
|
|
announceJsonLd: {
|
|
|
|
|
'@context': 'https://schema.org/',
|
|
|
|
|
'@type': 'WebAPI',
|
2021-07-17 16:19:03 -07:00
|
|
|
name: ipfsCoordName,
|
2021-08-03 13:05:45 -07:00
|
|
|
version,
|
2021-08-05 17:16:37 -07:00
|
|
|
protocol: 'bch-wallet',
|
2021-07-13 18:35:08 -07:00
|
|
|
description:
|
|
|
|
|
'IPFS service providing BCH blockchain access needed by a wallet.',
|
|
|
|
|
documentation: 'https://ipfs-bch-wallet-service.fullstack.cash/',
|
2021-07-13 12:34:51 -07:00
|
|
|
provider: {
|
|
|
|
|
'@type': 'Organization',
|
|
|
|
|
name: 'Permissionless Software Foundation',
|
|
|
|
|
url: 'https://PSFoundation.cash'
|
|
|
|
|
}
|
2021-07-17 10:54:00 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// IPFS Ports
|
|
|
|
|
ipfsTcpPort: process.env.IPFS_TCP_PORT ? process.env.IPFS_TCP_PORT : 5668,
|
2021-08-24 16:03:17 -07:00
|
|
|
ipfsWsPort: process.env.IPFS_WS_PORT ? process.env.IPFS_WS_PORT : 5669,
|
|
|
|
|
|
|
|
|
|
// BCH Mnemonic for generating encryption keys and payment address
|
2021-08-26 09:21:08 -07:00
|
|
|
mnemonic: process.env.MNEMONIC ? process.env.MNEMONIC : '',
|
|
|
|
|
|
2021-12-29 17:28:35 -08:00
|
|
|
debugLevel: process.env.DEBUG_LEVEL ? parseInt(process.env.DEBUG_LEVEL) : 2,
|
|
|
|
|
|
|
|
|
|
// Settings for production, using external go-ipfs node.
|
2023-10-28 11:24:40 -07:00
|
|
|
isProduction: process.env.SVC_ENV === 'prod' ? true : false,
|
2021-12-29 17:28:35 -08:00
|
|
|
ipfsHost: process.env.IPFS_HOST ? process.env.IPFS_HOST : 'localhost',
|
|
|
|
|
ipfsApiPort: process.env.IPFS_API_PORT
|
|
|
|
|
? parseInt(process.env.IPFS_API_PORT)
|
2022-05-26 09:12:15 -07:00
|
|
|
: 5001,
|
|
|
|
|
|
2023-11-03 12:07:43 -07:00
|
|
|
chatPubSubChan: 'psf-ipfs-chat-001',
|
|
|
|
|
|
2023-12-04 07:25:32 -08:00
|
|
|
// This can add specific Circuit Relay v2 servers to connect to.
|
2023-12-02 14:12:32 -08:00
|
|
|
bootstrapRelays: [
|
|
|
|
|
// v2 Circuit Relay (Token Tiger)
|
2023-12-04 07:25:32 -08:00
|
|
|
// '/ip4/137.184.93.145/tcp/8001/p2p/12D3KooWGMEKkdJfyZbwdH9EafZbRTtMn7FnhWPrE4MhRty2763g',
|
2023-11-03 12:07:43 -07:00
|
|
|
|
2023-12-02 14:12:32 -08:00
|
|
|
// v2 Circuit Relay server (FullStack.cash)
|
2023-12-04 07:25:32 -08:00
|
|
|
// '/ip4/78.46.129.7/tcp/4001/p2p/12D3KooWFQ11GQ5NubsJGhYZ4X3wrAGimLevxfm6HPExCrMYhpSL'
|
2023-11-03 12:07:43 -07:00
|
|
|
]
|
2021-07-13 12:34:51 -07:00
|
|
|
}
|