/ app / config.js
config.js
 1  import { app } from 'electron'
 2  import path from 'path'
 3  import RC from 'rc'
 4  
 5  const USER_DATA = app.getPath('userData')
 6  const DEFAULT_EXTENSIONS_DIR = path.join(USER_DATA, 'extensions')
 7  const DEFAULT_IPFS_DIR = path.join(USER_DATA, 'ipfs')
 8  const DEFAULT_HYPER_DIR = path.join(USER_DATA, 'hyper')
 9  // const DEFAULT_SSB_DIR = path.join(USER_DATA, 'ssb')
10  const DEFAULT_BT_DIR = path.join(USER_DATA, 'bt')
11  
12  const DEFAULT_PAGE = 'agregore://welcome'
13  
14  export default RC('agregore', {
15    accelerators: {
16      OpenDevTools: 'CommandOrControl+Shift+I',
17      NewWindow: 'CommandOrControl+N',
18      Forward: 'CommandOrControl+]',
19      Back: 'CommandOrControl+[',
20      FocusURLBar: 'CommandOrControl+L',
21      FindInPage: 'CommandOrControl+F',
22      Reload: 'CommandOrControl+R',
23      HardReload: 'CommandOrControl+Shift+R',
24      LearnMore: null,
25      OpenExtensionsFolder: null,
26      EditConfigFile: 'CommandOrControl+.',
27      CreateBookmark: 'CommandOrControl+D'
28    },
29  
30    extensions: {
31      dir: DEFAULT_EXTENSIONS_DIR,
32      // TODO: This will be for loading extensions from remote URLs
33      remote: []
34    },
35  
36    theme: {
37      'font-family': 'system-ui',
38      background: 'var(--ag-color-black)',
39      text: 'var(--ag-color-white)',
40      primary: 'var(--ag-color-purple)',
41      secondary: 'var(--ag-color-green)',
42      indent: '16px',
43      'max-width': '666px'
44    },
45  
46    defaultPage: DEFAULT_PAGE,
47    autoHideMenuBar: false,
48  
49    // All options here: https://github.com/ipfs/js-ipfs/blob/master/docs/CONFIG.md
50    ipfsOptions: {
51      repo: DEFAULT_IPFS_DIR,
52      silent: true,
53      preload: {
54        enabled: false
55      },
56      config: {
57        Ipns: {
58          UsePubsub: true
59        },
60        Pubsub: {
61          Enabled: true
62        },
63        Addresses: {
64          API: '/ip4/127.0.0.1/tcp/2473',
65          Gateway: '/ip4/127.0.0.1/tcp/2474',
66          Swarm: [
67            '/ip4/0.0.0.0/tcp/2475',
68            '/ip6/::/tcp/2475',
69            '/ip4/0.0.0.0/udp/2475/quic',
70            '/ip6/::/udp/2475/quic'
71          ]
72        },
73        // We don't need a gateway running. 🤷
74        Gateway: null
75      }
76    },
77  
78    // All options here: https://github.com/datproject/sdk/#const-hypercore-hyperdrive-resolvename-keypair-derivesecret-registerextension-close--await-sdkopts
79    hyperOptions: {
80      storage: DEFAULT_HYPER_DIR
81    },
82  
83    // All options here: https://github.com/ssbc/ssb-config#configuration
84    ssbOptions: {},
85  
86    // All options here: https://github.com/webtorrent/webtorrent/blob/master/docs/api.md
87    btOptions: {
88      folder: DEFAULT_BT_DIR
89    }
90  })