Compare commits

...

95 Commits

Author SHA1 Message Date
Anthony M
49bf529ea1
fix NODE_ENV port priority (#356) 2023-05-26 19:52:26 +02:00
Milos Vetesnik
b6547a66d7
Maielo/upgrade socket io (#355)
* added cors to env dev

* updated socket.io

* tweaked pm2 configs

* tweaked readme

* slight refactor of index

* removed types for socket.io as it is part of main package

* clean up and setting default ports
2023-05-16 14:35:29 +02:00
Aakansha Doshi
c0bf0ba76c
fix: update port to 3002 to avoid conflict with excalidraw local setup (#305) 2022-01-11 18:39:40 +05:30
dwelle
c3ea2431cb fix lint 2021-10-28 16:27:21 +02:00
dwelle
89ff6477f7 update readme 2021-10-28 15:55:46 +02:00
dwelle
c07fcccc69 use yarn 2021-10-28 15:55:42 +02:00
dwelle
1db3508386 set NODE_ENV in dev and bump ts-node-dev 2021-10-28 15:41:23 +02:00
Maielo
0ce66b4d52 [dev] updated git ignore 2021-10-17 22:33:32 +02:00
Maielo
193cfcc412 [feat] added pm2 configs & .env for port 2021-10-17 22:31:14 +02:00
dependabot[bot]
8ab964590d
Bump typescript from 4.2.2 to 4.2.3 (#177)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.2...v4.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-12 15:28:03 +02:00
dependabot[bot]
a0232caac3
Bump @excalidraw/eslint-config from 1.0.0 to 1.0.1 (#178)
Bumps [@excalidraw/eslint-config](https://github.com/excalidraw/eslint-config) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/excalidraw/eslint-config/releases)
- [Commits](https://github.com/excalidraw/eslint-config/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-12 15:27:55 +02:00
Lipis
c0eeac3feb
feat: Add ESLint (#176) 2021-03-03 10:25:30 +02:00
dependabot[bot]
cbda52be05
Bump @excalidraw/prettier-config from 1.0.1 to 1.0.2 (#175)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 10:23:00 +02:00
Panayiotis Lipiridis
64f5aa5ac0 Lock 2021-02-27 12:50:05 +02:00
Panayiotis Lipiridis
637e0df159 Use @excalidraw/prettier-config 2021-02-25 14:01:49 +02:00
dependabot[bot]
e55bdd93d5
Bump @types/node from 14.14.28 to 14.14.31 (#171)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.28 to 14.14.31.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-25 13:59:07 +02:00
dependabot[bot]
f2bad1f8a8
Bump @types/node from 14.14.25 to 14.14.28 (#170)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.25 to 14.14.28.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 12:49:32 +02:00
dependabot[bot]
8a98340552
Bump typescript from 4.1.3 to 4.1.5 (#169)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.3 to 4.1.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.3...v4.1.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 12:49:24 +02:00
dependabot[bot]
a7c9c35a3c
Bump @types/node from 14.14.22 to 14.14.25 (#168)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.22 to 14.14.25.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-09 16:00:17 +02:00
Panayiotis Lipiridis
5b174809e6 const 2021-02-07 13:47:01 +02:00
Lipis
2d8d11e706
feat: Add ts-node-dev (#166) 2021-02-07 13:44:57 +02:00
Lipis
ed1862dab8
Add test images (#165) 2021-02-07 11:18:30 +02:00
Lipis
fc6f1f5228
Revert "Bump socket.io from 2.3.0 to 2.4.0" (#163)
This reverts commit adc27425d4519342063ac5f4154df954bea05d96.
2021-02-05 00:27:36 +02:00
dependabot[bot]
adc27425d4
Bump socket.io from 2.3.0 to 2.4.0 (#162)
Bumps [socket.io](https://github.com/socketio/socket.io) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/2.4.0/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/2.3.0...2.4.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-04 23:29:05 +02:00
dependabot[bot]
ddd05855a2
Bump @types/node from 14.14.21 to 14.14.22 (#160)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.21 to 14.14.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-28 02:07:30 +02:00
Panayiotis Lipiridis
eadbf5e0a5 Update readme and prettier 2021-01-19 13:25:36 +02:00
Panayiotis Lipiridis
e4626960ad Test and build 2021-01-19 01:24:57 +02:00
Panayiotis Lipiridis
073c12197d Remove comments 2021-01-19 01:20:09 +02:00
Panayiotis Lipiridis
1a63db89f2 Clean up 2021-01-19 01:19:39 +02:00
Panayiotis Lipiridis
c1651aea2d lock 2021-01-19 00:33:23 +02:00
Lipis
a0d2a5b82a
GitHub actions and some cleanup (#158) 2021-01-19 00:31:56 +02:00
dependabot[bot]
c6b867d888
Bump typescript from 3.9.5 to 4.1.3 (#153)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.5 to 4.1.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.5...v4.1.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 22:43:11 +02:00
Lipis
f977554cb7
Revert "Bump @types/socket.io from 2.1.4 to 2.1.12" (#156)
This reverts commit 2c6829ec350cc51fad14b4d8f331299e270112c5.
2021-01-18 22:41:52 +02:00
dependabot[bot]
2c6829ec35
Bump @types/socket.io from 2.1.4 to 2.1.12 (#155)
Bumps [@types/socket.io](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/socket.io) from 2.1.4 to 2.1.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/socket.io)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 22:40:16 +02:00
dependabot[bot]
dc7be43a17
Bump eslint-plugin-prettier from 3.1.4 to 3.3.1 (#151)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.1.4 to 3.3.1.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v3.1.4...v3.3.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 22:37:48 +02:00
dependabot[bot]
528be0daad
Bump @types/express from 4.17.6 to 4.17.11 (#154)
Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.6 to 4.17.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 22:37:27 +02:00
Lipis
7c0077297a
Update dependabot.yml 2021-01-18 22:34:20 +02:00
Lipis
8735e79948
Create dependabot.yml 2021-01-18 22:33:00 +02:00
dependabot[bot]
6b120dfa9c
Bump lodash from 4.17.15 to 4.17.20 (#150)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.20.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.20)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 22:22:59 +02:00
dependabot-preview[bot]
c9893af409
Bump prettier from 2.0.5 to 2.2.1 (#139)
Bumps [prettier](https://github.com/prettier/prettier) from 2.0.5 to 2.2.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.0.5...2.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-18 22:22:25 +02:00
dependabot-preview[bot]
b341513c3e
Bump debug from 4.1.1 to 4.3.1 (#133)
Bumps [debug](https://github.com/visionmedia/debug) from 4.1.1 to 4.3.1.
- [Release notes](https://github.com/visionmedia/debug/releases)
- [Commits](https://github.com/visionmedia/debug/compare/4.1.1...4.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-18 22:22:16 +02:00
dependabot-preview[bot]
21377392e1
[Security] Bump lodash from 4.17.15 to 4.17.20 (#117)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.20. **This update includes security fixes.**
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-18 22:21:58 +02:00
dependabot-preview[bot]
95761911e3
Bump @types/node from 13.9.8 to 14.14.12 (#146)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.9.8 to 14.14.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-18 22:21:39 +02:00
dependabot-preview[bot]
fc9d626899
Bump eslint-config-prettier from 6.10.1 to 7.0.0 (#142)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.10.1 to 7.0.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.10.1...v7.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-18 22:21:30 +02:00
David Luzar
dda25d7920
Merge pull request #149 from excalidraw/fix_cors 2021-01-14 14:29:59 +01:00
dwelle
1cc554339d fix lint 2021-01-14 12:23:07 +01:00
dwelle
1de26f690b fallback to excalidraw.com if no origin header present 2021-01-14 12:22:52 +01:00
dwelle
c970c74a2b fix: ensure non-* CORS origin header is set if no req headers sent 2021-01-14 12:10:45 +01:00
David Luzar
cc4a6ce1b9
Merge pull request #148 from excalidraw/add_root 2020-12-28 12:38:27 +01:00
David Luzar
480c9ff00a
Update src/index.ts
Co-authored-by: Lipis <lipiridis@gmail.com>
2020-12-28 12:37:47 +01:00
David Luzar
dba4e6e137
Update src/index.ts 2020-12-28 12:37:32 +01:00
dwelle
2374d0956d add root route 2020-12-28 12:36:46 +01:00
Christopher Chedeau
5f9fa61b3e
Merge pull request #113 from excalidraw/revert_to_right
Revert to 35314725, a version that works
2020-10-21 16:40:27 -07:00
Christopher Chedeau
a0b69ee474 Revert to 35314725, a version that works 2020-10-21 16:39:51 -07:00
Christopher Chedeau
8887424e73
Merge pull request #112 from excalidraw/revert-71-docker
Revert "Containerise socket server"
2020-10-21 16:36:21 -07:00
Christopher Chedeau
97da2adc7f
Revert "Containerise socket server" 2020-10-21 16:36:06 -07:00
Christopher Chedeau
4eaa422e4a
Merge pull request #111 from excalidraw/revert-109-bugfix/preflight_request
Revert "Bugfix: fix typescript issues"
2020-10-21 16:34:05 -07:00
Christopher Chedeau
a705e631b5
Revert "Bugfix: fix typescript issues" 2020-10-21 16:33:47 -07:00
David Luzar
4cf53f1d55
Merge pull request #109 from asvinours/bugfix/preflight_request 2020-10-21 16:12:37 +02:00
Fabrice Baumann
8ad980912d Remove optional message 2020-10-19 19:53:02 -04:00
Fabrice Baumann
3a67db8891 Bugfix: fix typescript issues 2020-10-19 19:46:59 -04:00
dependabot-preview[bot]
408cac825f
Bump typescript from 3.9.5 to 4.0.2 (#86)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.5 to 4.0.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.5...v4.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-21 21:03:20 +03:00
dependabot-preview[bot]
a2960b4dbd
[Security] Bump lodash from 4.17.15 to 4.17.20 (#83)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.20. **This update includes security fixes.**
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-21 21:03:08 +03:00
dependabot-preview[bot]
2f5bc3beed
Bump @types/socket.io from 2.1.4 to 2.1.11 (#82)
Bumps [@types/socket.io](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/socket.io) from 2.1.4 to 2.1.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/socket.io)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-21 21:03:03 +03:00
dependabot-preview[bot]
d6a61bb4f8
Bump @types/express from 4.17.6 to 4.17.7 (#64)
Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.6 to 4.17.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-21 21:02:57 +03:00
dependabot-preview[bot]
40cf68049c
Bump eslint-config-prettier from 6.10.1 to 6.11.0 (#38)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.10.1 to 6.11.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.10.1...v6.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-21 21:02:51 +03:00
Kostas Bariotis
35314725c4
Merge pull request #71 from NMinhNguyen/docker
Containerise socket server
2020-07-29 18:58:42 +01:00
Minh Nguyen
a859638b72 Remove postinstall 2020-07-17 00:29:49 +01:00
Minh Nguyen
9d4a5b900c Add publish Docker GitHub action 2020-07-16 20:59:52 +01:00
Minh Nguyen
425fb98d70 Expand comment about postinstall 2020-07-14 23:31:12 +01:00
Minh Nguyen
1a38ad9166 Use Node 12 image 2020-07-14 22:03:25 +01:00
Minh Nguyen
0e1c9cb583 Containerise socket server
See https://github.com/excalidraw/excalidraw/issues/1772#issuecomment-652043326
2020-07-14 13:40:32 +01:00
dependabot-preview[bot]
30ca342490
Bump prettier from 1.19.1 to 2.0.5 (#36)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
2020-06-25 18:33:46 +03:00
dependabot-preview[bot]
78ed62d438
Bump eslint-plugin-prettier from 3.1.2 to 3.1.4 (#58)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-25 18:31:16 +03:00
dependabot-preview[bot]
b9c755b09d
Bump typescript from 3.8.3 to 3.9.5 (#53)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.8.3 to 3.9.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.8.3...v3.9.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-25 18:31:05 +03:00
dependabot-preview[bot]
d2c9169f61
Bump eslint from 6.8.0 to 7.3.1 (#60)
Bumps [eslint](https://github.com/eslint/eslint) from 6.8.0 to 7.3.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v6.8.0...v7.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-25 18:30:46 +03:00
dependabot-preview[bot]
4fabc315f2
Bump @types/express from 4.17.4 to 4.17.6 (#32)
Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.4 to 4.17.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-25 18:30:33 +03:00
Lipis
8b2e3d3885
Check lint on master as well (#26) 2020-04-01 11:25:44 +03:00
dependabot-preview[bot]
e442aed741
Bump @types/node from 13.9.4 to 13.9.8 (#24)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.9.4 to 13.9.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-01 11:25:29 +03:00
dependabot-preview[bot]
c4ba42c491
Bump @types/express from 4.17.3 to 4.17.4 (#25)
Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.3 to 4.17.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-01 11:21:39 +03:00
dependabot-preview[bot]
40b7c43bf3
Bump eslint-config-prettier from 6.10.0 to 6.10.1 (#17)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.10.0 to 6.10.1.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.10.0...v6.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-25 12:38:41 +02:00
dependabot-preview[bot]
c3d9fd2ffb
Bump @types/node from 13.9.0 to 13.9.4 (#22)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.9.0 to 13.9.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-25 12:38:29 +02:00
Edwin Lin
7b85440c88
Merge pull request #16 from idlewinn/master
enable volatile broadcasts
2020-03-21 17:20:54 -07:00
idlewinn
2a680dff53 pin dependency versions 2020-03-16 23:41:51 -07:00
idlewinn
230ccd1baf add debug library and replace console.logs 2020-03-15 19:10:43 -07:00
idlewinn
c39832dc2c lint 2020-03-15 04:23:26 -07:00
idlewinn
bac40c1c04 enable volatile broadcasts 2020-03-15 04:18:26 -07:00
Edwin Lin
96e0e6ca32
Merge pull request #15 from idlewinn/master
Switch back to yarn, add in prettier linting
2020-03-15 04:00:35 -07:00
idlewinn
d5ad770446 Switch back to yarn, add in prettier linting 2020-03-15 03:50:51 -07:00
Edwin Lin
e263722dde
Merge pull request #5 from excalidraw/emit_client_disconnection
emit event with disconnected client id
2020-03-12 12:18:36 -07:00
dwelle
af0904ccfa rewrite user-count and disconnect events 2020-03-12 12:17:31 +01:00
Edwin Lin
ff9e761fe3
Merge pull request #11 from idlewinn/master
Update to current production version supporting excalidraw.com (loade…
2020-03-12 02:57:17 -07:00
idlewinn
98e8500a6f Merge branch 'idlewinn-master' 2020-03-11 17:26:02 -07:00
idlewinn
7d17be5983 Update to current production version supporting excalidraw.com (loaded on Heroku) 2020-03-11 17:24:24 -07:00
idlewinn
290c0a1e3a Update to current production version supporting excalidraw.com (loaded on Heroku) 2020-03-11 16:36:28 -07:00
22 changed files with 1420 additions and 985 deletions

2
.env.development Normal file
View File

@ -0,0 +1,2 @@
PORT=
CORS_ORIGIN=

3
.eslintrc.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "@excalidraw/eslint-config"
}

View File

@ -1,5 +0,0 @@
# Exclude compiled .js files
*.js
# Exclude dependencies
node_modules/

8
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: sunday
time: "01:00"

View File

@ -1,20 +1,18 @@
name: Lint name: Lint
on: pull_request on:
push:
jobs: jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Setup Node.js 14.x
- name: Setup Node.js 12.x
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 12.x node-version: 14.x
- name: Install dependencies
- name: Install and lint run: yarn --frozen-lockfile
run: | - name: Lint
yarn run: yarn test:other
yarn lint

19
.github/workflows/publish-docker.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Publish Docker
on:
push:
branches:
- master
jobs:
publish-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: excalidraw/excalidraw-room
tag_with_ref: true
tag_with_sha: true

20
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Test & Build
on:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Test and Build
run: |
yarn test:code
yarn build

111
.gitignore vendored
View File

@ -1,3 +1,108 @@
*.js # Logs
node_modules logs
yarn-error.log *.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
.env.production
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
.DS_Store
dist

View File

@ -1 +0,0 @@
{}

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM node:12-alpine
WORKDIR /excalidraw-room
COPY package.json yarn.lock ./
RUN yarn
COPY tsconfig.json ./
COPY src ./src
RUN yarn build
EXPOSE 80
CMD ["yarn", "start"]

47
README.md Normal file → Executable file
View File

@ -1,32 +1,27 @@
# excalidraw-room # Example of excalidraw collaboration server
## Requirements Collaboration server for Excalidraw
- [Node.js](https://nodejs.org/en/) If you need to use cluster mode with pm2. Checkout: https://socket.io/docs/v4/pm2/
- [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en_US)
## Install If you are not familiar with pm2: https://pm2.keymetrics.io/docs/usage/quick-start/
# Development
- install
```sh
yarn
```
- run development server
```sh
yarn start:dev
```
# Start with pm2
``` ```
yarn pm2 start pm2.production.json
```
## Build
```
yarn build
```
## Run
```
yarn start
```
## Deploy
Make sure you have access to the [`excalidraw-room`](https://console.cloud.google.com/home/dashboard?project=excalidraw-room) project.
```
yarn deploy
``` ```

View File

@ -1,2 +0,0 @@
runtime: nodejs
env: flex

View File

@ -1,70 +0,0 @@
// source: https://github.com/idlewinn/collab-server/blob/master/src/index.ts
import express from "express";
import http from "http";
import socketIO from "socket.io";
const app = express();
const port = process.env.PORT || 8080;
app.get("/", (req, res) => {
res.send("Hi, excalidraw-room!");
});
const server = http.createServer(app);
server.listen(port, () => {
console.log(`listening on port: ${port}`);
});
const io = socketIO(server, {
handlePreflightRequest: function(req, res) {
var headers = {
"Access-Control-Allow-Headers": "Content-Type, Authorization",
"Access-Control-Allow-Origin": req.header ? req.header.origin : "*",
"Access-Control-Allow-Credentials": true
};
res.writeHead(200, headers);
res.end();
}
});
io.on("connection", socket => {
console.log("connection established!");
io.to(`${socket.id}`).emit("init-room");
socket.on("join-room", roomID => {
console.log(`${socket.id} has joined ${roomID}`);
socket.join(roomID);
if (io.sockets.adapter.rooms[roomID].length <= 1) {
io.to(`${socket.id}`).emit("first-in-room");
} else {
socket.broadcast.to(roomID).emit("new-user", socket.id);
}
io.in(roomID).emit(
"room-user-count",
io.sockets.adapter.rooms[roomID].length
);
});
socket.on(
"server-broadcast",
(roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
console.log(`${socket.id} sends update to ${roomID}`);
socket.broadcast.to(roomID).emit("client-broadcast", encryptedData, iv);
}
);
socket.on("disconnecting", () => {
const rooms = io.sockets.adapter.rooms;
for (const roomID in socket.rooms) {
const remaining = rooms[roomID].length - 1;
if (remaining > 0) {
socket.broadcast.to(roomID).emit("room-user-count", remaining);
}
}
});
socket.on("disconnect", () => {
socket.removeAllListeners();
});
});

View File

@ -1,41 +1,39 @@
{ {
"dependencies": { "dependencies": {
"@types/express": "4.17.3", "@excalidraw/eslint-config": "1.0.1",
"@types/node": "13.9.0", "@excalidraw/prettier-config": "1.0.2",
"@types/socket.io": "2.1.4", "@types/debug": "4.1.5",
"@types/express": "4.17.11",
"@types/node": "14.14.31",
"@typescript-eslint/eslint-plugin": "4.16.1",
"@typescript-eslint/parser": "4.16.1",
"cross-env": "^7.0.3",
"debug": "4.3.1",
"dotenv": "^10.0.0",
"eslint": "7.21.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-prettier": "3.3.1",
"express": "4.17.1", "express": "4.17.1",
"socket.io": "2.3.0", "prettier": "2.2.1",
"typescript": "3.8.3" "socket.io": "^4.6.1",
}, "ts-node-dev": "^1.1.8",
"devDependencies": { "typescript": "4.2.3"
"husky": "4.2.3",
"lint-staged": "10.0.8",
"prettier": "1.19.1"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}, },
"license": "MIT", "license": "MIT",
"lint-staged": { "main": "dist/index.js",
"*.{ts,md,json,yaml,yml}": [ "name": "excalidraw-portal",
"prettier --write" "prettier": "@excalidraw/prettier-config",
]
},
"main": "index.js",
"name": "excalidraw-room",
"scripts": { "scripts": {
"build": "yarn gcp-build", "build": "tsc",
"deploy": "gcloud app deploy --project=excalidraw-room", "fix:code": "yarn test:code --fix",
"fix": "yarn prettier --write", "fix:other": "yarn prettier --write",
"gcp-build": "tsc -p .", "fix": "yarn fix:other && yarn fix:code",
"lint": "yarn prettier --list-different", "prettier": "prettier . --ignore-path=.gitignore",
"prepare": "yarn gcp-build", "start": "node dist/index.js",
"pretest": "yarn gcp-build", "start:dev": "cross-env NODE_ENV=development ts-node-dev --respawn --transpile-only src/index.ts",
"prettier": "prettier \"**/*.{ts,md,json,yaml,yml}\"", "test:code": "eslint --ext .ts .",
"start": "node ./index.js", "test:other": "yarn prettier --list-different",
"test": "yarn lint" "test": "yarn test:other && yarn test:code"
}, },
"version": "1.0.0" "version": "1.0.0"
} }

14
pm2.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "excalidraw-collab-dev",
"script": "./dist/index.js",
"watch": ["src/"],
"ignore_watch": ["node_modules", "public"],
"autorestart": false,
"exec_mode": "fork_mode",
"instances": 1,
"env": {
"NODE_ENV": "development",
"TZ": "Europe/London"
},
"node_args": ["--inspect=127.0.0.1:9320"]
}

15
pm2.production.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "excalidraw-collab",
"script": "./dist/index.js",
"ignore_watch": ["node_modules", "public"],
"max_memory_restart": "4G",
"watch": false,
"wait_ready": true,
"log_date_format": "YYYY-MM-DD HH:mm Z",
"autorestart": true,
"exec_mode": "fork_mode",
"instances": 1,
"env": {
"NODE_ENV": "production"
}
}

BIN
public/test128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
public/test256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
public/test64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

104
src/index.ts Executable file
View File

@ -0,0 +1,104 @@
import debug from "debug";
import express from "express";
import http from "http";
import { Server as SocketIO } from "socket.io";
const serverDebug = debug("server");
const ioDebug = debug("io");
const socketDebug = debug("socket");
require("dotenv").config(
process.env.NODE_ENV !== "development"
? { path: ".env.production" }
: { path: ".env.development" },
);
const app = express();
const port =
process.env.PORT || (process.env.NODE_ENV !== "development" ? 80 : 3002); // default port to listen
app.use(express.static("public"));
app.get("/", (req, res) => {
res.send("Excalidraw collaboration server is up :)");
});
const server = http.createServer(app);
server.listen(port, () => {
serverDebug(`listening on port: ${port}`);
});
try {
const io = new SocketIO(server, {
transports: ["websocket", "polling"],
cors: {
allowedHeaders: ["Content-Type", "Authorization"],
origin: process.env.CORS_ORIGIN || "*",
credentials: true,
},
allowEIO3: true,
});
io.on("connection", (socket) => {
ioDebug("connection established!");
io.to(`${socket.id}`).emit("init-room");
socket.on("join-room", async (roomID) => {
socketDebug(`${socket.id} has joined ${roomID}`);
await socket.join(roomID);
const sockets = await io.in(roomID).fetchSockets();
if (sockets.length <= 1) {
io.to(`${socket.id}`).emit("first-in-room");
} else {
socketDebug(`${socket.id} new-user emitted to room ${roomID}`);
socket.broadcast.to(roomID).emit("new-user", socket.id);
}
io.in(roomID).emit(
"room-user-change",
sockets.map((socket) => socket.id),
);
});
socket.on(
"server-broadcast",
(roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
socketDebug(`${socket.id} sends update to ${roomID}`);
socket.broadcast.to(roomID).emit("client-broadcast", encryptedData, iv);
},
);
socket.on(
"server-volatile-broadcast",
(roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
socketDebug(`${socket.id} sends volatile update to ${roomID}`);
socket.volatile.broadcast
.to(roomID)
.emit("client-broadcast", encryptedData, iv);
},
);
socket.on("disconnecting", async () => {
socketDebug(`${socket.id} has disconnected`);
for (const roomID in socket.rooms) {
const otherClients = (await io.in(roomID).fetchSockets()).filter(
(_socket) => _socket.id !== socket.id,
);
if (otherClients.length > 0) {
socket.broadcast.to(roomID).emit(
"room-user-change",
otherClients.map((socket) => socket.id),
);
}
}
});
socket.on("disconnect", () => {
socket.removeAllListeners();
socket.disconnect();
});
});
} catch (error) {
console.error(error);
}

14
tsconfig.json Normal file → Executable file
View File

@ -1,8 +1,16 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true, "esModuleInterop": true,
"module": "CommonJS" "allowSyntheticDefaultImports": true,
}, "strict": true,
"include": ["*.ts"] "forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"outDir": "dist"
}
} }

1877
yarn.lock

File diff suppressed because it is too large Load Diff