diff --git a/.github/workflows/jestCI.yml b/.github/workflows/jestCI.yml index 86a4cd52..75d27375 100644 --- a/.github/workflows/jestCI.yml +++ b/.github/workflows/jestCI.yml @@ -9,6 +9,13 @@ on: - main - "bacpop-*" +env: + GITHUB_CLIENT_ID: ${{ secrets.CLIENT_ID_GITHUB }} + GITHUB_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET_GITHUB }} + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + SESSION_SECRET: ${{ secrets.SESSION_SECRET }} + jobs: unit_frontend: runs-on: ubuntu-latest @@ -56,10 +63,6 @@ jobs: cache: "npm" cache-dependency-path: ./app/server/package-lock.json - run: npm ci - - name: get config file - run: | - pwd - cp ./src/resources/config.json.in.development ./src/resources/config.json - name: run all components working-directory: . run: ./scripts/run_test server-only diff --git a/.github/workflows/playwrightCI.yml b/.github/workflows/playwrightCI.yml index 98b3723c..9d8b7943 100644 --- a/.github/workflows/playwrightCI.yml +++ b/.github/workflows/playwrightCI.yml @@ -9,6 +9,13 @@ on: - main - "bacpop-*" +env: + GITHUB_CLIENT_ID: ${{ secrets.CLIENT_ID_GITHUB }} + GITHUB_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET_GITHUB }} + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + SESSION_SECRET: ${{ secrets.SESSION_SECRET }} + jobs: playwright-tests: timeout-minutes: 60 @@ -26,10 +33,6 @@ jobs: node-version: ${{ matrix.node-version }} cache: "npm" cache-dependency-path: ./app/client-v2/package-lock.json - - name: get config file - run: | - pwd - cp ./app/server/src/resources/config.json.in.development ./app/server/src/resources/config.json - name: Run all components working-directory: . run: ./scripts/run_test @@ -37,8 +40,6 @@ jobs: working-directory: ./app/client-v2 run: npx playwright install --with-deps - name: Run e2e tests - env: - MICROREACT_TOKEN: ${{ secrets.MICROREACT_TOKEN }} working-directory: ./app/client-v2 run: npm run test:e2e:${{ matrix.browser}} - name: Stop all components diff --git a/.gitignore b/.gitignore index 1f33378f..67e5a162 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ app/server/coverage .idea proxy/ssl/production .vscode +.env diff --git a/README.md b/README.md index 6ab2e34d..97b73400 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ docker --version ``` -If you run the application for the first time (or for the first time after running in docker), you need to replace the -secrets in the config file in `app/server/src/resources` first. +If you run the application for the first time in development you need to env variables into `.env`. + Login to the vault: ``` export VAULT_ADDR=https://vault.dide.ic.ac.uk:8200 @@ -78,28 +78,13 @@ You can also run everything outside pm2, by separately running: - `./scripts/run_client` ## Config -Config for the front-end lives in `./app/client/src/settings` and by default webpack (via the vue-cli) will use the config -defined in `./app/client/src/settings/development`; this gets overriden by setting an env var called `BUILD_TARGET` - see `./proxy/Dockerfile`. - -Config for the back-end lives in `./app/server/src/resources`. When deploying using a docker image this file has to be -copied into the running container before the app will start - see `./app/server/docker/entrypoint.sh`. +Config for the back-end should be done via env variables. All needed variables can be found at `./app/server/src/buildConfig.ts`. In development, these are set in `./app/server/.env` which can be set by running `./scripts/decrypt_config`. ## Deploying with docker Docker images are built on CI using `./proxy/docker/build`, `./app/server/docker/build`. If you want to generate them from changed local sources you can run those same scripts locally to build images. -Generate the correct server config file with -``` - ./scripts/decrypt_config docker -``` - -Then run the dockerised app with - -``` - ./scripts/run_docker -``` - By default this will configure the nginx proxy for host `localhost`. To deploy with a different hostname, pass it as an argument, e.g. diff --git a/app/server/.gitignore b/app/server/.gitignore index bd07d4e1..a690fca4 100644 --- a/app/server/.gitignore +++ b/app/server/.gitignore @@ -1,2 +1,3 @@ node_modules /dist +.env \ No newline at end of file diff --git a/app/server/docker/Dockerfile b/app/server/docker/Dockerfile index 44541ecd..0eb0831a 100644 --- a/app/server/docker/Dockerfile +++ b/app/server/docker/Dockerfile @@ -9,4 +9,4 @@ COPY . /app EXPOSE 4000 RUN npm run build RUN npm install -g ts-node -ENTRYPOINT ["docker/entrypoint.sh"] +ENTRYPOINT ["ts-node", "--transpile-only", "src/index.ts"] diff --git a/app/server/docker/entrypoint.sh b/app/server/docker/entrypoint.sh deleted file mode 100755 index bc7e2b75..00000000 --- a/app/server/docker/entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -eu - -PATH_CONFIG=/app/src/resources/config.json -echo "Waiting for config at $PATH_CONFIG" -while [ ! -e $PATH_CONFIG ]; do - sleep 1 -done - -ts-node --transpile-only src/index.ts --config src/resources diff --git a/app/server/package-lock.json b/app/server/package-lock.json index 47d852e5..f7b926b6 100644 --- a/app/server/package-lock.json +++ b/app/server/package-lock.json @@ -16,6 +16,7 @@ "axios-mock-adapter": "^1.20.0", "body-parser": "^1.19.2", "cors": "^2.8.5", + "dotenv": "^16.4.5", "express": "^4.17.3", "express-session": "^1.17.2", "ioredis": "^5.2.4", @@ -5542,6 +5543,17 @@ "node": ">=8" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/download": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/download/-/download-7.1.0.tgz", @@ -18152,6 +18164,11 @@ } } }, + "dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==" + }, "download": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/download/-/download-7.1.0.tgz", diff --git a/app/server/package.json b/app/server/package.json index 0d4d6844..9b10f6dd 100644 --- a/app/server/package.json +++ b/app/server/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.ts", "scripts": { - "express": "ts-node src/index.ts --config src/resources", + "express": "ts-node src/index.ts", "test": "jest", "test:dev": "jest --watch", "eslint": "eslint src tests --ext .js,.jsx,.ts,.tsx", @@ -21,6 +21,7 @@ "axios-mock-adapter": "^1.20.0", "body-parser": "^1.19.2", "cors": "^2.8.5", + "dotenv": "^16.4.5", "express": "^4.17.3", "express-session": "^1.17.2", "ioredis": "^5.2.4", diff --git a/app/server/src/args.ts b/app/server/src/args.ts deleted file mode 100644 index c39a76bf..00000000 --- a/app/server/src/args.ts +++ /dev/null @@ -1,14 +0,0 @@ -import yargs from "yargs/yargs"; -import path from "path"; -import {hideBin} from "yargs/helpers"; - -const {argv} = yargs(hideBin(process.argv)); -const configPathGiven = argv.config as string; -if (!configPathGiven) { - throw new Error("Usage index.js --config path/to/config/dir"); -} -const configPath = path.resolve(configPathGiven); - -console.log(`Config path: ${configPathGiven} (${configPath})`); - -export default configPath; diff --git a/app/server/src/buildConfig.ts b/app/server/src/buildConfig.ts new file mode 100644 index 00000000..de9674c1 --- /dev/null +++ b/app/server/src/buildConfig.ts @@ -0,0 +1,13 @@ +// These environment variables can override the default values in the .env file +export const buildConfig = () => ({ + server_port: process.env.PORT || 4000, + api_url: process.env.API_URL || "http://localhost:5000", + client_url: process.env.CLIENT_URL || "http://localhost:5173", + server_url: process.env.SERVER_URL || "http://localhost:4000", + redis_url: process.env.REDIS_URL || "redis://localhost:6379", + GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID, + GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET, + SESSION_SECRET: process.env.SESSION_SECRET, + GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID, + GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET, +}); diff --git a/app/server/src/index.ts b/app/server/src/index.ts index fb3b5cd3..1a3576ab 100644 --- a/app/server/src/index.ts +++ b/app/server/src/index.ts @@ -1,29 +1,20 @@ import express from "express"; -import MockStrategy from 'passport-mock-strategy'; -import passport from 'passport'; +import passport from "passport"; +import MockStrategy from "passport-mock-strategy"; -import { configureApp } from './configureApp'; -import { router } from './routes/routes'; +import { configureApp } from "./configureApp"; +import { router } from "./routes/routes"; -import fs from "fs"; -import path from "path"; - -import configPath from "./args"; +import dotenv from "dotenv"; import { redisConnection } from "./db/redis"; -import {initialiseLogging} from "./logging"; -import {handleError} from "./errors/handleError"; +import { handleError } from "./errors/handleError"; +import { initialiseLogging } from "./logging"; +import { buildConfig } from "./buildConfig"; -const filename = path.join(configPath, "config.json"); +dotenv.config(); -if (!fs.existsSync(filename)) { - throw new Error(`File ${configPath} does not exist`); -} +const config = buildConfig(); -const configText = fs.readFileSync(filename, { encoding: "utf-8" }); -const config = JSON.parse(configText); -if (!fs.existsSync(filename)) { - throw new Error(`File ${configPath} does not exist`); -} const app = express(); initialiseLogging(app); @@ -33,20 +24,19 @@ router(app, config); if (process.env.BEEBOP_TEST === "true") { passport.use(new MockStrategy()); - app.get('/login/mock', passport.authenticate('mock'), (req, res) => { - res.send({ status: 'ok' }); + app.get("/login/mock", passport.authenticate("mock"), (req, res) => { + res.send({ status: "ok" }); }); } - + const port = process.env.PORT || config.server_port; app.listen(port, () => { console.log(`listening on ${port}`); }); -const redis = redisConnection( - config.redis_url, - () => { throw Error(`Failed to connect to redis server ${config.redis_url}`); } -); +const redis = redisConnection(config.redis_url, () => { + throw Error(`Failed to connect to redis server ${config.redis_url}`); +}); app.locals.redis = redis; app.use(handleError); diff --git a/app/server/src/resources/config.json.in.development b/app/server/src/resources/config.json.in.development deleted file mode 100644 index f40651ab..00000000 --- a/app/server/src/resources/config.json.in.development +++ /dev/null @@ -1,12 +0,0 @@ -{ - "server_port": 4000, - "api_url": "http://localhost:5000", - "client_url": "http://localhost:5173", - "server_url": "http://localhost:4000", - "redis_url": "redis://localhost:6379", - "GOOGLE_CLIENT_ID": "${GOOGLE_ID}", - "GOOGLE_CLIENT_SECRET": "$GOOGLE_SECRET", - "SESSION_SECRET": "$EXPRESS_SESSION_SECRET", - "GITHUB_CLIENT_ID":"$GITHUB_ID", - "GITHUB_CLIENT_SECRET":"$GITHUB_SECRET" -} diff --git a/app/server/src/resources/config.json.in.docker b/app/server/src/resources/config.json.in.docker deleted file mode 100644 index dc2f11bd..00000000 --- a/app/server/src/resources/config.json.in.docker +++ /dev/null @@ -1,12 +0,0 @@ -{ - "server_port": 4000, - "api_url": "http://beebop-py-api:5000", - "client_url": "https://localhost", - "server_url": "https://localhost/api", - "redis_url": "redis://beebop-redis:6379", - "GOOGLE_CLIENT_ID": "$DOCKER_GOOGLE_ID", - "GOOGLE_CLIENT_SECRET": "$DOCKER_GOOGLE_SECRET", - "SESSION_SECRET": "1234", - "GITHUB_CLIENT_ID": "$DOCKER_GITHUB_ID", - "GITHUB_CLIENT_SECRET": "$DOCKER_GITHUB_SECRET" -} diff --git a/app/server/src/resources/config.json.in.production b/app/server/src/resources/config.json.in.production deleted file mode 100644 index c95b6355..00000000 --- a/app/server/src/resources/config.json.in.production +++ /dev/null @@ -1,12 +0,0 @@ -{ - "server_port": 4000, - "api_url": "http://beebop-py-api:5000", - "client_url": "https://beebop.dide.ic.ac.uk", - "server_url": "https://beebop.dide.ic.ac.uk/api", - "redis_url": "redis://beebop-redis:6379", - "GOOGLE_CLIENT_ID": "${PROD_GOOGLE_ID}", - "GOOGLE_CLIENT_SECRET": "$PROD_GOOGLE_SECRET", - "SESSION_SECRET": "$PROD_EXPRESS_SESSION_SECRET", - "GITHUB_CLIENT_ID":"$PROD_GITHUB_ID", - "GITHUB_CLIENT_SECRET":"$PROD_GITHUB_SECRET" -} diff --git a/app/server/tests/integration/router.test.ts b/app/server/tests/integration/router.test.ts index 83df6a8c..0a572295 100644 --- a/app/server/tests/integration/router.test.ts +++ b/app/server/tests/integration/router.test.ts @@ -1,57 +1,60 @@ -import request from 'supertest'; -import Agent from'supertest'; +import request from "supertest"; +import Agent from "supertest"; import express from "express"; -import axios from 'axios'; -import passport from 'passport'; -import MockAdapter from 'axios-mock-adapter'; -import { router } from '../../src/routes/routes'; -import { configureApp } from '../../src/configureApp'; -import versionInfo from '../../../server/resources/versionInfo.json'; -import config from '../../src/resources/config.json'; -import MockStrategy from 'passport-mock-strategy'; +import axios from "axios"; +import passport from "passport"; +import MockAdapter from "axios-mock-adapter"; +import { router } from "../../src/routes/routes"; +import { configureApp } from "../../src/configureApp"; +import versionInfo from "../../../server/resources/versionInfo.json"; +import MockStrategy from "passport-mock-strategy"; +import dotenv from "dotenv"; +import { buildConfig } from "../../src/buildConfig"; +dotenv.config(); +const config = buildConfig(); const app = express(); configureApp(app, config); -router(app, config) +router(app, config); // adding passport mock strategy and route for tests passport.use(new MockStrategy()); -app.get('/login/mock', passport.authenticate('mock'), (req, res) => { - res.send({ status: 'ok' }); - }); +app.get("/login/mock", passport.authenticate("mock"), (req, res) => { + res.send({ status: "ok" }); +}); describe("testing-server-routes", () => { - const mock = new MockAdapter(axios); - mock.onGet(`${config.api_url}/version`).reply(200, versionInfo); + const mock = new MockAdapter(axios); + mock.onGet(`${config.api_url}/version`).reply(200, versionInfo); - it("GET /version", async () => { - const response= await request(app).get("/version"); - expect(response.body).toMatchObject(versionInfo); - }); - it("GET /", async () => { - const { body } = await request(app).get("/"); - expect(body).toEqual({ message: 'Welcome to beebop!' }); - }); - it("GET /user", async () => { - const { body } = await request(app).get("/user"); - expect(body.status).toEqual('failure'); - }); + it("GET /version", async () => { + const response = await request(app).get("/version"); + expect(response.body).toMatchObject(versionInfo); + }); + it("GET /", async () => { + const { body } = await request(app).get("/"); + expect(body).toEqual({ message: "Welcome to beebop!" }); + }); + it("GET /user", async () => { + const { body } = await request(app).get("/user"); + expect(body.status).toEqual("failure"); + }); }); describe("testing-server-routes as logged in user", () => { - let agent; - beforeEach(() => { - agent = Agent.agent(app); - }); + let agent; + beforeEach(() => { + agent = Agent.agent(app); + }); - it('should authenticate the user', () => { - return agent.get('/login/mock').expect(200, { status: 'ok' }); - }); + it("should authenticate the user", () => { + return agent.get("/login/mock").expect(200, { status: "ok" }); + }); - it("GET /user", async () => { - Agent.agent - await agent.get('/login/mock'); - const { body } = await agent.get("/user"); - expect(body.data).toEqual({id:'1234', provider:'mock', name:'Foo'}); - }); -}); \ No newline at end of file + it("GET /user", async () => { + Agent.agent; + await agent.get("/login/mock"); + const { body } = await agent.get("/user"); + expect(body.data).toEqual({ id: "1234", provider: "mock", name: "Foo" }); + }); +}); diff --git a/app/server/tests/unit/controllers/indexController.test.ts b/app/server/tests/unit/controllers/indexController.test.ts index 3ca36a64..6c26e7b0 100644 --- a/app/server/tests/unit/controllers/indexController.test.ts +++ b/app/server/tests/unit/controllers/indexController.test.ts @@ -7,12 +7,15 @@ jest.mock("../../../src/db/userStore", () => ({ })); import { mockApp, mockRedis, mockResponse } from "../utils"; -import config from "../../../src/resources/config.json"; import versionInfo from "../../../resources/versionInfo.json"; import MockAdapter from "axios-mock-adapter"; import axios from "axios"; import indexController from "../../../src/controllers/indexController"; +import { buildConfig } from "../../../src/buildConfig"; +import dotenv from "dotenv"; +dotenv.config(); +const config = buildConfig(); describe("indexController", () => { const mockRequest: any = {}; diff --git a/app/server/tests/unit/controllers/projectController.test.ts b/app/server/tests/unit/controllers/projectController.test.ts index 58f307e9..3f49d286 100644 --- a/app/server/tests/unit/controllers/projectController.test.ts +++ b/app/server/tests/unit/controllers/projectController.test.ts @@ -44,13 +44,16 @@ jest.mock("../../../src/utils/projectUtils", () => ({ })); import {mockApp, mockRedis, mockResponse} from "../utils"; -import config from "../../../src/resources/config.json"; import projectController from "../../../src/controllers/projectController"; import MockAdapter from "axios-mock-adapter"; import axios from "axios"; import { BeebopError } from "../../../src/errors/beebopError"; +import dotenv from "dotenv"; +import { buildConfig } from "../../../src/buildConfig"; const mockAxios = new MockAdapter(axios); +dotenv.config(); +const config = buildConfig() describe("projectController", () => { beforeEach(() => { diff --git a/buildkite/pipeline.yml b/buildkite/pipeline.yml index 033737e4..781a1ee9 100644 --- a/buildkite/pipeline.yml +++ b/buildkite/pipeline.yml @@ -13,8 +13,3 @@ steps: - label: ":shipit: Push Proxy images" command: proxy/docker/push - - wait - - - label: ":mag: Docker smoke test" - command: scripts/docker_smoke_test - diff --git a/package-lock.json b/package-lock.json index 279b0121..6d2efcb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "dotenv": "^16.4.5", "pm2": "^5.4.2" } }, @@ -364,6 +365,17 @@ "node": ">= 14" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", diff --git a/package.json b/package.json index 2d52aed8..2cf5ff2c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "dotenv": "^16.4.5", "pm2": "^5.4.2" } } diff --git a/proxy/Dockerfile b/proxy/Dockerfile index 846ef67c..282fedbd 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -5,22 +5,9 @@ WORKDIR /app RUN npm install COPY app/client-v2 /app -ENV BUILD_TARGET docker RUN npm install && npm run build -FROM nginx:stable +RUN npm install -g serve +EXPOSE 3000 +CMD ["serve", "-s", "dist"] -# Clear out existing configuration -RUN rm /etc/nginx/conf.d/default.conf -RUN rm /usr/share/nginx/html -rf - -VOLUME /var/log/nginx -VOLUME /run/proxy - -COPY proxy/nginx.conf.template /etc/nginx/nginx.conf.template -COPY proxy/bin /usr/local/bin -COPY proxy/ssl/dhparam.pem /run/proxy/dhparam.pem - -COPY --from=0 /app/dist /usr/share/nginx/html - -ENTRYPOINT ["/usr/local/bin/reverse-proxy"] diff --git a/scripts/decrypt_config b/scripts/decrypt_config index c250ed5b..0a728565 100755 --- a/scripts/decrypt_config +++ b/scripts/decrypt_config @@ -1,31 +1,26 @@ #!/usr/bin/env bash set -e -if [ "$#" -eq 1 ]; then - FILE_IN_SERVER=app/server/src/resources/config.json.in.$1 -else - FILE_IN_SERVER=app/server/src/resources/config.json.in.development -fi +export GITHUB_CLIENT_ID=$(vault read -field=clientid secret/beebop/auth/github) +export GITHUB_CLIENT_SECRET=$(vault read -field=secret secret/beebop/auth/github) +export GOOGLE_CLIENT_ID=$(vault read -field=clientid secret/beebop/auth/google) +export GOOGLE_CLIENT_SECRET=$(vault read -field=secret secret/beebop/auth/google) +export SESSION_SECRET=$(vault read -field=secret secret/beebop/express-session) -FILE_CLEAR_SERVER=app/server/src/resources/config.json - -export GITHUB_ID=$(vault read -field=clientid secret/beebop/auth/github) -export GITHUB_SECRET=$(vault read -field=secret secret/beebop/auth/github) -export DOCKER_GITHUB_ID=$(vault read -field=clientid secret/beebop/auth/devdocker/github) -export DOCKER_GITHUB_SECRET=$(vault read -field=secret secret/beebop/auth/devdocker/github) -export DOCKER_GOOGLE_ID=$(vault read -field=clientid secret/beebop/auth/devdocker/google) -export DOCKER_GOOGLE_SECRET=$(vault read -field=secret secret/beebop/auth/devdocker/google) -export PROD_GITHUB_ID=$(vault read -field=clientid secret/beebop/auth/production/github) -export PROD_GITHUB_SECRET=$(vault read -field=secret secret/beebop/auth/production/github) -export PROD_GOOGLE_ID=$(vault read -field=clientid secret/beebop/auth/production/google) -export PROD_GOOGLE_SECRET=$(vault read -field=secret secret/beebop/auth/production/google) -export PROD_EXPRESS_SESSION_SECRET=$(vault read -field=secret secret/beebop/express-session/production) -export GOOGLE_ID=$(vault read -field=clientid secret/beebop/auth/google) -export GOOGLE_SECRET=$(vault read -field=secret secret/beebop/auth/google) -export EXPRESS_SESSION_SECRET=$(vault read -field=secret secret/beebop/express-session) mkdir proxy/ssl/production -p -vault read -field=key secret/beebop/ssl > proxy/ssl/production/key.pem -vault read -field=cert secret/beebop/ssl > proxy/ssl/production/certificate.pem +vault read -field=key secret/beebop/ssl/production > proxy/ssl/production/key.pem +vault read -field=cert secret/beebop/ssl/production > proxy/ssl/production/certificate.pem -envsubst < $FILE_IN_SERVER > $FILE_CLEAR_SERVER +envsubst > app/server/.env <Beebop") then - echo "Unexpected home page content:" - echo $CONTENT - exit 1 -fi \ No newline at end of file