Skip to content

Commit 74f7ae5

Browse files
Merge pull request #147 from TKOaly/lolasd123
Fixes
2 parents 656c26d + c9c0540 commit 74f7ae5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3204
-753
lines changed

.env.example

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ POSTGRES_PASSWORD=abcd
33
POSTGRES_DB=abcd
44
PORT=4040
55
NODE_ENV=development
6-
JWT_SECRET=nottellingyou
7-
JWT_ADMIN_SECRET=tellingnoone
6+
JWT_SECRET=nottellingyou

.github/workflows/node.yml

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
DB_NAME: rv
5151
DB_PORT: 5432
5252
JWT_SECRET: unsecure1
53-
JWT_ADMIN_SECRET: unsecure2
5453
- name: Generate the code coverage report
5554
uses: codecov/codecov-action@v3
5655
lint:

.vscode/launch.json

+10-34
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,20 @@
77
{
88
"type": "node",
99
"request": "launch",
10-
"name": "Mocha test all",
11-
"runtimeExecutable": "docker-compose",
12-
"runtimeArgs": [
13-
"run",
14-
"-p",
15-
"9229:9229",
16-
"rv-backend",
17-
"node_modules/.bin/mocha",
18-
"--inspect-brk=0.0.0.0:9229",
19-
"--colors",
20-
"--exit",
21-
"test"
22-
],
23-
"port": 9229,
24-
"timeout": 20000,
25-
"remoteRoot": "/usr/src/app",
26-
"localRoot": "${workspaceFolder}"
10+
"name": "Test all",
11+
"runtimeExecutable": "sh",
12+
"runtimeArgs": ["-c", ". test/test.env && node --test test/"],
13+
"localRoot": "${workspaceFolder}",
14+
"console": "integratedTerminal"
2715
},
2816
{
2917
"type": "node",
3018
"request": "launch",
31-
"name": "Mocha test current file",
32-
"runtimeExecutable": "docker-compose",
33-
"runtimeArgs": [
34-
"run",
35-
"-p",
36-
"9229:9229",
37-
"rv-backend",
38-
"node_modules/.bin/mocha",
39-
"--inspect-brk=0.0.0.0:9229",
40-
"--colors",
41-
"--exit",
42-
"${relativeFile}"
43-
],
44-
"port": 9229,
45-
"timeout": 20000,
46-
"remoteRoot": "/usr/src/app",
47-
"localRoot": "${workspaceFolder}"
19+
"name": "Test current file",
20+
"runtimeExecutable": "sh",
21+
"runtimeArgs": ["-c", ". test/test.env && node --test ${relativeFile}"],
22+
"localRoot": "${workspaceFolder}",
23+
"console": "integratedTerminal"
4824
}
4925
]
5026
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ You can use a custom [.env](.env) file to override the environment variables set
138138
| Environment Variable | Description |
139139
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
140140
| POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB | Postgres database configuration |
141-
| JWT_SECRET, JWT_ADMIN_SECRET | Secret keys for signing JWT tokens. **Do not** use default values in production! The security of authentication will depend on this key being kept secret, so treat it accordingly. |
141+
| JWT_SECRET | Secret keys for signing JWT tokens. **Do not** use default values in production! The security of authentication will depend on this key being kept secret, so treat it accordingly. |
142142
| PORT | Port the backend is served at |
143143
| NODE_ENV | Environment for Node, can be one of `development`, `test` or `production`. |
144144

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
- DB_NAME=rv
2020
- DB_PORT=5432
2121
- JWT_SECRET=unsecure1
22-
- JWT_ADMIN_SECRET=unsecure2
22+
- RV_TERMINAL_SECRET=unsecure
2323
volumes:
2424
- ./src:/usr/src/app/src
2525
- ./test:/usr/src/app/test
@@ -31,7 +31,7 @@ services:
3131
ports:
3232
- 127.0.0.1:5432:5432
3333
volumes:
34-
- rv-postgres-data:/var/lib/postgresql/data
34+
- ./data/rv-postgres-data:/var/lib/postgresql/data
3535
- ./db-init-scripts:/docker-entrypoint-initdb.d
3636
environment:
3737
- POSTGRES_USER=rvadmin

knexfile.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const config = {
99
port: process.env.DB_PORT,
1010
},
1111
migrations: {
12-
directory: import.meta.dirname + '/src/db/migrations',
12+
directory: import.meta.dirname + '/built/src/db/migrations',
1313
},
1414
seeds: {
15-
directory: import.meta.dirname + '/src/db/seeds/development',
15+
directory: import.meta.dirname + '/built/src/db/seeds/development',
1616
},
1717
},
1818

@@ -43,10 +43,10 @@ const config = {
4343
port: process.env.DB_PORT,
4444
},
4545
migrations: {
46-
directory: import.meta.dirname + '/src/db/migrations',
46+
directory: import.meta.dirname + '/built/src/db/migrations',
4747
},
4848
seeds: {
49-
directory: import.meta.dirname + '/src/db/seeds/production',
49+
directory: import.meta.dirname + '/built/src/db/seeds/production',
5050
},
5151
},
5252
};

migrate.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#For migration run these commands, tunnel mysql from haba port 3306, after these run knex db-migrate
2+
#git clone [email protected]:dimitri/pgloader.git
3+
#sudo docker build ./pgloader -t pgloader
4+
#sudo docker run -it --network="host" --rm -v ./rv.load:/rv.load pgloader:latest bash

0 commit comments

Comments
 (0)