diff --git a/.devcontainer/auto-quick-setup/devcontainer.json b/.devcontainer/auto-quick-setup/devcontainer.json index 90d74945e3..799b5a4932 100644 --- a/.devcontainer/auto-quick-setup/devcontainer.json +++ b/.devcontainer/auto-quick-setup/devcontainer.json @@ -1,6 +1,36 @@ { "name": "theyworkforyou", + "secrets": { + "TWFY_VOTES_URL": { + "description": "URL to the TWFY Votes page" + }, + "MAPIT_URL": { + "description": "URL to the MapIt API - defaults to mapit.mysociety.org." + }, + "MAPIT_API_KEY": { + "description": "API key for the MapIt API - optional for small numbers of queries." + }, + "DEMOCRACYCLUB_TOKEN": { + "description": "API key for the Democracy Club API - only for election postcode lookups." + }, + "RECAPTCHA_SITE_KEY": { + "description": "Recaptcha site key. Can use v2 test keys from link.", + "documentationUrl": "https://developers.google.com/recaptcha/docs/faq#:~:text=hidden%3B%20%7D-,I%27d%20like%20to%20run%20automated%20tests%20with%20reCAPTCHA.%20What%20should%20I%20do%3F,-For%20reCAPTCHA%20v3" + }, + "RECAPTCHA_SECRET": { + "description": "Recaptcha secret key. Can use v2 test keys from link.", + "documentationUrl": "https://developers.google.com/recaptcha/docs/faq#:~:text=hidden%3B%20%7D-,I%27d%20like%20to%20run%20automated%20tests%20with%20reCAPTCHA.%20What%20should%20I%20do%3F,-For%20reCAPTCHA%20v3" + + }, + "STRIPE_DONATE_PUBLIC_KEY": { + "description": "Stripe donate public key (test key). Only needed for donate page testing." + }, + "STRIPE_DONATE_SECRET_KEY": { + "description": "Stripe donate secret key (test key). Only needed for donate page testing." + } + + }, "dockerComposeFile": "../../docker-compose.yml", "service": "twfy", "workspaceFolder": "/twfy", diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 27ec13bf1c..ad88b23aad 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,36 @@ { "name": "theyworkforyou", + "secrets": { + "TWFY_VOTES_URL": { + "description": "URL to the TWFY Votes page" + }, + "MAPIT_URL": { + "description": "URL to the MapIt API - defaults to mapit.mysociety.org" + }, + "MAPIT_API_KEY": { + "description": "API key for the MapIt API - optional for small numbers of queries" + }, + "DEMOCRACYCLUB_TOKEN": { + "description": "API key for the Democracy Club API - only for election postcode lookups." + }, + "RECAPTCHA_SITE_KEY": { + "description": "Recaptcha site key. Can use v2 test keys from link.", + "documentationUrl": "https://developers.google.com/recaptcha/docs/faq#:~:text=hidden%3B%20%7D-,I%27d%20like%20to%20run%20automated%20tests%20with%20reCAPTCHA.%20What%20should%20I%20do%3F,-For%20reCAPTCHA%20v3" + }, + "RECAPTCHA_SECRET": { + "description": "Recaptcha secret key. Can use v2 test keys from link.", + "documentationUrl": "https://developers.google.com/recaptcha/docs/faq#:~:text=hidden%3B%20%7D-,I%27d%20like%20to%20run%20automated%20tests%20with%20reCAPTCHA.%20What%20should%20I%20do%3F,-For%20reCAPTCHA%20v3" + + }, + "STRIPE_DONATE_PUBLIC_KEY": { + "description": "Stripe donate public key (test key). Only needed for donate page testing." + }, + "STRIPE_DONATE_SECRET_KEY": { + "description": "Stripe donate secret key (test key). Only needed for donate page testing." + } + + }, "dockerComposeFile": "../docker-compose.yml", "service": "twfy", "workspaceFolder": "/twfy", diff --git a/bin/docker-entrypoint.sh b/bin/docker-entrypoint.sh index 27acd9de56..a5c5c5460b 100755 --- a/bin/docker-entrypoint.sh +++ b/bin/docker-entrypoint.sh @@ -15,6 +15,13 @@ sed -r \ -e 's!^(.*"OPTION_TWFY_DB_NAME", *)"[^"]*"!'"\\1'twfy'!" \ -e 's!^(.*"OPTION_TWFY_MEMCACHED_HOST", *)"[^"]*"!'"\\1'memcache'!" \ -e 's!^(.*"TWFY_VOTES_URL", *)"[^"]*"!'"\\1'$TWFY_VOTES_URL'!" \ + -e 's!^(.*"OPTION_MAPIT_URL", *)"[^"]*"!'"\\1'$MAPIT_URL'!" \ + -e 's!^(.*"OPTION_MAPIT_API_KEY", *)"[^"]*"!'"\\1'$MAPIT_API_KEY'!" \ + -e 's!^(.*"OPTION_DEMOCRACYCLUB_TOKEN", *)"[^"]*"!'"\\1'$DEMOCRACYCLUB_TOKEN'!" \ + -e 's!^(.*"OPTION_RECAPTCHA_SITE_KEY", *)"[^"]*"!'"\\1'$RECAPTCHA_SITE_KEY'!" \ + -e 's!^(.*"OPTION_RECAPTCHA_SECRET", *)"[^"]*"!'"\\1'$RECAPTCHA_SECRET'!" \ + -e 's!^(.*"STRIPE_DONATE_PUBLIC_KEY", *)"[^"]*"!'"\\1'$STRIPE_DONATE_PUBLIC_KEY'!" \ + -e 's!^(.*"STRIPE_DONATE_SECRET_KEY", *)"[^"]*"!'"\\1'$STRIPE_DONATE_SECRET_KEY'!" \ -e 's!^(.*"BASEDIR", *)"[^"]*"!'"\\1'/twfy/www/docs'!" \ -e 's!^(.*"DOMAIN", *)"[^"]*"!'"\\1'localhost'!" \ -e 's!^(.*"COOKIEDOMAIN", *)"[^"]*"!'"\\1'localhost'!" \ diff --git a/conf/general-example b/conf/general-example index 0e74da8fb1..cbdd119f7c 100644 --- a/conf/general-example +++ b/conf/general-example @@ -173,6 +173,8 @@ define('OPTION_HEARFROMYOURMP_BASE_URL', ''); if (!defined('OPTION_MAPIT_URL')) { define('OPTION_MAPIT_URL', ''); } + +define('OPTION_MAPIT_API_KEY', ''); define('OPTION_DEMOCRACYCLUB_TOKEN', ''); define('OPTION_MAPIT_UPRN_LOOKUP', ''); diff --git a/docker-compose.yml b/docker-compose.yml index 7983aa6366..8deec08c50 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,13 @@ services: TWFY_TEST_DB_USER: twfy TWFY_TEST_DB_PASS: password TWFY_VOTES_URL: ${TWFY_VOTES_URL} + MAPIT_URL: ${MAPIT_URL:-https://mapit.mysociety.org/} + MAPIT_API_KEY: ${MAPIT_API_KEY:-} + DEMOCRACYCLUB_TOKEN: ${DEMOCRACYCLUB_TOKEN:-} + RECAPTCHA_SITE_KEY: ${RECAPTCHA_SITE_KEY:-} + RECAPTCHA_SECRET: ${RECAPTCHA_SECRET:-} + STRIPE_DONATE_PUBLIC_KEY: ${STRIPE_DONATE_PUBLIC_KEY:-} + STRIPE_DONATE_SECRET_KEY: ${STRIPE_DONATE_SECRET_KEY:-} DEV_MODE: 'true' WSL_IP: ports: