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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "astro dev",
"start": "astro dev",
"check": "astro check",
"build": "astro build",
"build": "astro build --force",
"preview": "astro preview",
"astro": "astro",
"format": "prettier --write \"{src,public}/**/*.{astro,css,js,json,mjs,ts}\" \"*.{json,mjs,ts}\"",
Expand Down
52 changes: 52 additions & 0 deletions src/content/docs/404.mdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Page Not Found
description: The requested FOSSBilling documentation page could not be found.
editUrl: false
lastUpdated: false
template: splash
tableOfContents: false
head:
- tag: meta
attrs:
name: robots
content: noindex
---

The page you are looking for may have moved, been renamed, or no longer exists.

Start with one of the main documentation sections below, or use search to find the topic you need.

{% cardgrid %}
{% linkcard
title="Getting Started"
href="/getting-started/"
description="Install FOSSBilling, check requirements, and prepare your environment."
/%}
{% linkcard
title="Maintenance"
href="/maintenance/"
description="Update, troubleshoot, and maintain an existing FOSSBilling installation."
/%}
{% linkcard
title="Admin Guide"
href="/admin-guide/"
description="Configure FOSSBilling and manage day-to-day administration tasks."
/%}
{% linkcard
title="Extensions & Development"
href="/extensions-and-development/"
description="Build modules, themes, payment gateways, and integrations."
/%}
{% linkcard
title="Support"
href="/support/"
description="Find FAQs, troubleshooting guidance, and community support links."
/%}
{% linkcard
title="GitHub Repository"
href="https://github.com/FOSSBilling/FOSSBilling"
description="Report issues or browse the FOSSBilling source code."
/%}
{% /cardgrid %}

