tutanota/buildSrc/electron-package-json-template.js

174 lines
5.2 KiB
JavaScript
Raw Normal View History

const path = require('path')
2019-11-12 13:53:34 +01:00
const pj = require('../package.json')
/**
* This is used for launching electron:
2019-02-05 15:15:05 +01:00
* 1. copied to app-desktop/build from make.js
* 2. copied to app-desktop/build/dist from dist.js (DesktopBuilder)
*/
module.exports = function (opts) {
const {nameSuffix, version, updateUrl, iconPath, sign, notarize, unpacked} = opts
const appName = "tutanota-desktop" + nameSuffix
const appId = "de.tutao.tutanota" + nameSuffix
2019-07-18 15:16:13 +02:00
return {
"name": appName,
2019-07-18 15:16:13 +02:00
"main": "./src/desktop/DesktopMain.js",
"version": version,
"author": "Tutao GmbH",
"description": "The desktop client for Tutanota, the secure e-mail service.",
"scripts": {
"start": "electron ."
},
"tutao-config": {
"pubKeys": [
"-----BEGIN PUBLIC KEY-----\n"
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhFrLW999Y/ODqGfGKSzh\n"
+ "7SFm6UgIj5scpb1r+KmEgVr/3zmd973+u2z5gG/wtayUbdVUGlzTgxqTE76BGTBR\n"
+ "szq932uTsPfjRbtbyjIOzfzPvkyAB1Ew91gQk5ubrO1VCbXAZyuFi7RxDibuklLO\n"
+ "lzHyjKyEIVTTdOqOTE+mg/vr41MxDW0X4nZw5MT1mIV/aYGeOSdtNdFsL69aR+d7\n"
+ "KufD43J60FUS9G0tf4KmyQInmGqC8MSXCO0SMwwEJZDxDzkBsSensKfS0HzIjCXS\n"
+ "or/Ahu6RwhEhjm7MyXbhiDyis+kGHSfatsO5KWWuZ4xgCEUO0L6vMQwr5M/qYOj1\n"
+ "7QIDAQAB\n"
+ "-----END PUBLIC KEY-----",
"-----BEGIN PUBLIC KEY-----\n"
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk4NkSbs41KjuNZfFco2l\n"
+ "unXXFOIkrdBfDmIiVfVTYagEk2cN9HkjCkiNsHucLHPuHb0reHsaxrDVE1lWGTPI\n"
+ "0Lh5diLYdxJ+AGy/8j9jsO51hONqTujdD0mJs14YkVfOUXyHQh1z6WJCLc9jrN9+\n"
+ "3dgKOlQRYW2mYise8ggYYcrRs/CY40s3/cQvrFSprFMPS6E+9lmIDp0hPKr9q90t\n"
+ "IXmzihQyc8Q0VmAfCqEwUtx6RY6BGkqKiDoMh4Qs5ZwFxhoSfgrJiwBmv0HcX1yv\n"
+ "QGNSdxrpLuMA/afCPdf49x3iwy+p+paXHKirgM5z6rnikk10Lko7dNXV0735PsZd\n"
+ "dQIDAQAB\n"
+ "-----END PUBLIC KEY-----"
],
2019-07-18 15:16:13 +02:00
"pollingInterval": 1000 * 60 * 60 * 3, // 3 hours
"preloadjs": "./src/desktop/preload.js",
"desktophtml": "./desktop.html",
"iconName": "logo-solo-red.png",
"fileManagerTimeout": 30000,
// true if this version checks its updates. use to prevent local builds from checking sigs.
"checkUpdateSignature": sign || !!process.env.JENKINS,
"appUserModelId": appId,
2019-07-18 15:16:13 +02:00
"initialSseConnectTimeoutInSeconds": 60,
"maxSseConnectTimeoutInSeconds": 2400,
2020-03-05 12:15:08 +01:00
"configMigrationFunction": "migrateClient",
2019-07-18 15:16:13 +02:00
"defaultDesktopConfig": {
/**
* do not change defaultDesktopConfig
* instead, add migrations to src/desktop/DesktopConfigMigrator.js
*/
2019-07-18 15:16:13 +02:00
"heartbeatTimeoutInSeconds": 30,
"defaultDownloadPath": null,
"enableAutoUpdate": true,
"runAsTrayApp": true,
}
},
"dependencies": {
2019-11-12 13:53:34 +01:00
"electron-updater": pj.devDependencies["electron-updater"],
"chalk": pj.devDependencies.chalk,
"electron-localshortcut": pj.devDependencies["electron-localshortcut"],
"fs-extra": pj.devDependencies["fs-extra"],
"bluebird": pj.dependencies.bluebird,
"node-forge": pj.devDependencies["node-forge"],
"winreg": pj.devDependencies.winreg,
"keytar": pj.dependencies.keytar
2019-07-18 15:16:13 +02:00
},
"build": {
2019-11-12 13:53:34 +01:00
"electronVersion": pj.devDependencies.electron,
2019-07-18 15:16:13 +02:00
"icon": iconPath,
"appId": appId,
2019-07-18 15:16:13 +02:00
"productName": nameSuffix.length > 0
? nameSuffix.slice(1) + " Tutanota Desktop"
: "Tutanota Desktop",
"artifactName": "${name}-${os}.${ext}",
"afterSign": notarize ? "buildSrc/notarize.js" : undefined,
2019-07-18 15:16:13 +02:00
"protocols": [
{
"name": "Mailto Links",
"schemes": [
"mailto"
],
"role": "Editor"
}
],
2019-09-05 13:53:12 +02:00
"forceCodeSigning": sign || !!process.env.JENKINS,
"publish": updateUrl
? {
"provider": "generic",
"url": updateUrl,
"channel": "latest",
"publishAutoUpdate": true,
"useMultipleRangeRequest": false
}
: undefined,
2019-07-18 15:16:13 +02:00
"directories": {
"output": "installers"
},
"extraResources": {
"from": path.dirname(iconPath),
"to": "./icons/"
},
"win": {
"verifyUpdateCodeSignature": sign,
2019-07-18 15:16:13 +02:00
"publisherName": "Tutao GmbH",
"sign": sign
? "./buildSrc/winsigner.js"
: undefined,
"signingHashAlgorithms": sign
? ["sha256"]
: undefined,
2019-07-18 15:16:13 +02:00
"target": [
{
"target": unpacked ? "dir" : "nsis",
2019-07-18 15:16:13 +02:00
"arch": "x64"
}
]
},
"nsis": {
"oneClick": false,
"perMachine": false,
2019-07-18 15:16:13 +02:00
"createStartMenuShortcut": true,
"allowElevation": true,
"allowToChangeInstallationDirectory": true,
"include": path.join("..", "..", "buildSrc", "fix-old-uuid.nsh")
2019-07-18 15:16:13 +02:00
},
"mac": {
2019-10-17 10:11:41 +02:00
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "buildSrc/mac-entitlements.plist",
"entitlementsInherit": "buildSrc/mac-entitlements.plist",
2019-07-18 15:16:13 +02:00
"icon": path.join(path.dirname(iconPath), "logo-solo-red.png.icns"),
"extendInfo": {
"LSUIElement": 1 //hide dock icon on startup
},
"target": unpacked
? [{"target": "dir", "arch": "x64"}]
: [
{
"target": "zip",
"arch": "x64"
},
{
"target": "dmg",
"arch": "x64"
}
]
2019-07-18 15:16:13 +02:00
},
"linux": {
"icon": path.join(path.dirname(iconPath), "icon/"),
"synopsis": "Tutanota Desktop Client",
"category": "Network",
"desktop": {
"StartupWMClass": appName
2019-07-18 15:16:13 +02:00
},
"target": [
{
"target": unpacked ? "dir" : "AppImage",
2019-07-18 15:16:13 +02:00
"arch": "x64"
}
]
}
}
}
2019-02-27 17:57:08 +01:00
}
2019-04-02 13:49:38 +02:00