Skip to content

Commit

Permalink
meta: use a single .env file for config
Browse files Browse the repository at this point in the history
Fixes: transloadit#3473
Co-authored-by: Antoine du Hamel <[email protected]>
Co-authored-by: Mikael Finstad <[email protected]>
  • Loading branch information
mifi and aduh95 committed Feb 17, 2022
1 parent 7e9f34e commit 03ce606
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clone this file to `.env.local` and edit the clone. Don't put secrets in the `.env` files.
# Clone this file to `.env` and edit the clone. Don't put secrets in the `.env` files.

NODE_ENV=development

Expand Down
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ yarn run test:unit

We use [Cypress](cypress.io/) for our e2e test suite. Be sure to checkout “[Writing your first test](https://docs.cypress.io/guides/getting-started/writing-your-first-test#Add-a-test-file)” and the “[Introduction to Cypress](https://docs.cypress.io/guides/core-concepts/introduction-to-cypress#Cypress-Can-Be-Simple-Sometimes)”. You should also be aware of the “[Best Practices](https://docs.cypress.io/guides/references/best-practices)”.

To get started make sure you have your `.env.local` set up. If it doesn’t exist, it will use the default value in the `.env` file which won’t work for most cases. Consider copy `.env` in a file named `.env.local` and the values relevant for the test(s) you are trying to run.
To get started make sure you have your `.env` set up. If it doesn’t exist, it will use the default value in the `.env` file which won’t work for most cases. Consider copy `.env` in a file named `.env` and the values relevant for the test(s) you are trying to run.

To start the testing suite run:

Expand All @@ -60,7 +60,7 @@ Even though facebook [allows using](https://developers.facebook.com/blog/post/20

Make sure that you are using a development facebook app at <https://developers.facebook.com/apps>

Go to “Instagram Basic Display” and find `Instagram App ID` and `Instagram App Secret`. Put them in a file called `.env.local` in the repo root:
Go to “Instagram Basic Display” and find `Instagram App ID` and `Instagram App Secret`. Put them in a file called `.env` in the repo root:

COMPANION_INSTAGRAM_KEY="Instagram App ID"
COMPANION_INSTAGRAM_SECRET="Instagram App Secret"
Expand All @@ -78,7 +78,7 @@ append `/instagram/redirect` to it, such as:

Add this full ngrok URL to `Valid OAuth Redirect URIs` under `Instagram Basic Display`.

Edit `.env.local` and change to your ngrok URI:
Edit `.env` and change to your ngrok URI:

COMPANION_DOMAIN="e0c7de09808d.ngrok.io"
COMPANION_PROTOCOL="https"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ node_modules
.yarn/install-state.gz
yarn-error.log

*.local
.env

dist/
lib/
Expand Down
8 changes: 2 additions & 6 deletions bin/companion.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#!/usr/bin/env bash

# Load local env vars. In CI, these are injected.
if [ -f .env.local ]; then
# https://gist.github.com/mihow/9c7f559807069a03e302605691f85572?permalink_comment_id=3625310#gistcomment-3625310
set -a
source <(sed -e '/^#/d;/^\s*$/d' -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g" .env.local)
set +a
nodemon --watch packages/@uppy/companion/src --exec node ./packages/@uppy/companion/src/standalone/start-server.js
if [ -f .env ]; then
nodemon --watch packages/@uppy/companion/src --exec node -r dotenv/config ./packages/@uppy/companion/src/standalone/start-server.js
else
env \
COMPANION_DATADIR="./output" \
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"core-js": "~3.19.3",
"cssnano": "^5.0.6",
"dedent": "^0.7.0",
"dotenv": "^16.0.0",
"esbuild": "^0.14.1",
"esbuild-plugin-babel": "^0.2.3",
"eslint": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion private/dev/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import DropTarget from '@uppy/drop-target'
import Audio from '@uppy/audio'
/* eslint-enable import/no-extraneous-dependencies */

// DEV CONFIG: create a .env.local file to customize those values.
// DEV CONFIG: create a .env file in the project root directory to customize those values.
const {
VITE_UPLOADER : UPLOADER,
VITE_COMPANION_URL : COMPANION_URL,
Expand Down
2 changes: 1 addition & 1 deletion private/dev/DragDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DragDrop from '@uppy/drag-drop'
import ProgressBar from '@uppy/progress-bar'
/* eslint-enable import/no-extraneous-dependencies */

// DEV CONFIG: create a .env.local file to customize those values.
// DEV CONFIG: create a .env file in the project root directory to customize those values.
const {
VITE_TUS_ENDPOINT : TUS_ENDPOINT,
} = import.meta.env
Expand Down
6 changes: 3 additions & 3 deletions website/src/_template/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ yarn run test:unit

We use [Cypress](cypress.io/) for our e2e test suite. Be sure to checkout “[Writing your first test](https://docs.cypress.io/guides/getting-started/writing-your-first-test#Add-a-test-file)” and the “[Introduction to Cypress](https://docs.cypress.io/guides/core-concepts/introduction-to-cypress#Cypress-Can-Be-Simple-Sometimes)”. You should also be aware of the “[Best Practices](https://docs.cypress.io/guides/references/best-practices)”.

To get started make sure you have your `.env.local` set up. If it doesn’t exist, it will use the default value in the `.env` file which won’t work for most cases. Copy `.env` to a file named `.env.local` and add the values relevant for the test(s) you are trying to run.
To get started make sure you have your `.env` set up. If it doesn’t exist, it will use the default value in the `.env` file which won’t work for most cases. Consider copy `.env` in a file named `.env` and the values relevant for the test(s) you are trying to run.

To start the testing suite run:

Expand All @@ -62,7 +62,7 @@ Even though facebook [allows using](https://developers.facebook.com/blog/post/20

Make sure that you are using a development facebook app at <https://developers.facebook.com/apps>

Go to “Instagram Basic Display” and find `Instagram App ID` and `Instagram App Secret`. Put them in a file called `.env.local` in the repo root:
Go to “Instagram Basic Display” and find `Instagram App ID` and `Instagram App Secret`. Put them in a file called `.env` in the repo root:

COMPANION_INSTAGRAM_KEY="Instagram App ID"
COMPANION_INSTAGRAM_SECRET="Instagram App Secret"
Expand All @@ -80,7 +80,7 @@ append `/instagram/redirect` to it, such as:

Add this full ngrok URL to `Valid OAuth Redirect URIs` under `Instagram Basic Display`.

Edit `.env.local` and change to your ngrok URI:
Edit `.env` and change to your ngrok URI:

COMPANION_DOMAIN="e0c7de09808d.ngrok.io"
COMPANION_PROTOCOL="https"
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8538,6 +8538,7 @@ __metadata:
core-js: ~3.19.3
cssnano: ^5.0.6
dedent: ^0.7.0
dotenv: ^16.0.0
esbuild: ^0.14.1
esbuild-plugin-babel: ^0.2.3
eslint: ^8.0.0
Expand Down Expand Up @@ -16869,6 +16870,13 @@ __metadata:
languageName: node
linkType: hard

"dotenv@npm:^16.0.0":
version: 16.0.0
resolution: "dotenv@npm:16.0.0"
checksum: 664cebb51f0a9a1d1b930f51f0271e72e26d62feaecc9dc03df39453dd494b4e724809ca480fb3ec3213382b1ed3f791aaeb83569a137f9329ce58efd4853dbf
languageName: node
linkType: hard

"dotenv@npm:^7.0.0":
version: 7.0.0
resolution: "dotenv@npm:7.0.0"
Expand Down

0 comments on commit 03ce606

Please sign in to comment.