43 Commits
Author SHA1 Message Date
Adam Daleyandrenovate[bot] 2a14679d2e Move Docker file and add automated Docker builds (#1916)
* Rework reusable workflows to use composite actions (#1918)

* Update FOSSBilling/.workflows digest to 5c7b960

* Update dependency apexcharts to v3.44.2

* Update CKEditor to v39.3.0 (minor) (#1931)

Update CKEditor to v39.3.0

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency core-js to v3.34.0 (#1932)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency cypress to v13.6.1

* Update dependency flag-icons to v7.0.3

* Update dependency phpunit/phpunit to v10.5.2

* Bump lcharette/webpack-encore-twig to v1.2 (#1933)

Bump lcharette/webpack-encore-twig

Bump lcharette/webpack-encore-twig to ^1.2 and remove symfony/webpack-encore-bundle override as now fixed upstream.

* Move Dockerfile from Docker repo

* Add Docker preview build and push to CI

* Add workflow to build and tag Docker builds on release

* Update workflow to build and tag Docker builds on release

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-07 17:29:45 +00:00
51cbebda71 Migrate Huraga and all client templates to bootstrap 5 (#1602)
* Begin migration from BS 3.4.1 to BS 4

This is still entirely untested, I just read the docs and made some quick changes to follow it. Now I need to actually dig in and fix what was broken by this.

This is going to be the most painful upgrade path as BS 4 basically rewrote everything

* Started porting Huraga over to bootstrap

* Fix public dashboard for guests

* Minor fix for a long-standing issue

Resolves #412

* Fix the breadcrumb placement

* Migrate the client balance page

* Migrate the order list template

* Migrated the news pages

* Fix & improve breadcrumbs

* Remove outdated options, update showcase

* Migrated the KB pages

* Removed the company name from the header

* Remove the order popup menu

The way it's done is ugly and I don't like it, so instead let's just have those buttons take you to the actual order page

* Migrate the error page

* Fix the mobile layout, make the menu work

This makes it actually functional on mobile, although the nav menu is hideous and needs more work

* Migrate the Invoice templates

* Replace old usage of bb-btn

* Migrate the profile page

* Improve invoice

* Migrated a bunch of templates

The order management screen needs work to make it usable, but the layout is done and functional

* Improved usability on small devices + nav fixes

* Migrated login, signup, and PW reset templates

* TOS, Privacy Policy, & About + made them full-page

* Migrated support related templates

* Completed order management page

* Mobile usability improvements

* Remove outdated table logic

* Enhance Huraga with Bootstrap 5 Support and Design Improvements (#1612)

* setup package json

* set encore and postcss config

* add Huraga sass and js

* partially bring in legacy Huraga design in BS5

* improve design

* replace f16 flag icons with flag-icons

* add more order status badge

* add breadcrumb and replace card design for footer pages

* improve card text color

* improve invoices index

* improve footer link color

* add failed_renew badge

* change paid invoice button color

* apply muted text color to whole footer texts

* replace bs colors with tailwind

* improve payment history and replace it with Wallet

* replace layout nav icons with MDI svg

* remove icon and rename ticket modal title

* improve order page design

* replace iframe with twig include and improve accordion

* fix tabs and improve account form

* remove accordion chevron icon

* add mistakenly removed postcode

* use tom-select for language selector

* fix the product config tabs and improve form

* improve order form

* fix and improve news module design

* improve and fix tabs of profile page

* fix spacing on card header

* improve public page design

* Improve emails card

* use API.js to login

* improve public pages by replacing jquery and bb-jquery

* improve contact us page and fix minor spacing

* improve Cookieconsent design

* minor improvements to auth error message

* fix toast message for funds form

* improve custom page card

* Improve Kb, servicedomain and orderbutton modules

* fix ticket modal submission

* improve Invoice page

* minor fixes

* Replace Google Font with local font for Inter

* Fix ticket modal

* add offcanvas and describedby

* fix service ticket modals

* set github markdown for support ticket conversation

* minor improvements to order and servicehosting

* improve error page design

* add flashMessage method

* Improve emails module

* hide warning on empty api key

* more improvements to Emails

* remove stripes from services table

* add BS5 support for pagination

* improve emails pagination

* place asterisk using js (Firefox does not support :has())

* add auth class for asterisk to be ignored

* Updated the npm lockfile, replaced BB_URL references

* Ported back some changes

* Use web-safe fonts (Verdana)

* Some adjustments

* Resolve issues after recent merger of KB and support

* Reviewed the BS 5 migration guide

* Remove the "proforma" labeling

AFAIK the old behavior was never truly proforma, but things have been changed since then anyways so now it's definitely not

* Bug fixes and removed unused deps

* Bug fixes

* Revised the KB article template

* Further improvements & fixes. New default config

* Update settings_data.json.example

* Fix: emails can change the page layout / styling

This was a PITA, but I got it to (mostly) work quite well.
The full list does as it should, but the individual email page didn't work correctly with the autosizing so that's just hardcoded in size.

I don't think most will use that page over the complete list, but even if they do an an email is too long a scroll bar will be visible so it's good enough till we find a better solution

* Spelling

* Ignore iframes for spelling

* Fix the checkout process

* Improved table consistency

* Migrated the new password reset template

* A create account button doesn't make sense there..

* QC: Replaced unnecessary custom JS code

* Fixed a grammatical error

Fix originates from PR #1868

Co-Authored-By: Duncan Bennie <33364216+DuncanBennie@users.noreply.github.com>

* Addressed feedback and suggestions

---------

Co-authored-by: Shamshid <shmshd12@gmail.com>
Co-authored-by: Duncan Bennie <33364216+DuncanBennie@users.noreply.github.com>
2023-11-24 12:28:43 -08: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 AerniandYağızhan 865b0b6159 Implemented PHP DebugBar (#1825)
* Brought in the debugbar extension

Co-Authored-By: Yağızhan <hi@yagiz.dev>

* Completely restructured

Redid the previous work to allow us to pass around a single instance of the debug bar, allowing us to leverage more types of data collection.

* Added some more time measurements

* Enabled HTML var dumper, added config collector

* Fix

---------

Co-authored-by: Yağızhan <hi@yagiz.dev>
2023-11-16 23:21:14 +00:00
Belle Aerni 63b1e66caf Massmailer bugfixes & improvements (#1817)
* Prevent Massmailer from duplicating recipients

* Minor optimization

We don't need this info as it's actually fetched in a later step. All we need from this step is the ID of each client

* Further optimize using the DISTINCT SQL query option

Thanks to @evrifaessa for pointing out this is an option.
Should be more efficient to let the SQL engine do the worth rather than doing it via PHP

* Further optimization, fixed filter selection in the UI

* Added the ability to see the list of recipients

* Update cspell.json
2023-11-13 10:42:23 +01:00
Belle Aerni 50cc54ed4e Improved email validation & spam prevention (#1806)
* Improved email validation

* Fixed spelling & PHPDoc, updated module description

* Removed accidental leftovers from debugging

* Rremoved PHP 81 pollyfil, assume email valid if there's an error
2023-11-11 21:44:08 +02: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
Belle Aerni b8d3d35ad2 Significantly improve translation management (#1661)
* Started work on locale disable / enable functionality

* Implemented enable / disable functionality

* Implemented completion bar

* Update the preview workflow to use locale releases

* Fix typos, correct workflow

* Use the latest translation release

* Fix tests

* Fixed typo, removed crappy instructions

* fkn spelling
2023-09-30 22:19:15 +03:00
f2f9701359 Mark as paid now adds funds if the Payment Provider is "Custom". (#1487)
* When you press the "Mark as paid" Button on the invoice, you can now enter a transaction id.
If the Payment gateway of the Invoice is "Custom" and it's enabled, the transaction ID will be used to add transactions that add funds in the amount of the invoice to the customer. Then, it will be marked as paid, just like with any other payment provider.

* Added processTransaction method to the Custom Payment Gateway.
* Fixed tests by removing unnecessary tests for Payment Adapters that don't have the processTransaction method.


---------

Co-authored-by: Christoph Schläpfer <chris+github@cleverly.ch>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
2023-09-28 13:14:06 +02:00
Belle Aerni 1881ff7bfb Bump PHPStan analysis level (#1641)
* Bump PHPStan to level 2
2023-09-28 09:06:58 +02:00
Christoph Schläpfer e96828b52a Cleanup & Spelling 2023-09-27 12:32:48 +02:00
Christoph Schläpfer fbc303a42a If accessing invoices via hash is disabled, logged in clients will be redirected to their invoice page if they are not the buyer on the invoice they are trying to view. 2023-09-27 12:25:38 +02:00
3ee7f29689 Reworked Password-Reset flow (#1627)
* Reworked Password-Reset flow
- No more Passwords sent via E-Mail
- Correct redirects.

* Fixed spelling & last redirect

* Small fixes and updated tests for pw-reset-flow

* Fixed tests for pw-reset-flow

* Fixed tests for the Password reset flow

* Fixed typos, resolved Feedback

* Renamed event before password reset

* Renamed event after password reset

* Tweak a few comments, send the reset email instantly

---------

Co-authored-by: Christoph Schläpfer <c.schlaepfer@datact.ch>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-09-22 18:15:18 -07:00
Belle Aerni 997fad4699 Improve .htaccess rules & prevent access to PHP files (#1522)
* Prevent browser access to cron and other files

* Prevent access to PHP files + enhanced htaccess

* Remove browser related stuff from cron.php

* Added the .htaccess file to our cspell ignore list
2023-08-08 14:26:39 +02:00
Christoph SchlaepferandAnuril df077d3c04 Added function to allow to Update all Orders with a new file by updating the Product. (#1488)
* This PR Fixes #1405 and adds the functionality to configure if the downloadable product should update all orders with the product, or not.

It's configurable per Product.

* Fixed duplicate ID in Installer

* Add words to ignorelist

* This PR Fixes #1405 and adds the functionality to configure if the downloadable product should update all orders with the product, or not.

It's configurable per Product.

* Fixed duplicate ID in Installer

* Add words to ignorelist

* Add words to ignorelist

* Cleaned up Code

* Improved readability

* More cleanup

* Cspell fix

* Fixed missing :

* Made update_prodcts default

* Removed field update from sql and updater

* Removed default option code from Product code

---------

Co-authored-by: Anuril <ta@TAPC01.localdomain>
2023-08-07 14:10:39 -07:00
Christoph SchlaepferandAnuril e466b0a425 Prevent deletion of Servers, Hosting Plans and TLDs that have active Products. (#1492)
* Started to rework deletion checks so no unintended database issues can arise.

We should really start working with referential integrity, otherwise this will become unmanageable soon.

That would also require things like Taxes be referred to by their IDs, not their names.

https://github.com/FOSSBilling/FOSSBilling/blob/ad94a9f3255801817f393cda36bc0a38796e1eb9/src/install/sql/structure.sql#L575

https://github.com/FOSSBilling/FOSSBilling/blob/ad94a9f3255801817f393cda36bc0a38796e1eb9/src/install/sql/structure.sql#L1365

* Fixed the tests for the _delete functions

* Started to rework deletion checks so no unintended database issues can arise.

We should really start working with referential integrity, otherwise this will become unmanageable soon.

That would also require things like Taxes be referred to by their IDs, not their names.

https://github.com/FOSSBilling/FOSSBilling/blob/ad94a9f3255801817f393cda36bc0a38796e1eb9/src/install/sql/structure.sql#L575

https://github.com/FOSSBilling/FOSSBilling/blob/ad94a9f3255801817f393cda36bc0a38796e1eb9/src/install/sql/structure.sql#L1365

* Fixed the tests for the _delete functions

* Fixed tests

* Fixed tests

* Fixed tests

* Fixed tests

* Fixed testhp_delete tests

* Add words to ignorelist

* Add words to ignorelist

* Fixed count placeholder & cleaned up code

---------

Co-authored-by: Anuril <ta@TAPC01.localdomain>
2023-07-30 20:38:53 +02:00
fefbcd21b0 Apply PHP Code Styling & Quality Changes (#1498)
* Apply PHP Code Styling & Quality Changes

* Delete these

* Update .gitignore

* Fixes for PHPStan

* Ignore spelling in the gitnore

* Allow null for that type

Honestly doing so makes ZERO sense, but it matches the current behavior.

---------

Co-authored-by: FOSSBilling Bot <fossbilling-bot>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-07-30 08:57:44 -07:00
Belle Aerni 7584387207 Run the CS workflow on push to main & add rector (#1497)
* Added a new rector config

* Fixes & corrections

* Spelling

* Remove commented out config
2023-07-30 08:32:55 -07:00
Yağızhanandfossbilling-bot fd872ac941 Implement PHP-CS-Fixer as an automated workflow (#1240)
* Implement PHP-CS-Fixer as an automated workflow

* Apply PHP-CS-Fixer changes

---------

Co-authored-by: fossbilling-bot <121974958+fossbilling-bot@users.noreply.github.com>
2023-07-30 06:49:11 -07: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
Guillaume ARNOUX 776af1750f ✨Add prefix for generated users (#1378)
* ✨Add prefix for generated users

adding a customizable prefix for users whose name is automatically generated during an order

* fix spelling mistake
2023-07-02 22:54:57 +03:00
Belle Aerni 6548ae92e1 Created a new API key product type (#1272)
* Created a new API key product type

* Make the CI happy + a few minor fixes

* Improvements to the generation options

Plus generalized improvements to the config pages

* Fix my typo

* Final touches

At least, I hope they are the final touches. We will see after reviews :P

* Cleanup and minor improvements

* Minor fix

* Move to HTML email templates + add logo

* This doesn't / shouldn't return the ID anymore

It's no longer used as things were switched to the order ID

* Update the model to reflect DB changes

* Misc. cleanup + added some missing types
2023-06-28 11:14:20 -07:00
Belle Aerni 776ddcb7e9 Modify the fingerprint weights (#1367)
* Modify the fingerprint weights

* Update cspell.json
2023-06-25 23:38:59 +03:00
Belle Aerni b9c35a1747 Replace Box_Session and improve session handling (#1332)
* Replace Box_Session and improve session handling

* Improve weights, capitalize class name correctly

* Make the tests pass, update the SQL structure

* Tweak to the fingerprint class, fix more tests

* Regenerate session IDs when logging in

* Improve readability

* Update ServiceTest.php

* Tweak weights and added Huntr badge to the readme

* Improve readability, add PHPDocs, and updated weight

* Update SECURITY.md
2023-06-19 04:14:29 -07:00
Belle Aerni 28559c39b9 Improve our security policy (#1307)
* Improve our security policy

* Update the cspell config

* Whoops - those should have been capitalized
2023-06-11 19:35:52 -07:00
Adam Daley 0e5109a0a5 Refactor System Updater (#1252)
* Refactor System Updater

Refactor Box/Update to clean things up, merge related functionality, improve error checking, and move to FOSSBilling namespace.

Also refactor foss-update.php into core class, `UpdatePatcher`.

* Refactor file system actions to use Symfony Filesystem

Refactor file system actions to use Symfony Filesystem component, and declare all used resources at start of files rather than duplicating throughout.
2023-05-26 15:30:39 +01:00
Adam Daley e54569d2cd Introduce namespaces and strict typing for FOSSBilling library classes (#1206) 2023-05-04 01:02:06 +01:00
YağızhanandAdam Daley 4928ebf932 Implemented Monolog (#1155)
* Implemented Monolog

* Doesn't need to look for BB_DEBUG. It won't be logged on prod anyway.

* Doesn't need to be an array

* -Box_LogStream

* Reverted squash

* Fixed a duplicate

* Type hinting

* This got lost in a merge commit

* Kind of distracted today. Good thing squash and merge exists.

* Cleaning

* Rebased composer.json & lockfile

* Enabled the check again

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2023-05-02 09:32:40 +01:00
Belle Aerni d9e69d4146 Implement a custom autoloader (#1194)
* Implement a custom autoloader

* Remove unreachable line

* Spelling

* I missed that

* Just use the latest version of PHPStan

* Also setup the autoloader in the installer

* Implemented classmap capabilities

* Remove debug line, add PHPDocs

* Typo 7 removing dead code

* Fix the installer after the most recent commit

* Remove outdated installation steps

And link to the website instead

* Excuse me. Formatting please?
2023-05-01 13:19:55 -07:00
Belle AerniandAdam Daley e3d6bc9ad9 Introduce a cspell workflow (#1192)
* Introduce a cspell workflow

* Update cspell.yml

* Update cspell.yml

* Why is it seemingly ignoring the config?

* Waiit a min

* Fixed a bunch of spelling mistakes

* And set it back to incremental mode

* That is actually supposed to be spelled wrong..

Because BoxBilling :)

* Capitalization

* I swear I fixed this as well

* Update cspell.json

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2023-04-30 00:05:25 -07:00
Adam Daley e3967dfe96 Move composer files to project root (#1191) 2023-04-30 07:17:06 +01:00
Adam Daley b08fc53d72 Update rewrite rules, improve error handling, and some related cleanup (#1075)
* Rename htaccess to be applied automatically

Rename the htaccess file, improve handling when .htaccess is missing, and remove from .gitignore so that rules are automatically applied on supported web servers.

* Clean up .gitignore file

* Update .htaccess to improve security

Update .htaccess file to improve general security, handle missing mod_rewrite, and to simplify the required rules.

* Improve HTTP and generic error handling

Improve handling of HTTP errors, and make the error handling code more generic to permit catching more errors.

* Remove outdated example web server config files

Remove the outdated and unmaintained example web server configuration files in favour of FOSSBilling/config-generator.

* Remove support for non-search engine friendly URLs

Remove support for non-search engine friendly URLs as these are depreciated.

* Revert "Remove support for non-search engine friendly URLs"

This reverts commit 724b1eb274.

* Update config migration backup handling
2023-04-06 21:59:25 +02:00
Adam de0bed20ec Replace various HTTP client implementations with symfony/http-client (#861)
* Replace guzzlehttp/guzzle with symfony/http-client

Replace guzzlehttp/guzzle with symfony/http-client to standardise around one globally available HTTP client.

* Replace Box\Curl library and native cURL with symfony/http-client

Replace the Box\Curl library and native cURL with symfony/http-client to standardise around one well supported HTTP client, reduce unnecessary code, and improve compatibility.

* Remove obsolete functionality from Spamchecker module

Remove obsolete functions from Spamchecker module which depended upon cURL.
2023-03-15 11:11:28 +01:00
Belle Aerni 738fa8b3a9 Remove modernizr from Huraga (#927)
It was unused anyways, and I don't imagine it's particularly useful this day and age
2023-03-10 07:00:56 +01:00
Belle Aerni 7ecaf786d5 Move RedBeanPHP to composer (#767)
* Move RedBeanPHP to composer

* Remove missed references to rb.php

* This *should* fix the tests

* Update DummyBean.php

* Remove payment adapter tests

They.. honestly didn't test much and are proving to cause issues when moving rb.php to composer
2023-02-05 08:43:37 -08:00
Belle Aerni 7acac92709 Replace php-markdown with commonmark and remove Spyc (#688)
* Remove spyc package

We aren't using it

* Replace php-markdown with commonmark

* update lockfile after rebase
2023-01-12 12:40:12 +01:00
Belle Aerni b6e4f22dfb Remove old file references 2022-12-08 17:22:12 -08:00
Belle Aerni ee676ca33a Update file references 2022-11-28 17:22:50 +03:00
Belle Aerni 363563a37d Fix spelling mistake 2022-11-27 12:24:44 -08:00
Belle Aerni 741a58bac3 Exclude all assets folder 2022-11-01 19:36:17 -07:00
Belle Aerni 6d557ce39c Fix remaining typos 2022-11-01 18:53:36 -07:00
Belle Aerni 10944467a8 Fixed typos in .md files 2022-11-01 18:00:46 -07:00
Belle Aerni c2688d7ac5 Created initial cspell config file 2022-11-01 17:20:59 -07:00