Run Jami locally in Dev and CI enviroment

This commit is contained in:
Miko Keskimäki
2022-12-20 13:59:07 +02:00
parent badba781d5
commit 3c4de8bf60
5 changed files with 27 additions and 4 deletions
+10
View File
@@ -62,6 +62,16 @@ services:
POSTGRES_HOST_AUTH_METHOD: trust
image: registry.toska.cs.helsinki.fi/user-db
jami:
<<: *defaults
image: toska/jami
environment:
- NODE_ENV=production
- PORT=3003
ports:
- 3003:3003
container_name: jami
nginx:
image: nginx:latest
container_name: nginx
+10
View File
@@ -168,6 +168,16 @@ services:
volumes:
- user-db-data:/data
jami:
<<: *defaults
image: toska/jami
environment:
- NODE_ENV=development
- PORT=3003
ports:
- 3003:3003
container_name: jami
volumes:
backend-nodemod:
frontend-nodemod:
+4
View File
@@ -16,6 +16,9 @@ const requiredGroup = isStaging
// Pate
const pateToken = process.env.PATE_API_TOKEN || ''
// Jami
const jamiUrl = isDev ? 'http://jami:3003/' : 'https://importer.cs.helsinki.fi/api/auth'
// Importer client
const importerToken = process.env.IMPORTER_DB_API_TOKEN || ''
@@ -79,6 +82,7 @@ module.exports = {
sentryEnvironment,
isProduction,
pateToken,
jamiUrl,
baseUrl,
frontUrl,
backendPort,
+2 -2
View File
@@ -1,12 +1,12 @@
const axios = require('axios')
const { importerToken } = require('../conf-backend')
const { importerToken, jamiUrl } = require('../conf-backend')
const logger = require('./logger')
const jamiClient = axios.create({
params: {
token: importerToken,
},
baseURL: 'https://importer.cs.helsinki.fi/api/auth',
baseURL: jamiUrl,
})
const getJamiClient = () => {
@@ -2,7 +2,7 @@
const _ = require('lodash')
const Sentry = require('@sentry/node')
const { runningInCI, isProduction } = require('../conf-backend')
const { runningInCI } = require('../conf-backend')
const logger = require('./logger')
const { getJamiClient } = require('../util/jamiClient')
const jamiClient = getJamiClient()
@@ -14,7 +14,6 @@ const getIAMAccessFromJami = async (user, attempt = 1) => {
const { data: iamAccess } = await jamiClient.post('/', {
userId,
iamGroups,
noLogging: !isProduction,
})
return iamAccess