-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: single top level dev .env file and quicker quickstart (#1021)
Use a single top level .env flle to set all dev env vars. With this PR getting started with the api and website is just - create a magic.link account - copy .env.tpl to .env in the monorepo root and fill out the magic link keys - npm i - npm start and you'll be off to the races with the api and website 🏇 💨 ✨ This PR includes: - create a new .env.tpl template that aggregates all the module env needs. - add top level `npm start` task to run the api and the website, for a quicker quickstart. - remove old FAUNA logic from pinpin so we don't have to set the DATABASE var any more. - Updated README's TODO: - [x] warn people that they need to copy the env template and fill out their magic link keys, and maybe copy their SALT over. - [x] fix it so that the api start command does't fail if you are already running the cluster and db containers. License: (Apache-2.0 AND MIT) Signed-off-by: Oli Evans <[email protected]>
- Loading branch information
Showing
25 changed files
with
670 additions
and
8,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# web3.storage DEV environment variables | ||
|
||
# Copy me to `.env` and fill out the missing values. | ||
# This file is only for DEV. In prod, set the env vars a process needs as secrets. | ||
ENV=dev | ||
|
||
|
||
## ---- api ------------------------------------------------------------------- | ||
|
||
# Create a https://magic.link account and set secret keys here. Set NEXT_PUBLIC_MAGIC with the publi key. | ||
MAGIC_SECRET_KEY= | ||
|
||
# Open https://csprng.xyz/v1/api and use the value of `Data`, or just use this one. it's for dev, it's ok. | ||
SALT="Q6d8sTZa+wpIPrppPq6VdIKEbknjrsSCQklh/hVU4U0=" | ||
|
||
# base64 test:test - the creds for the local cluster test container | ||
CLUSTER_BASIC_AUTH_TOKEN="dGVzdDp0ZXN0" | ||
CLUSTER_API_URL=http://127.0.0.1:9094 | ||
|
||
# PostgREST API token, for role "postgres", using secret value PGRST_JWT_SECRET from './postgres/docker/docker-compose.yml' see: https://postgrest.org/en/v8.0/tutorials/tut1.html#step-3-sign-a-token | ||
PG_REST_JWT="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicG9zdGdyZXMifQ.oM0SXF31Vs1nfwCaDxjlczE237KcNKhTpKEYxMX-jEU" | ||
PG_REST_URL=http://127.0.0.1:3000 | ||
# FOR TESTS ONLY: DB connection string for locally running postgres | ||
PG_CONNECTION=postgres://postgres:[email protected]:5432/postgres | ||
|
||
# IPFS Gateaway URL pointing to dockerised ipfs instance | ||
GATEWAY_URL=http://localhost:8080 | ||
|
||
## ---- website --------------------------------------------------------------- | ||
|
||
# vars to expose to the public website build have to be prefixed with NEXT_PUBLIC_ | ||
# see: https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser | ||
|
||
NEXT_PUBLIC_MAGIC= | ||
NEXT_PUBLIC_API=http://127.0.0.1:8787 | ||
NEXT_PUBLIC_ENV=dev | ||
|
||
# set me to test Countly analytics integration. | ||
# NEXT_PUBLIC_COUNTLY_KEY= | ||
# NEXT_PUBLIC_COUNTLY_URL= | ||
|
||
|
||
## ---- cron ------------------------------------------------------------------ | ||
|
||
# TODO: these are a duplicate of the api vars. Fix cron jobs so we can reuse the api vars. | ||
DEV_PG_REST_JWT="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicG9zdGdyZXMifQ.oM0SXF31Vs1nfwCaDxjlczE237KcNKhTpKEYxMX-jEU" | ||
DEV_PG_REST_URL=http://127.0.0.1:3000 | ||
DEV_PG_CONNECTION=postgres://postgres:[email protected]:5432/postgres | ||
|
||
CLUSTER_IPFS_PROXY_API_URL=http://127.0.0.1:9095/api/v0/ | ||
|
||
|
||
## ---- pinpin ---------------------------------------------------------------- | ||
|
||
# set me to test repinning our pins on pinata | ||
PINATA_JWT="<your jwt here>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.