From d645d1a8a4e065336d7b40b13f4900eda013e493 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Tue, 12 Nov 2024 19:45:53 -0500 Subject: [PATCH 1/2] chore: remove recaptcha files available upstream --- .../beforeRegister/recaptcha.php | 9 --------- .../recaptcha.php | 17 ----------------- 2 files changed, 26 deletions(-) delete mode 100644 event-handlers/Emergence/People/RegistrationRequestHandler/beforeRegister/recaptcha.php delete mode 100644 php-config/ContactRequestHandler.config.d/recaptcha.php diff --git a/event-handlers/Emergence/People/RegistrationRequestHandler/beforeRegister/recaptcha.php b/event-handlers/Emergence/People/RegistrationRequestHandler/beforeRegister/recaptcha.php deleted file mode 100644 index 1cc5f1ea..00000000 --- a/event-handlers/Emergence/People/RegistrationRequestHandler/beforeRegister/recaptcha.php +++ /dev/null @@ -1,9 +0,0 @@ -verify($_EVENT['requestData']['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); - - if (!$recaptchaResponse->isSuccess()) { - $_EVENT['additionalErrors']['ReCaptcha'] = 'Please prove that you aren\'t a spam robot by completing the reCAPTCHA'; - } -} \ No newline at end of file diff --git a/php-config/ContactRequestHandler.config.d/recaptcha.php b/php-config/ContactRequestHandler.config.d/recaptcha.php deleted file mode 100644 index 3771cbe0..00000000 --- a/php-config/ContactRequestHandler.config.d/recaptcha.php +++ /dev/null @@ -1,17 +0,0 @@ - 'ReCaptcha', - 'field' => 'g-recaptcha-response', - 'required' => true, - 'errorMessage' => 'Please prove that you aren\'t a spam robot by completing the reCAPTCHA', - 'validator' => function ($response) use ($recaptcha) { - $recaptchaResponse = $recaptcha->verify($response, $_SERVER['REMOTE_ADDR']); - - return $recaptchaResponse->isSuccess(); - }, - ]; - - ContactRequestHandler::$excludeFields[] = 'g-recaptcha-response'; -} From 52a60efdb3021ee939b8e0f490e5722f87f3d12c Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Tue, 12 Nov 2024 20:07:47 -0500 Subject: [PATCH 2/2] feat: add support for .env file --- .env.example | 2 ++ .gitignore | 1 + script/studio | 9 +++++++++ 3 files changed, 12 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..71efc645 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +RECAPTCHA_SITE_KEY= +RECAPTCHA_SECRET_KEY= diff --git a/.gitignore b/.gitignore index a8edd793..d1f1658a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .emergence .php_cs.cache +.env diff --git a/script/studio b/script/studio index ed36f8bc..33736156 100755 --- a/script/studio +++ b/script/studio @@ -22,6 +22,14 @@ if [ -n "${1}" ]; then fi +# initialize .env +if [ ! -f .env ]; then + echo + echo "==> studio: initializing .env" + cp .env.example .env +fi + + echo echo "==> studio: configuring Chef Habitat studio Docker options…" STUDIO_NAME="${STUDIO_NAME:-laddr-studio}" @@ -33,6 +41,7 @@ export HAB_DOCKER_OPTS=" -v $(cd ~/.ssh; pwd)/known_hosts:/root/.ssh/known_hosts:ro --env STUDIO_DEVELOPER_UID=$(id -u) --env STUDIO_DEVELOPER_GID=$(id -g) + --env-file .env " echo "${HAB_DOCKER_OPTS}"