diff --git a/public/_redirects b/public/_redirects index 66af865d8..a3988e149 100644 --- a/public/_redirects +++ b/public/_redirects @@ -8,7 +8,7 @@ /s/divide-and-conquer-drupal4gov https://docs.google.com/presentation/d/1_OyAwQGTtz9xv1e_Qzau4Rarum5xQpPy0uS7ntA9leI/edit?usp=sharing 301 /s/divide-conquer-dcco https://docs.google.com/presentation/d/1JBSXLP59E8DSzkvxqPPKuceQ_fSMXoW_tySs_jXe8Pg/edit?usp=sharing 301 /s/addon-update-checker.sh https://raw.githubusercontent.com/ddev/ddev-addon-template/main/.github/scripts/update-checker.sh 301 -/s/sponsorship-data.json https://rfay.github.io/sponsorship-data/data/all-sponsorships.json 301 +/s/sponsorship-data.json https://ddev.github.io/sponsorship-data/data/all-sponsorships.json 301 # Generic blog redirects /ddev-local /blog 301 diff --git a/src/components/SponsorsBanner.astro b/src/components/SponsorsBanner.astro index fd5749254..5f74cc030 100644 --- a/src/components/SponsorsBanner.astro +++ b/src/components/SponsorsBanner.astro @@ -1,8 +1,8 @@ --- import { getSponsorshipData } from "../lib/api"; -const goal = 12000; const data = await getSponsorshipData(); +const goal = data?.current_goal?.target_amount || 12000; const income = data?.total_monthly_average_income || 0; const percentage = Math.min((income / goal) * 100, 100).toFixed(0); @@ -141,7 +141,7 @@ function formatCurrency(value: number): string { const goal = 12000; const cacheKey = 'ddevSponsorshipData'; const cacheTTL = 12 * 60 * 60 * 1000; // 12 hours in ms - const apiUrl = 'https://raw.githubusercontent.com/ddev/sponsorship-data/refs/heads/main/data/all-sponsorships.json'; + const apiUrl = '/s/sponsorship-data.json'; function formatCurrency(value) { return new Intl.NumberFormat('en-US', { @@ -155,10 +155,11 @@ function formatCurrency(value: number): string { function updateUI(data) { try { const income = data.total_monthly_average_income; - const percentage = Math.min((income / goal) * 100, 100).toFixed(0); + const currentGoal = data.current_goal?.target_amount || goal; + const percentage = Math.min((income / currentGoal) * 100, 100).toFixed(0); document.querySelector('.ddev-sponsor-us-banner__raised').textContent = `Raised: ${formatCurrency(income)}`; - document.querySelector('.ddev-sponsor-us-banner__goal').textContent = `Goal: ${formatCurrency(goal)}`; + document.querySelector('.ddev-sponsor-us-banner__goal').textContent = `Goal: ${formatCurrency(currentGoal)}`; document.querySelector('.ddev-sponsor-us-banner__percent').textContent = `${percentage}% of monthly goal`; document.querySelector('.ddev-sponsor-us-banner__fill').style.width = `${percentage}%`; } catch (error) { diff --git a/src/content/blog/ddev-april-2025-newsletter.md b/src/content/blog/ddev-april-2025-newsletter.md index 2a38904e5..7e6050242 100644 --- a/src/content/blog/ddev-april-2025-newsletter.md +++ b/src/content/blog/ddev-april-2025-newsletter.md @@ -29,7 +29,7 @@ categories: **Thanks for subscribing to the newsletter! We love to have this way to keep in touch.** If you're not getting it yet by email, please sign up at [ddev.com/newsletter](/newsletter). -**Great News: Sponsorship Level is Increasing!** According to our [open sponsorship feed](https://github.com/ddev/sponsorship-data/blob/main/data/all-sponsorships.json) our total monthly average income went up from $7099 to $7639 since March 1, a $540 bump in one month. Wow, you're awesome, thank you! If your organization or you aren't on the bandwagon yet, [join us to help make DDEV sustainable](https://github.com/sponsors/ddev). GitHub Sponsors is great, but we also do support contracts, invoicing, PayPal — anything that works for you! Our goal is $12,000/month, so we're more than halfway there. Special thanks to new $100/month sponsors [@fullfatthings](http://www.fullfatthings.com/), [@liip](https://www.liip.ch/en), [@andreas-anwesoft](https://www.anwesoft.com/), [@wearrudder](https://wearerudder.com/)! +**Great News: Sponsorship Level is Increasing!** According to our [open sponsorship feed](https://ddev.com/s/sponsorship-data.json) our total monthly average income went up from $7099 to $7639 since March 1, a $540 bump in one month. Wow, you're awesome, thank you! If your organization or you aren't on the bandwagon yet, [join us to help make DDEV sustainable](https://github.com/sponsors/ddev). GitHub Sponsors is great, but we also do support contracts, invoicing, PayPal — anything that works for you! Our goal is $12,000/month, so we're more than halfway there. Special thanks to new $100/month sponsors [@fullfatthings](http://www.fullfatthings.com/), [@liip](https://www.liip.ch/en), [@andreas-anwesoft](https://www.anwesoft.com/), [@wearrudder](https://wearerudder.com/)! **THANKS to all of you who are supporting DDEV’s path to sustainability** and who have gotten your organizations to do so. diff --git a/src/content/blog/ddev-feb-2025-newsletter.md b/src/content/blog/ddev-feb-2025-newsletter.md index 7a178ec17..af6e0a69d 100644 --- a/src/content/blog/ddev-feb-2025-newsletter.md +++ b/src/content/blog/ddev-feb-2025-newsletter.md @@ -35,7 +35,7 @@ categories: - **Node.js** improved support: People have asked for some time for Node.js to be the primary web server (instead of Nginx+php-fpm, etc), and now it can be done in a number of ways. This is now in [DDEV HEAD](https://ddev.readthedocs.io/en/stable/developers/building-contributing/#testing-latest-commits-on-head) and there are Quickstarts for [Simple Node.js](https://ddev.readthedocs.io/en/latest/users/quickstart/#nodejs-nodejs-web-server) and [SvelteKit](https://ddev.readthedocs.io/en/latest/users/quickstart/#nodejs-sveltekit). Incidentally, this also provides experimental support for [FrankenPHP](https://frankenphp.dev/) and provides a [Quickstart](https://ddev.readthedocs.io/en/latest/users/quickstart/#generic-frankenphp) for it as a demonstration of the "generic" web server type. - **Web-based Add-on Registry**: As add-ons have become so very popular it's hard to sort them out and understand which ones are meaningful for a particular need. This long-term goal is nearing completion as Stas has a proof of concept and now has to push it through to a maintained production status. - **Automated Tests for Quickstarts**: You won't see these, but it's a big step for us. Because our [Quickstarts](https://ddev.readthedocs.io/en/stable/users/quickstart/) are so dependent on the behavior of the upstream projects, it's always been hard for us to know when the target project has had a change that invalidates them. Now we have automated tests for the quickstarts of number of project types, and will add others as maintenance is done. Thanks to [Ralf Koller](https://github.com/rpkoller) for extensive work on the Drupal, WordPress, and TYPO3 quickstarts. -- **Funding situation data feed**: Aiming for ever-increasing transparency in the DDEV funding situation, we now have an automatically-updated feed showing our [funding situation from all sources](https://github.com/ddev/sponsorship-data). You can see the [exact situation](https://github.com/ddev/sponsorship-data/blob/main/data/all-sponsorships.json) at any time. We expect to use this feed in the message-of-the-day on DDEV, as well as ddev.com and the DDEV README. +- **Funding situation data feed**: Aiming for ever-increasing transparency in the DDEV funding situation, we now have an automatically-updated feed showing our [funding situation from all sources](https://github.com/ddev/sponsorship-data). You can see the [exact situation](/s/sponsorship-data.json) at any time. We expect to use this feed in the message-of-the-day on DDEV, as well as ddev.com and the DDEV README. - **New contributors and maintainers**: As DDEV's community grows, we always need new contributors and maintainers. We love to get contributors trained and get privileges to maintainers as needed! We already have lots of [Contributor Training](https://ddev.com/blog/category/training/) material, and [docs on how to contribute](https://ddev.readthedocs.io/en/stable/developers/) but we'll do anything you ask for! Need help with something? Need updates? Join us in [Discord](/s/discord) or [make an appointment with me](https://cal.com/randyfay/30min). The next **DDEV Advisory Group Meeting** is Wednesday, March 5, 2025. We'll be doing a review of DDEV's 2024 and a discussion of [proposed plans for 2025](2025-plans.md). This is open to all and we'd love to have you! diff --git a/src/content/blog/sponsor-thanks.md b/src/content/blog/sponsor-thanks.md index 8d8ed5e1d..e739915fd 100644 --- a/src/content/blog/sponsor-thanks.md +++ b/src/content/blog/sponsor-thanks.md @@ -40,7 +40,7 @@ And please don't forget that the [open-source Docker project](https://github.com ## JSON Detail about Sponsorships -We recently set up a [full updated JSON feed](https://github.com/ddev/sponsorship-data) that can be used to see exactly where DDEV's sponsorship comes from and how we're doing. You can see the latest data any day in the [all sponsorships](https://github.com/ddev/sponsorship-data/blob/main/data/all-sponsorships.json) feed. And [Mark Conroy](https://bsky.app/profile/mark.ie) has built a [web component](https://web-components.mark.ie/web-components/ddev/sponsors-banner/) that can be used to show where we're at on any website. Thank you! +We recently set up a [full updated JSON feed](/s/sponsorship-data.json) that can be used to see exactly where DDEV's sponsorship comes from and how we're doing. You can see the latest data any day in the [all sponsorships](https://github.com/ddev/sponsorship-data/blob/main/data/all-sponsorships.json) feed. And [Mark Conroy](https://bsky.app/profile/mark.ie) has built a [web component](https://web-components.mark.ie/web-components/ddev/sponsors-banner/) that can be used to show where we're at on any website. Thank you! ## Many Ways to Sponsor diff --git a/src/content/blog/sustainability-for-ddev.md b/src/content/blog/sustainability-for-ddev.md index 0f574a12a..3be7bb601 100644 --- a/src/content/blog/sustainability-for-ddev.md +++ b/src/content/blog/sustainability-for-ddev.md @@ -56,7 +56,7 @@ We work hard to identify areas that are dependent on a single maintainer, and to ## Current Financial Status -As of June, 2025, DDEV's monthly support is at the $7800 USD level. Our goal is $12,000. You can see this at any time on the top of [ddev.com](/), and a full accounting updated daily is in the [sponsorship-data](https://github.com/ddev/sponsorship-data/blob/main/data/all-sponsorships.json) repository. Our current bank balance is about $19,000 USD. +As of June, 2025, DDEV's monthly support is at the $7800 USD level. Our goal is $12,000. You can see this at any time on the top of [ddev.com](/), and a full accounting updated daily is in the [sponsorship-data](https://github.com/ddev/sponsorship-data/) repository. Our current bank balance is about $19,000 USD. ## Share Your Thoughts! diff --git a/src/lib/api.ts b/src/lib/api.ts index c3a52904e..c4ab4bf51 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -22,7 +22,7 @@ const githubTokenIsSet: boolean = (() => { process.env.GITHUB_TOKEN === "" ) { // add warning for production builds - if (import.meta.env.MODE === "production") { + if (import.meta.env.PROD) { console.warn( "GITHUB_TOKEN not set or empty. You can ignore this warning for local development." ) @@ -265,13 +265,17 @@ export async function getSponsorshipData() { return cachedData } - const response = await octokit().request( - `GET https://api.github.com/repos/ddev/sponsorship-data/contents/data/all-sponsorships.json` - ) + // Construct the full URL for the redirect + const baseUrl = import.meta.env.PROD + ? "https://ddev.com" + : import.meta.env.SITE || "https://ddev.com" + const response = await fetch(`${baseUrl}/s/sponsorship-data.json`) - const content = Buffer.from(response.data.content, "base64").toString("utf8") + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`) + } - const sponsorshipData = JSON.parse(content) + const sponsorshipData = await response.json() putCache(cacheFilename, JSON.stringify(sponsorshipData))