Skip to content
FOSSBillingPublic

About

Official website for FOSSBilling.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

16 stars

Watchers

5 watching

Forks

FOSSBilling Website

CI/CD

FOSSBilling's website. Built with Astro, deployed to Cloudflare Workers, and available at fossbilling.org.

Documentation is hosted separately at docs.fossbilling.org.

Installation

Requires Node.js 26.

$ npm ci

Local Development

$ npm run dev

This command starts a local development server at http://localhost:4321.

For authenticated GitHub star counts during local development, copy .dev.vars.example to .dev.vars and fill in the GitHub App credentials described below. The website can also read the public star count without credentials.

Scripts

  • npm run dev: local development server
  • npm run build: production build
  • npm run preview: preview the production build locally
  • npm run check: TypeScript & Astro diagnostics
  • npm test: run the release metadata tests
  • npm run format: format source with Prettier
  • npm run format:check: verify formatting without writing
  • npm run cf-deploy: deploy to Cloudflare Workers and promote to production traffic with the Cloudflare CLI (cf auth login)
  • npm run cf-preview: deploy a Worker Preview for the current branch with cf previews deploy (cf auth login)

Deployment

CI runs formatting, Astro/TypeScript checks, tests, and a build on branch pushes and PRs targeting main. Deployment requires checks and build to pass.

  • main deploys to production at fossbilling.org.
  • Other branches deploy previews. Matching PRs receive a comment with preview links and build/deployment history.
  • PR runs validate changes without deploying; forks receive no deployment credentials.

Deployments use the shared workflow in FOSSBilling/.workflows. The local Cloudflare Events workflow syncs PR comments and deletes previews when same-repository PRs merge into main. Renovate updates the pinned workflow references together.

Configure the production and preview GitHub environments, the Actions secret CLOUDFLARE_API_TOKEN, and the repository variable CLOUDFLARE_ACCOUNT_ID. Manage runtime secrets in Cloudflare, including Previews Base settings. Keep Cloudflare Workers Builds disabled to avoid duplicate deployments.

The Worker is configured in cloudflare.config.ts, managed with the Cloudflare CLI (cf); builds write Build Output to .cloudflare/output/. To deploy locally, run cf auth login, then npm run cf-deploy or npm run cf-preview.

Branch previews use <preview-slug>.website.fossbilling.foo. The production deployment applies the preview-only domain to the parent Worker. Its Cloudflare API token needs Workers Routes Write access to the fossbilling.foo zone. Cloudflare provisions wildcard DNS and TLS for the preview hostnames.

GitHub App authentication

The star counter uses the FOSSBilling Integrations GitHub App, as used by FOSSBilling/api. Install the App on FOSSBilling/FOSSBilling with read-only Metadata access. The site requests short-lived installation tokens scoped to that repository.

On the production website Worker, store GITHUB_APP_CLIENT_ID, GITHUB_APP_INSTALLATION_ID, and GITHUB_APP_PRIVATE_KEY as Cloudflare runtime secrets. Use the PEM from GitHub for the private key. The Cloudflare CLI preserves these bindings when it deploys a new version.

In Previews Base, set GITHUB_APP_CLIENT_ID and GITHUB_APP_INSTALLATION_ID and add GITHUB_APP_PRIVATE_KEY as a secret. Use distinct private keys for local development, previews, and production.

OpenGraph Image Generation

Social preview images are generated at build time using satori and @resvg/resvg-js in src/pages/og-image/[route].png.ts. Fonts in src/assets/fonts/ are used exclusively by this pipeline. The prerenderEnvironment: 'node' adapter option enables Node-only APIs (node:fs, node:path) during prerendering.

Code Review

Cubic provides automated AI code review, configured via cubic.yaml at the repository root. Renovate handles dependency updates, configured via .github/renovate.json.

Licensing

Code, configuration, and build tooling in this repository are licensed under the GNU Affero General Public License v3.0 or later. See LICENSE.

Website content is licensed under Creative Commons Attribution-ShareAlike 4.0 International. See LICENSE-content.

Unless otherwise noted, the content license applies to the visible website text, graphics, and design assets.

Logos, wordmarks, trademarks, and other brand assets are not licensed under CC BY-SA 4.0. Third-party marks remain subject to their respective owners' rights.

About

Official website for FOSSBilling.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

16 stars

Watchers

5 watching

Forks

Sponsor this project

Used by

Contributors

Languages