Skip to content

Commit

Permalink
Merge pull request #216 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 10.0.0-alpha.2 -- cleanup, twig prep, typehints
  • Loading branch information
briskt authored Jun 13, 2024
2 parents a953fea + 1a1e348 commit b0e8d10
Show file tree
Hide file tree
Showing 114 changed files with 720 additions and 1,435 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: test
run: docker-compose -f actions-services.yml run --rm app ./run-tests.sh
run: docker-compose -f actions-services.yml run --rm test ./run-tests.sh
- name: check hub metadata for tests
run: docker-compose -f actions-services.yml run --rm ssp-hub.local ./run-metadata-tests.sh
- name: check idp metadata for tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ composer.phar
*.aes
dockercfg
node_modules/
features/screenshots/
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,22 @@ RUN curl https://raw.githubusercontent.com/silinternational/s3-expand/1.5/s3-exp
WORKDIR /data

# Install/cleanup composer dependencies
ARG COMPOSER_FLAGS="--prefer-dist --no-interaction --no-dev --optimize-autoloader --no-scripts --no-progress"
COPY composer.json /data/
COPY composer.lock /data/
RUN composer self-update --no-interaction
RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --prefer-dist --no-interaction --no-dev --optimize-autoloader --no-scripts --no-progress
RUN COMPOSER_ALLOW_SUPERUSER=1 composer install $COMPOSER_FLAGS

ENV SSP_PATH /data/vendor/simplesamlphp/simplesamlphp

# Copy modules into simplesamlphp
COPY modules/ $SSP_PATH/modules

