From bf3ba3363a36134ed2eb9b6516955c6ad43e6770 Mon Sep 17 00:00:00 2001 From: Sem Bauke Date: Thu, 9 Jan 2025 17:45:58 +0100 Subject: [PATCH] fix: serve assets from CDN instead of AWS (#58023) --- .../src/common/utils/constantStrings.json | 2 +- client/i18n/locales/english/links.json | 4 +-- client/static/json/cats.json | 27 +++++++++++++------ e2e/image-picture-check.spec.ts | 4 +-- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/api-server/src/common/utils/constantStrings.json b/api-server/src/common/utils/constantStrings.json index dc58f9809a6..195890ccffa 100644 --- a/api-server/src/common/utils/constantStrings.json +++ b/api-server/src/common/utils/constantStrings.json @@ -1,6 +1,6 @@ { "aboutUrl": "https://www.freecodecamp.org/about", - "defaultProfileImage": "https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png", + "defaultProfileImage": "https://cdn.freecodecamp.org/platform/universal/camper-image-placeholder.png", "donateUrl": "https://www.freecodecamp.org/donate", "forumUrl": "https://forum.freecodecamp.org", "githubUrl": "https://github.com/freecodecamp/freecodecamp", diff --git a/client/i18n/locales/english/links.json b/client/i18n/locales/english/links.json index 6d8d8c23baf..ff1b275aaf8 100644 --- a/client/i18n/locales/english/links.json +++ b/client/i18n/locales/english/links.json @@ -14,8 +14,8 @@ }, "donate": { "other-ways-url": "https://www.freecodecamp.org/news/how-to-donate-to-free-code-camp", - "download-irs-url": "https://s3.amazonaws.com/freecodecamp/Free+Code+Camp+Inc+IRS+Determination+Letter.pdf", - "download-990-url": "https://freecodecamp.s3.amazonaws.com/freeCodeCamp+2019+f990.pdf", + "download-irs-url": "https://cdn.freecodecamp.org/non-profit-docs/freeCodeCamp-determination-letter.pdf", + "download-990-url": "https://cdn.freecodecamp.org/non-profit-docs/freeCodeCamp-2019-f990.pdf", "one-time-url": "https://paypal.me/freecodecamp", "one-time-external-url": "https://www.freecodecamp.org/news/how-to-donate-to-free-code-camp/#how-can-i-make-a-one-time-donation", "mail-check-url": "https://www.freecodecamp.org/news/how-to-donate-to-free-code-camp/#can-i-mail-a-physical-check" diff --git a/client/static/json/cats.json b/client/static/json/cats.json index e5d43f74dcd..8acce127305 100644 --- a/client/static/json/cats.json +++ b/client/static/json/cats.json @@ -1,21 +1,32 @@ [ { "id": 0, - "imageLink": "https://s3.amazonaws.com/freecodecamp/funny-cat.jpg", + "imageLink": "https://cdn.freecodecamp.org/curriculum/legacy-json-apis-ajax/funny-cat.jpg", "altText": "A white cat wearing a green, helmet shaped melon on its head. ", - "codeNames": ["Juggernaut", "Mrs. Wallace", "Buttercup"] + "codeNames": [ + "Juggernaut", + "Mrs. Wallace", + "Buttercup" + ] }, { "id": 1, - "imageLink": "https://s3.amazonaws.com/freecodecamp/grumpy-cat.jpg", + "imageLink": "https://cdn.freecodecamp.org/curriculum/legacy-json-apis-ajax/grumpy-cat.jpg", "altText": "A white cat with blue eyes, looking very grumpy. ", - "codeNames": ["Oscar", "Scrooge", "Tyrion"] + "codeNames": [ + "Oscar", + "Scrooge", + "Tyrion" + ] }, { "id": 2, - "imageLink": "https://s3.amazonaws.com/freecodecamp/mischievous-cat.jpg", - "altText": - "A ginger cat with one eye closed and mouth in a grin-like expression. Looking very mischievous. ", - "codeNames": ["The Doctor", "Loki", "Joker"] + "imageLink": "https://cdn.freecodecamp.org/curriculum/legacy-json-apis-ajax/mischievous-cat.jpg", + "altText": "A ginger cat with one eye closed and mouth in a grin-like expression. Looking very mischievous. ", + "codeNames": [ + "The Doctor", + "Loki", + "Joker" + ] } ] diff --git a/e2e/image-picture-check.spec.ts b/e2e/image-picture-check.spec.ts index 4c4590605af..6119776ac30 100644 --- a/e2e/image-picture-check.spec.ts +++ b/e2e/image-picture-check.spec.ts @@ -26,7 +26,7 @@ test.describe('Picture input field', () => { const pictureInput = page.getByLabel('Picture'); await pictureInput.fill(''); await pictureInput.fill( - 'https://s3.amazonaws.com/freecodecamp/camper-image' + 'https://cdn.freecodecamp.org/platform/universal/camper-image-placeholder' ); await expect( page.getByText('URL must link directly to an image file') @@ -37,7 +37,7 @@ test.describe('Picture input field', () => { const pictureInput = page.getByLabel('Picture'); await pictureInput.fill(''); await pictureInput.fill( - 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png' + 'https://cdn.freecodecamp.org/platform/universal/camper-image-placeholder.png' ); const form = page.getByTestId('camper-identity');