diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6fd503d9..b81b8e807 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,4 +29,6 @@ jobs: - name: release env: GH_TOKEN: ${{ secrets.GH_TOKEN }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: electron-builder -p always --linux diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index 047927ea9..5e193e7c8 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -44,6 +44,8 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} APPLEID: ${{ secrets.APPLEID }} APPLEIDPASS: ${{ secrets.APPLEIDPASS }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} USE_HARD_LINKS: false run: electron-builder -p always --mac diff --git a/.github/workflows/buildWin.yml b/.github/workflows/buildWin.yml index 3bcc92d65..e6f22a8fb 100644 --- a/.github/workflows/buildWin.yml +++ b/.github/workflows/buildWin.yml @@ -45,5 +45,7 @@ jobs: CERTIFICATE_PATH: ${{ steps.write_file.outputs.filePath }} WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} WINDOWS_ALIAS: ${{ secrets.WINDOWS_ALIAS }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} USE_HARD_LINKS: false run: electron-builder -p always --win \ No newline at end of file diff --git a/package.json b/package.json index 365da9319..a5ce5494a 100644 --- a/package.json +++ b/package.json @@ -43,10 +43,8 @@ ] }, "publish": { - "provider": "github", - "repo": "ZbayLite", - "owner": "ZbayApp", - "releaseType": "draft" + "provider": "s3", + "bucket": "release.zbay.lite" }, "extraResources": [ "worker/**/*", @@ -189,7 +187,7 @@ "@types/ps-node": "^0.1.0", "@types/redux-debounced": "^0.2.19", "async": "^3.1.0", - "axios": "^0.18.0", + "axios": "^0.21.1", "bech32": "^1.1.3", "bignumber.js": "^8.1.1", "binance-api-node": "^0.9.5", diff --git a/scripts/notarize.js b/scripts/notarize.js index 22fae9c74..2e5763255 100644 --- a/scripts/notarize.js +++ b/scripts/notarize.js @@ -16,9 +16,9 @@ exports.default = async function notarizing (context) { appleId: process.env.APPLEID, appleIdPassword: process.env.APPLEIDPASS }) + console.log('notarization done') return response } catch (e) { - console.log('error') + console.error(e) } - console.log('notarization done') } diff --git a/src/main/main.js b/src/main/main.js index d9604f298..741d0a3f5 100644 --- a/src/main/main.js +++ b/src/main/main.js @@ -253,14 +253,17 @@ app.on('ready', async () => { mainWindow.webContents.on('did-finish-load', async () => { mainWindow.webContents.send('ping') try { - // Spawn and kill tor to generate onionAddress - console.log('spawning tor for onion address') - torProcess = await spawnTor() - createServer(mainWindow) - mainWindow.webContents.send('onionAddress', getOnionAddress()) - torProcess.kill() - torProcess = null - console.log('killed tor process') + if (!torProcess) { + + // Spawn and kill tor to generate onionAddress + console.log('spawning tor for onion address') + torProcess = await spawnTor() + createServer(mainWindow) + mainWindow.webContents.send('onionAddress', getOnionAddress()) + // torProcess.kill() + // torProcess = null + // console.log('killed tor process') + } } catch (error) { console.log(error) } @@ -284,10 +287,13 @@ app.on('ready', async () => { console.log('spawning tor for application') torProcess = await spawnTor() electronStore.set('isTorActive', true) + mainWindow.webContents.send('connectWsContacts') } }) ipcMain.on('killTor', async (event, arg) => { + console.log('starting killing tor') if (torProcess !== null) { + console.log('tor killing proccessing') torProcess.kill() torProcess = null electronStore.set('isTorActive', false) diff --git a/src/main/websockets/client.js b/src/main/websockets/client.js index c0c814c5b..9e16a3381 100644 --- a/src/main/websockets/client.js +++ b/src/main/websockets/client.js @@ -32,7 +32,7 @@ new Promise((resolve, reject) => { const id = setTimeout(() => { // eslint-disable-next-line reject('timeout') - }, 20000) + }, 35000) socket.on('unexpected-response', err => { console.log(err) }) diff --git a/src/renderer/components/widgets/VaultUnlockerForm.js b/src/renderer/components/widgets/VaultUnlockerForm.js index f218539d0..a9276ae1f 100644 --- a/src/renderer/components/widgets/VaultUnlockerForm.js +++ b/src/renderer/components/widgets/VaultUnlockerForm.js @@ -157,7 +157,8 @@ export const VaultUnlockerForm = ({ margin='normal' text={!isNewUser ? 'Sign in' : 'Connect Now'} fullWidth - inProgress={!done} + disabled={!done || isRescanning || syncingStart} + inProgress={!done || isRescanning || syncingStart} /> @@ -170,8 +171,8 @@ export const VaultUnlockerForm = ({ {nodeConnected && isLogIn && - !isRescanning && isSynced && + !isRescanning && isInitialLoadFinished && } )} diff --git a/src/renderer/index.js b/src/renderer/index.js index d00b45eb8..deb7d3426 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -15,8 +15,9 @@ import messagesHandlers from './store/handlers/messages' import nodeSelectors from './store/selectors/node' import coordinatorSelectors from './store/selectors/coordinator' import identityHandlers from './store/handlers/identity' -import { errorNotification, successNotification } from './store/handlers/utils' +import contactsHandlers from './store/handlers/contacts' +import { errorNotification, successNotification } from './store/handlers/utils' import notificationsHandlers from './store/handlers/notifications' import appSelectors from './store/selectors/app' @@ -66,6 +67,11 @@ ipcRenderer.on('wsMessage', (_, data) => { store.dispatch(messagesHandlers.epics.handleWebsocketMessage(data)) }) +ipcRenderer.on('connectWsContacts', (event, msg) => { + console.log('connecting ws contacts') + store.dispatch(contactsHandlers.epics.connectWsContacts()) +}) + ipcRenderer.on('askForUsingDefaultBlockchainLocation', event => { store.dispatch(appHandlers.epics.askForBlockchainLocation()) }) diff --git a/src/renderer/store/handlers/contacts.ts b/src/renderer/store/handlers/contacts.ts index f9007476b..3e7941901 100644 --- a/src/renderer/store/handlers/contacts.ts +++ b/src/renderer/store/handlers/contacts.ts @@ -223,6 +223,7 @@ export const connectWsContacts = (key?: string) => async (dispatch, getState) => const user = users[contact.key] if (user?.onionAddress) { console.log("trying to connect inside contacts loop") + console.log(user?.onionAddress) contactsToConnect.push({ key: contact.key, onionAddress: user?.onionAddress }) } } diff --git a/src/renderer/store/handlers/identity.ts b/src/renderer/store/handlers/identity.ts index c21068700..7b1b14de0 100644 --- a/src/renderer/store/handlers/identity.ts +++ b/src/renderer/store/handlers/identity.ts @@ -4,7 +4,7 @@ import { createAction, handleActions } from 'redux-actions' import secp256k1 from 'secp256k1' import { randomBytes } from 'crypto' import { DateTime } from 'luxon' -import { remote } from 'electron' +import { ipcRenderer, remote } from 'electron' import client from '../../zcash' import channels from '../../zcash/channels' @@ -408,8 +408,11 @@ export const setIdentityEpic = identityToSet => async (dispatch, getState) => { await dispatch(fetchBalance()) await dispatch(fetchFreeUtxos()) await dispatch(messagesHandlers.epics.fetchMessages()) - await dispatch(appHandlers.epics.initializeUseTor()) - const usernameStatus = electronStore.get('registrationStatus.status') + if (!useTor) { + ipcRenderer.send('killTor') + // await dispatch(appHandlers.epics.initializeUseTor()) + } + const usernameStatus = electronStore.get('registrationStatus.status') const nickname = electronStore.get('registrationStatus.nickname') console.log(usernameStatus) if (nickname && usernameStatus !== 'SUCCESS') { @@ -429,10 +432,8 @@ export const setIdentityEpic = identityToSet => async (dispatch, getState) => { } dispatch(setLoadingMessage('')) dispatch(setLoading(false)) - setTimeout(() => { dispatch(contactsHandlers.epics.connectWsContacts()) - }, 5000) - if (electronStore.get('isMigrating')) { + if (electronStore.get('isMigrating')) { dispatch(modalsHandlers.actionCreators.openModal('migrationModal')()) } } diff --git a/src/renderer/store/handlers/messages.ts b/src/renderer/store/handlers/messages.ts index b256509c1..3de56942d 100644 --- a/src/renderer/store/handlers/messages.ts +++ b/src/renderer/store/handlers/messages.ts @@ -620,6 +620,7 @@ export const handleWebsocketMessage = data => async (dispatch, getState) => { console.log('Contact exist') if (!contact.connected) { console.log('Contact is not connected, initializing connection') + console.log(publicKey) //dispatch(contactsHandlers.actions.setContactConnected({ connected: true, key: publicKey })) dispatch(contactsHandlers.epics.connectWsContacts(publicKey)) } diff --git a/src/renderer/store/handlers/users.ts b/src/renderer/store/handlers/users.ts index 778bab93c..ed9088753 100644 --- a/src/renderer/store/handlers/users.ts +++ b/src/renderer/store/handlers/users.ts @@ -252,9 +252,9 @@ export const createOrUpdateUser = payload => async (dispatch, getState) => { status: 'IN_PROGRESS' }) - ipcRenderer.send('spawnTor') - electronStore.set('useTor', true) - dispatch(appHandlers.actions.setUseTor(true)) + // ipcRenderer.send('spawnTor') + // electronStore.set('useTor', true) + // dispatch(appHandlers.actions.setUseTor(true)) dispatch(checkRegistrationConfirmations({ firstRun: true })) dispatch( notificationsHandlers.actions.enqueueSnackbar( diff --git a/src/renderer/store/handlers/vault.ts b/src/renderer/store/handlers/vault.ts index 95fd16582..417407018 100644 --- a/src/renderer/store/handlers/vault.ts +++ b/src/renderer/store/handlers/vault.ts @@ -154,7 +154,7 @@ const unlockVaultEpic = ( } else { const identity = electronStore.get('identity') if (!identity) { - dispatch(actionCreators.openModal('registrationGuide')()) + //dispatch(actionCreators.openModal('registrationGuide')()) await dispatch(createVaultEpic()) } else { await dispatch(setVaultIdentity())