Skip to content

Commit 86ede73

Browse files
committed
Merge branch 'cookies' into userauth
2 parents 3fe2441 + b7cc0bf commit 86ede73

27 files changed

+815
-776
lines changed

config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import dotenv from 'dotenv';
2+
dotenv.config();
3+
4+
export const POSTGRES_HOST = process.env.POSTGRES_HOST
5+
? process.env.POSTGRES_HOST
6+
: 'localhost';
7+
export const POSTGRES_NAME = process.env.POSTGRES_NAME
8+
? process.env.POSTGRES_NAME
9+
: 'docketeer-db';
10+
export const POSTGRES_PORT = process.env.POSTGRES_PORT
11+
? Number(process.env.POSTGRES_PORT)
12+
: 5432;
13+
export const POSTGRES_USER = process.env.POSTGRES_USER
14+
? process.env.POSTGRES_USER
15+
: 'postgres';
16+
export const POSTGRES_PASS = process.env.POSTGRES_PASS
17+
? process.env.POSTGRES_PASS
18+
: 'postgres';
19+
export const POSTGRES_SERVICE = process.env.POSTGRES_NAME
20+
? process.env.POSTGRES_NAME
21+
: 'db';
22+
export const JWT_SECRET = process.env.JWT_SECRET
23+
? process.env.JWT_SECRET
24+
: 'fced686ad3297c774a7c635cc3d7d33421ec0f557fda29510c6c8b7a95736dc36da9064e1fa6963f0069a29a9c1a62d799ce667dece4f3aafe9449aaed2b2302';
25+
26+
export const DASHBOARD_PORT = process.env.REACT_DASHBOARD_PORT
27+
? Number(process.env.DASHBOARD_PORT)
28+
: 2999;
29+
export const DASHBOARD_UID = process.env.REACT_REACT_DASHBOARD_ORG_ID
30+
? Number(process.env.DASHBOARD_ORG_ID)
31+
: 1;

docker-compose.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ services:
55
image: docketeerx/postgres
66
restart: always
77
ports:
8-
- '${POSTGRES_PORT}:5432'
8+
- 5432:5432
99
volumes:
1010
- ./imageConfigs/postgres/docketeerdb:/var/lib/postgresql/data/
1111

1212
environment:
13-
POSTGRES_DB: ${POSTGRES_NAME}
14-
POSTGRES_USER: ${POSTGRES_USER}
15-
POSTGRES_PASSWORD: ${POSTGRES_PASS}
13+
POSTGRES_DB: docketeer-db
14+
POSTGRES_USER: postgres
15+
POSTGRES_PASSWORD: postgres
1616

1717
cadvisor:
1818
image: gcr.io/cadvisor/cadvisor:v0.47.1
@@ -52,7 +52,8 @@ services:
5252
ports:
5353
- '9090:9090'
5454

55-
#can add volume here to persist the prometheus data.
55+
volumes:
56+
- ./imageConfigs/prometheus/promData:/prometheus
5657
depends_on:
5758
- node-exporter
5859
labels:
@@ -86,5 +87,8 @@ services:
8687
- 4000:4000
8788
volumes:
8889
- /var/run/docker.sock:/var/run/docker.sock
89-
# depends_on:
90-
# - grafana
90+
91+
environment:
92+
POSTGRES_USER: 'postgres'
93+
depends_on:
94+
- db

imageConfigs/postgres/init.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,8 @@ INSERT INTO notification_settings (metric_name, triggering_value) VALUES
6161
('memory', 80),
6262
('cpu', 80),
6363
('stopped', 0);
64+
65+
INSERT INTO roles (role) VALUES
66+
('system admin'),
67+
('admin'),
68+
('user');

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
"@testing-library/user-event": "^14.4.3",
2323
"child_process": "^1.0.2",
2424
"colors": "^1.4.0",
25+
"cookie-parser": "^1.4.6",
2526
"cors": "^2.8.5",
2627
"electron-squirrel-startup": "^1.0.0",
28+
"jsonwebtoken": "^9.0.0",
2729
"os": "^0.1.2",
2830
"os-utils": "^0.0.14",
2931
"pg": "^8.8.0",

server/app.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import express, { NextFunction, Request, Response } from 'express';
22
import cors from 'cors';
3+
import cookieParser from 'cookie-parser';
4+
import { exec } from 'child_process';
35
const app = express();
46
app.use(cors());
5-
const { exec } = require('child_process');
7+
app.use(cookieParser());
68

79
exec(
810
'docker container ls -a --format "table {{.ID}}\t{{.Names}}" | grep docketeerx/docketeer | cut -d" " -f1 | cut -f1 | xargs -I{} docker container restart -t 0 {}',
@@ -16,7 +18,7 @@ exec(
1618
return;
1719
}
1820
console.log(`stdout: ${stdout}`);
19-
}
21+
},
2022
);
2123
// Importing routers...
2224
import accountRouter from './routes/accountRouter';
@@ -64,7 +66,7 @@ app.get(
6466
};
6567
const errorObj: ServerError = Object.assign(defaultErr, err);
6668
return res.status(errorObj.status).json(errorObj.message);
67-
}
69+
},
6870
);
6971

7072
// Exporting app...

server/controllers/apiController.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import nodemailer from 'nodemailer';
88
import email from '../../security/email';
99
import { ApiController, ServerError } from '../../types';
1010

11-
// create transporter object to make sure these values are filled out in email.js
11+
// *** Signup email not currently being used. ***
12+
1213
const transporter = nodemailer.createTransport({
1314
host: email.host,
1415
port: email.port,

0 commit comments

Comments
 (0)