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
This commit is contained in:
Belle Aerni authored and GitHub committed 2023-10-28 18:40:39 -07:00
1 parent fbd7f97481
commit 602b537996
213 files changed
+3065 -1284

No files matched your search

+28 -3
View File
@@ -1,13 +1,31 @@
name: Bug report
description: Create a report to help us improve FOSSBilling
title: "[Bug]"
title: "[Bug] Enter a short title of the issue you are having here"
labels: [bug]
body:
- type: markdown
attributes:
value: |
Please ensure that there is no existing issue for your bug, and fill out the title before continuing.
**Important: DO NOT include any private/sensitive information such as email addresses, passwords, IP addresses, or hostnames.**
# Bug reporting
- Please ensure that there is no existing issue for your bug, and fill out the title before continuing.
- **Important: DO NOT include any private/sensitive information such as email addresses, passwords, IP addresses, or hostnames.**
- You may find the error log for your installation under the `/data/log` folder. For the most part, we specifically want for the `error.log` file.
- Before attaching the error log, please validate that it does not contain any private or sensitive information.
## Instance ID and error reporting
This guide will ask you for your instance ID. If you do not have error reporting enabled, you may skip this step.
If you have error reporting enabled and do not know how to find the instance ID, please refer to the [documentation](https://fossbilling.org/docs/faq/error-reporting#what-is-the-instance-id-and-where-do-i-find-it).
### What not to send when using error reporting
If you have error reporting enabled and have provided us with the instance ID, please **do not** attach the `error.log` file to this ticket.
We have access to an error log that includes more information than the one you have and may gain acceess to it using the instance ID you provide.
By not attaching the `error.log` file, you are helping us keep your information private and secure.
If we require more information that wasn't already collected via error reporting, we will will specifically ask for you to share it with us.
Thanks!
- type: textarea
id: describe
@@ -57,6 +75,13 @@ body:
validations:
required: true
- type: input
id: ID
attributes:
label: FOSSBilling instance ID
description: If you have opted in to error reporting, providing your instance ID below allows us to provide better technical support for you.
placeholder: XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX
- type: input
id: module
attributes:
+9
View File
@@ -86,6 +86,15 @@ jobs:
mv Version2.php Version.php
working-directory: ./build/source/library/FOSSBilling
- name: Add in the Sentry DSN
if: ${{ vars.SENTRY_DSN }}
run: |
d=$'\03'
sed -i "s${d}--replace--this--during--release--process--${d}$SENTRY_DSN$d" SentryHelper.php
working-directory: ./build/source/library/FOSSBilling
env:
SENTRY_DSN: ${{ vars.SENTRY_DSN }}
- name: Upload the Final Artifact to GitHub
uses: actions/upload-artifact@v3
with: