Skip to content

Commit b3e3f6a

Browse files
authored
Merge pull request #1781 from OpenConext/feature/update-devconf-installation
Update Devconf installation and docs
2 parents eda4d94 + d64ee74 commit b3e3f6a

File tree

115 files changed

+638
-1208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+638
-1208
lines changed

.github/workflows/run-cypress.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
cd docker &&
3131
${DOCKER_COMPOSE} up -d --build &&
32-
docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
32+
docker compose exec -T --user www-data engine.dev.openconext.local bash -c '
3333
SYMFONY_ENV=ci composer install --prefer-dist -n -o --ignore-platform-reqs && \
3434
./app/console cache:clear --env=ci && \
3535
cd theme && CYPRESS_INSTALL_BINARY=0 yarn install --frozen-lockfile && EB_THEME=skeune yarn build
@@ -38,13 +38,13 @@ jobs:
3838
if: always()
3939
run: |
4040
cd docker && \
41-
docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
41+
docker compose exec -T --user www-data engine.dev.openconext.local bash -c '
4242
EB_THEME=skeune ./theme/scripts/prepare-test.js
4343
' && \
4444
docker compose exec -T cypress bash -c '
4545
cd e2e && yarn install && cypress run --spec cypress/integration/skeune/**/*.spec.js,cypress/integration/shared/*.spec.js --browser=chrome --headless
4646
' && \
47-
docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
47+
docker compose exec -T --user www-data engine.dev.openconext.local bash -c '
4848
EB_THEME=openconext ./theme/scripts/prepare-test.js
4949
' && \
5050
docker compose exec -T cypress bash -c '

.github/workflows/test-integration.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
run: |
3030
cd docker &&
3131
${DOCKER_COMPOSE} up -d --build &&
32-
docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
32+
docker compose exec -T --user www-data engine.dev.openconext.local bash -c '
3333
SYMFONY_ENV=ci composer install --prefer-dist -n -o --ignore-platform-reqs && \
3434
./app/console cache:clear --env=ci && \
3535
cd theme && CYPRESS_INSTALL_BINARY=0 yarn install --frozen-lockfile && EB_THEME=skeune yarn build
3636
'
3737
- name: Run code quality tests
3838
if: always()
3939
run: |
40-
cd docker && docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
40+
cd docker && docker compose exec -T --user www-data engine.dev.openconext.local bash -c '
4141
echo -e "\nPHP Mess Detector\n" && \
4242
./vendor/bin/phpmd src text ci/qa-config/phpmd.xml --exclude */Tests/* && \
4343
echo -e "\nPHP CodeSniffer\n" && \
@@ -52,7 +52,7 @@ jobs:
5252
- name: Run unit tests
5353
if: always()
5454
run: |
55-
cd docker && APP_ENV=ci docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
55+
cd docker && APP_ENV=ci SYMFONY_ENV=ci docker compose exec -T --user www-data engine.dev.openconext.local bash -c '
5656
echo -e "\nInstalling database fixtures...\n" && \
5757
./app/console doctrine:schema:drop --force --env=ci && \
5858
./app/console doctrine:schema:create --env=ci && \
@@ -70,7 +70,7 @@ jobs:
7070
- name: Run acceptance tests
7171
if: always()
7272
run: |
73-
cd docker && docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
73+
cd docker && docker compose exec -T --user www-data engine.dev.openconext.local bash -c '
7474
echo -e "\nInstalling database fixtures...\n" && \
7575
./app/console doctrine:schema:drop --force --env=ci && \
7676
./app/console doctrine:schema:create --env=ci && \
@@ -86,7 +86,7 @@ jobs:
8686
- name: Run linting tests
8787
if: always()
8888
run: |
89-
cd docker && docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
89+
cd docker && docker compose exec -T --user www-data engine.dev.openconext.local bash -c '
9090
echo -e "\nTwig lint\n" && \
9191
app/console lint:twig theme/ && \
9292
cd theme && \
@@ -98,7 +98,7 @@ jobs:
9898
- name: Show log on failure
9999
if: failure()
100100
run: |
101-
cd docker && docker compose exec -T php-fpm.vm.openconext.org cat /opt/openconext/OpenConext-engineblock/app/logs/ci/ci.log
101+
cd docker && docker compose exec -T engine.dev.openconext.local cat /var/www/html/app/logs/ci/ci.log
102102
- name: Send notification on production build nightly build failure
103103
uses: sonots/slack-notice-action@v3
104104
with:

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Finally, when not in an environment with the debug flag enabled, you need to cle
4242
$ php72 ./app/console cache:clear --env=prod
4343
```
4444

45-
To setup the required tooling on the VM, the following steps might be useful:
45+
To setup the required tooling on the container, the following steps might be useful:
4646

4747
cd /opt/openconext/OpenConext-engineblock/theme
4848
sudo curl --silent --location https://rpm.nodesource.com/setup_11.x | sudo bash -
@@ -82,12 +82,12 @@ it is only regularly tested with RedHat Enterprise Linux and CentOS._
8282

8383
## Installation
8484

85-
_**Note**: you are highly encouraged to use [OpenConext-Deploy][op-dep] to deploy OpenConext installations._
85+
_**Note**: you are highly encouraged to use [OpenConext-Devconf][op-dev] to deploy OpenConext installations._
8686

8787
If you are reading this then you've probably already installed a copy of EngineBlock somewhere on the destination server,
8888
if not, then that would be step 1 for the installation.
8989

90-
If you do not use [OpenConext-Deploy][op-dep] and have an installed copy and your server meets all the requirements
90+
If you do not use [OpenConext-Devconf][op-dev] and have an installed copy and your server meets all the requirements
9191
above, then please follow the steps below to start your installation.
9292

9393
### First, create an empty database
@@ -143,11 +143,11 @@ It should also serve both the `engine.yourdomain.example` and `engine-api.yourdo
143143
Make sure the `ENGINEBLOCK_ENV` is set, and that the `SYMFONY_ENV` is set, this can be mapped from `ENGINEBLOCK_ENV` as:
144144

145145
| `ENGINEBLOCK_ENV` | `SYMFONY_ENV` |
146-
| --- | --- |
147-
| production | prod |
148-
| acceptance | acc |
149-
| test | test |
150-
| vm | dev |
146+
|-------------------| --- |
147+
| production | prod |
148+
| acceptance | acc |
149+
| test | test |
150+
| dev | dev |
151151

152152
**EXAMPLE**
153153

@@ -254,7 +254,7 @@ Also, the following documentation can be found in the [docs][docs] directory:
254254
[notice]: NOTICE.txt
255255
[upgrading]: UPGRADING.md
256256
[comp]: https://getcomposer.org/
257-
[op-dep]: https://github.com/OpenConext/OpenConext-deploy
257+
[op-dev]: https://github.com/OpenConext/OpenConext-devconf
258258
[manage]: https://github.com/OpenConext/OpenConext-manage
259259
[eb-wiki-theme-development]: https://github.com/OpenConext/OpenConext-engineblock/wiki/Development-Guidelines#theme-development
260260
[wiki]: https://github.com/OpenConext/OpenConext-engineblock/wiki

app/AppKernel.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,19 @@ public function registerContainerConfiguration(LoaderInterface $loader)
6060

6161
public function getCacheDir()
6262
{
63-
// In the dev & test environments use a folder outside the shared filesystem. This greatly improves cache clear
64-
// and warmup time.
65-
if ($this->getEnvironment() === 'dev' || $this->getEnvironment() === 'test') {
66-
return sprintf('/tmp/engineblock/cache/%s', $this->getEnvironment());
67-
}
68-
6963
return $this->rootDir . '/cache/' . $this->environment;
7064
}
7165

7266
public function getLogDir()
7367
{
7468
return $this->rootDir . '/logs/' . $this->environment;
7569
}
70+
71+
public function getProjectDir()
72+
{
73+
// This is needed to define the project dir without composer.json
74+
// @see: https://symfony.com/doc/current/reference/configuration/kernel.html#configuration-kernel-project-directory
75+
return \dirname(__DIR__);
76+
}
77+
7678
}

app/config/config_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ doctrine:
1010
driver: pdo_mysql # This must be PDO until all database interaction runs through doctrine
1111
server_version: 5.5
1212
dbname: "%database.dbname%"
13-
host: "db.vm.openconext.org"
13+
host: "mariadb"
1414
port: "%database.port%"
1515
user: "%database.user%"
1616
password: "%database.password%"
1717
engineblock_test:
1818
driver: pdo_mysql # This must be PDO until all database interaction runs through doctrine
1919
server_version: 5.5
2020
dbname: "%database.test.dbname%"
21-
host: "db-test.vm.openconext.org"
21+
host: "mariadb"
2222
port: "%database.test.port%"
2323
user: "%database.test.user%"
2424
password: "%database.test.password%"

app/config/functional_testing.yml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ parameters:
55
# Where must we store the writable state of the Mock IdP and Mock SP?
66
idp_fixture_file: '/tmp/eb-fixtures/db/idp.states.php.serialized'
77
sp_fixture_file: '/tmp/eb-fixtures/db/sp.states.php.serialized'
8-
stepup.sfo.override_engine_entityid: 'https://engine.vm.openconext.com/new/stepup/metadata'
8+
stepup.sfo.override_engine_entityid: 'https://engine.dev.openconext.local/new/stepup/metadata'

app/config/parameters.yml.dist

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ parameters:
1111
## from the Host header will be used) or set to match the domain
1212
## setting. For example:
1313
##
14-
## domain = vm.openconext.org
15-
## hostname = engine.vm.openconext.org
16-
domain: vm.openconext.org
14+
## domain = dev.openconext.local
15+
## hostname = engine.dev.openconext.local
16+
domain: dev.openconext.local
1717
## Set a fixed hostname for OpenConext EngineBlock to use.
18-
hostname: engine.vm.openconext.org
18+
hostname: engine.dev.openconext.local
1919

2020
## Configure trusted proxies to use their X-Forwarded-For header.
2121
trusted_proxies:
@@ -43,8 +43,8 @@ parameters:
4343
## or requests (when it acts as an SP) it uses these X.509 certs.
4444
encryption_keys:
4545
default:
46-
publicFile: /etc/openconext/engineblock.crt
47-
privateFile: /etc/openconext/engineblock.pem
46+
publicFile: /config/engine/engineblock.crt
47+
privateFile: /config/engine/engineblock.pem
4848

4949
## List of signature methods explicitly forbidden by EngineBlock.
5050
forbidden_signature_methods: { }
@@ -73,7 +73,7 @@ parameters:
7373

7474
## EngineBlock API credentials
7575
## The API user config, allows for configuration of multiple different users
76-
api.users.metadataPush.username: serviceregistry
76+
api.users.metadataPush.username: manage
7777
api.users.metadataPush.password: secret
7878
api.users.profile.username: profile
7979
api.users.profile.password: secret
@@ -84,7 +84,7 @@ parameters:
8484
## PDP SETTINGS
8585
##########################################################################################
8686
## Location of PDP
87-
pdp.host: 'https://pdp.vm.openconext.org'
87+
pdp.host: 'https://pdp.dev.openconext.local'
8888

8989
## PDP uses basic auth
9090
pdp.username: pdp_admin
@@ -96,7 +96,7 @@ parameters:
9696
## ATTRIBUTE AGGREGATION SETTINGS
9797
##########################################################################################
9898
## Location of AA
99-
attribute_aggregation.base_url: 'https://aa.vm.openconext.org/aa/api/internal/attribute/aggregation'
99+
attribute_aggregation.base_url: 'https://aa.dev.openconext.local/internal/attribute/aggregation'
100100
attribute_aggregation.username: eb
101101
attribute_aggregation.password: secret
102102

@@ -119,12 +119,12 @@ parameters:
119119
##########################################################################################
120120
## DATABASE SETTINGS
121121
##########################################################################################
122-
database.host: localhost
122+
database.host: mariadb
123123
database.port: '3306'
124124
database.user: ebrw
125125
database.password: secret
126126
database.dbname: eb
127-
database.test.host: localhost
127+
database.test.host: mariadb
128128
database.test.port: '3306'
129129
database.test.user: eb_testrw
130130
database.test.password: secret
@@ -138,13 +138,13 @@ parameters:
138138
## Minimum execution time in milliseconds when a received response is deemed invalid (default: 5000 ms)
139139
minimum_execution_time_on_invalid_received_response: 5000
140140
## The value for guest qualifier. Can be overridden for specific environments
141-
addgueststatus_guestqualifier: 'urn:collab:org:vm.openconext.org'
141+
addgueststatus_guestqualifier: 'urn:collab:org:dev.openconext.local'
142142

143143
## Language cookie settings
144144
## The value for the domain is also used for clearing SSO Notification cookies if the feature is enabled
145145
cookie.path: /
146146
cookie.secure: true
147-
cookie.locale.domain: .vm.openconext.org
147+
cookie.locale.domain: .dev.openconext.local
148148
cookie.locale.expiry: 5184000
149149
cookie.locale.http_only: false
150150
cookie.locale.secure: true
@@ -157,7 +157,7 @@ parameters:
157157
view_default_logo_height: 96
158158
# when set, will show a ribbon top-right to visually distinguish this install from other
159159
# environments in your constellation (e.g. "test", "qa"), with the given ribbon color in
160-
# env_ribbon_color. You can choose from colors: crimson,darkorchid,orange,hotpink,khaki.
160+
# env_ribbon_color. You can choose from colors: crimson,orange,hotpink,khaki.
161161
env_name: ""
162162
env_ribbon_color: ""
163163

@@ -178,7 +178,7 @@ parameters:
178178

179179
## Toggle the default IdP quick link banner on the WAYF.
180180
wayf.display_default_idp_banner_on_wayf: true
181-
wayf.default_idp_entity_id: https://default-idp.vm.openconext.org
181+
wayf.default_idp_entity_id: https://default-idp.dev.openconext.local
182182

183183
## Toggle display & content of global site notice
184184
global.site_notice.show: false
@@ -221,7 +221,7 @@ parameters:
221221
feature_api_metadata_api: true
222222
feature_api_deprovision: true
223223
feature_run_all_manipulations_prior_to_consent: false
224-
feature_block_user_on_violation: true
224+
feature_block_user_on_violation: false
225225
feature_enable_consent: true
226226
feature_stepup_sfo_override_engine_entityid: false
227227
feature_enable_idp_initiated_flow: true
@@ -230,40 +230,42 @@ parameters:
230230
## PROFILE SETTINGS
231231
##########################################################################################
232232
## Location of Profile
233-
profile_base_url: 'https://profile.vm.openconext.org'
233+
profile_base_url: 'https://profile.dev.openconext.local'
234234

235235
##########################################################################################
236236
## SFO SETTINGS
237237
##########################################################################################
238238
## This PCRE regex is used to blacklist incoming AuthnContextClassRef attributes on. If an empty string is used
239239
## the validation is skipped. The validator will throw an exception if the used regex is invalid.
240-
stepup.authn_context_class_ref_blacklist_regex: '/http:\/\/vm\.openconext\.org\/assurance\/loa[1-3]/'
240+
stepup.authn_context_class_ref_blacklist_regex: '/http:\/\/dev\.openconext\.local\/assurance\/loa[1-3]/'
241241
## The loa mapping from the internal used LoA's to the Stepup Gateway LOA's.
242242
## Specification of the mapping: stepup.loa.mapping.[int 1|2|3].[string engineblock|gateway]
243243
## The integer after the mapping field indicates the LoA level (1, 2 or 3 are supported).
244244
## The engineblock or gateway keys specify the LoAs identifier as will be carried in the AuthnContextClassRef of an assertion.
245245
stepup.loa.mapping:
246246
10:
247-
engineblock: 'http://vm.openconext.org/assurance/loa1'
248-
gateway: 'http://stepup.vm.openconext.org/assurance/loa1'
247+
engineblock: 'http://dev.openconext.local/assurance/loa1'
248+
gateway: 'http://dev.openconext.local/assurance/loa1'
249249
15:
250-
engineblock: 'http://vm.openconext.org/assurance/loa1_5'
251-
gateway: 'http://stepup.vm.openconext.org/assurance/loa1_5'
250+
engineblock: 'http://dev.openconext.local/assurance/loa1_5'
251+
gateway: 'http://dev.openconext.local/assurance/loa1_5'
252252
20:
253-
engineblock: 'http://vm.openconext.org/assurance/loa2'
254-
gateway: 'http://stepup.vm.openconext.org/assurance/loa2'
253+
engineblock: 'http://dev.openconext.local/assurance/loa2'
254+
gateway: 'http://dev.openconext.local/assurance/loa2'
255255
30:
256-
engineblock: 'http://vm.openconext.org/assurance/loa3'
257-
gateway: 'http://stepup.vm.openconext.org/assurance/loa3'
256+
engineblock: 'http://dev.openconext.local/assurance/loa3'
257+
gateway: 'http://dev.openconext.local/assurance/loa3'
258258
## The fallback LoA to return when the Stepup authentication fails but is not required
259-
stepup.loa.loa1: 'http://vm.openconext.org/assurance/loa1'
259+
stepup.loa.loa1: 'http://dev.openconext.local/assurance/loa1'
260260
## The EntityId (metadata URL) used in the callout to the SFO endpoint of the configured Stepup Gateway
261-
stepup.gateway.sfo.entity_id: 'https://gateway.stepup.vm.openconext.org/second-factor-only/metadata'
261+
stepup.gateway.sfo.entity_id: 'https://gateway.dev.openconext.local/second-factor-only/metadata'
262262
## The single sign-on endpoint used for Stepup Gateway SFO callouts
263-
stepup.gateway.sfo.sso_location: 'https://gateway.stepup.vm.openconext.org/second-factor-only/single-sign-on'
263+
stepup.gateway.sfo.sso_location: 'https://gateway.dev.openconext.local/second-factor-only/single-sign-on'
264264
## The public key from the Stepup Gateway IdP
265-
stepup.gateway.sfo.key_file: /etc/openconext/engineblock.crt
266-
stepup.sfo.override_engine_entityid: 'https://engine.vm.openconext.com/new/stepup/metadata'
265+
stepup.gateway.sfo.key_file: /config/engine/engineblock.crt
266+
## You can override the default entityID used by Engineblock for its callout to stepup gateway.
267+
## You also need to enable the feature toggle feature_stepup_sfo_override_engine_entityid above.
268+
stepup.sfo.override_engine_entityid: "https://engine.dev.openconext.local/new/stepup/metadata"
267269

268270
##########################################################################################
269271
## THEME SETTINGS
@@ -303,4 +305,3 @@ parameters:
303305
# used in the authentication log record. The attributeName will be searched in the response attributes and if present
304306
# the log data will be enriched. The values of the response attributes are the final values after ARP and Attribute Manipulation.
305307
auth.log.attributes: []
306-

0 commit comments

Comments
 (0)