chore: cleanup testing code

This commit is contained in:
Nicolas Meienberger 2022-09-01 13:33:45 +02:00
parent 4cb2462dfb
commit f0607b5db0
13 changed files with 30 additions and 63 deletions

View file

@ -3,7 +3,8 @@ FROM alpine:3.16.0 as app
WORKDIR /
# Install dependencies
RUN apk --no-cache add docker-compose nodejs npm bash g++ make git
RUN apk --no-cache add docker-compose nodejs npm bash git
RUN npm install node-gyp -g
WORKDIR /api

View file

@ -3,7 +3,7 @@ FROM alpine:3.16.0 as app
WORKDIR /
# Install docker
RUN apk --no-cache add docker-compose nodejs npm bash g++ make git
RUN apk --no-cache add docker-compose nodejs npm bash git
RUN npm install node-gyp -g

View file

@ -1,20 +1,6 @@
version: "3.7"
services:
reverse-proxy:
container_name: reverse-proxy
image: traefik:v2.8
restart: always
ports:
- ${NGINX_PORT-80}:80
- ${PROXY_PORT-8080}:8080
command: --api.insecure=true --providers.docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/traefik:/root/.config
networks:
- tipi_main_network
tipi-db:
container_name: tipi-db
image: postgres:latest
@ -67,12 +53,6 @@ services:
APPS_REPO_URL: ${APPS_REPO_URL}
networks:
- tipi_main_network
# labels:
# traefik.enable: true
# traefik.http.routers.api.rule: PathPrefix("/api") # Host(`tipi.local`) &&
# traefik.http.routers.api.entrypoints: webinsecure
# traefik.http.routers.api.service: api
# traefik.http.services.api.loadbalancer.server.port: 3001
dashboard:
build:
@ -90,12 +70,6 @@ services:
- ${PWD}/packages/dashboard/src:/dashboard/src
# - /dashboard/node_modules
# - /dashboard/.next
labels:
traefik.enable: true
traefik.http.routers.dashboard.rule: PathPrefix("/") # Host(`tipi.local`) &&
traefik.http.routers.dashboard.entrypoints: web
traefik.http.routers.dashboard.service: dashboard
traefik.http.services.dashboard.loadbalancer.server.port: 3000
networks:
tipi_main_network:

View file

@ -7,8 +7,8 @@ services:
restart: always
ports:
- ${NGINX_PORT-80}:80
- ${PROXY_PORT-8080}:8080
command: --api.insecure=true --providers.docker
- ${NGINX_PORT_SSL-443}:443
command: --providers.docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/traefik:/root/.config

View file

@ -7,8 +7,8 @@ services:
restart: always
ports:
- ${NGINX_PORT-80}:80
- ${PROXY_PORT-8080}:8080
command: --api.insecure=true --providers.docker
- ${NGINX_PORT_SSL-443}:443
command: --providers.docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/traefik:/root/.config

View file

