Skip to content

Commit

Permalink
new key leaked again (#16)
Browse files Browse the repository at this point in the history
* login fully complete

* event machine types added

* attendance upload and verify logic added

* add attendance working with database

* add event working, core version ready

* the most import edge case is taken care of

* github actions workflow setup for cloud run

* github actions workflow setup for cloud run #2

* ignored build errors, CHANGE LATER

* ignored build errors, CHANGE LATER #1

* staging and prod build seperated

* leaked key removed and secrets added

* leaked key removed and secrets added #2

* leaked key removed and secrets added #3

* leaked key removed and secrets added #4

* leaked key removed and secrets added #5

* leaked key removed and secrets added #6

* leaked key removed and secrets added #7

* leaked key removed and secrets added #8

* leave it

* leaked key removed and secrets added #8
  • Loading branch information
JayeshVP24 authored Jan 3, 2023
1 parent ede7152 commit d23622e
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 15 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/cloud-run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ env:
PROJECT_ID: ${{ secrets.CLOUD_RUN_PROJECT_NAME}}
REGION: asia-south1
REPO_NAME: activity-dekho-staging

<<<<<<< HEAD
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY}}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID}}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID}}

=======

>>>>>>> ede71521b8c65e6233e2d5d795c0c5e693b641ba
jobs:
build-and-deploy:
name: Setup, Build, and Deploy
Expand All @@ -35,7 +42,7 @@ jobs:
# build docker image
- name: Build and tag the docker image
run: |-
docker build . --tag gcr.io/$PROJECT_ID/$REPO_NAME:$GITHUB_SHA
docker build . --tag gcr.io/$PROJECT_ID/$REPO_NAME:$GITHUB_SHA
# pushing image to google container registry
- name: Push the image to the Google Container Registry (GCR)
Expand All @@ -48,4 +55,9 @@ jobs:
--region $REGION \
--image gcr.io/$PROJECT_ID/$REPO_NAME:$GITHUB_SHA \
--platform "managed" \
--quiet
<<<<<<< HEAD
--quiet \

=======
--quiet
>>>>>>> ede71521b8c65e6233e2d5d795c0c5e693b641ba
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ WORKDIR /usr/app

COPY . .

ARG FIREBASE_API_KEY
ARG FIREBASE_MESSAGING_SENDER_ID
ARG FIREBASE_APP_ID

ENV FIREBASE_API_KEY=${FIREBASE_API_KEY}
ENV FIREBASE_MESSAGING_SENDER_ID=${FIREBASE_API_KEY}
ENV FIREBASE_APP_ID=${FIREBASE_API_KEY}
ENV FIREBASE_AUTH_DOMAIN=aicte-diary.firebaseapp.com
ENV FIREBASE_PROJECT_ID=aicte-diary
ENV FIREBASE_STORAGE_BUCKET=aicte-diary.appspot.com



RUN yarn install --frozen-lockfile

RUN yarn build
Expand Down
51 changes: 39 additions & 12 deletions src/firebase/config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import {getFirestore} from "firebase/firestore"
import {getAuth} from "firebase/auth"
import { getFirestore } from "firebase/firestore";
import { getAuth } from "firebase/auth";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyDvyg0ymLOqs181XfDZ2VxvuAEqDcvZrOI",
authDomain: "aicte-diary.firebaseapp.com",
projectId: "aicte-diary",
storageBucket: "aicte-diary.appspot.com",
messagingSenderId: "944319415450",
appId: "1:944319415450:web:3e453ecb0786bde4f68b23"
};

console.log("prod env ", process.env.NODE_ENV);
let firebaseConfig = {};
// if (process.env.NODE_ENV === "production") {
// console.log("here is the node env")
// firebaseConfig = {
// apiKey: process.env.FIREBASE_API_KEY,
// authDomain: "aicte-diary.firebaseapp.com",
// projectId: "aicte-diary",
// storageBucket: "aicte-diary.appspot.com",
// messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
// appId: process.env.FIREBASE_APP_ID,
// };
// }
if (process.env.NODE_ENV === "production") {
console.log("here is the node env")
firebaseConfig = {
apiKey: "AIzaSyDvyg0ymLOqs181XfDZ2VxvuAEqDcvZrOI",
authDomain: "aicte-diary.firebaseapp.com",
projectId: "aicte-diary",
storageBucket: "aicte-diary.appspot.com",
messagingSenderId: "944319415450",
appId: "1:944319415450:web:7598324a715c03c1f68b23",
};
}
else {
firebaseConfig = {
apiKey: "process.env.NEXT_PUBLIC_FIREBASE_API_KEY",
authDomain: "aicte-diary.firebaseapp.com",
projectId: "aicte-diary",
storageBucket: "aicte-diary.appspot.com",
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
};
}

// Initialize Firebase
const app = initializeApp(firebaseConfig);
export const firedb = getFirestore(app)
export const auth = getAuth(app)
export const firedb = getFirestore(app);
export const auth = getAuth(app);

0 comments on commit d23622e

Please sign in to comment.