Stedi-Demos / bootstrap-archived

A workflow for receiving and sending EDI documents that you can adjust to build your own EDI system.
Apache License 2.0
7 stars 7 forks source link

[bug] .env file creation causes confusion #142

Open ZackKanter opened 1 year ago

ZackKanter commented 1 year ago

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
  2. 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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.