From dc0b139996fa06197f9d93ec2a7b065ee29958f8 Mon Sep 17 00:00:00 2001 From: Jay Varner Date: Fri, 6 Sep 2024 11:30:49 -0400 Subject: [PATCH] Replace key on deploy --- .github/workflows/deploy.yml | 4 ++++ public/verifyCaptcha.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 public/verifyCaptcha.php diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 95cba80..e6e4b47 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,6 +21,7 @@ jobs: VITE_API_ENDPOINT: ${{secrets.VITE_API_ENDPOINT}} VITE_RECAPTCHA_API_KEY: ${{secrets.VITE_RECAPTCHA_API_KEY}} REMOTE_USER: ${{secrets.REMOTE_USER}} + CAPTCHA_SECRET_KEY: ${{secrets.CAPTCHA_SECRET_KEY}} steps: - uses: actions/checkout@v3 @@ -34,6 +35,9 @@ jobs: uses: actions/setup-node@v3 with: node-version: 16 + - name: Add key to Captcha script + run: | + sed -i "s\\\$CAPTCHA_SECRET_KEY\g" ./public/verifyCaptcha.php - name: Install and Build run: | npm install diff --git a/public/verifyCaptcha.php b/public/verifyCaptcha.php old mode 100644 new mode 100755 index a81e78e..ef6b6cd --- a/public/verifyCaptcha.php +++ b/public/verifyCaptcha.php @@ -2,7 +2,7 @@ switch ($_SERVER["REQUEST_METHOD"]) { case 'POST': $captcha_value = $_POST['captchaValue']; - $url = "https://www.google.com/recaptcha/api/siteverify?secret=&response=$captcha_value"; + $url = "https://www.google.com/recaptcha/api/siteverify?secret=6LcX8jYqA4-ka_cYIcW7mM6TmMDFAAAAFnPjlLa0&response=$captcha_value"; $request = [ 'https' => [ 'method' => 'POST',