From 46ef00a191cb2c22597585a80f29da3012eee73b Mon Sep 17 00:00:00 2001 From: Sebastian Ruan Date: Wed, 24 Aug 2022 19:57:10 -0400 Subject: [PATCH 1/3] Updated chat room link in docs. --- docs/deployment.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index 8b88771dd..e6bd77414 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -218,7 +218,11 @@ You'd do this for each new file. Please help us out as you go in setting things up by improving the deployment code and documentation! -* General/system-wide issues you come across can go in https://github.com/pol-is/polis-issues/issues, and repo specific issues in their respective issues lists -* PRs improving either documentation or deployment code are welcome, but please submit an issue to discuss before making any substantial code changes -* After you've made an issue, you can try to chat folks up at https://gitter.im/pol-is/polisDeployment +* General/system-wide issues you come across can go in https://github.com/pol-is/polis-issues/issues, and repo specific +issues in their respective issues lists +* PRs improving either documentation or deployment code are welcome, but please submit an issue to discuss before making +any substantial code changes +* After you've made an issue, you can try to chat folks up on Gitter: +https://gitter.im/compdemocracy/polis-dev-chat +* There is also an old Gitter chat room but please do not post here: https://gitter.im/pol-is/polisDeployment From 25852ce353623608770200e42d2b768988b51b99 Mon Sep 17 00:00:00 2001 From: Christopher Small Date: Mon, 29 Aug 2022 14:36:39 -0700 Subject: [PATCH 2/3] Switch gitter channel links for GH discussions Some additional miscellaneous cleanup as well --- docs/deployment.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index e6bd77414..a6ecc8135 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -79,11 +79,6 @@ It is NOT suited for production, but it may be in the future. [arch-image]: docker-architecture.png [arch-edit]: https://www.draw.io/#R7Vpdb5swFP01ecyEDQTy2rRrHjapUzqt3ZsHLngjGDkmkP36mWBCwCRjKHxUWh8qfP19ju%2Fx9W1n%2BmqbPjIU%2BZ%2Bpi4MZ1Nx0pt%2FPIFzqlvidGQ65wVhoucFjxM1NoDRs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w%3D%3D -:tada: Contributors to Docker support: -- [@uzzal2k5](https://github.com/uzzal2k5) via [`uzzal2k5/polis_container`](https://github.com/uzzal2k5/polis_container) -- [@crkrenn](https://github.com/crkrenn) & [@david-nadaraia](https://github.com/david-nadaraia) -- [@patcon](https://github.com/patcon) -- [@ballPointPenguin](https://github.com/ballPointPenguin) ## Enabling Comment Translation @@ -218,11 +213,6 @@ You'd do this for each new file. Please help us out as you go in setting things up by improving the deployment code and documentation! -* General/system-wide issues you come across can go in https://github.com/pol-is/polis-issues/issues, and repo specific -issues in their respective issues lists -* PRs improving either documentation or deployment code are welcome, but please submit an issue to discuss before making -any substantial code changes -* After you've made an issue, you can try to chat folks up on Gitter: -https://gitter.im/compdemocracy/polis-dev-chat -* There is also an old Gitter chat room but please do not post here: https://gitter.im/pol-is/polisDeployment - +* Well definted technical issues can go in https://github.com/compdemocracy/polis/issues, but please check to make sure you aren't submitting a duplicate issue +* PRs improving either documentation or deployment code are welcome, but please submit an issue to discuss before making any substantial code changes +* Questions about usage can go in https://github.com/compdemocracy/polis/discussions. From 7185c8251e6cdf38b627dab8adf393c0d4e8323f Mon Sep 17 00:00:00 2001 From: Sebastian Ruan Date: Wed, 31 Aug 2022 17:27:08 -0400 Subject: [PATCH 3/3] Fixed: TypeScript linenumbers on server stacktraces --- server/package-lock.json | 13 +++++++++++-- server/package.json | 5 +++-- server/src/config.ts | 3 ++- server/src/server.ts | 2 +- server/tsconfig.json | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/server/package-lock.json b/server/package-lock.json index 751c7c813..f23b3bf61 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -5058,8 +5058,17 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } }, "split": { "version": "1.0.1", diff --git a/server/package.json b/server/package.json index ebd124b86..45bf8f1ba 100644 --- a/server/package.json +++ b/server/package.json @@ -81,8 +81,9 @@ "@types/response-time": "^2.3.4", "@types/underscore": "^1.11.1", "@types/valid-url": "^1.0.3", + "nodemon": "^2.0.7", "prettier": "^2.2.1", - "typescript": "^4.2.4", - "nodemon": "^2.0.7" + "source-map-support": "^0.5.21", + "typescript": "^4.2.4" } } diff --git a/server/src/config.ts b/server/src/config.ts index fd8f64043..96d1346ee 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -1,6 +1,7 @@ import boolean from "boolean"; const devMode = boolean(get('DEV_MODE')); - +/* Do NOT use source-map-support in production as it uses the non-standard stack property of Errors */ +if(devMode) { require('source-map-support').install(); } const domainOverride = process.env.DOMAIN_OVERRIDE || null; function getServerNameWithProtocol(req: any) { diff --git a/server/src/server.ts b/server/src/server.ts index a56c03c04..80561f161 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -39,12 +39,12 @@ import _ from "underscore"; import { WebClient } from "@slack/client"; import pg from "pg"; +import Config from "./config"; import { METRICS_IN_RAM, addInRamMetric, MPromise } from "./utils/metered"; import CreateUser from "./auth/create-user"; import Password from "./auth/password"; import dbPgQuery from "./db/pg-query"; -import Config from "./config"; // Re-import disassembled code to promise existing code will work import Log from "./log"; diff --git a/server/tsconfig.json b/server/tsconfig.json index 61ac8a8e3..ca862e2ab 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -12,7 +12,7 @@ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./dist/app.js" /* Concatenate and emit output to single file. */, "outDir": "./dist" /* Redirect output structure to the directory. */, "rootDir": "./" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,