Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

[bug] .env file creation causes confusion #142

Open
ZackKanter opened this issue Apr 21, 2023 · 4 comments
Open

[bug] .env file creation causes confusion #142

ZackKanter opened this issue Apr 21, 2023 · 4 comments

Comments

@ZackKanter
Copy link
Contributor

Steps to reproduce:

  1. Clone the bootstrap repository and install the necessary dependencies:
git clone https://github.com/Stedi-Demos/bootstrap.git
cd bootstrap
npm ci
  1. Store your Stedi API key and webhook destination URL as environment variables:
export STEDI_API_KEY=<YOUR_STEDI_API_KEY>
export DESTINATION_WEBHOOK_URL=<YOUR_WEBHOOK_URL>
  1. Run npm bootstrap
  2. Bootstrap will deploy your Functions without the STEDI_API_KEY environment variable, and your local .env file will only have the following:
SFTP_BUCKET_NAME=<SFTP_BUCKET_NAME>
EXECUTIONS_BUCKET_NAME=<EXECUTIONS_BUCKET_NAME>
CORE_INGESTION_BUCKET_NAME=<INGESTION_BUCKET_NAME>
@rsioss
Copy link
Contributor

rsioss commented Apr 21, 2023

this is also an interesting one because STEDI_API_KEY shouldn't be needed in the functions themselves IIRC. cc: @OlafConijn who worked on those changes. are we missing something in the bootstrap repo for that to work?

@BDQ
Copy link
Collaborator

BDQ commented Apr 21, 2023

We could add some validation to all Bootstrap CLI commands to verify that the .env file exists and it has at least STEDI_API_KEY defined?

@ZackKanter
Copy link
Contributor Author

We could add some validation to all Bootstrap CLI commands to verify that the .env file exists and it has at least STEDI_API_KEY defined?

Yes, I think that's a good idea.

this is also an interesting one because STEDI_API_KEY shouldn't be needed in the functions themselves IIRC. cc: @OlafConijn who worked on those changes. are we missing something in the bootstrap repo for that to work?

This was my recollection as well.

@BDQ
Copy link
Collaborator

BDQ commented Apr 21, 2023

We discussed also ensuring that the value of STEDI_API_KEY in the .env matches the value in process.env.STEDI_API_KEY in case a user sets the env var manually in their shell (bash, etc) etc. If they do not match, we such block all commands from running.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants