Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
cf6f726
new better Approach
mtuktarov Oct 16, 2019
ded4cc4
buildAndDeployPipelineFix
mtuktarov Oct 16, 2019
88e9517
buildAndDeployPipelineFix
mtuktarov Oct 16, 2019
775d16e
buildAndDeployPipelineFix
mtuktarov Oct 16, 2019
22b1323
macSinging
mtuktarov Oct 16, 2019
3024c3c
macSinging
mtuktarov Oct 16, 2019
e43ddbc
macSinging
mtuktarov Oct 16, 2019
348f775
macSinging
mtuktarov Oct 16, 2019
491a58d
macSinging
mtuktarov Oct 16, 2019
bb55d5f
macSinging
mtuktarov Oct 16, 2019
c8e35d8
wip
mtuktarov Oct 17, 2019
5220824
wip
mtuktarov Oct 17, 2019
76ee9d9
wip
mtuktarov Oct 17, 2019
aa78936
wip
mtuktarov Oct 17, 2019
3510f57
wip
mtuktarov Oct 17, 2019
fe1e00b
wip
mtuktarov Oct 17, 2019
a79a9fc
wip
mtuktarov Oct 17, 2019
e37cbc9
wip
mtuktarov Oct 17, 2019
1aa6ff4
wip
mtuktarov Oct 17, 2019
f060e5d
wip
mtuktarov Oct 17, 2019
a1030c3
wip
mtuktarov Oct 17, 2019
5f9bbdb
wip
mtuktarov Oct 17, 2019
2b5c693
wip
mtuktarov Oct 17, 2019
5228b20
wip
mtuktarov Oct 17, 2019
e24bcdc
wip
mtuktarov Oct 17, 2019
cf57ddb
wip
mtuktarov Oct 17, 2019
fe59ab3
wip
mtuktarov Oct 17, 2019
f421903
wip
mtuktarov Oct 17, 2019
e7320e6
wip
mtuktarov Oct 17, 2019
5e5ee8b
wip
mtuktarov Oct 17, 2019
801e6ca
new better Approach
mtuktarov Oct 16, 2019
7ae6920
cersions
mtuktarov Oct 17, 2019
533f499
wip
mtuktarov Oct 19, 2019
da5fa2a
wip
mtuktarov Oct 19, 2019
cc61046
wip
mtuktarov Oct 19, 2019
d0e144c
updateElectron
mtuktarov Oct 20, 2019
ca17525
updateElectron
mtuktarov Oct 20, 2019
1c16baa
updateElectron
mtuktarov Oct 20, 2019
9c77684
updateElectron
mtuktarov Oct 20, 2019
43245ad
NEWAPPROACH-NaN: updateToNewBuilder
mtuktarov Oct 20, 2019
5dcb24e
NEWAPPROACH-NaN: updateToNewBuilder
mtuktarov Oct 20, 2019
6119bdd
ok
mtuktarov Oct 20, 2019
7bad050
macParallelsSteps
mtuktarov Oct 20, 2019
7874fba
macParallelsSteps
mtuktarov Oct 20, 2019
dfb5f38
wip
mtuktarov Oct 20, 2019
a175a1e
templateFix
mtuktarov Oct 20, 2019
c1fb4f9
templateFix
mtuktarov Oct 20, 2019
d1edf98
templateFix
mtuktarov Oct 20, 2019
949b26f
templateFix
mtuktarov Oct 20, 2019
fd479f9
templateFix
mtuktarov Oct 20, 2019
238ccf3
Fix up electron version
vba2000 Oct 21, 2019
bd86d45
Modify timeout limit
Oct 30, 2019
c6542a8
Merge branch 'dev' into newApproach
jahsus-waves Oct 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
509 changes: 305 additions & 204 deletions Jenkinsfile

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions build-wallet/Dockerfile_template → build-wallet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM node:lts-alpine as trading-view-${jenkins_platform}
FROM node:lts-alpine as trading-view-${jenkinsPlatform}
ARG trading_view_token
WORKDIR /root
RUN echo "//registry.npmjs.org/:_authToken=${trading_view_token}" > /root/.npmrc && \
RUN echo "//registry.npmjs.org/:_authToken=\$trading_view_token" > /root/.npmrc && \
npm i @waves/trading-view

FROM node:lts-alpine as static-${jenkins_platform}
FROM node:lts-alpine as static-${jenkinsPlatform}
RUN apk update && apk add git

