mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
Add authorization token to file system api
This commit is contained in:
parent
cc4f07d037
commit
5d7d72a3e2
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,6 +4,7 @@ Changelog.txt
|
||||
Netburner.txt
|
||||
/doc/build
|
||||
/node_modules
|
||||
/electron/node_modules
|
||||
/dist/*.map
|
||||
/test/*.map
|
||||
/test/*.bundle.*
|
||||
|
124
electron/api-server.js
Normal file
124
electron/api-server.js
Normal file
@ -0,0 +1,124 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const http = require("http");
|
||||
const crypto = require('crypto');
|
||||
const log = require('electron-log');
|
||||
const Config = require('electron-config');
|
||||
const config = new Config();
|
||||
|
||||
let server;
|
||||
let window;
|
||||
|
||||
function initialize(win, callback) {
|
||||
window = win;
|
||||
server = http.createServer(async function (req, res) {
|
||||
let body = "";
|
||||
|
||||
req.on("data", (chunk) => {
|
||||
body += chunk.toString(); // convert Buffer to string
|
||||
});
|
||||
req.on("end", () => {
|
||||
const providedToken = req.headers?.authorization?.replace('Bearer ', '') ?? '';
|
||||
const isValid = providedToken === getAuthenticationToken();
|
||||
if (isValid) {
|
||||
log.log('Valid authentication token');
|
||||
} else {
|
||||
log.log('Invalid authentication token');
|
||||
res.writeHead(401);
|
||||
res.write('Invalid authentication token');
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(body);
|
||||
} catch (error) {
|
||||
log.warn(`Invalid body data`);
|
||||
res.writeHead(400);
|
||||
res.write('Invalid body data');
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
|
||||
if (data) {
|
||||
window.webContents.executeJavaScript(`document.saveFile("${data.filename}", "${data.code}")`).then((result) => {
|
||||
res.write(result);
|
||||
res.end();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const autostart = config.get('autostart', false);
|
||||
if (autostart) {
|
||||
return enable(callback);
|
||||
}
|
||||
|
||||
if (callback) return callback();
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
||||
function enable(callback) {
|
||||
if (isListening()) {
|
||||
log.warn('API server already listening');
|
||||
return;
|
||||
}
|
||||
|
||||
const port = config.get('port', 9990);
|
||||
log.log(`Starting http server on port ${port}`);
|
||||
return server.listen(port, "127.0.0.1", callback);
|
||||
}
|
||||
|
||||
function disable() {
|
||||
if (!isListening()) {
|
||||
log.warn('API server not listening');
|
||||
return;
|
||||
}
|
||||
|
||||
log.log('Stopping http server');
|
||||
return server.close();
|
||||
}
|
||||
|
||||
function toggleServer() {
|
||||
if (isListening()) {
|
||||
return disable();
|
||||
} else {
|
||||
return enable();
|
||||
}
|
||||
}
|
||||
|
||||
function isListening() {
|
||||
return server?.listening ?? false;
|
||||
}
|
||||
|
||||
function toggleAutostart() {
|
||||
const newValue = !isAutostart();
|
||||
config.set('autostart', newValue);
|
||||
log.log(`New autostart value is '${newValue}'`);
|
||||
}
|
||||
|
||||
function isAutostart() {
|
||||
return config.get('autostart');
|
||||
}
|
||||
|
||||
function getAuthenticationToken() {
|
||||
const token = config.get('token');
|
||||
if (token) return token;
|
||||
|
||||
const newToken = generateToken();
|
||||
config.set('token', newToken);
|
||||
return newToken;
|
||||
}
|
||||
|
||||
function generateToken() {
|
||||
const buffer = crypto.randomBytes(48);
|
||||
return buffer.toString('base64')
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
initialize,
|
||||
enable, disable, toggleServer,
|
||||
toggleAutostart, isAutostart,
|
||||
getAuthenticationToken, isListening,
|
||||
}
|
196
electron/main.js
196
electron/main.js
@ -1,8 +1,9 @@
|
||||
/* eslint-disable no-process-exit */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const { app, BrowserWindow, Menu, shell, dialog } = require("electron");
|
||||
const { app, BrowserWindow, Menu, shell, dialog, clipboard } = require("electron");
|
||||
const log = require('electron-log');
|
||||
const greenworks = require("./greenworks");
|
||||
const api = require("./api-server");
|
||||
|
||||
log.catchErrors();
|
||||
log.info(`Started app: ${JSON.stringify(process.argv)}`);
|
||||
@ -19,24 +20,106 @@ if (greenworks.init()) {
|
||||
}
|
||||
|
||||
const debug = false;
|
||||
|
||||
let win = null;
|
||||
|
||||
require("http")
|
||||
.createServer(async function (req, res) {
|
||||
let body = "";
|
||||
req.on("data", (chunk) => {
|
||||
body += chunk.toString(); // convert Buffer to string
|
||||
});
|
||||
req.on("end", () => {
|
||||
const data = JSON.parse(body);
|
||||
win.webContents.executeJavaScript(`document.saveFile("${data.filename}", "${data.code}")`).then((result) => {
|
||||
res.write(result);
|
||||
res.end();
|
||||
});
|
||||
});
|
||||
const getMenu = (win) => Menu.buildFromTemplate([
|
||||
{
|
||||
label: "Edit",
|
||||
submenu: [
|
||||
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
|
||||
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
|
||||
{ type: "separator" },
|
||||
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
|
||||
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
|
||||
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
|
||||
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Reloads",
|
||||
submenu: [
|
||||
{
|
||||
label: "Reload",
|
||||
accelerator: "f5",
|
||||
click: () => {
|
||||
win.loadFile("index.html");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Reload & Kill All Scripts",
|
||||
click: () => reloadAndKill(win)
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Fullscreen",
|
||||
submenu: [
|
||||
{
|
||||
label: "Toggle",
|
||||
accelerator: "f9",
|
||||
click: (() => {
|
||||
let full = false;
|
||||
return () => {
|
||||
full = !full;
|
||||
win.setFullScreen(full);
|
||||
};
|
||||
})(),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "API Server",
|
||||
submenu: [
|
||||
{
|
||||
label: api.isListening() ? 'Disable Server' : 'Enable Server',
|
||||
click: (async () => {
|
||||
await api.toggleServer();
|
||||
Menu.setApplicationMenu(getMenu());
|
||||
})
|
||||
.listen(9990, "127.0.0.1");
|
||||
},
|
||||
{
|
||||
label: api.isAutostart() ? 'Disable Autostart' : 'Enable Autostart',
|
||||
click: (async () => {
|
||||
api.toggleAutostart();
|
||||
Menu.setApplicationMenu(getMenu());
|
||||
})
|
||||
},
|
||||
{
|
||||
label: 'Copy Auth Token',
|
||||
click: (async () => {
|
||||
const token = api.getAuthenticationToken();
|
||||
log.log('Wrote authentication token to clipboard');
|
||||
clipboard.writeText(token);
|
||||
})
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "Debug",
|
||||
submenu: [
|
||||
{
|
||||
label: "Activate",
|
||||
click: () => win.webContents.openDevTools(),
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const reloadAndKill = (win, killScripts = true) => {
|
||||
log.info('Reloading & Killing all scripts...');
|
||||
setStopProcessHandler(app, win, false);
|
||||
if (win.achievementsIntervalID) clearInterval(win.achievementsIntervalID);
|
||||
win.webContents.forcefullyCrashRenderer();
|
||||
win.on('closed', () => {
|
||||
// Wait for window to be closed before opening the new one to prevent race conditions
|
||||
log.debug('Opening new window');
|
||||
const newWindow = createWindow(killScripts);
|
||||
api.initialize(newWindow, () => Menu.setApplicationMenu(getMenu(win)));
|
||||
setStopProcessHandler(app, newWindow, true);
|
||||
})
|
||||
win.close();
|
||||
};
|
||||
|
||||
|
||||
function createWindow(killall) {
|
||||
win = new BrowserWindow({
|
||||
@ -83,19 +166,7 @@ function createWindow(killall) {
|
||||
}, 1000);
|
||||
win.achievementsIntervalID = intervalID;
|
||||
|
||||
const reloadAndKill = (killScripts = true) => {
|
||||
log.info('Reloading & Killing all scripts...');
|
||||
setStopProcessHandler(app, win, false);
|
||||
if (intervalID) clearInterval(intervalID);
|
||||
win.webContents.forcefullyCrashRenderer();
|
||||
win.on('closed', () => {
|
||||
// Wait for window to be closed before opening the new one to prevent race conditions
|
||||
log.debug('Opening new window');
|
||||
const newWindow = createWindow(killScripts);
|
||||
setStopProcessHandler(app, newWindow, true);
|
||||
})
|
||||
win.close();
|
||||
};
|
||||
|
||||
const promptForReload = () => {
|
||||
win.off('unresponsive', promptForReload);
|
||||
dialog.showMessageBox({
|
||||
@ -111,7 +182,7 @@ function createWindow(killall) {
|
||||
noLink: true,
|
||||
}).then(({response, checkboxChecked}) => {
|
||||
if (response === 0) {
|
||||
reloadAndKill(checkboxChecked);
|
||||
reloadAndKill(win, checkboxChecked);
|
||||
} else {
|
||||
win.on('unresponsive', promptForReload)
|
||||
}
|
||||
@ -119,64 +190,8 @@ function createWindow(killall) {
|
||||
}
|
||||
win.on('unresponsive', promptForReload);
|
||||
|
||||
// Create the Application's main menu
|
||||
Menu.setApplicationMenu(
|
||||
Menu.buildFromTemplate([
|
||||
{
|
||||
label: "Edit",
|
||||
submenu: [
|
||||
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
|
||||
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
|
||||
{ type: "separator" },
|
||||
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
|
||||
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
|
||||
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
|
||||
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "reloads",
|
||||
submenu: [
|
||||
{
|
||||
label: "reload",
|
||||
accelerator: "f5",
|
||||
click: () => {
|
||||
win.loadFile("index.html");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "reload & kill all scripts",
|
||||
click: reloadAndKill
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "fullscreen",
|
||||
submenu: [
|
||||
{
|
||||
label: "toggle",
|
||||
accelerator: "f9",
|
||||
click: (() => {
|
||||
let full = false;
|
||||
return () => {
|
||||
full = !full;
|
||||
win.setFullScreen(full);
|
||||
};
|
||||
})(),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "debug",
|
||||
submenu: [
|
||||
{
|
||||
label: "activate",
|
||||
click: () => win.webContents.openDevTools(),
|
||||
},
|
||||
],
|
||||
},
|
||||
]),
|
||||
);
|
||||
// // Create the Application's main menu
|
||||
// Menu.setApplicationMenu(getMenu());
|
||||
|
||||
return win;
|
||||
}
|
||||
@ -191,6 +206,8 @@ function setStopProcessHandler(app, window, enabled) {
|
||||
clearInterval(window.achievementsIntervalID);
|
||||
}
|
||||
|
||||
api.disable();
|
||||
|
||||
// We'll try to execute javascript on the page to see if we're stuck
|
||||
let canRunJS = false;
|
||||
win.webContents.executeJavaScript('window.stop(); document.close()', true)
|
||||
@ -238,8 +255,9 @@ function setStopProcessHandler(app, window, enabled) {
|
||||
}
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
app.whenReady().then(async () => {
|
||||
log.info('Application is ready!');
|
||||
const win = createWindow(process.argv.includes("--no-scripts"));
|
||||
await api.initialize(win, () => Menu.setApplicationMenu(getMenu(win)));
|
||||
setStopProcessHandler(app, win, true);
|
||||
});
|
||||
|
325
electron/package-lock.json
generated
Normal file
325
electron/package-lock.json
generated
Normal file
@ -0,0 +1,325 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bitburner",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"electron-config": "^2.0.0",
|
||||
"electron-log": "^4.4.4"
|
||||
}
|
||||
},
|
||||
"node_modules/conf": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/conf/-/conf-1.4.0.tgz",
|
||||
"integrity": "sha512-bzlVWS2THbMetHqXKB8ypsXN4DQ/1qopGwNJi1eYbpwesJcd86FBjFciCQX/YwAhp9bM7NVnPFqZ5LpV7gP0Dg==",
|
||||
"dependencies": {
|
||||
"dot-prop": "^4.1.0",
|
||||
"env-paths": "^1.0.0",
|
||||
"make-dir": "^1.0.0",
|
||||
"pkg-up": "^2.0.0",
|
||||
"write-file-atomic": "^2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/dot-prop": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz",
|
||||
"integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==",
|
||||
"dependencies": {
|
||||
"is-obj": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-config": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-config/-/electron-config-2.0.0.tgz",
|
||||
"integrity": "sha512-5mGwRK4lsAo6tiy4KNF/zUInYpUGr7JJzLA8FHOoqBWV3kkKJWSrDXo4Uk2Ffm5aeQ1o73XuorfkYhaWFV2O4g==",
|
||||
"deprecated": "Renamed to `electron-store`.",
|
||||
"dependencies": {
|
||||
"conf": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-log": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/electron-log/-/electron-log-4.4.4.tgz",
|
||||
"integrity": "sha512-jcNtrVmKXG+CHchLo/jnjjQ9K4/ORguWD23H2nqApTwisQ4Qo3IRQtLiorubajX0Uxg76Xm/Yt+eNfQMoHVr5w=="
|
||||
},
|
||||
"node_modules/env-paths": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz",
|
||||
"integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/find-up": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
|
||||
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
|
||||
"dependencies": {
|
||||
"locate-path": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
|
||||
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg=="
|
||||
},
|
||||
"node_modules/imurmurhash": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
|
||||
"engines": {
|
||||
"node": ">=0.8.19"
|
||||
}
|
||||
},
|
||||
"node_modules/is-obj": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
|
||||
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/locate-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
|
||||
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
|
||||
"dependencies": {
|
||||
"p-locate": "^2.0.0",
|
||||
"path-exists": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
|
||||
"integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
|
||||
"dependencies": {
|
||||
"pify": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
|
||||
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
|
||||
"dependencies": {
|
||||
"p-try": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/p-locate": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
|
||||
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
|
||||
"dependencies": {
|
||||
"p-limit": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/p-try": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
|
||||
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-up": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz",
|
||||
"integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=",
|
||||
"dependencies": {
|
||||
"find-up": "^2.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/signal-exit": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
|
||||
"integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ=="
|
||||
},
|
||||
"node_modules/write-file-atomic": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
|
||||
"integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.1.11",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"conf": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/conf/-/conf-1.4.0.tgz",
|
||||
"integrity": "sha512-bzlVWS2THbMetHqXKB8ypsXN4DQ/1qopGwNJi1eYbpwesJcd86FBjFciCQX/YwAhp9bM7NVnPFqZ5LpV7gP0Dg==",
|
||||
"requires": {
|
||||
"dot-prop": "^4.1.0",
|
||||
"env-paths": "^1.0.0",
|
||||
"make-dir": "^1.0.0",
|
||||
"pkg-up": "^2.0.0",
|
||||
"write-file-atomic": "^2.3.0"
|
||||
}
|
||||
},
|
||||
"dot-prop": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz",
|
||||
"integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==",
|
||||
"requires": {
|
||||
"is-obj": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"electron-config": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-config/-/electron-config-2.0.0.tgz",
|
||||
"integrity": "sha512-5mGwRK4lsAo6tiy4KNF/zUInYpUGr7JJzLA8FHOoqBWV3kkKJWSrDXo4Uk2Ffm5aeQ1o73XuorfkYhaWFV2O4g==",
|
||||
"requires": {
|
||||
"conf": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"electron-log": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/electron-log/-/electron-log-4.4.4.tgz",
|
||||
"integrity": "sha512-jcNtrVmKXG+CHchLo/jnjjQ9K4/ORguWD23H2nqApTwisQ4Qo3IRQtLiorubajX0Uxg76Xm/Yt+eNfQMoHVr5w=="
|
||||
},
|
||||
"env-paths": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz",
|
||||
"integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA="
|
||||
},
|
||||
"find-up": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
|
||||
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
|
||||
"requires": {
|
||||
"locate-path": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
|
||||
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg=="
|
||||
},
|
||||
"imurmurhash": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
|
||||
},
|
||||
"is-obj": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
|
||||
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8="
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
|
||||
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
|
||||
"requires": {
|
||||
"p-locate": "^2.0.0",
|
||||
"path-exists": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
|
||||
"integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
|
||||
"requires": {
|
||||
"pify": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
|
||||
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
|
||||
"requires": {
|
||||
"p-try": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"p-locate": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
|
||||
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
|
||||
"requires": {
|
||||
"p-limit": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"p-try": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
|
||||
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M="
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
|
||||
},
|
||||
"pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
|
||||
},
|
||||
"pkg-up": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz",
|
||||
"integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=",
|
||||
"requires": {
|
||||
"find-up": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
|
||||
"integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ=="
|
||||
},
|
||||
"write-file-atomic": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
|
||||
"integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.11",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -20,5 +20,9 @@
|
||||
],
|
||||
"directories": {
|
||||
"buildResources": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"electron-config": "^2.0.0",
|
||||
"electron-log": "^4.4.4"
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,6 @@
|
||||
"babel-loader": "^8.0.5",
|
||||
"cypress": "^8.3.1",
|
||||
"electron": "^14.0.2",
|
||||
"electron-log": "^4.4.3",
|
||||
"electron-packager": "^15.4.0",
|
||||
"eslint": "^7.24.0",
|
||||
"fork-ts-checker-webpack-plugin": "^6.3.3",
|
||||
|
@ -16,7 +16,4 @@ cp main.css .package/main.css
|
||||
cp dist/vendor.bundle.js .package/dist/vendor.bundle.js
|
||||
cp main.bundle.js .package/main.bundle.js
|
||||
|
||||
# Adding electron-log dependency
|
||||
cp -r node_modules/electron-log .package/node_modules/electron-log
|
||||
|
||||
npm run electron:packager
|
||||
|
Loading…
Reference in New Issue
Block a user