@ -27,7 +27,7 @@
"dependencies": {
"apollo-server-core": "^3.10.0",
"apollo-server-express": "^3.9.0",
"argon2": "^0.28.5",
"argon2": "^0.29.1",
"axios": "^0.26.1",
"class-validator": "^0.13.2",
"compression": "^1.7.4",

View file

@ -1,15 +1,17 @@
import session from 'express-session';
import config from '../../config';
import SessionFileStore from 'session-file-store';
import { COOKIE_MAX_AGE } from '../../config/constants/constants';
import { COOKIE_MAX_AGE, __prod__ } from '../../config/constants/constants';
const getSessionMiddleware = () => {
const FileStore = SessionFileStore(session);
const sameSite = __prod__ ? 'lax' : 'none';
return session({
name: 'qid',
store: new FileStore(),
cookie: { maxAge: COOKIE_MAX_AGE, secure: false, sameSite: 'lax', httpOnly: true },
cookie: { maxAge: COOKIE_MAX_AGE, secure: false, sameSite, httpOnly: true },
secret: config.JWT_SECRET,
resave: false,
saveUninitialized: false,

View file

@ -33,7 +33,12 @@ let corsOptions = __prod__
return callback(new Error(message), false);
},
}
: {};
: {
credential: true,
origin: function (origin: any, callback: any) {
return callback(null, true);
},
};
const main = async () => {
try {

View file

@ -149,7 +149,7 @@ importers:
'@typescript-eslint/parser': ^5.22.0
apollo-server-core: ^3.10.0
apollo-server-express: ^3.9.0
argon2: ^0.28.5
argon2: ^0.29.1
axios: ^0.26.1
class-validator: ^0.13.2
compression: ^1.7.4
@ -195,7 +195,7 @@ importers:
dependencies:
apollo-server-core: 3.10.0_graphql@15.8.0
apollo-server-express: 3.9.0_jfj6k5cqxqbusbdzwqjdzioxzm
argon2: 0.28.5
argon2: 0.29.1
axios: 0.26.1
class-validator: 0.13.2
compression: 1.7.4
@ -4629,14 +4629,14 @@ packages:
resolution: {integrity: sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA==}
dev: true
/argon2/0.28.5:
resolution: {integrity: sha512-kGFCctzc3VWmR1aCOYjNgvoTmVF5uVBUtWlXCKKO54d1K+31zRz45KAcDIqMo2746ozv/52d25nfEekitaXP0w==}
engines: {node: '>=12.0.0'}
/argon2/0.29.1:
resolution: {integrity: sha512-bWXzAsQA0B6EFWZh5li+YBk+muoknAb8KacAi1h/bC6Gigy9p5ANbrPvpnjTIb7i9I11/8Df6FeSxpJDK3vy4g==}
engines: {node: '>=14.0.0'}
requiresBuild: true
dependencies:
'@mapbox/node-pre-gyp': 1.0.9
'@phc/format': 1.0.0
node-addon-api: 4.3.0
node-addon-api: 5.0.0
transitivePeerDependencies:
- encoding
- supports-color
@ -9942,8 +9942,8 @@ packages:
tslib: 2.4.0
dev: true
/node-addon-api/4.3.0:
resolution: {integrity: sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==}
/node-addon-api/5.0.0:
resolution: {integrity: sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA==}
dev: false
/node-cache/5.1.2:

View file

@ -1,16 +0,0 @@
{
"myresolver": {
"Account": {
"Email": "",
"Registration": {
"body": {
"status": "valid"
},
"uri": "https://acme-v02.api.letsencrypt.org/acme/acct/476208700"
},
"PrivateKey": "MIIJKAIBAAKCAgEAn42EtgYsqNgwXbt6e/Ix1er5hMUjiWOql0Cf6wQ09FRTpBTc4iKxxjINH03k8tJe501rAYliPfrBtt6TwQ4FNlPRFWULS8pTQ9Fq6Ra1QvgG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kfznpICEq+ArdwGpPWpryr+XFV8kq6GMZZQTV/hKQ2907xnzo09lu6Eon8/b1tCxvjqW6tBMM+3fvEfp4d0dW/pZ4TyL6Jv5K380f7dId4jW4o46TiSUI+ZeZRS1etl0wPoxLOGaLeLfEFQKCAQAp0w7OQEii1cXoj8pI2y/UhULdT5pS/pPVcU+2NutUoMVrG5tMpTfBbfB7l65XvXNaAe4N8S6miCt5s4NNeSpxrkDGh2N4AN3vGZuG4zqKGgNz0sMhj39eFmzbOgV2uittz09bAy4fYr4PlY2fhZ4FW/ItDXa21Nnb5ga30+zioWHWLTfPUrnHvpihsscLriYLP6lK3bpNy84IpWCgb0dsiG1YbQQggh5uayycE29oFEGqg7FKTAaAeKQ20XpXr91orOLtZK3VAKUjOhN5KwkvTTbWZk4evF2V8FTyIa7hpvN3PIrV7AHp9p2k7j8xiZjE7964+6HhhTDd+ajZ1DTfAoIBAHnnLVPmFsQktM5dNcESNcJPoeZTggO+vQsHYPn6dxMxXRnzR3/vC7Be/WECq0u4k8Kt0SET5fEw3cbWIeDUNd8q+oETtePO7rPOC6DUYtEkXMoQr7lvsmfVq0qbTXsqxW1MCCB8HXUHD/uZHjueUHLBZETlB6s0r2IlRsf+8CBt9CF8hA/qZHqVqkePfP/uAe69wICDcVxdAJ/C8juMv0BY6g7+BtCAqgSqKYy4iQDP1EswwUV7z5V8HjuTmkS2Bhs0fziP1UoLq3fk86ZefB3wcYkBv8kXHPgDbpo/PaIyGeGvE8/hT7nJh50nAgwFwp8f7tcmafiNKudZVZq3Sso=",
"KeyType": "4096"
},
"Certificates": null
}
}

View file

View file

@ -1,6 +1,6 @@
# api:
# dashboard: true
# insecure: true
api:
dashboard: true
insecure: true
providers:
docker:
@ -25,5 +25,6 @@ entryPoints:
websecure:
address: ":443"
log:
level: DEBUG