diff --git a/api/controllers/contacts.ts b/api/controllers/contacts.ts index 8b2b766..d02bbe8 100644 --- a/api/controllers/contacts.ts +++ b/api/controllers/contacts.ts @@ -4,6 +4,7 @@ import * as socket from '../utils/socket' import * as helpers from '../helpers' import * as jsonUtils from '../utils/json' import {success, failure} from '../utils/res' +import password from '../utils/password' const constants = require(__dirname + '/../../config/constants.json') @@ -39,6 +40,16 @@ const generateToken = async (req, res) => { const owner = await models.Contact.findOne({ where: { isOwner: true, authToken: null }}) + const pwd = password + if(process.env.USE_PASSWORD==='true'){ + if(pwd!==req.query.pwd) { + failure(res, 'Wrong Password') + return + } else { + console.log("PASSWORD ACCEPTED!") + } + } + if (owner) { const hash = crypto.createHash('sha256').update(req.body['token']).digest('base64'); @@ -60,14 +71,6 @@ const updateContact = async (req, res) => { const contact = await models.Contact.findOne({ where: { id: req.params.id }}) let shouldUpdateContactKey = (contact.isOwner && contact.contactKey == null && attrs["contact_key"] != null) - - const pwd = process.env.NODE_PASSWORD || '' - if(pwd){ // if NODE_PASSWORD set, needs to set submitted - if(pwd!==req.params['pwd']) { - failure(res, 'Wrong Password') - return - } - } const owner = await contact.update(jsonUtils.jsonToContact(attrs)) success(res, jsonUtils.contactToJson(owner)) diff --git a/api/utils/password.ts b/api/utils/password.ts new file mode 100644 index 0000000..34c9548 --- /dev/null +++ b/api/utils/password.ts @@ -0,0 +1,6 @@ + +import * as crypto from 'crypto' + +const password = crypto.randomBytes(16).toString('hex'); + +export default password diff --git a/api/utils/setup.ts b/api/utils/setup.ts index 05280ea..b684873 100644 --- a/api/utils/setup.ts +++ b/api/utils/setup.ts @@ -3,6 +3,7 @@ import {sequelize, models} from '../models' import { exec } from 'child_process' import * as QRCode from 'qrcode' import * as publicIp from 'public-ip' +import password from '../utils/password' const USER_VERSION = 1 @@ -98,8 +99,8 @@ async function printQR(){ } if(!public_ip) return - const pwd = process.env.NODE_PASSWORD || '' - console.log('pass:',pwd) + const pwd = password||'' + console.log('use password?',process.env.USE_PASSWORD) const b64 = Buffer.from(`ip:${public_ip}:${pwd}`).toString('base64') console.log('=>', b64) diff --git a/dist/api/controllers/contacts.js b/dist/api/controllers/contacts.js index 0476cdd..30a06e0 100644 --- a/dist/api/controllers/contacts.js +++ b/dist/api/controllers/contacts.js @@ -15,6 +15,7 @@ const socket = require("../utils/socket"); const helpers = require("../helpers"); const jsonUtils = require("../utils/json"); const res_1 = require("../utils/res"); +const password_1 = require("../utils/password"); const constants = require(__dirname + '/../../config/constants.json'); const getContacts = (req, res) => __awaiter(void 0, void 0, void 0, function* () { const contacts = yield models_1.models.Contact.findAll({ where: { deleted: false }, raw: true }); @@ -41,6 +42,16 @@ exports.getContacts = getContacts; const generateToken = (req, res) => __awaiter(void 0, void 0, void 0, function* () { console.log('=> generateToken called', { body: req.body, params: req.params, query: req.query }); const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true, authToken: null } }); + const pwd = password_1.default; + if (process.env.USE_PASSWORD === 'true') { + if (pwd !== req.query.pwd) { + res_1.failure(res, 'Wrong Password'); + return; + } + else { + console.log("PASSWORD ACCEPTED!"); + } + } if (owner) { const hash = crypto.createHash('sha256').update(req.body['token']).digest('base64'); console.log("req.params['token']", req.params['token']); @@ -58,13 +69,6 @@ const updateContact = (req, res) => __awaiter(void 0, void 0, void 0, function* let attrs = extractAttrs(req.body); const contact = yield models_1.models.Contact.findOne({ where: { id: req.params.id } }); let shouldUpdateContactKey = (contact.isOwner && contact.contactKey == null && attrs["contact_key"] != null); - const pwd = process.env.NODE_PASSWORD || ''; - if (pwd) { // if NODE_PASSWORD set, needs to set submitted - if (pwd !== req.params['pwd']) { - res_1.failure(res, 'Wrong Password'); - return; - } - } const owner = yield contact.update(jsonUtils.jsonToContact(attrs)); res_1.success(res, jsonUtils.contactToJson(owner)); if (!shouldUpdateContactKey) diff --git a/dist/api/controllers/contacts.js.map b/dist/api/controllers/contacts.js.map index dda9155..81d1a6f 100644 --- a/dist/api/controllers/contacts.js.map +++ b/dist/api/controllers/contacts.js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;SACzC,CAAC,CAAA;KACF;IAED,OAAO,CAAC,eAAe,CAAC;QACvB,aAAa,EAAE,cAAc;QAC7B,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,wBAAwB;KACtD,CAAC,CAAA;AACH,CAAC,CAAA,CAAA;AAoBA,8CAAiB;AAlBlB,MAAM,YAAY,GAAG,IAAI,CAAC,EAAE;IAC3B,IAAI,gBAAgB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAA;IAC/G,IAAI,KAAK,GAAG,EAAE,CAAA;IACd,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC/B,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACnC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;SACtB;IACF,CAAC,CAAC,CAAA;IACF,OAAO,KAAK,CAAA;AACb,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../../api/controllers/contacts.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,0CAAyC;AACzC,sCAAqC;AACrC,2CAA0C;AAC1C,sCAA6C;AAC7C,gDAAwC;AAExC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,8BAA8B,CAAC,CAAA;AAErE,MAAM,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACtC,MAAM,QAAQ,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;IACnF,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,MAAM,CAAC,OAAO,CA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C/B,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACnC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;SACtB;IACF,CAAC,CAAC,CAAA;IACF,OAAO,KAAK,CAAA;AACb,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/api/utils/password.js b/dist/api/utils/password.js new file mode 100644 index 0000000..fa5e8b7 --- /dev/null +++ b/dist/api/utils/password.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto = require("crypto"); +const password = crypto.randomBytes(16).toString('hex'); +exports.default = password; +//# sourceMappingURL=password.js.map \ No newline at end of file diff --git a/dist/api/utils/password.js.map b/dist/api/utils/password.js.map new file mode 100644 index 0000000..c913a16 --- /dev/null +++ b/dist/api/utils/password.js.map @@ -0,0 +1 @@ +{"version":3,"file":"password.js","sourceRoot":"","sources":["../../../api/utils/password.ts"],"names":[],"mappings":";;AACA,iCAAgC;AAEhC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAExD,kBAAe,QAAQ,CAAA"} \ No newline at end of file diff --git a/dist/api/utils/setup.js b/dist/api/utils/setup.js index 2644c76..7b58582 100644 --- a/dist/api/utils/setup.js +++ b/dist/api/utils/setup.js @@ -14,6 +14,7 @@ const models_1 = require("../models"); const child_process_1 = require("child_process"); const QRCode = require("qrcode"); const publicIp = require("public-ip"); +const password_1 = require("../utils/password"); const USER_VERSION = 1; const setupDatabase = () => __awaiter(void 0, void 0, void 0, function* () { console.log('=> [db] starting setup...'); @@ -112,8 +113,8 @@ function printQR() { } if (!public_ip) return; - const pwd = process.env.NODE_PASSWORD || ''; - console.log('pass:', pwd); + const pwd = password_1.default || ''; + console.log('use password?', process.env.USE_PASSWORD); const b64 = Buffer.from(`ip:${public_ip}:${pwd}`).toString('base64'); console.log('=>', b64); console.log('Scan this QR in Sphinx app:'); diff --git a/dist/api/utils/setup.js.map b/dist/api/utils/setup.js.map index d8a1b93..0de028d 100644 --- a/dist/api/utils/setup.js.map +++ b/dist/api/utils/setup.js.map @@ -1 +1 @@ -{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../api/utils/setup.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA2C;AAC3C,sCAA2C;AAC3C,iDAAoC;AACpC,iCAAgC;AAChC,sCAAqC;AAErC,MAAM,YAAY,GAAG,CAAC,CAAA;AAEtB,MAAM,aAAa,GAAG,GAAS,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;IACxC,MAAM,UAAU,EAAE,CAAA;IAClB,IAAI;QACF,MAAM,kBAAS,CAAC,IAAI,EAAE,CAAA;QACtB,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;KACpC;IAAC,OAAM,CAAC,EAAE;QACT,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAC,CAAC,CAAC,CAAA;KAChC;IACD,MAAM,OAAO,EAAE,CAAA;IACf,iBAAiB,EAAE,CAAA;IACnB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AACnC,CAAC,CAAA,CAAA;AAgEQ,sCAAa;AA9DtB,SAAe,UAAU;;QACvB,IAAI;YACF,MAAM,kBAAS,CAAC,KAAK,CAAC,yBAAyB,YAAY,EAAE,CAAC,CAAA;SAC/D;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAC,CAAC,CAAC,CAAA;SACtC;IACH,CAAC;CAAA;AAED,SAAe,OAAO;;QACpB,IAAI;YACF,MAAM,kBAAS,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAA;SACrE;QAAC,OAAM,CAAC,EAAE;YACT,oCAAoC;SACrC;IACH,CAAC;CAAA;AAED,MAAM,iBAAiB,GAAG,GAAS,EAAE;IACnC,MAAM,KAAK,GAAG,MAAM,eAA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,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CAAA;AAzByD,0BAAO"} \ No newline at end of file +{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../api/utils/setup.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA2C;AAC3C,sCAA2C;AAC3C,iDAAoC;AACpC,iCAAgC;AAChC,sCAAqC;AACrC,gDAAwC;AAExC,MAAM,YAAY,GAAG,CAAC,CAAA;AAEtB,MAAM,aAAa,GAAG,GAAS,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;IACxC,MAAM,UAAU,EAAE,CAAA;IAClB,IAAI;QACF,MAAM,kBAAS,CAAC,IAAI,EAAE,CAAA;QACtB,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;KACpC;IAAC,OAAM,CAAC,EAAE;QACT,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAC,CAAC,CAAC,CAAA;KAChC;IACD,MAAM,OAAO,EAAE,CAAA;IACf,iBAAiB,EAAE,CAAA;IACnB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AACnC,CAAC,CAAA,CAAA;AAgEQ,sCAAa;AA9DtB,SAAe,UAAU;;QACvB,IAAI;YACF,MAAM,kBAAS,CAAC,KAAK,CAAC,yBAAyB,YAAY,EAAE,CAAC,CAAA;SAC/D;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAC,CAAC,CAAC,CAAA;SACtC;IACH,CAAC;CAAA;AAED,SAAe,OAAO;;QACpB,IAAI;YACF,MAAM,kBAAS,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAA;SACrE;QAAC,OAAM,CAAC,EAAE;YACT,oCAAoC;SACrC;IACH,CAAC;CAAA;AAED,MAAM,iBAAiB,GAAG,GAAS,EAAE;IACnC,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,E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AAA;AAzByD,0BAAO"} \ No newline at end of file diff --git a/package.json b/package.json index 0c56e6c..e7aa7a4 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "webpack --config webpack.config.js", "frontend": "webpack-dev-server --entry ./frontend.jsx", "start-ts": "ts-node ./app.ts", - "start": "ts-node ./app.ts", + "start": "USE_PASSWORD=true ts-node ./app.ts", "start-hosting": "HOSTING_PROVIDER=true ts-node ./app.ts", "prod": "cp config/app.json dist/config/app.json && cp config/config.json dist/config/config.json && env NODE_ENV=production node dist/app.js", "tsc": "rm -rf dist/ && tsc && cp -r public dist/public",