Skip to content

Commit

Permalink
Merge pull request #827 from CobyPear/DB-6233-dotenv-example-refinements
Browse files Browse the repository at this point in the history
DB-6233: Add comments to .env.example env vars
  • Loading branch information
backlineint authored Aug 22, 2023
2 parents 6580b5d + 3ee2a48 commit e6c8c07
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-chefs-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pantheon-systems/decoupled-kit-health-check': patch
---

Fix link to WordPress preview site settings
6 changes: 6 additions & 0 deletions .changeset/happy-eggs-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'create-pantheon-decoupled-kit': patch
---

[next-wp][gatsby-wp][next-drupal] Add comments describing each env var in the
`.env.example`
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Copy as .env.development.local to override envars for local development
# Optional environment variables are commented out

# The graphql endpoint of your WordPress instance
WPGRAPHQL_URL=https://my-backend-site.pantheonsite.io/wp/graphql
#PANTHEON_UPLOAD_PATH=/example
#WP_APPLICATION_USERNAME=
#WP_APPLICATION_PASSWORD=

# Username and Application Password for a valid user in the WordPress instance
# Required to fetch private content from WordPress
# WP_APPLICATION_USERNAME=user
# WP_APPLICATION_PASSWORD=example_pass

# Sets the gatsby.config.pathPrefix setting for you
# This value is only required if using the pathPrefix feature
# See https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/ for more information
# PANTHEON_UPLOAD_PATH=/example
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# Copy as .env.development.local to override envars for local development
# Optional environment variables are commented out

# The URL of your Drupal site
BACKEND_URL=http://my-backend-site.pantheonsite.io
FRONTEND_URL=http://my-frontend-site.pantheonsite.io
IMAGE_DOMAIN=my-frontend-site.pantheonsite.io
PREVIEW_SECRET=mysecret
CLIENT_ID=my-client-id
CLIENT_SECRET=my-client-secret
NEXT_PUBLIC_FRONTEND_URL=$FRONTEND_URL

# The domain where your images are hosted. By default, we will set the domain of the BACKEND_URL
# to the value of IMAGE_DOMAIN. Set this if your images are hosted somewhere other than your Drupal instance
# See https://nextjs.org/docs/pages/api-reference/components/image#domains for more information
# IMAGE_DOMAIN=some-other-domain.example

# The secret set on your Drupal Preview Site. Required for preview functionality
# See https://decoupledkit.pantheon.io/docs/backend-starters/decoupled-drupal/configuring-preview-site for more information on configuring a preview site
# PREVIEW_SECRET=super-secret-preview-secret

# The credentials of your Drupal OAuth client
# CLIENT_ID=my-client-id
# CLIENT_SECRET=my-client-secret

# Sets debug mode for instance of DrupalState.
# Leave empty to turn off debug mode
DEBUG_MODE=
# Leave empty or remove to turn off debug mode
# DEBUG_MODE=true

#PANTHEON_UPLOAD_PATH=/example
# The value of Next.js basePath
# See https://nextjs.org/docs/pages/api-reference/next-config-js/basePath for more information
# This variable is only required if using the basePath feature
# PANTHEON_UPLOAD_PATH=/example
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
# Copy as .env.development.local to override envars for local development
# Optional environment variables are commented out
WPGRAPHQL_URL=
IMAGE_DOMAIN=
#PANTHEON_UPLOAD_PATH=/example
#PREVIEW_SECRET=
#WP_APPLICATION_USERNAME=
#WP_APPLICATION_PASSWORD=

# The graphql endpoint of your WordPress instance
WPGRAPHQL_URL=https://my-backend-site.pantheonsite.io/wp/graphql

# Username and Application Password for a valid user in the WordPress instance
# Required to fetch private content from WordPress
# WP_APPLICATION_USERNAME=user
# WP_APPLICATION_PASSWORD=example_pass

# The secret set on your WordPress Preview Site. Required for preview functionality
# See https://decoupledkit.pantheon.io/docs/backend-starters/decoupled-wordpress/configuring-preview-site for more information on configuring a preview site
# PREVIEW_SECRET=super-secret-preview-secret

# The domain where your images are hosted. By default, we will set the domain of the WPGRAPHQL_URL
# to the value of IMAGE_DOMAIN. Set this if your images are hosted somewhere other than your WordPress instance
# See https://nextjs.org/docs/pages/api-reference/components/image#domains for more information
# IMAGE_DOMAIN=some-other-domain.example


# Sets the next.config.basePath setting for you
# This variable is only required if using the basePath feature
# See https://nextjs.org/docs/pages/api-reference/next-config-js/basePath for more information
# PANTHEON_UPLOAD_PATH=/example
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ exports[`NextWordPressHealthCheck > should pass for a valid backend and valid au
"|__✅ Auth is valid!",
"Checking for PREVIEW_SECRET...",
"|__💡 PREVIEW_SECRET env var is not set.",
"|____ To set a new secret, go to 🔗 https://wordpress.test/admin/structure/dp-preview-site and edit the preview site you want to use.",
"|____ To set a new secret, go to 🔗 https://wordpress.test/wp/wp-admin/options-general.php?page=preview_sites and edit the preview site you want to use.",
"⏭ Skipping preview endpoint validation -- PREVIEW_SECRET required.",
]
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class NextWordPressHealthCheck extends WordPressHealthCheck {
this.log.suggest(
`To set a new secret, go to 🔗 https://${
this.getURL().host
}/admin/structure/dp-preview-site and edit the preview site you want to use.`,
}/wp/wp-admin/options-general.php?page=preview_sites and edit the preview site you want to use.`,
);
console.log(
'⏭ Skipping preview endpoint validation -- PREVIEW_SECRET required.',
Expand Down

0 comments on commit e6c8c07

Please sign in to comment.