Document env vars (#1601)
This commit is contained in:
commit
67d058d77c
3 changed files with 98 additions and 11 deletions
98
apps/photos/.env.development
Normal file
98
apps/photos/.env.development
Normal file
|
@ -0,0 +1,98 @@
|
|||
# Sample configuration file
|
||||
#
|
||||
# All variables are commented out by default. Copy paste this into a new file
|
||||
# called `.env.local`, or create a new file with that name and add the
|
||||
# environment variables you need into it. That `.env.local` file will be
|
||||
# .gitignored, so you can freely customize how the app runs in your local setup.
|
||||
#
|
||||
# - `.env.local` is picked up by next when NODE_ENV is development
|
||||
#
|
||||
# - `.env` is picked up always
|
||||
#
|
||||
# You don't necessarily need to use these files, these variables can be provided
|
||||
# as environment variables when running yarn dev too. e.g.
|
||||
#
|
||||
# NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:3000 yarn dev:photos
|
||||
#
|
||||
# Variables prefixed with NEXT_PUBLIC_ (in our case, all of them) are made
|
||||
# available when next runs our code in the browser. For more details, see
|
||||
# https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables
|
||||
#
|
||||
# By default, the app is configured to connect to the production instance etc.
|
||||
# This is usually a good default, for example someone might want to run the
|
||||
# client locally but still use their actual ente account.
|
||||
#
|
||||
# Even though it connects to the production instances, when invoked with `yarn
|
||||
# dev:*`, next will behave as if NODE_ENV was set to 'development' (otherwise
|
||||
# this is assumed to be 'production'). There are some other cases too when we
|
||||
# assume we're in a dev environment (e.g. the NEXT_PUBLIC_APP_ENV env var below.
|
||||
# For the full list of rules that decide what counts as a dev build, see the
|
||||
# `isDevDeployment` function).
|
||||
#
|
||||
# We have some development related conveniences tied to the dev build:
|
||||
# 1. Logs go to the browser console instead of the log file
|
||||
# 2. Sentry crash reporting etc is disabled
|
||||
#
|
||||
# The variables below thus serve as ways to customize which API instance we
|
||||
# connect to for various purposes. These variables are only honoured when we're
|
||||
# in a development environment.
|
||||
|
||||
# The ente API endpoint
|
||||
# NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:3000
|
||||
|
||||
# The ente API endpoint for payments related functionality
|
||||
# NEXT_PUBLIC_ENTE_PAYMENT_ENDPOINT = http://localhost:3001
|
||||
|
||||
# The URL for the shared albums deployment
|
||||
#
|
||||
# Currently the shared albums code is intermixed with the photos app code; when
|
||||
# deploying, we add an a CNAME alias from "albums.ente.io" -> "/shared-album".
|
||||
#
|
||||
# Enhancement: Consider splitting this into a separate app/ in this repository.
|
||||
# NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT = http://localhost:3002
|
||||
|
||||
# The URL of the family plans web app deployment
|
||||
#
|
||||
# Currently the source code for the family plan related pages is in a separate
|
||||
# repository (https://github.com/ente-io/families). The mobile app also uses
|
||||
# these pages.
|
||||
#
|
||||
# Enhancement: Consider moving that into the app/ folder in this repository.
|
||||
# NEXT_PUBLIC_ENTE_FAMILY_PORTAL_ENDPOINT = http://localhost:3003
|
||||
|
||||
# This in not useful when running locally. It is used to provide us a way to
|
||||
# mark certain deployments as "staging" by setting environment variables in the
|
||||
# CI job that deploys them on a remote server. See the `isDevDeployment`
|
||||
# function.
|
||||
#
|
||||
# By default, the photos web app gets deployed to "web.ente.io".
|
||||
# NEXT_PUBLIC_ENTE_WEB_ENDPOINT = http://localhost:3000
|
||||
|
||||
# Set this to true to disable reporting of crashes to Sentry.
|
||||
#
|
||||
# Crash reporting is disabled if the user has opted out. This provides another
|
||||
# way to disable crash reporting, say for local test branches.
|
||||
# NEXT_PUBLIC_DISABLE_SENTRY=true
|
||||
|
||||
# Set this to disable the upload of files via CF Workers
|
||||
#
|
||||
# CF workers provide us with a way of make the file uploads faster. The why and
|
||||
# how is explained here: https://ente.io/blog/tech/making-uploads-faster/
|
||||
#
|
||||
# By default, that's the route we take. This flag can be set to true to disable
|
||||
# that route, and instead directly upload to the S3-compatible URLs provided by
|
||||
# our API server.
|
||||
#
|
||||
# Note the double negative.
|
||||
# NEXT_PUBLIC_DISABLE_CF_UPLOAD_PROXY = true
|
||||
|
||||
# This is an alternative to run as a development build.
|
||||
#
|
||||
# You likely don't need this if you're running on your machine, because when
|
||||
# invoked with `next dev` (as is the case for `yarn dev:photos` etc), next will
|
||||
# behave as if NODE_ENV was set to 'development'.
|
||||
# NEXT_PUBLIC_APP_ENV = development
|
||||
|
||||
# The path of the JSON file which contains the expected results of our
|
||||
# integration tests. See `upload.test.ts` for more details.
|
||||
# NEXT_PUBLIC_EXPECTED_JSON_PATH = /path/to/dataset/expected.json
|
|
@ -78,16 +78,6 @@ export const getFamilyPortalURL = () => {
|
|||
return `https://family.ente.io`;
|
||||
};
|
||||
|
||||
// getAuthenticatorURL returns the endpoint for the authenticator which can be used to
|
||||
// view authenticator codes.
|
||||
export const getAuthURL = () => {
|
||||
const authURL = process.env.NEXT_PUBLIC_ENTE_AUTH_ENDPOINT;
|
||||
if (isDevDeployment() && authURL) {
|
||||
return authURL;
|
||||
}
|
||||
return `https://auth.ente.io`;
|
||||
};
|
||||
|
||||
export const getSentryTunnelURL = () => {
|
||||
return `https://sentry-reporter.ente.io`;
|
||||
};
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
"NEXT_PUBLIC_ENTE_PAYMENT_ENDPOINT",
|
||||
"NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT",
|
||||
"NEXT_PUBLIC_ENTE_FAMILY_PORTAL_ENDPOINT",
|
||||
"NEXT_PUBLIC_ENTE_AUTH_ENDPOINT",
|
||||
"NEXT_PUBLIC_ENTE_WEB_ENDPOINT",
|
||||
"NEXT_PUBLIC_IS_TEST_APP",
|
||||
"NODE_ENV",
|
||||
|
|
Loading…
Add table
Reference in a new issue