diff options
author | Anthony Wang | 2022-01-12 14:36:59 -0600 |
---|---|---|
committer | Anthony Wang | 2022-01-12 14:36:59 -0600 |
commit | f4d4d16b87272c728a138475659d9c5f67ecd090 (patch) | |
tree | 09241f473287571b3f7bec533b696f85dffe80a2 | |
parent | 63b522b6d23cbeb3aefe5125ef8f489a49266d50 (diff) |
Move SSL to proxy so we don't need sudo for backend
-rw-r--r-- | back/src/server.ts | 6 | ||||
-rw-r--r-- | env | 5 | ||||
-rwxr-xr-x | run | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/back/src/server.ts b/back/src/server.ts index fca32d1..c73162a 100644 --- a/back/src/server.ts +++ b/back/src/server.ts @@ -3,9 +3,9 @@ import http from 'http'; import https from 'https'; import {Server} from 'socket.io'; -// export default new Server({cors: {origin: process.env.ORIGIN, methods: ['GET', 'POST']}}); +export default new Server({cors: {origin: process.env.ORIGIN, methods: ['GET', 'POST']}}); -const base = process.env.SSL_KEY && process.env.SSL_CERT && process.env.SSL_CA ? https.createServer({ +/*const base = process.env.SSL_KEY && process.env.SSL_CERT && process.env.SSL_CA ? https.createServer({ "key": fs.readFileSync(process.env.SSL_KEY), "cert": fs.readFileSync(process.env.SSL_CERT), "ca": fs.readFileSync(process.env.SSL_CA) @@ -14,4 +14,4 @@ base.listen(+process.env.PORT!, '0.0.0.0', () => { console.log(`Listening on port ${process.env.PORT}`); }); -export default new Server(base, {cors: {origin: process.env.ORIGIN, methods: ['GET', 'POST']}}); +export default new Server(base, {cors: {origin: process.env.ORIGIN, methods: ['GET', 'POST']}});*/ @@ -1,6 +1,3 @@ export NEXT_PUBLIC_BACK_HOST='https://server.exozy.me' export ORIGIN="*" -export PORT=6001 -export SSL_KEY=/etc/letsencrypt/live/exozy.me/privkey.pem -export SSL_CERT=/etc/letsencrypt/live/exozy.me/cert.pem -export SSL_CA=/etc/letsencrypt/live/exozy.me/chain.pem +export PORT=6000 @@ -2,4 +2,4 @@ source ./env ./build cd front -npm run start -- -p 5000 | sudo -E node ../back/dist/index.js # sudo hack to read SSL files +npm run start -- -p 5000 | node ../back/dist/index.js |