diff --git a/Procfile b/Procfile index fbbae9266..17180c664 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: node -v ; yarn -v ; echo "APP_DIR: $APP_DIR" ; echo "PORT: $PORT" ; yarn workspace "$APP_DIR" run start:prod +web: node -v ; yarn -v ; echo "APP_DIR => $APP_DIR" ; echo "PORT => $PORT" ; yarn workspace "$APP_DIR" run start:prod diff --git a/api/tsconfig.json b/api/tsconfig.json index 4026611b5..2c873b5d5 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -30,10 +30,7 @@ "resolveJsonModule": true, /* Advanced Options */ - "forceConsistentCasingInFileNames": true, - - // temporary disable lib check waiting a fix for https://github.com/sindresorhus/got/issues/2051 - "skipLibCheck": true + "forceConsistentCasingInFileNames": true }, "ts-node": { "esm": true diff --git a/standup-mattermost-bot/.env.template b/standup-mattermost-bot/.env.template index 6057db199..43f0da7a1 100644 --- a/standup-mattermost-bot/.env.template +++ b/standup-mattermost-bot/.env.template @@ -1,2 +1,4 @@ +CLIENT_ID= +CLIENT_SECRET= MONGO_URL=mongodb://root:example@localhost:27017/ ORIGIN=http://localhost:4000 diff --git a/standup-mattermost-bot/source/config.ts b/standup-mattermost-bot/source/config.ts index 8763e1c81..d601f4b4e 100644 --- a/standup-mattermost-bot/source/config.ts +++ b/standup-mattermost-bot/source/config.ts @@ -1,13 +1,21 @@ import type { MattermostSendMessage } from './mattermost.js' +if (!process.env.MONGO_URL) { + throw new Error('MONGO_URL env var is empty') +} + +if (!process.env.CLIENT_ID || !process.env.CLIENT_SECRET) { + throw new Error('Empty env var CLIENT_ID or CLIENT_SECRET') +} + export const PORT = process.env.PORT || 4000 export const ORIGIN = process.env.ORIGIN || 'http://localhost:4000' export const MONGO_URL = process.env.MONGO_URL export const NODE_ENV = process.env.NODE_ENV export const serverUrl = 'https://mattermost.incubateur.net' -export const clientSecret = 'pgnch7w643yfdkdjnnjcxhpsoe' -export const clientId = 'wbkot91tjbd6byn4fbmrtu8h6o' +export const clientId = process.env.CLIENT_ID +export const clientSecret = process.env.CLIENT_SECRET export const redirectUri = `${ORIGIN}/oauth` const days = [ diff --git a/standup-mattermost-bot/source/mongodb.ts b/standup-mattermost-bot/source/mongodb.ts index 8e33559d2..b0a5cc644 100644 --- a/standup-mattermost-bot/source/mongodb.ts +++ b/standup-mattermost-bot/source/mongodb.ts @@ -10,10 +10,6 @@ interface MemberIds { } export const initMongodb = async () => { - if (!MONGO_URL) { - throw new Error('MONGO_URL env var is empty') - } - const client = new MongoClient(MONGO_URL) await client.connect()