If you followed a link from the documentation site, please [open an issue](https://github.com/FOSSBilling/docs/issues/new) so it can be corrected.
4 changes: 2 additions & 2 deletions src/content/docs/admin-guide/company.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Upload the logo assets FOSSBilling should use across the interface:

### Best Practices

- Store logos in your theme's `assets/` folder
- Upload custom logos through the settings page so updates do not overwrite them
- Use SVG for crisp display at any size
- Keep file sizes reasonable (< 500KB)

{% aside type="caution" %}
Don't edit `themes/huraga/assets/img/logo.svg` directly — it's overwritten on updates. Upload your logo through the settings page instead.
Don't edit the bundled files in `public/branding/` directly. They are default assets and may be overwritten on updates. Upload your logo through the settings page instead.
{% /aside %}

### Logo Not Showing?
Expand Down
23 changes: 22 additions & 1 deletion src/content/docs/extensions-and-development/file-structure.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ Runtime data storage:

This directory should be writable by the web server.

### `/src/public`

Public core assets that must be web-accessible:
- **Assets** — Shared built browser assets (`/public/assets`), including the API wrapper, shared runtime, Markdown CSS, and CKEditor bundle
- **Branding** — Default logo, dark logo, and favicon (`/public/branding`)
- **Gateway icons** — Payment gateway logos (`/public/gateways`)

### `/src/install`

The installation wizard. Automatically deleted after installation unless `APP_ENV=dev` is set.
Expand All @@ -28,7 +35,7 @@ Core PHP classes and business logic.

#### `/src/library/Api`

Core API files including the JavaScript wrapper (`API.js`). [See the wrapper docs](/extensions-and-development/javascript/).
Core PHP API files. The browser-side API wrapper source now lives in `/frontend/core/api.js` and builds to `/src/public/assets/js/api.js`. [See the wrapper docs](/extensions-and-development/javascript/).

#### `/src/library/Box`

Expand Down Expand Up @@ -87,6 +94,19 @@ These are for shared hosting control panels. For VPS or game servers, consider c

Translations as a Git submodule. Pointing to [github.com/FOSSBilling/locale](https://github.com/FOSSBilling/locale).

### `/frontend`

Shared frontend source and build tooling:

| Path | Purpose |
|------|---------|
| `core/` | Shared browser runtime and API wrapper source |
| `editor/` | CKEditor integration source |
| `styles/` | Shared CSS such as Markdown rendering styles |
| `tools/` | Common esbuild, Sass, PostCSS, asset copy, and PurgeCSS helpers used by theme builds |

The root `npm run build` command builds this directory into `/src/public/assets`.

### `/src/modules`

All modules live here. Each module is a self-contained unit of functionality.
Expand Down Expand Up @@ -122,6 +142,7 @@ Theme structure:
```
theme-name/
├── assets/ # CSS, JS, images (built via esbuild)
│ └── build/ # Generated theme assets and manifest
├── config/
│ └── settings.html.twig # Theme settings UI
├── html/ # Twig templates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ themes/mytheme/
├── assets/ # CSS, JS, images (built via esbuild)
│ ├── css/
│ ├── js/
│ └── img/
│ ├── img/
│ └── build/ # Generated assets and manifest
├── config/
│ └── settings.html.twig # Theme settings UI (optional)
├── html/ # Your templates
Expand Down Expand Up @@ -122,10 +123,19 @@ FOSSBilling provides [custom filters](/extensions-and-development/twig-filters)
{{ price | format_currency(currency.code) }} {# Format currency #}
{{ 'client/manage' | url(area: 'admin') }} {# Admin panel link #}
{{ 'css/theme.css' | asset_url }} {# Theme asset URL #}
{{ 'js/api.js' | public_asset_url }} {# Shared core asset URL #}
{{ date | timeago }} {# "2 hours ago" #}
{{ content | markdown_to_html }} {# Parse Markdown #}
```

Custom layouts that do not extend the bundled themes should load the shared runtime and API wrapper before theme JavaScript:

```twig
{{ 'js/fossbilling.js'|public_asset_url|script_tag }}
{{ 'js/api.js'|public_asset_url|script_tag }}
<script src="{{ 'build/js/mytheme.js'|asset_url }}"></script>
```

## Security Best Practices

- Use `htmlspecialchars` when outputting user data
Expand Down
3 changes: 2 additions & 1 deletion src/content/docs/extensions-and-development/javascript.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ If you're building themes or modules, use this wrapper instead of making raw bro
The bundled admin and Huraga themes already load the wrapper. For a custom theme, add this to your base layout before your theme JavaScript:

```twig
{{ "Api/API.js"|library_url|script_tag }}
{{ 'js/fossbilling.js'|public_asset_url|script_tag }}
{{ 'js/api.js'|public_asset_url|script_tag }}
<script src="{{ 'build/js/mytheme.js'|asset_url }}"></script>
```

Expand Down
10 changes: 8 additions & 2 deletions src/content/docs/extensions-and-development/twig-filters.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Project-specific filters and functions are defined in these classes:
| Filter | Description |
|--------|-------------|
| `asset_url` | Get the URL for a theme asset. |
| `library_url` | Get the URL for the library folder. |
| `public_asset_url` | Get the URL for a shared core public asset built into `/public/assets`. |
| `mod_asset_url` | Get the URL for a module asset. Use the asset path as the filtered value and the module name as the argument. |
| `script_tag` | Generate an HTML `<script>` tag. |
| `stylesheet_tag` | Generate an HTML `<link>` tag for CSS. |
Expand All @@ -74,6 +74,7 @@ Project-specific filters and functions are defined in these classes:
| `svg_sprite` | Render the current theme's SVG icon sprite when available. |
| `has_permission` | Check whether the logged-in admin has a module permission. |
| `antispam_honeypot` | Return the antispam honeypot configuration array. |
| `wysiwyg` | Load and initialize the shared CKEditor bundle for a selector. |

## Usage Examples

Expand All @@ -98,13 +99,18 @@ Project-specific filters and functions are defined in these classes:
{# Theme and module assets #}
<link rel="stylesheet" href="{{ 'css/theme.css'|asset_url }}">
<script src="{{ 'js/widget.js'|mod_asset_url('Example') }}"></script>
Comment thread
admdly marked this conversation as resolved.
{{ 'js/fossbilling.js'|public_asset_url|script_tag }}
{{ 'js/api.js'|public_asset_url|script_tag }}

{# API form handled by Api/API.js #}
{# API form handled by the shared API wrapper #}
<form action="{{ 'profile/update'|api_url }}" {{ fb_api_form({ message: 'Saved'|trans }) }}>
<input type="text" name="first_name">
<button type="submit">{{ 'Save'|trans }}</button>
</form>

{# Shared editor bundle #}
{{ wysiwyg('.editor-textarea') }}

{# API link with a confirmation modal #}
<a href="{{ 'client/delete'|api_url(query: { id: client.id }, role: 'admin') }}"
{{ fb_api_link({ modal: { type: 'confirm', title: 'Are you sure?'|trans }, reload: true }) }}>
Expand Down
18 changes: 13 additions & 5 deletions src/content/docs/getting-started/building.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Build FOSSBilling from source when you want to contribute code, test changes loc
Make sure you have:
- PHP 8.3 or newer
- [Composer](https://getcomposer.org/) (latest version)
- [Node.js](https://nodejs.org/) (LTS version) with npm
- [Node.js](https://nodejs.org/) with npm 11 or newer
{% /aside %}

## Build Steps
Expand Down Expand Up @@ -46,6 +46,8 @@ Make sure you have:
npm run build
```

This builds the shared frontend assets into `src/public/assets` and builds the bundled `admin_default` and `huraga` theme assets.

5. **Add translations** (optional)

Download the [latest translations](https://github.com/FOSSBilling/locale/releases/tag/latest) and extract to `src/locale/`, overwriting existing files.
Expand All @@ -54,13 +56,19 @@ After these steps, your checkout is ready for local development or for packaging

## Development Mode

For active development:
For active theme development, use the theme workspace scripts:

```bash
npm run dev
npm run build-admin_default
npm run build-huraga
```

This watches files and rebuilds automatically when you make changes.
The Huraga theme also supports watch mode:

```bash
cd src/themes/huraga
npm run dev
```

## Running Locally

Expand All @@ -71,4 +79,4 @@ cd src
php -S localhost:8000
```

Then visit `http://localhost:8000` in your browser.
Then visit `http://localhost:8000` in your browser.
47 changes: 24 additions & 23 deletions src/content/docs/getting-started/docker.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,45 @@ Use the `latest` tag for the current stable release.
The simplest option. This runs only the FOSSBilling container, so you must provide your own database service.

```bash
docker run -d -p 80:80 \
docker run -d \
--name fossbilling \
-p 80:80 \
-v fossbilling:/var/www/html \
--restart=always \
--restart unless-stopped \
fossbilling/fossbilling:latest
```

Then open your server IP or hostname in a browser to complete the web installer.
{% /tabitem %}
{% tabitem label="Docker Compose" %}
This option brings up FOSSBilling and MySQL together, which makes it the fastest way to get started.
This option brings up FOSSBilling and MariaDB together, which makes it the fastest way to get started.

```yaml
version: "3.9"
```yaml {% meta="title='docker-compose.yml'" %}
services:
fossbilling:
image: fossbilling/fossbilling:latest
restart: always
restart: unless-stopped
ports:
- 80:80
- "80:80"
volumes:
- fossbilling:/var/www/html
depends_on:
- mariadb

mysql:
image: mysql:8.4
restart: always
mariadb:
image: mariadb:lts
restart: unless-stopped
environment:
MYSQL_DATABASE: fossbilling
MYSQL_USER: fossbilling
MYSQL_PASSWORD: ${MYSQL_PASSWORD:?set-a-strong-database-password}
MYSQL_RANDOM_ROOT_PASSWORD: '1'
MARIADB_DATABASE: fossbilling
MARIADB_USER: fossbilling
MARIADB_PASSWORD: ${MARIADB_PASSWORD:?set-a-strong-database-password}
MARIADB_RANDOM_ROOT_PASSWORD: "1"
volumes:
- mysql:/var/lib/mysql
- mariadb:/var/lib/mysql

volumes:
fossbilling:
mysql:
mariadb:
```

Run it:
Expand All @@ -70,23 +73,21 @@ The first startup downloads container images, so it may take a few minutes.
Before starting the stack, set a strong database password:

```bash
export MYSQL_PASSWORD="$(openssl rand -base64 32)"
export MARIADB_PASSWORD="$(openssl rand -base64 32)"
```

**Database credentials** (if using the example above):
- Hostname: `mysql`
- Hostname: `mariadb`
- Database: `fossbilling`
- Username: `fossbilling`
- Password: the value of `MYSQL_PASSWORD`
- Password: the value of `MARIADB_PASSWORD`

Open `http://localhost` or your server's IP/hostname to continue with the installer.
{% /tabitem %}
{% /tabs %}

## Post-Installation

After installation, set up the cron job on your host:
The official Docker image runs FOSSBilling cron automatically every five minutes inside the container.

```bash
(crontab -l; echo "*/5 * * * * docker exec <container-name/id> su www-data -s /usr/local/bin/php /var/www/html/cron.php") | awk '!x[$0]++' | crontab -
```
You do not need to add a host crontab entry when using the official Docker image.
6 changes: 3 additions & 3 deletions src/content/docs/getting-started/installation.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ server {
return 403;
}

# Deny access to /data, except /assets/gateways
location ~* /data/(?!(assets/gateways/)) {
# Deny access to runtime data
location ^~ /data/ {
return 403;
}

Expand Down Expand Up @@ -114,7 +114,7 @@ server {
## Pre-installation Steps

1. **Download FOSSBilling**: Download the latest [stable release](https://fossbilling.org/downloads) from our downloads page.
2. **Prepare your database**: Create a new MySQL database and a dedicated user for this installation. Keep the credentials handy for the installer.
2. **Prepare your database**: Create a new MariaDB/MySQL database and a dedicated user for this installation. Keep the credentials handy for the installer.
3. **Set up SSL**: If you plan to use HTTPS, and you should, configure and verify your certificate *before* you start the installer.
4. **Configure reverse-proxy headers**: If you run behind a reverse proxy, forward the `X-Forwarded-Host` and `X-Forwarded-Proto` headers so FOSSBilling can generate the correct URLs and enforce HTTPS properly.

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/getting-started/requirements.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ Use `utf8mb4` with `utf8mb4_unicode_ci` collation. Your database user needs full

FOSSBilling requires a MySQL-compatible database:

- **MySQL** 8.0 or newer
- **MariaDB** 10.3 or newer
- **MySQL** 8.4 or newer
- **MariaDB** 11.4 or newer
5 changes: 5 additions & 0 deletions src/content/docs/index.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Introduction
description: Learn what FOSSBilling is, where to start, and how to get involved with the project.
tableOfContents: false
banner:
content: |
<strong>0.8.0 is here!</strong> Check out the
<a href="https://github.com/FOSSBilling/FOSSBilling/releases/tag/0.8.0">release notes</a>
and <a href="/maintenance/updating/0-7-to-0-8/">upgrade guide</a> for details.
---

FOSSBilling (*FOSS*: Free and Open Source Software) is a billing and client management solution for hosting providers and digital service businesses.
Expand Down
Loading
Loading