0

I'm developing my first OSS project hosted on GitHub. It's a Ionic 4 (Angular) project available on https://github.com/AlanCrevon/LeCoinDuProf

It's using a firebase backend, so I need to store important data such as apiKey in environment.ts file, but I don't want them to be available on GitHub.

Yet, I need these variables to be available by travis so that it can build, test and deploy the app.

If I understand correctly, I'm supposed to configure environment secrets in Github's settings, but I don't understand how to give this variables back to the ng build.

Can anyone clarify this point ?

Thanks in advance.

Alan Crevon
  • 221
  • 2
  • 3

2 Answers2

0

I dont remember that github have such setting. But you can do that using your CI & CD like travis ci or appvoyer. Those will allow you change enviroment setting when you build your source code.

  • Ho, yes, you are right : it's in Travis settings I have to declare the environment variables. But the problem il still the same : how do I give the variables back to ng build ? – Alan Crevon May 09 '19 at 19:21
0

According to the answer https://stackoverflow.com/a/37484053/8114270, exposing Firebase credentials is not a security risk as long as the account is locked with a specific domain (or a specific browser for localhost).

So it can be exposed on Github, and it will be embedded in the application code anyway.

Alan Crevon
  • 221
  • 2
  • 3