# Copy material theme templates to other modules, just in case the "default" theme is selected
COPY modules/material/themes/material/expirychecker/* $SSP_PATH/modules/expirychecker/templates/
COPY modules/material/themes/material/mfa/* $SSP_PATH/modules/mfa/templates/
COPY modules/material/themes/material/profilereview/* $SSP_PATH/modules/profilereview/templates/

# Copy in SSP override files
RUN mv $SSP_PATH/www/index.php $SSP_PATH/www/ssp-index.php
COPY dockerbuild/ssp-overrides/index.php $SSP_PATH/www/index.php
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ test-integration:
docker-compose run --rm test ./run-integration-tests.sh

copyJsLib:
cp ./node_modules/@simplewebauthn/browser/dist/bundle/index.umd.min.js ./modules/material/www/simplewebauthn/browser.js
cp ./node_modules/@simplewebauthn/browser/LICENSE.md ./www/simplewebauthn/LICENSE.md
cp ./node_modules/@simplewebauthn/browser/dist/bundle/index.umd.min.js ./modules/mfa/www/simplewebauthn/browser.js
cp ./node_modules/@simplewebauthn/browser/LICENSE.md ./modules/mfa/www/simplewebauthn/LICENSE.md

deps:
docker-compose run --rm node npm install --ignore-scripts
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@ will overwrite variables set in the execution environment.
4. `make` or `docker-compose up -d` within the project root.
5. Visit http://ssp-hub.local to see SimpleSAMLphp

### Configure a container for debugging with Xdebug

1. Add a volume map for run-debug.sh on the container you wish to debug.

```yml
- ./development/run-debug.sh:/data/run-debug.sh
```
2. Add or change the `command` for the container.

```yml
command: /data/run-debug.sh
```

3. Restart the container.

```shell
docker composer up -d ssp-hub.local
```

### Setup PhpStorm for remote debugging with Docker

1. Make sure you're running PhpStorm 2016.3 or later
Expand Down Expand Up @@ -192,7 +212,7 @@ Update `/simplesamlphp/config/config.php`:
'theme.use' => 'material:material'
```
This project provides a convenience by loading this config with whatever is in the environment variable `THEME_USE`._
This project sets this as the default value in the provided config file.
##### Google reCAPTCHA
Expand Down
22 changes: 7 additions & 15 deletions actions-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ services:
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth

app:
build: .
test:
build:
context: .
args:
COMPOSER_FLAGS: "--no-interaction --no-progress"
depends_on:
- ssp-hub.local
- ssp-idp1.local
Expand All @@ -28,7 +31,6 @@ services:
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
PROFILE_URL_FOR_TESTS: http://pwmanager.local/module.php/core/authenticate.php?as=ssp-hub
ADMIN_EMAIL: [email protected]
ADMIN_PASS: b
SECRET_SALT: abc123
IDP_NAME: x
Expand All @@ -53,6 +55,7 @@ services:

# Utilize custom configs
- ./development/hub/config/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
- ./development/announcement.php:/data/vendor/simplesamlphp/simplesamlphp/announcement/announcement.php

# Utilize custom metadata
- ./development/hub/metadata/idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/idp-remote.php
Expand All @@ -63,14 +66,12 @@ services:
# Enable checking our test metadata
- ./dockerbuild/run-metadata-tests.sh:/data/run-metadata-tests.sh
environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "abc123"
SECRET_SALT: "not-secret-h57fjemb&dn^nsJFGNjweJ"
IDP_NAME: "Hub"
SECURE_COOKIE: "false"
ADMIN_PROTECT_INDEX_PAGE: "false"
SHOW_SAML_ERRORS: "true"
THEME_USE: "material:material"
THEME_COLOR_SCHEME: "orange-light_blue"
HUB_MODE: "true"

Expand All @@ -85,6 +86,7 @@ services:
# Utilize custom configs
- ./development/idp-local/config/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
- ./development/idp-local/config/config.php:/data/vendor/simplesamlphp/simplesamlphp/config/config.php
- ./development/announcement.php:/data/vendor/simplesamlphp/simplesamlphp/announcement/announcement.php

# Utilize custom metadata
- ./development/idp-local/metadata/saml20-idp-hosted.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-hosted.php
Expand All @@ -102,7 +104,6 @@ services:
bash -c "whenavail db 3306 60 /data/vendor/simplesamlphp/simplesamlphp/modules/silauth/lib/Auth/Source/yii migrate --interactive=0 &&
/data/run.sh"
environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "a"
SECRET_SALT: "not-secret-h57fjemb&dn^nsJFGNjweJ"
IDP_NAME: "IDP 1"
Expand All @@ -117,7 +118,6 @@ services:
PROFILE_URL_FOR_TESTS: "http://pwmanager.local/module.php/core/authenticate.php?as=ssp-hub"
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
THEME_USE: "default"
MYSQL_HOST: "db"
MYSQL_DATABASE: "silauth"
MYSQL_USER: "silauth"
Expand All @@ -142,13 +142,11 @@ services:
- ./development/UserPass.php:/data/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/UserPass.php

environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "b"
SECRET_SALT: "h57fjemb&dn^nsJFGNjweJ"
IDP_NAME: "IDP 2"
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
THEME_USE: "material:material"

ssp-idp3.local:
build: .
Expand All @@ -165,7 +163,6 @@ services:
- ./development/idp3-local/metadata/saml20-sp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-sp-remote.php

environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "c"
SECRET_SALT: "h57fjem34fh*nsJFGNjweJ"
SECURE_COOKIE: "false"
Expand All @@ -188,7 +185,6 @@ services:
# Enable checking our test metadata
- ./dockerbuild/run-metadata-tests.sh:/data/run-metadata-tests.sh
environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "sp1"
SECRET_SALT: "not-secret-h57fjemb&dn^nsJFGNjweJz1"
SECURE_COOKIE: "false"
Expand All @@ -210,7 +206,6 @@ services:
- ./development/sp2-local/metadata/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php

environment:
ADMIN_EMAIL: [email protected]
ADMIN_PASS: sp2
SECRET_SALT: h57fjemb&dn^nsJFGNjweJz2
SECURE_COOKIE: "false"
Expand All @@ -232,7 +227,6 @@ services:
- ./development/sp3-local/metadata/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php

environment:
ADMIN_EMAIL: [email protected]
ADMIN_PASS: sp3
SECRET_SALT: h57fjemb&dn^nsJFGNjweJz3
SECURE_COOKIE: "false"
Expand All @@ -253,15 +247,13 @@ services:
# Utilize custom metadata
- ./development/sp-local/metadata/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php
environment:
ADMIN_EMAIL: [email protected]
ADMIN_PASS: sp1
IDP_NAME: THIS VARIABLE IS REQUIRED BUT PROBABLY NOT USED
SECRET_SALT: NOT-a-secret-k49fjfkw73hjf9t87wjiw
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
SAML20_IDP_ENABLE: "false"
ADMIN_PROTECT_INDEX_PAGE: "false"
THEME_USE: default

# the broker and brokerDb containers are used by the silauth module
broker:
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"simplesamlphp/composer-module-installer": "1.1.8",
"rlanvin/php-ip": "^1.0",
"silinternational/ssp-utilities": "^1.1.0",
"silinternational/simplesamlphp-module-material": "^8.1.1",
"silinternational/simplesamlphp-module-sildisco": "^4.0.0",
"silinternational/php-env": "^3.1.0",
"silinternational/psr3-adapters": "^3.1",
"silinternational/yii2-json-log-targets": "^2.0",
Expand All @@ -32,7 +30,8 @@
"fillup/fake-bower-assets": "^2.0",
"google/recaptcha": "^1.1",
"psr/log": "^1.0",
"monolog/monolog": "^1.22"
"monolog/monolog": "^1.22",
"aws/aws-sdk-php": "^3.313"
},
"require-dev": {
"behat/behat": "^3.8",
Expand All @@ -46,7 +45,8 @@
"vendor/yiisoft/yii2/Yii.php"
],
"psr-4": {
"Sil\\SspBase\\Features\\": "features/"
"Sil\\SspBase\\Features\\": "features/",
"Sil\\SilAuth\\migrations\\": "modules/silauth/migrations/"
}
},
"config": {
Expand Down
Loading

0 comments on commit b0e8d10

Please sign in to comment.