Skip to content

Commit

Permalink
updated dependencies and mariadb next lts version
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong committed Jul 24, 2024
1 parent 0ad8781 commit bce34d7
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 26 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# [4.0.0-alpha.20 - 2024-07-24]

* updated dependencies
* https://github.com/frmlx/framelix/compare/4.0.0-alpha.19...4.0.0-alpha.20

# [4.0.0-alpha.19 - 2024-04-13]

* a lot of updates, features and refactoring
Expand Down
6 changes: 3 additions & 3 deletions appdata/modules/Framelix/composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"require": {
"robthree/twofactorauth": "^2.1",
"lbuchs/webauthn": "^2.1",
"robthree/twofactorauth": "^3.0",
"lbuchs/webauthn": "^2.2",
"mpdf/qrcode": "^1.2",
"phpoffice/phpspreadsheet": "^2.0",
"phpoffice/phpspreadsheet": "^2.1",
"mpdf/mpdf": "^8.2",
"phpmailer/phpmailer": "^6.9",
"brainfoolong/cryptojs-aes-php": "^2.3"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions appdata/modules/Framelix/src/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,17 @@ public static function cron(): int
/**
* Call console script via php command line interpreter in a separate process
* @param string $methodName
* @param string $module Specific module, use "all" to run for all installed modules
* @param array|null $parameters
* @return Shell
*/
public static function callMethodInSeparateProcess(string $methodName, ?array $parameters = null): Shell
public static function callMethodInSeparateProcess(string $methodName, string $module = "all", ?array $parameters = null): Shell
{
if (!is_array($parameters)) {
$parameters = [];
}
array_unshift($parameters, $methodName);
array_unshift($parameters, "all");
array_unshift($parameters, $module);
array_unshift($parameters, self::CONSOLE_SCRIPT);
$shell = Shell::prepare("{*}", $parameters);
$shell->execute();
Expand Down
3 changes: 2 additions & 1 deletion appdata/modules/Framelix/src/Form/Field/TwoFactorCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Framelix\Framelix\Form\Field;
use Framelix\Framelix\Lang;
use Framelix\Framelix\Network\Cookie;
use RobThree\Auth\Providers\Qr\QRServerProvider;
use RobThree\Auth\TwoFactorAuth;

use function in_array;
Expand Down Expand Up @@ -44,7 +45,7 @@ public function validate(): string|bool
$valid = false;
$secret = Cookie::get(self::COOKIE_NAME_SECRET, encrypted: true);
if ($secret && strlen($value) === 6) {
$tfa = new TwoFactorAuth();
$tfa = new TwoFactorAuth(new QRServerProvider());
$result = $tfa->verifyCode($secret, $value);
if ($result) {
$valid = true;
Expand Down
20 changes: 10 additions & 10 deletions appdata/modules/Framelix/src/View/Backend/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,16 @@ public function showContent(): void
$form->addSubmitButton('setup', '__framelix_setup_finish_setup__');
$form->show();
?>
<script>
(function () {
// check if scripts have been loaded successfully, if not, we are on the wrong path
if (typeof FramelixDeviceDetection === 'undefined') {
const spl = window.location.pathname.split('/')
spl.splice(1, 1)
window.location.pathname = spl.join('/')
}
})()
</script>
<script>
(function () {
// check if scripts have been loaded successfully, if not, we are on the wrong path
if (typeof FramelixDeviceDetection === 'undefined') {
const spl = window.location.pathname.split('/')
spl.splice(1, 1)
window.location.pathname = spl.join('/')
}
})()
</script>
<?php
}

Expand Down
14 changes: 13 additions & 1 deletion appdata/modules/FramelixDemo/src/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,19 @@ class Console extends \Framelix\Framelix\Console

public static function appWarmup(): int
{
self::cleanupDemoData();
self::callMethodInSeparateProcess('updateDatabaseSafe');

$user = User::getByEmail('[email protected]', true);
if (!$user) {
// create the test user if not yet exist
$user = new User();
$user->email = "[email protected]";
$pw = RandomGenerator::getRandomString(5, 10);
$user->setPassword($pw);
$user->flagLocked = false;
$user->store();
$user->addRole('admin');
}
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
use Framelix\Framelix\Form\Field\TwoFactorCode;
use Framelix\Framelix\Network\Cookie;
use Framelix\FramelixTests\TestCase;
use RobThree\Auth\Providers\Qr\QRServerProvider;
use RobThree\Auth\TwoFactorAuth;

final class TwoFactorCodeTest extends TestCase
{
public function tests(): void
{
$tfa = new TwoFactorAuth();
$tfa = new TwoFactorAuth(new QRServerProvider());
$secret = $tfa->createSecret();

$field = new TwoFactorCode();
Expand Down
2 changes: 1 addition & 1 deletion appdata/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ parameters:
- vendor
bootstrapFiles:
- modules/FramelixTests/public/index.php
checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: false
ignoreErrors:
- identifier: missingType.iterableValue
- '#Unsafe usage of new static#'
- '#Argument of an invalid type .* supplied for foreach#'
- '#Call to an undefined method ReflectionType::getName#'
Expand Down
7 changes: 3 additions & 4 deletions dev-scripts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.4"

volumes:
mariadb:
name: ${COMPOSE_PROJECT_NAME}_mariadb
Expand All @@ -8,16 +6,17 @@ volumes:

services:
mariadb:
image: mariadb:10.11
image: mariadb:lts
restart: on-failure
volumes:
- mariadb:/var/lib/mysql
environment:
- MARIADB_ROOT_PASSWORD=app
- MARIADB_USER=app
- MARIADB_PASSWORD=app
- MARIADB_AUTO_UPGRADE=1
healthcheck:
test: mysql -u root '-papp' -e '\q'
test: mariadb -u root '-papp' -e '\q'
interval: 5s
timeout: 5s
retries: 5
Expand Down
2 changes: 1 addition & 1 deletion dev-scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ echo "Done."
echo ""

cecho b "# Drop databases"
docker $DOCKER_EXECPARAMS_MARIADB "mysql -u root -papp -e 'DROP DATABASE IF EXISTS unittests; DROP DATABASE IF EXISTS FramelixTests; DROP DATABASE IF EXISTS FramelixDocs; DROP DATABASE IF EXISTS FramelixStarter;'"
docker $DOCKER_EXECPARAMS_MARIADB "mariadb -u root -papp -e 'DROP DATABASE IF EXISTS unittests; DROP DATABASE IF EXISTS FramelixTests; DROP DATABASE IF EXISTS FramelixDocs; DROP DATABASE IF EXISTS FramelixStarter;'"
echo ""
echo "Done."
echo ""
Expand Down

0 comments on commit bce34d7

Please sign in to comment.