Code Monkey home page Code Monkey logo

Comments (7)

mchmielarski avatar mchmielarski commented on September 3, 2024 1

https://firebase.google.com/docs/functions/config-env#automatically_populated_environment_variables

from opentrace-cloud-functions.

blackopsteam avatar blackopsteam commented on September 3, 2024

thanks mchmielarski

a follow up question to this, do i declare the FIREBASE_CONFIG and GCLOUD_PROJECT environment variables in the config.ts file located in \functions\src folder? sorry for my ignorance. since i am pretty new in this and not much documentation is included in the write up under https://github.com/opentrace-community/opentrace-cloud-functions#test.

Unfortunately, i need some help in this area everyone! Please be patient with me. I am only trying to do this because no one has the initiative in our country to do this to fight against covid.

not sure after the configuration where i will add those variables.

help.

from opentrace-cloud-functions.

blackopsteam avatar blackopsteam commented on September 3, 2024

this is the content of the config.ts

import FunctionConfig from "./opentrace/types/FunctionConfig";
import Authenticator from "./opentrace/utils/Authenticator";
import PinGenerator from "./opentrace/utils/PinGenerator";

const config: FunctionConfig = {
projectId: "tracetogether-philippines",
regions: ["asia-east2"],
utcOffset: 0,
authenticator: new Authenticator(),
encryption: {
defaultAlgorithm: "aes-256-gcm",
keyPath: "./credentials/testdev.json",
defaultVersion: 1,
},
tempID: {
validityPeriod: 0.25, // in hours
refreshInterval: 12, // in hours
batchSize: 100, // sufficient for 24h+
},
upload: {
pinGenerator: new PinGenerator(),
bucket: "upload-bucket-ttph", //
recordsDir: "records",
testsDir: "tests",
tokenValidityPeriod: 2, // in hours
bucketForArchive: "archive-bucket-ttph",
},
};

export default config;

from opentrace-cloud-functions.

blackopsteam avatar blackopsteam commented on September 3, 2024

or should i replace in the keypath the values :
projects/**************/secrets/TraceTogetherSecret
or
just the name TraceTogetherSecret

located in the google cloud under Secret Manager?

from opentrace-cloud-functions.

blackopsteam avatar blackopsteam commented on September 3, 2024

thanks for your patience

from opentrace-cloud-functions.

mchmielarski avatar mchmielarski commented on September 3, 2024

you can set env variables in many ways, but remember that it's only required by your local environment. so that easiest way is to add them before command which you try to run:
FIREBASE_CONFIG=... GCLOUD_PROJECT=... npm --prefix functions test

from opentrace-cloud-functions.

qtangs avatar qtangs commented on September 3, 2024

In our setup we don't use FIREBASE_CONFIG and GCLOUD_PROJECT.
@tophatxperts, did you set GOOGLE_APPLICATION_CREDENTIALS variable to "C:\TraceTogether\functions\src\credentials\testdev.json"? Do ensure that the file exists and is a valid GCP credential file.

And keyPath should be set to TraceTogetherSecret in your case.

from opentrace-cloud-functions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.