From 6e31c2e890e4eb1f56ac8147ecf777c244348786 Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Sun, 11 Oct 2026 18:40:42 +0200 Subject: [PATCH] Updated qr code generation code --- README.md | 5 +++++ common_config.php | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53fadf1..d31796f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,11 @@ Install files and programs ./install_binaries.sh ``` +When updating the application, copy the updated `composer.json` to `/var/www/mail/` and refresh the installed dependencies and autoloader: +``` +cd /var/www/mail && composer install --no-dev --no-interaction +``` + Copy (and modify according to your needs) the site files in `etc` to `/etc` after installation has finished. Then restart some services: ``` systemctl daemon-reload && systemctl restart tor@default.service diff --git a/common_config.php b/common_config.php index 02ac4f7..907709b 100644 --- a/common_config.php +++ b/common_config.php @@ -184,9 +184,13 @@ function get_totp_provisioning_uri( string $account, string $secret ): string function get_totp_qr_data_uri( string $totp_uri ): string { - $qrCode = \Endroid\QrCode\QrCode::create( $totp_uri ) - ->setSize( 220 ) - ->setMargin( 8 ); + $qrCode = new \Endroid\QrCode\QrCode( + $totp_uri, + new \Endroid\QrCode\Encoding\Encoding( 'UTF-8' ), + \Endroid\QrCode\ErrorCorrectionLevel::Low, + 220, + 8 + ); return ( new \Endroid\QrCode\Writer\PngWriter() )->write( $qrCode )->getDataUri(); }