Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,11 @@ npx wrangler secret put EXTENSIONS_REVALIDATE_SECRET
The extension directory website is licensed under the GNU Affero General Public License Version 3. See [LICENSE](./LICENSE) for details.

Individual extensions are licensed by their respective authors.

## Manifest API contract

The generated v2 client follows the API's manifest v1 contract: `module`, string licenses, optional `homepage_url`, package authors, and full FOSSBilling/PHP/module requirements. Author/edit/moderator forms preserve these fields; historical revision diffs also accept pre-manifest license objects and `website` fields.

Package icons are paths relative to the distribution root. For GitHub release assets matching the declared source repository, the site resolves them against the release tag. `FOSSBilling/modules` uses its `Ucfirst(id)/` package directory; other GitHub sources use the repository root. Unsupported sources omit relative icons. Legacy HTTP(S) icons continue to work.

API mutations and site mutations both purge the `extensions` and `developers` tags. The `developers` tag is currently a no-op reserved for future cached surfaces; developer pages are uncached. Deploy this site with the API's manifest migration and cache-tag change before enabling the updated modules publisher. Existing cached pages expire through their cache windows; deployment must coordinate the new contract and tag. Old pending revisions require resubmission using the manifest fields before approval.
13 changes: 7 additions & 6 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check
import { defineConfig } from 'astro/config';
import { EXTENSIONS_CACHE_TAG } from './src/lib/cache-tags';
import tailwindcss from '@tailwindcss/vite';
import cloudflare from '@astrojs/cloudflare';
import { cacheCloudflare } from '@astrojs/cloudflare/cache';
Expand All @@ -9,26 +10,26 @@ export default defineConfig({
output: 'server',
// Canonical and Open Graph URLs are built from this origin at render time.
site: 'https://extensions.fossbilling.org',
// Route caching: public catalogue pages carry a Cloudflare-CDN-Cache-Control
// Route caching: public directory pages carry a Cloudflare-CDN-Cache-Control
// header, so Cloudflare's zone-wide CDN serves cache hits without invoking
// the worker at all. Per-colo Cache API cannot be purged remotely; these
// entries are tag-purgeable, which is what makes catalogue mutations
// entries are tag-purgeable, which is what makes directory mutations
// visible within seconds instead of after a TTL (see lib/cache-invalidate).
cache: {
provider: cacheCloudflare(),
},
routeRules: {
// New submissions enter a pending review queue, so the catalogue only
// changes when a dashboard approval (purges 'catalogue') or an api-side
// New submissions enter a pending review queue, so the directory only
// changes when a dashboard approval (purges 'extensions') or an api-side
// writer (POST /api/revalidate) publishes something; between events,
// maxAge+SWR bound the staleness of any other drift.
//
// /developer/[id] is deliberately NOT cached: unclaimed profiles render
// a session-dependent claim form vs sign-in link, and CDN hits are
// served by URL without cookies, so the first visitor's variant would
// leak to everyone.
'/': { maxAge: 120, swr: 60, tags: ['catalogue'] },
'/extension/[id]': { maxAge: 300, swr: 120, tags: ['catalogue'] },
'/': { maxAge: 120, swr: 60, tags: [EXTENSIONS_CACHE_TAG] },
'/extension/[id]': { maxAge: 300, swr: 120, tags: [EXTENSIONS_CACHE_TAG] },
'/404': { maxAge: 60 },
},
// Prefetch is disabled entirely: Cloudflare's edge refuses
Expand Down
Loading
Loading