COPY ./WavesGUI/ /srv/www/WavesGUI/
Expand All @@ -30,8 +30,8 @@ RUN mkdir -p /etc/nginx/sites-enabled && \
apk update && \
apk add gettext libintl
WORKDIR /srv/www
COPY --from=trading-view-${jenkins_platform} /root/node_modules node_modules
COPY --from=static-${jenkins_platform} /srv/www .
COPY --from=trading-view-${jenkinsPlatform} /root/node_modules node_modules
COPY --from=static-${jenkinsPlatform} /srv/www .
COPY ./nginx/default.conf /etc/nginx/sites-available/default.conf
COPY ./info.html /srv/www/info
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ server {

server {
listen 80;
server_name ${nginx_server_name};
server_name ${nginxServerName};
index index.html index.htm;

access_log syslog:server=td-agent-${nginx_access_log_address} nginx_ltsv_access;
error_log syslog:server=td-agent-${nginx_error_log_address} error;
access_log syslog:server=td-agent-${nginxAccessLogAddress} nginx_ltsv_access;
error_log syslog:server=td-agent-${nginxErrorLogAddress} error;
rewrite ^/(.*)/\$ /\$1 permanent;
root /srv/www/WavesGUI/dist/${nginx_platform}/\${WEB_ENVIRONMENT}/;
root /srv/www/WavesGUI/dist/${nginxPlatform}/\${WEB_ENVIRONMENT}/;
add_header X-Frame-Options "SAMEORIGIN";
add_header Access-Control-Allow-Origin *;
add_header Referrer-Policy origin always;
add_header X-Content-Type-Options nosniff always;
add_header X-XSS-Protection "1; mode=block" always;
add_header strict-transport-security "max-age=2592000; includeSubDomains" always;
add_header Content-Security-Policy "default-src * 'unsafe-inline' data: blob: https:; script-src 'self' ${nginx_security_policy_domains} 'unsafe-inline' 'unsafe-eval' blob:; upgrade-insecure-requests; report-uri ${nginx_security_policy_domain}-uri.com/r/d/csp/enforce" always;
add_header Content-Security-Policy "default-src * 'unsafe-inline' data: blob: https:; script-src 'self' ${nginxSecurityPolicyDomains} 'unsafe-inline' 'unsafe-eval' blob:; upgrade-insecure-requests; report-uri ${nginxSecurityPolicyDomain}-uri.com/r/d/csp/enforce" always;

location /img/images-list.json {
auth_basic off;
Expand All @@ -48,8 +48,12 @@ server {
rewrite /wallet /wallet/assets;
}

location ~ ^/(sign-up|switch|migrate|sign-in|dex-demo|dex|wallet/transactions|wallet/portfolio|wallet/assets|import/ledger|import/restore|import|restore|export|create|tokens) {
rewrite /(sign-up|switch|migrate|sign-in|dex-demo|dex|wallet/transactions|wallet/portfolio|wallet/assets|import/ledger|import/restore|import|restore|export|create|tokens) /index.html;
location ~ ^/(sign-in|dex-demo|dex|wallet/transactions|wallet/portfolio|wallet/assets|import/ledger|import/restore|import|restore|export|create|tokens) {
rewrite /(sign-in|dex-demo|dex|wallet/transactions|wallet/portfolio|wallet/assets|import/ledger|import/restore|import|restore|export|create|tokens) /index.html;
}

location = /keeper.html {
add_header X-Frame-Options "";
}

location /trading-view {
Expand Down
11 changes: 5 additions & 6 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
productName: "Waves DEX"
appId: "com.wavesplatform.client.lite"
appId: "com.wavesplatform.client"
copyright: "Waves Platform"

afterSign: "./notarize.js"
compression: normal
npmRebuild: true
artifactName: "${productName}[${env.WAVES_CONFIGURATION}]-${version}-${os}-${arch}.${ext}"
asar: true

directories:
buildResources: electron/
output: "release/${env.WAVES_CONFIGURATION}"
Expand All @@ -23,8 +22,8 @@ win:
mac:
hardenedRuntime: true
gatekeeperAssess: false
entitlements: "electron/entitlements.mac.plist"
entitlementsInherit: "electron/entitlements.mac.plist"
entitlements: "electron/dex.wavesplatform.client.entitlements.plist"
entitlementsInherit: "electron/dex.wavesplatform.client.entitlements.plist"
category: "public.app-category.finance"
target: dmg
icon: "electron/icons/icon.icns"
Expand All @@ -48,7 +47,6 @@ deb:
# --- Default END

nsis:
artifactName: "waves-client[${env.WAVES_CONFIGURATION}]-setup-${version}.${ext}"
include: "electron/installer.nsh"
installerIcon: "electron/icons/icon.ico"
uninstallerIcon: "electron/icons/icon.ico"
Expand All @@ -58,3 +56,4 @@ nsis:
dmg:
icon: "electron/icons/icon.icns"
background: "electron/icons/macos-installer-bg.tiff"
sign: false
15 changes: 9 additions & 6 deletions electron/Bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ export class Bridge implements IBridge {
const path = app.getPath('downloads');
const options = { defaultPath: join(path, data.fileName) };

dialog.showSaveDialog(this.main.mainWindow, options, function (filename) {
if (filename) {
return write(filename, data.fileContent).then(resolve, reject);
} else {
return reject(new Error('Cancel'));
return dialog.showSaveDialog(this.main.mainWindow, options).then(
function (saveDialogValue) {
if (saveDialogValue.filePath) {
return write(saveDialogValue.filePath, data.fileContent).then(resolve, reject);
} else {
return reject(new Error('Cancel'));
}
}
});
);

});
}

Expand Down
10 changes: 5 additions & 5 deletions electron/constansts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
import { MenuItemConstructorOptions, MenuItem } from 'electron';


export const META_NAME = 'meta.json';
Expand Down Expand Up @@ -51,8 +51,8 @@ export const GET_MENU_LIST = (app, t, hasDevTools) => [
} : null
].filter(Boolean) as MenuItemConstructorOptions[];

export const CONTEXT_MENU = t => [
{ label: t('menu.cut'), accelerator: 'CmdOrCtrl+X', role: 'cut' },
{ label: t('menu.copy'), accelerator: 'CmdOrCtrl+C', role: 'copy' },
{ label: t('menu.paste'), accelerator: 'CmdOrCtrl+V', role: 'paste' }
export const CONTEXT_MENU = locale => [
new MenuItem({ label: locale('menu.cut'), accelerator: 'CmdOrCtrl+X', role: 'cut' }),
new MenuItem({ label: locale('menu.copy'), accelerator: 'CmdOrCtrl+C', role: 'copy' }),
new MenuItem({ label: locale('menu.paste'), accelerator: 'CmdOrCtrl+V', role: 'paste' }),
];
20 changes: 20 additions & 0 deletions electron/dex.wavesplatform.client.entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>
8 changes: 0 additions & 8 deletions electron/entitlements.mac.plist

This file was deleted.

26 changes: 14 additions & 12 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,17 @@ class Main implements IMain {
this.addContextMenu();
}

private makeSingleInstance(): boolean {
const isOpenClient = app.makeSingleInstance((argv) => {
const link = argv.find(hasProtocol) || '';

this.openProtocolIn(link);
});

if (isOpenClient) {
private makeSingleInstance() {
const gotTheLock = app.requestSingleInstanceLock();
const argv = process.argv;
const link = argv.find(hasProtocol) || '';
this.openProtocolIn(link);

if (!gotTheLock) {
app.quit();
}

return !isOpenClient;
}
return gotTheLock;
}

private openProtocolIn(browserLink) {
if (!browserLink || !hasProtocol(browserLink)) {
Expand Down Expand Up @@ -211,10 +209,14 @@ class Main implements IMain {
}

private createCtxMenu(locale) {
const onContextMenu = (menu: Menu): () => void => () => menu.popup({});
const onContextMenu = (menu: Menu) => () => {
menu.popup({});
};

if (this.ctxMenuList.length > 0) {
this.mainWindow.webContents.removeAllListeners('context-menu');
}

const ctxMenuTemplate = CONTEXT_MENU(locale);
const ctxMenu = Menu.buildFromTemplate(ctxMenuTemplate);
this.ctxMenuList.push(ctxMenu);
Expand Down
45 changes: 45 additions & 0 deletions electron/notarize.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const notarize = require ('electron-notarize').notarize;
const fs = require('fs');
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const access = fs.createWriteStream('./out.log');
process.stdout.write = process.stderr.write = access.write.bind(access);

process.on('uncaughtException', function(err) {
console.error((err && err.stack) ? err.stack : err);
});

async function notarizeAppInfo() {
const { stdout, stderr } = await exec("\
{ sleep 30 && xcrun altool --notarization-history 0 -u '${appleIdUsername}' -p '${appleIdPassword}' || true ;} && \
{ xcrun altool --notarization-info \$(cat out.log | grep 'checking notarization status' | cut -d':' -f2 | cut -d' ' -f2 | \
tail -1) -u '${appleIdUsername}' -p '${appleIdPassword}' || true ;} && \
{ xcrun stapler staple -v './release/mainnet/mac/Waves DEX.app' || true ;}");
console.log(`\${stdout}`);
if (stderr) {
console.error("error: \${stderr}");
}
}

async function notarizeApp () {
try {
await notarize({
appBundleId: 'com.wavesplatform.client',
appPath: 'release/mainnet/mac/Waves DEX.app',
appleId: '${appleIdUsername}',
appleIdPassword: '${appleIdPassword}'
});
}
catch(err){
console.log(err);
return true;
}
}

module.exports = async function sequence(context) {
const {electronPlatformName} = context;
if (electronPlatformName === 'darwin') {
await notarizeApp();
await notarizeAppInfo();
}
};
Loading