Secrets and .env Files

A secret such as a token or an API key never goes in a script: it goes in a .env file beside the project, which the script loads with set -a and source, which Git is told to ignore, and which chmod 600 keeps private to you.

Updated

Cheat sheet for the lesson Secrets and .env Files: A secret such as a token or an API key never goes in a script: it goes in a .env file beside the project, which the script loads with set -a and source, which Git is told to ignore, and which chmod 600 keeps private to you.
Category
Bash
Level
Journeyman
Tags
API Key, chmod, env-file, environment-variable, gitignore, linux, unix