Commit Graph
110 Commits
Author SHA1 Message Date
Adam Daley 388826d4bd Persist currency selection on installation validation failure (#3167)
Fix: Persist currency selection on installation validation failure (#2746)

- Move currency session storage before validation steps
- Prevents currency from resetting to USD when database connection or admin validation fails
- Ensures consistent behavior with other form fields
2026-01-17 00:45:05 +00:00
Belle Aerni c486b262d9 Small developer experience improvements (#2971)
* ddev enhancements

Introduced a new script that runs when the ddev container starts.
This script will automatically update the dependencies if they fall behind the lockfile and will rebuild NPM when needed too

* Fixes and improvements for DX

* Cleaner, better

* Changes based on copilot review

* Remove an old comment I somehow missed

* use npm ci instead
2025-10-14 11:06:33 -07:00
Adam Daley a9b903c222 Codebase modernisation, configuration cleanup, and improved type safety (#2957)
* Refactor tests to replace depreciated functions

* Update Rector config and dependencies

* Rector: Add explicit string casting for stricter type safety

* Rector: Add return type hints to methods across codebase

* Rector: Increase dead code level and refactor invoice item logic

* Remove unnecessary `willReturn` from test mocks

Eliminate redundant `willReturn(null)` and similar calls from PHPUnit mock setups in legacy module tests, leaving only method expectations. Also update some test values to use floats for consistency.

* Refactor API controller and email adapter return values

* Update formatting and guidelines in `AGENTS.md`
2025-10-11 23:39:44 +01:00
Yağızhan 48bb35386d Replace ramsey/uuid with symfony/uid (#2917)
* Replace ramsey/uuid with symfony/uid

* Use the imported class for class_exists
2025-09-18 00:42:41 +01:00
Belle Aerni 996ff15a3e Partial revert of added strict types (#2881) 2025-08-29 15:06:49 -07:00
Adam DaleyandCopilot 315f9f3944 Refactor Filesystem and Path handling (#2836)
* Removed legacy files

* Refactor Filesystem and Path handling

* Removed `FOSSBilling\Tools` legacy functions

* Update live-tests to include file check for `php_error.log`

* Update Extension module tables to fix wrapping issue

* Apply suggestions from @Copilot

Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Extension module icon URL handling

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-09 21:50:11 +01:00
Belle Aerni 368f8cd6ad Bump the year (#2581) 2025-01-23 15:11:53 -08:00
Belle Aerni 7d69ec42ad Bring us out of NPM dependency hell (#2579) 2025-01-20 15:44:02 -08:00
Belle Aerni c0ee8d3fc5 Cleaned up some routing, simplified webserver conf (#2511)
* Cleaned up some routing, simplified webserver conf

* Update cspell.json

* Update cspell.json

* Fixes
2024-11-27 04:00:12 -08:00
Belle Aerni 45db4910a7 PHP 8.4 prep (#2464)
* Update CI for PHP 8.4

* Update composer deps for PHP 8.4

* Updates

* This is the default mode and this constant causes test failutes

* Explicily install the PDO extensions

* Temporarily downgrade the live tests to PHP 8.3

It would seem that there is some kind of problem with PHP 8.4 in regards to these tests. I believe it is outside of our control however as it installs fine for me with PHP 8.4 under DirectAdmin

* Update to address deprecations

* Make that nullable

* Fixed my typo

* Bump PHPunit to v11

* Also take care of two minor things

* Formatting fix
2024-11-21 23:16:29 -08:00
Belle Aerni a3b0f7d919 Disable fallback cron behavior for non preview / development enviroments (#2378)
* Only enable the fallback cron behavior for testing / dev setups

* Clean up the cron error message

We don't need to worry about it clearing the message on prod environments going forward as the fallback will be disabled

* Fixed CS
2024-08-01 17:18:01 -07:00
FOSSBilling BotandFOSSBilling Bot 17d19c28ee Apply PHP Code Styling & Quality Changes (#2333)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-07-04 13:46:38 -07:00
Belle Aerni 303f4cfa2d Code styling & rector config improvements (#2254)
* Bumped the Rector deadcode level

* Added the instanceof setlist

* Increasded type coverage and updated tests config too

* Bumped type coverage & ran PHP-cs-fixer
2024-04-23 10:38:18 -07:00
Belle Aerni 628726e61a Bump the password hashing cost (#2193)
* Bump the password hash cost from 10 to 12

And a few minor changes to the password class + moving it under the FOSSBilling namespace

* Slight fixup, spelling fixed
2024-03-20 21:44:13 -07:00
Belle AerniandJohn @ S4 037acce702 Bulk fix of many grammar / phraseology mistakes (#2166)
* Bulk fix of many grammar / phraseology mistakes

* Small fixes after self-review

* Corrections

* Update mod_currency_settings.html.twig

* Update mod_currency_settings.html.twig

* Update mod_formbuilder_field.html.twig

---------

Co-authored-by: John @ S4 <64874788+John-S4@users.noreply.github.com>
2024-02-27 03:01:07 -08:00
Belle Aerni d771457efc Bump the year (#2167)
* Bump the year

* And fix the spelling
2024-02-25 02:45:38 -08:00
Belle Aerni 8f4d0d4cac More tests and CI improvements (#2078)
* Wrote a few more tests, improvements

* Ran Rector & PHP-CS-Fixer

* Append a capital letter to the test client passwords

* Minor tweaks

* Display more info after the tests run

* Oops, I forgot to set the dir

* Fix cron behavior for test env, dropped legacy tests

* Rename the empty test suite so PHPUnit ignores it

* Update cspell.json

* Minor tweaks to the tests

* Fixes
2024-01-17 18:11:45 -08:00
Belle Aerni ccc97a3ec9 Initial implementation of CI against a live FOSSBilling Install (#2067)
* Rename tests to tests-legacy

* Groundwork for live tests

* Somewhat working tests on a live instance

* Hmmmmmm

* Fix

* Fixed the other bug

* Added a handful of various tests

* Typos, all these are admin endpoints

* Bypass this check for testing envs

* Disable it for now

* Mini cleanup

* Cleanup from debugging, ran PHP-CS-Fixer
2024-01-14 22:51:32 -08:00
Belle Aerni 32d011225b Rector & PHP-CS-Fixer Improvements (#2047)
* Added the rector cache to the action

* Enabled PHP-CS fixer for the tests & library folder

* Use the PHP-CS-Fixer Cache

* Fix the tests

* Ensure the Sentry placeholder isn't messed up from CS changes

* Typo..
2024-01-08 00:10:00 +00:00
Belle Aerni f71f972d7a Define PATH_LOG in the installer (#2035) 2024-01-03 15:02:46 -08:00
Belle Aerni b0e2b4041c Added support for per-theme default markdown attributes (#2016)
* Fixed admin route detection

* Added support for per-theme default MD attributes

* Restore the subfolder check

In theory my changes would fix the original issue, but I'm finding I have other errors when testing it so.. I'm not gonna worry about it
2023-12-28 15:57:00 -08:00
Jaap Marcus 7e8ff7700a Fix Installer when behind a reverse proxy (#1977)
Make sure set:
 proxy_set_header X-Forwarded-Host $host;
 proxy_set_header X-Forwarded-Proto https;

When creating then nginx config
2023-12-15 23:27:30 +00:00
Belle Aerni c9f2988cf5 4 bugfixes (#1958)
* Fixed client search for cases without first and last names

* Fixed the domain action not being set properly when ordering

This issue prevented someone from selecting "transfer" as their option

* Cleanup the 'srp' locale folder

* Updated the post-install admin URL
2023-12-12 19:39:48 -08:00
Belle Aerni a3b6180abf Fix the issue John noticed (#1870)
* Fix the issue John noticed

* QoL: Don't delete it when debug mode is enabled
2023-11-25 04:01:08 +00:00
Belle Aerni cd002b4729 Rebuilt the requirements class (#1858)
* Rebuilt the requirements class

* Update cspell.json
2023-11-22 15:05:50 +03:00
Belle Aerni 50043e6211 Run Rector against our tests (#1761)
* Update rector config to include tests

* Run Rector against the tests

* Delete test-results

* Update .gitignore

* Correctly set the PHP min to 8.1, split the configs

* Corrected PHPDoc

* Deleted tests we can't really get to pass

PHPunit is hard-coded to fail when a class has a return type of `never`, which is the correct return type of our redirect function (and rightfully so).

No way to disable the exception as far as we can tell
2023-11-11 18:41:09 +00:00
Belle Aerni 33695f268e Remove the unused path_logs config key (#1784) 2023-11-11 20:47:19 +03:00
Belle Aerni 371fa59f70 Minor changes / improvements (#1783)
* Make IDs links in the order management screens

* Remove messages about version 0.0.1

* Fix spelling mistake. Closes #1794
2023-11-07 17:46:13 -08:00
Adam Daley 230b10f6ea Replace direct config references with constants (#1768)
* Fix PATH_DATA constant to use config

Update `PATH_DATA` constant to use the `path_data` config option.

* Replace direct config references with constants

Replace direct references to `config.php` file and specific config options in favour of global constants, where available.

* Drop BB prefix on global constants

Rename global constants to drop `BB_` prefix, where appropriate.
2023-11-06 07:55:23 +00:00
Belle Aerni a4c32d70a7 Minor improvements to Sentry.io integration (#1769)
* Remove php-http/message-factory

* Don't report error reporting changes on preview builds

We don't have a way to reliably track / compare this, so the message would otherwise almost always be displayed.

Hiding the massage on preview builds resolves that

* Downgrade errors in the API controller

None of these are really errors, so let's convert them to InformationException so they aren't captured and sent to Sentry
2023-10-31 08:14:17 +01:00
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
FOSSBilling BotandFOSSBilling Bot 03d7032c65 Apply PHP Code Styling & Quality Changes (#1716)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2023-10-12 14:34:18 +02:00
e0d412aa93 Installer Overhaul (#1698)
* #1583 initial workflow update using debug reference in config for install dir bypass

* #1583 add missed files

* #1583 improve config generation

* #1583 clean up docblock (issue feedback)

* fix https detection, corrected pull from upstream

* #1583 improve docker build config

* #1583 remove docker configs from repo, they have been moved to dev workflow documentation

* #1683 replace installer template assets

* #1683 initial UI layout overhaul, still need to port in some original UI logic

* #1683 initial backend overhaul, also still needs work

* #1683 misc cleanup, move license placement

* #1683 rename installer result template

* improve layout and content, fix variable naming #1683

* small fixes, readability improvement #1683

* stop passing references everywhere... use class variable instead #1683

* refactor unnecessary methods, improve more class variable references, optimize exception flow, remove duplicated method calls, verbose commenting/method renaming/code flow adjustment for readability #1683

* rename installer class (I think we deserve it at this point...) #1683

* improve form submission UX #1683

* block install if subfolder is detected #1683

* add validation for checking if we are already installed, secure against tampered requests #1683

* touch up install result for better onboarding #1683

* conver theme to jsdelivr, delete local picocss assets #1683

* fix typos #1683

* Use a local CSS file, other minor improvements

* Implemented new functionality on the install page

* Bug fix, make it more space efficient

* Minor fix

* Casing and minor JavaScript changes

* Adjusted the buttons

* Fix the blank screen issue

* window -> tab

* match other link tooltip adjustments

* update subfolder installations documentation link

* add Database prefix to db field labels

* Sentence case

* agreement checkbox

---------

Co-authored-by: Belle Aerni <belleaerni@gmail.com>
Co-authored-by: Yağızhan <yagizhan49@protonmail.com>
2023-10-12 09:52:03 +02:00
RonandBelle Aerni 75fb9cbdcf Developer Workflow Supporting Code (#1692)
* #1583 initial workflow update using debug reference in config for install dir bypass

* #1583 add missed files

* #1583 improve config generation

* #1583 clean up docblock (issue feedback)

* fix https detection, corrected pull from upstream

* #1583 improve docker build config

* #1583 remove docker configs from repo, they have been moved to dev workflow documentation

* Two very minor changes

* Other minor changes

---------

Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-10-05 09:47:57 +02:00
Belle Aerni 8c7729ccd3 Miscellaneous autoloader improvements (#1676)
* Miscellaneous autoloader improvements

* Spelling

* Fixed PHPDocs
2023-10-04 07:40:19 +03:00
Belle Aerni 8c047bc0da Fix to allow analysis to run against the installer (#1633) 2023-09-25 22:02:57 +03:00
Albin Varghese 9e216ca9b2 Add missing import on installer (#1632) 2023-09-24 13:43:48 +03:00
YağızhanandBelle Aerni dbcf9a3ad4 Rewritten bin/prepare & +FOSSBilling_Environment (#1622)
* Rewritten bin/prepare & +FOSSBilling_Environment

* -redundancy

* - unnecessary bits

* nothing much

* Fix inverted logic, use new function in missed location

---------

Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-09-22 18:19:02 -07:00
Belle Aerni cba659534c Improve session max age logic / behavior (#1614) 2023-09-22 16:46:58 -07:00
Albin Varghese f268f39fc8 Fix installer ssl check (#1620)
* fix: replace removed function

* fix: correct http detection
2023-09-19 10:03:31 -07:00
Belle Aerni e07b4a2b08 MInor improvements to the installer (#1613) 2023-09-19 07:14:04 +02:00
Belle AerniandJohn @ S4 20e38a162f Exception messages cleanup (#1376)
* Misc exception messages improvements

* Cleanup / improve server manager exceptions

* Tests :)

* Some registrar exception cleanup

* Clean up payment gateway exceptions

* Some other misc improvements

* Update Resellerclub.php

* Fix typo in Namecheap error message

---------

Co-authored-by: John @ S4 <64874788+John-S4@users.noreply.github.com>
2023-07-03 14:54:23 -07:00
Belle Aerni 06b010138c Allow IPs to be whitelisted from rate limiting (#1382)
* Allow IPs to be whitelisted from rate limiting

* Minor formatting change
2023-06-30 19:34:21 -07:00
Belle Aerni 1488c54afe Remove the installer's HTTPs rewrite (#1369) 2023-06-26 08:09:49 +03:00
Belle Aerni 484de12ae2 Fix issue with the sessions during installation (#1361) 2023-06-23 10:12:47 +03:00
Belle Aerni 25a0090c5d Bump AntLoader to v2.0.0 (#1280) 2023-05-30 12:26:24 +03:00
Yağızhan d909d77f7e -Unnecessary whitespace in the class headers (#1219) 2023-05-07 13:24:29 -07:00
Yağızhan 412e4a9fbd Standardized the class headers (#1212) 2023-05-06 13:06:17 +01:00
Belle Aerni dded03b41d Replace custom autoloader with AntLoader (#1215)
* Replace custom autoloader with AntLoader

* Update install.php

* Bump antcms/antloader to v1.0.1
2023-05-05 14:17:56 -07:00
Adam Daley e54569d2cd Introduce namespaces and strict typing for FOSSBilling library classes (#1206) 2023-05-04 01:02:06 +01:00