From b4180172a55e40ee50536e9de4e7e0ec95471dc6 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Mon, 27 May 2024 17:03:43 +0800 Subject: [PATCH 01/13] minor tweaks to script files --- dockerbuild/run-idp.sh | 19 +++++++++---------- dockerbuild/run-integration-tests.sh | 5 ++++- dockerbuild/run-metadata-tests.sh | 5 ++++- dockerbuild/run-tests.sh | 5 ++++- dockerbuild/run.sh | 6 ++++++ 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/dockerbuild/run-idp.sh b/dockerbuild/run-idp.sh index f2faa512..d08922d0 100755 --- a/dockerbuild/run-idp.sh +++ b/dockerbuild/run-idp.sh @@ -1,17 +1,16 @@ #!/usr/bin/env bash -# Try to run database migrations -cd /data/vendor/simplesamlphp/simplesamlphp/modules/silauth -chmod a+x ./lib/Auth/Source/yii +# echo script commands to stdout +set -x + +# exit if any command fails +set -e -output=$(./lib/Auth/Source/yii migrate --interactive=0 2>&1) +# Try to run database migrations +cd /data/vendor/simplesamlphp/simplesamlphp/modules/silauth/lib/Auth/Source +chmod a+x ./yii -# If they failed, exit. -rc=$?; -if [[ $rc != 0 ]]; then - logger --priority user.err --stderr "Migrations failed with status ${rc} and output: ${output}" - exit $rc; -fi +./yii migrate --interactive=0 cd /data ./run.sh diff --git a/dockerbuild/run-integration-tests.sh b/dockerbuild/run-integration-tests.sh index f4ca4aa3..b3d92545 100755 --- a/dockerbuild/run-integration-tests.sh +++ b/dockerbuild/run-integration-tests.sh @@ -1,8 +1,11 @@ #!/usr/bin/env bash -set -e +# echo script commands to stdout set -x +# exit if any command fails +set -e + cd /data export COMPOSER_ALLOW_SUPERUSER=1; composer install diff --git a/dockerbuild/run-metadata-tests.sh b/dockerbuild/run-metadata-tests.sh index e8bb0678..f052741c 100755 --- a/dockerbuild/run-metadata-tests.sh +++ b/dockerbuild/run-metadata-tests.sh @@ -1,8 +1,11 @@ #!/usr/bin/env bash -set -e +# echo script commands to stdout set -x +# exit if any command fails +set -e + cd /data export COMPOSER_ALLOW_SUPERUSER=1; composer install diff --git a/dockerbuild/run-tests.sh b/dockerbuild/run-tests.sh index e17edd55..37c21ec7 100755 --- a/dockerbuild/run-tests.sh +++ b/dockerbuild/run-tests.sh @@ -1,8 +1,11 @@ #!/usr/bin/env bash -set -e +# echo script commands to stdout set -x +# exit if any command fails +set -e + /data/run-metadata-tests.sh ./vendor/bin/phpunit -v tests/AnnouncementTest.php diff --git a/dockerbuild/run.sh b/dockerbuild/run.sh index 748fc0b6..4d7ff730 100755 --- a/dockerbuild/run.sh +++ b/dockerbuild/run.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +# echo script commands to stdout +set -x + +# exit if any command fails +set -e + # This is a temporary fix (bug workaround) until ssp 2.0 is in use sed -i 's_\(\\SimpleSAML\\Error\\Assertion::installHandler()\)_// \1 _' /data/vendor/simplesamlphp/simplesamlphp/www/_include.php From 44baf140d46ad7d7c65d238c7b9a5b91f35ac74e Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Wed, 29 May 2024 16:26:44 +0800 Subject: [PATCH 02/13] Google analytics4 https://github.com/silinternational/simplesamlphp-module-material/pull/119 --- README.md | 2 +- .../themes/material/common-head-elements.php | 28 ++++++++----------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 922fd98d..3f908f36 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ The login page looks for `/simplesamlphp/www/logo.png` which is **NOT** provided Update `/simplesamlphp/config/config.php`: ``` -'analytics.trackingId' => 'UA-some-unique-id-for-your-site' +'analytics.trackingId' => 'G-some-unique-id-for-your-site' ``` This project provides a convenience by loading this config with whatever is in the environment variable `ANALYTICS_ID`._ diff --git a/modules/material/themes/material/common-head-elements.php b/modules/material/themes/material/common-head-elements.php index 140d0899..ceb5690d 100644 --- a/modules/material/themes/material/common-head-elements.php +++ b/modules/material/themes/material/common-head-elements.php @@ -8,26 +8,20 @@ configuration->getValue('analytics.trackingId')); if (! empty($trackingId)) { -?> - - - - - + + + + - configuration->getValue('theme.color-scheme') ?: 'indigo-purple'); ?> From 9d1d0296f4043104497b1cd19a778fc55684e246 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Wed, 29 May 2024 16:31:46 +0800 Subject: [PATCH 03/13] input color was too light https://github.com/silinternational/simplesamlphp-module-material/pull/136 --- modules/material/themes/material/core/loginuserpass.php | 4 ++-- .../themes/material/mfa/prompt-for-mfa-backupcode.php | 2 +- .../material/themes/material/mfa/prompt-for-mfa-manager.php | 2 +- modules/material/themes/material/mfa/prompt-for-mfa-totp.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/material/themes/material/core/loginuserpass.php b/modules/material/themes/material/core/loginuserpass.php index bc4a62af..afea971b 100644 --- a/modules/material/themes/material/core/loginuserpass.php +++ b/modules/material/themes/material/core/loginuserpass.php @@ -82,7 +82,7 @@ function onRecaptchaLoad() { data['username'] ?? null); ?> - id="username"/> @@ -91,7 +91,7 @@ function onRecaptchaLoad() { = $this->t('{material:login:label_password}') ?> - + id="password"/> diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.php b/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.php index a621d002..7520467a 100644 --- a/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.php +++ b/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.php @@ -39,7 +39,7 @@ - diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-manager.php b/modules/material/themes/material/mfa/prompt-for-mfa-manager.php index a385a082..e9899947 100644 --- a/modules/material/themes/material/mfa/prompt-for-mfa-manager.php +++ b/modules/material/themes/material/mfa/prompt-for-mfa-manager.php @@ -38,7 +38,7 @@ - + diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-totp.php b/modules/material/themes/material/mfa/prompt-for-mfa-totp.php index 4b861524..c85c6718 100644 --- a/modules/material/themes/material/mfa/prompt-for-mfa-totp.php +++ b/modules/material/themes/material/mfa/prompt-for-mfa-totp.php @@ -39,7 +39,7 @@ class="icon"> - From 3f9a018045dcdee81b20b27d9406dc4d710983fa Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Wed, 29 May 2024 16:48:10 +0800 Subject: [PATCH 04/13] PHP 8 update https://github.com/silinternational/simplesamlphp-module-material/pull/108 --- docs/material_tests.md | 1 + modules/material/themes/material/mfa/low-on-backup-codes.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/material_tests.md b/docs/material_tests.md index a2cc2247..87a2fed0 100644 --- a/docs/material_tests.md +++ b/docs/material_tests.md @@ -115,6 +115,7 @@ _Note: This nag only works once since choosing later will simply set the nag da 1. Goto [SP 1](http://ssp-sp1.local:8081/module.php/core/authenticate.php?as=ssp-hub-custom-port) 1. Click **idp4** (third one) 1. Login as a "totp" user: `username=`**has_totp** `password=`**a** +1. You should see the form to enter a totp code. 1. Set up an app using this secret, `JVRXKYTMPBEVKXLS` 1. Enter code from app to verify 1. Click **Logout** diff --git a/modules/material/themes/material/mfa/low-on-backup-codes.php b/modules/material/themes/material/mfa/low-on-backup-codes.php index 152207dd..9f148a1c 100644 --- a/modules/material/themes/material/mfa/low-on-backup-codes.php +++ b/modules/material/themes/material/mfa/low-on-backup-codes.php @@ -29,7 +29,7 @@
- = $this->t('{material:mfa:running_out_info}', ['{numBackupCodesRemaining}' => (int)$this->data['numBackupCodesRemaining']]) ?> + = $this->t('{material:mfa:running_out_info}', ['{numBackupCodesRemaining}' => (string)(int)$this->data['numBackupCodesRemaining']]) ?>