Files
FOSSBilling/src/config-sample.php
T
Belle Aerni 602b537996 Opt-in error reporting via Sentry.io (#1732)
* Began implementing Sentry.io support

* Added to the installer

* Added the ID to the bug report template and UI

* Hook it into our error handler, added the ability to filter by error code

* Attempting to add the DSN via GH actions

* Spelling and making PHPstan happy

* Skip exceptions for various incomplete configurations

Also brings in some of the category suggestions made by @Anuril in #195

* Update tests to account for changes

* Added & renamed exception classes

* Fix tests

* Change a bunch of items to be InformationExceptions

* Use a lighter HTTP client, fixed API error reporting

* I guess that's not needed now?

Arighty then

* Improvements, additional info added

* Update SentryHelper.php

* Improved error logging, added instance ID to error page

Also made it so that errors are correctly sent to Sentry rather than exclusively exceptions

* Make the tests happy

* Added the link, improved wording

Also removed the "performance" part of the reporting as it needs to be added to the front-end and I'm not currently implementing that

* Began implementing UI alerts and info

* Added the ability to toggle, fixed tests, use path constants

* Added some useful info & links to the page

* These should be InformationException

* Fix the automated Sentry DSN entry

* Fix the install number text

* Minor cleanup, converted more to InformationException

* Replaced some direct config references with constants

We have the BB_DEBUG constant to indicate if we have debug mode enabled or not, so we shouldn't be directly referencing it in the config file unless we actually need to do so.

Using the constant means there's less locations to update the reference if the config structure is changed

* Bugfix

* Consistency & fixed a PHPDoc

* Corrections

* We actually do want exceptions thrown here

* Change how we get the instance ID

* Stability improvements

Having support for translatable error pages was proving to be problematic, so I had to remove it.

I also had to update the exception class to handle cases where the trans function wasn't setup yet (needed for the /run-patcher page if an error occurs)

* Missed this change on git

* Also fix the variable names...

* Re-added new deps after rebase

* This should also accept "Error" types

* Added more info to the bug report and removed a dug line

* This wasn't supposed to get renamed

* Updated some missed references to Box_Exception
2023-10-28 18:40:39 -07:00

201 lines
6.5 KiB
PHP

<?php
/**
* FOSSBilling configuration file example.
*
* If you are not using the web installer, you can rename this file
* to "config.php" and fill in the values.
* Import /install/sql/structure.sql to your database
* Import /install/sql/content.sql to your database
* Open browser https://www.yourdomain.com/admin to create a new admin account.
* Remove /install directory
*/
return [
/*
* These configuration options allow you to configure the security options inside of FOSSBilling.
* The default values are what we recommended running unless they are causing issues.
*/
'security' => [
'mode' => 'strict',
'force_https' => true,
'session_lifespan' => 7200,
],
'debug_and_monitoring' => [
/*
* Enable or disable displaying advanced debugging messages.
* You should keep this disabled unless you're making tests as it can reveal some information about your server.
*/
'debug' => false,
/*
* Enable or disable stacktraces when an exception is thrown (also requires debug to be enabled).
*/
'log_stacktrace' => true,
/*
* How long the stacktrace should be.
*/
'stacktrace_length' => 25,
/*
* Enables automated error, stability, and performance reporting.
* Private information is scrubbed from any info before being sent.
* FOSSBilling uses Sentry.io for error reporting which has a full writeup on their security and privacy practices here: https://sentry.io/security/.
* Enabling error reporting will help us proactively identify and fix bugs in FOSSBilling as well as provide better technical support.
*/
'report_errors' => false,
],
'info' => [
'salt' => '',
'instance_id' => 'XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX',
],
/*
* Full URL where FOSSBilling is installed with trailing slash.
*/
'url' => 'http://localhost/',
/*
* The URL prefix to access the BB admin area. Ex: '/admin' for https://example.com/admin.
*/
'admin_area_prefix' => '/admin',
/*
* Configure the update branch for the automatic updater.
* Currently acceptable options are "release" or "preview".
*/
'update_branch' => 'release',
'maintenance_mode' => [
/*
* Enable or disable the system maintenance mode.
* Enabling this will block public access to your website, and API endpoints except the allowed ones won't work
* However, this will not block access to the administrator area.
*/
'enabled' => false,
/*
* Don't block these URLs when the maintenance is going on.
* Supports wildcard (e.g. '/api/guest/staff/*').
*/
'allowed_urls' => [],
/*
* Don't block these IP/Subnet addresses when the maintenance is going on.
* Supported formats: 127.0.0.1、127.0.0.1/32.
*/
'allowed_ips' => [],
],
/*
* FOSSBilling will automatically execute cron when you login to the admin panel if it hasn't been executed in awhile. You can disable this fallback here.
*/
'disable_auto_cron' => false,
/*
* These configuration options allow you to configure the default localisation.
*/
'i18n' => [
'locale' => 'en_US',
'timezone' => 'UTC',
// Short names for formats (none, short, medium, long).
// @see https://www.php.net/manual/en/class.intldateformatter.php
'date_format' => 'medium',
'time_format' => 'short',
// Specifying a pattern will override the above date/time options.
// @see https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax
'datetime_pattern' => '',
],
/*
* Set location to store sensitive data.
*/
'path_data' => __DIR__ . '/data',
'path_logs' => __DIR__ . '/data/log/application.log',
'log_to_db' => true,
'db' => [
/*
* Database type. Don't change this if in doubt.
*/
'type' => 'mysql',
/*
* Database hostname. Don't change this if in doubt.
*/
'host' => getenv('DB_HOST') ?: '127.0.0.1',
/*
* The name of the database for FOSSBilling.
*/
'name' => getenv('DB_NAME') ?: 'fossbilling',
/*
* Database username.
*/
'user' => getenv('DB_USER') ?: 'foo',
/*
* Database password.
*/
'password' => getenv('DB_PASS') ?: 'foo',
/*
* Database Port.
*/
'port' => getenv('DB_PORT') ?: '3306',
],
'twig' => [
'debug' => false,
'auto_reload' => true,
'cache' => __DIR__ . '/data/cache',
],
'api' => [
// All requests made to the API must have referrer request header with the same URL as the FOSSBilling installation
'require_referrer_header' => false,
// Empty array will allow all IPs to access the API
'allowed_ips' => [],
// Time span for limit in seconds
'rate_span' => 60 * 60,
// How many requests allowed per time span
'rate_limit' => 1000,
/**
* Note about rate-limiting login attempts:
* When the limit is reached, a default delay of 2 seconds is added to the request.
* This makes brute-forcing a password useless while not outright blocking legitimate traffic.
* When calculating, ensure the rate-limited traffic can still make enough requests to stay rate limited
* Ex: One request every 2 seconds is more than 20 times in 1 minute, so the IP will remain throttled.
*/
'throttle_delay' => 2,
// Time span login for limit in seconds
'rate_span_login' => 60,
// How many login requests allowed per time span
'rate_limit_login' => 20,
/*
* This enables the usage of a token to protect the system from CSRF attacks.
* Disabling this is highly discouraged and opens your instance to a known vulnerability.
* This option is only here for backwards compatibility.
*/
'CSRFPrevention' => true,
/**
* Any IP address within this list will not be put through the rate-limiter system.
* This is useful if you have an application with a static IP address that needs to make frequent API requests to FOSSBilling.
*/
'rate_limit_whitelist' => [],
],
];