From 372120e83524e11d4aa8fd6a5baa24762b9411f4 Mon Sep 17 00:00:00 2001 From: JBB0807 <104856796+JBB0807@users.noreply.github.com> Date: Wed, 7 May 2025 14:11:19 -0700 Subject: [PATCH] Update environment variables --- assignment-db-service/.env.test | 2 +- assignment-service/.env.test | 4 ++-- auth-service/.env.test | 12 ++++++++++++ auth-service/passport.js | 2 +- compose.yaml | 22 ++++++++++++++++++---- deployment-service/.env.test | 9 +++++++++ user-db-service/.env.development | 2 +- user-db-service/.env.test | 12 ++++++++++++ 8 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 auth-service/.env.test create mode 100644 deployment-service/.env.test create mode 100644 user-db-service/.env.test diff --git a/assignment-db-service/.env.test b/assignment-db-service/.env.test index b464239..048a45c 100644 --- a/assignment-db-service/.env.test +++ b/assignment-db-service/.env.test @@ -1,4 +1,4 @@ -NODE_ENV=development +NODE_ENV=docker # Environment variables declared in this file are automatically made available to Prisma. # See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema diff --git a/assignment-service/.env.test b/assignment-service/.env.test index fd1e4e1..2c83b66 100644 --- a/assignment-service/.env.test +++ b/assignment-service/.env.test @@ -1,4 +1,4 @@ -NODE_ENV=test +NODE_ENV=docker DB_ASSIGNMENT_SERVICE_URL="http://js-assignment-db-service:3200" -DEPLOY_API_URL="http://localhost:3006/deploy" +DEPLOY_API_URL="http://js-deployment-service:3006/deploy" NODE_PORT=8082 \ No newline at end of file diff --git a/auth-service/.env.test b/auth-service/.env.test new file mode 100644 index 0000000..3787375 --- /dev/null +++ b/auth-service/.env.test @@ -0,0 +1,12 @@ +NODE_ENV=docker + +GOOGLE_CLIENT_ID="485880105639-1in8tvb6ondnn198rasuj2d8ank06ntp.apps.googleusercontent.com" +GOOGLE_CLIENT_SECRET="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" +GOOGLE_CALLBACK_URL="http://localhost:8080/auth/google/callback" +LOGIN_REDIRECT_URL="http://localhost:5173/" +ACCEPTED_ORIGINS=http://localhost:3000,http://localhost:8081,http://localhost:3001,http://localhost:5173 +ASSIGNMENT_SERVICE_URL="http://js-assignment-service:8082" +DB_USER_SERVICE_URL="http://js-user-db-service:3100/" +AUTH_SESSION_KEY="f3f4d8e6b17a4b3abdc8e9a2c0457aaf91c0d5f6e3b7a9c8df624bd71ea35f42" +AUTH_URL = "http://localhost:8080" +PORT=8080 \ No newline at end of file diff --git a/auth-service/passport.js b/auth-service/passport.js index 39479de..14f3481 100644 --- a/auth-service/passport.js +++ b/auth-service/passport.js @@ -66,7 +66,7 @@ passport.serializeUser((user, done) => { console.log("Serializing user:", user); // done(null, user); done(null, { - userId: user.qrcodenumber || user.id, + userId: user.qrcodenumber || user.userId, displayName: user.studentname || user.displayName, role: user.role, // emails: user.emails || "none", diff --git a/compose.yaml b/compose.yaml index 41c59e6..46bf230 100644 --- a/compose.yaml +++ b/compose.yaml @@ -11,7 +11,7 @@ services: ports: - "3200:3200" # Expose port to the same host env_file: - - ./assignment-db-service/.env.development + - ./assignment-db-service/.env.test networks: - backend @@ -25,7 +25,7 @@ services: ports: - "8082:8082" # Expose port to the same host env_file: - - ./assignment-service/.env.development + - ./assignment-service/.env.test depends_on: - js-assignment-db-service networks: @@ -41,7 +41,7 @@ services: ports: - "8080:8080" # Expose port to the same host env_file: - - ./auth-service/.env.development + - ./auth-service/.env.test networks: - backend @@ -55,7 +55,21 @@ services: ports: - "3100:3100" # Expose port to the same host env_file: - - ./user-db-service/.env.development + - ./user-db-service/.env.test + networks: + - backend + + js-deployment-service: + build: + context: ./deployment-service + dockerfile: DockerfileDEV + container_name: js-deployment-service + restart: unless-stopped + init: true + ports: + - "3100:3100" # Expose port to the same host + env_file: + - ./deployment-service/.env.test networks: - backend diff --git a/deployment-service/.env.test b/deployment-service/.env.test new file mode 100644 index 0000000..8c0e809 --- /dev/null +++ b/deployment-service/.env.test @@ -0,0 +1,9 @@ +NODE_ENV=docker +FLY_ACCESS_TOKEN="FlyV1 fm2_lJPECAAAAAAACJJHxBAjRF69RAjf3FXXuVT+M3bcwrVodHRwczovL2FwaS5mbHkuaW8vdjGUAJLOAA//nh8Lk7lodHRwczovL2FwaS5mbHkuaW8vYWFhL3YxxDxmIdNTu/DGjUSyYxuC5W7Rio4bNT5w6c1Ihi+ZJnjcmEutbt5KuyFcCo1C0CFPEhrP4hY5SEvXN58GHUDEToWZ0GwI5ndmIsZnhWSG8TBixbuFTaBb8lTBU5lNOvm2l4rX1i6dfId7S9Ko6qXpOzl9oYngy0zw+g2MwXuQrH6/XELBdEy/KThVeTEjt8QgBzOo/Eae+DsrATm6WjVv9f5a4iS/s7WtYHydZZr3z9M=,fm2_lJPEToWZ0GwI5ndmIsZnhWSG8TBixbuFTaBb8lTBU5lNOvm2l4rX1i6dfId7S9Ko6qXpOzl9oYngy0zw+g2MwXuQrH6/XELBdEy/KThVeTEjt8QQNZaUoOrVdOnk6Vo/DkeMGsO5aHR0cHM6Ly9hcGkuZmx5LmlvL2FhYS92MZgEks5oGwzFzwAAAAEkEyrjF84AD2FZCpHOAA9hWQzEEASQrBHkPDFO3LlZDaxRRIjEIEW1ki/syKHnhFamHgze8PFeunPOAmNmh57hslV04lL7" +AWS_ACCESS_KEY_ID='tid__NSmOVaGknqitaCySppZjqVTgJSdDFnFbWcQllkC_juHwkbQZO' +AWS_ENDPOINT_URL_S3='https://fly.storage.tigris.dev' +AWS_REGION='auto' +AWS_SECRET_ACCESS_KEY='tsec_6Bz1aMbfYQftuq5WfIVEDZkHwskU4MMjVywdtxSP6uxetEBvkSC2VHI9HfTeDgHr4D6kiz' +COMMON_BUCKET='snakeapi-deployment-test-bucket' +FLY_ORG='personal' +IMAGE_REF="registry.fly.io/snake-api-template:latest" \ No newline at end of file diff --git a/user-db-service/.env.development b/user-db-service/.env.development index 7509cce..52a3ca1 100644 --- a/user-db-service/.env.development +++ b/user-db-service/.env.development @@ -5,7 +5,7 @@ # See the documentation for all the connection string options: https://pris.ly/d/connection-strings #use this when testing local, remmber to run the proxy command -DATABASE_URL="postgresql://postgres:wly9H8gjjmxYfg1@host.docker.internal:15432/postgres?schema=public" +DATABASE_URL="postgresql://postgres:wly9H8gjjmxYfg1@localhost:15432/postgres?schema=public" # DATABASE_URL="postgres://postgres:wly9H8gjjmxYfg1@bytecamp-db.flycast:5432?sslmode=disable" # DATABASE_URL=postgres://snakebyte:zVB7lgOiKr89dq6@localhost:5432/snakebyte?sslmode=disable diff --git a/user-db-service/.env.test b/user-db-service/.env.test new file mode 100644 index 0000000..7509cce --- /dev/null +++ b/user-db-service/.env.test @@ -0,0 +1,12 @@ +# Environment variables declared in this file are automatically made available to Prisma. +# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema + +# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. +# See the documentation for all the connection string options: https://pris.ly/d/connection-strings + +#use this when testing local, remmber to run the proxy command +DATABASE_URL="postgresql://postgres:wly9H8gjjmxYfg1@host.docker.internal:15432/postgres?schema=public" + +# DATABASE_URL="postgres://postgres:wly9H8gjjmxYfg1@bytecamp-db.flycast:5432?sslmode=disable" +# DATABASE_URL=postgres://snakebyte:zVB7lgOiKr89dq6@localhost:5432/snakebyte?sslmode=disable +NODE_PORT=3100