Skip to content

Commit 55586eb

Browse files
authored
Merge branch 'main' into release/620
2 parents 2814c61 + 2575547 commit 55586eb

File tree

12 files changed

+445
-400
lines changed

12 files changed

+445
-400
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ end_of_line = lf
99
insert_final_newline = true
1010
indent_style = space
1111
indent_size = 2
12+
max_line_length = 180
1213

1314
[*.py]
1415
indent_size = 4

environments/template/secrets/secret_example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ myconext_verify_client_id: secret
3232
myconext_verify_secret: secret
3333
engine_api_profile_password: secret
3434
engine_api_deprovision_password: secret
35-
engine_parameters_secret: secret
35+
engine_parameters_secret: secretsecretsecretsecretsecretsecret # need 32 chars
3636

3737
profile_secret: secret
3838

provision.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
hosts: docker_engineblock
141141
become: true
142142
roles:
143-
- engineblock
143+
- engine
144144
tags: ['engineblock', 'eb']
145145

146146
- name: Deploy invite app
Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,8 @@ engine_feature_send_user_attributes: 0
2222
engine_wayf_cutoff_point_for_showing_unfiltered_idps: 50
2323
engine_wayf_show_remember_choice: false
2424

25-
## Engine installer specific variables.
26-
engine_version_dir: "{{ engine_version | replace('/', '-') }}"
27-
engine_branch_dir: "{{ openconext_builds_dir }}/OpenConext-engineblock-{{ engine_branch | replace('/', '-') }}"
28-
engine_release_dir: "{{ openconext_releases_dir }}/OpenConext-engineblock-{{ engine_version_dir }}"
29-
engine_build_path: "{{ openconext_builds_dir }}/OpenConext-engineblock-{{ engine_version_dir }}.tar.gz"
30-
engine_download_url: "https://github.com/OpenConext/OpenConext-engineblock/releases/download/{{ engine_version }}/OpenConext-engineblock-{{ engine_version_dir }}.tar.gz"
31-
engine_current_release_symlink: "{{ openconext_releases_dir }}/OpenConext-engineblock"
32-
33-
engine_ipv4_address: "*"
34-
# engine_ipv6_address:
35-
engine_api_ipv4_address: "*"
36-
# engine_api_ipv6_address:
37-
3825
# Required for the Symfony routing.
3926
engine_base_domain: "{{ base_domain }}"
40-
4127
engine_domain: engine.{{ base_domain }}
4228

4329
engine_debug: false
@@ -89,8 +75,6 @@ engine_stepup_gateway_loa3: "http://{{ engine_stepup_base_domain }}/assurance/lo
8975
engine_stepup_gateway_sfo_entity_id: "https://{{ engine_stepup_gateway_domain }}/second-factor-only/metadata"
9076
# The single sign-on endpoint used for Stepup Gateway SFO callouts
9177
engine_stepup_gateway_sfo_sso_location: "https://{{ engine_stepup_gateway_domain }}/second-factor-only/single-sign-on"
92-
# The public key from the Stepup Gateway IdP
93-
engine_stepup_gateway_sfo_public_key_file: "{{ engine_keys.default.publicFile }}"
9478

9579
## The minimum priority of messages that will be logged
9680
engine_logging_passthru_level: NOTICE
@@ -104,13 +88,12 @@ engine_idp_debugging_to_name: "{{ instance_name }} Admin"
10488
engine_idp_debugging_email_address: "{{ support_email }}"
10589
engine_idp_debugging_subject: "IdP debug info from %1$s"
10690

107-
eb_support_url: "https://example.org"
108-
eb_support_url_nameid: "https://example.org"
109-
eb_tos_url: "https://example.org"
91+
engine_support_url: "https://example.org"
92+
engine_support_url_nameid: "https://example.org"
11093

11194
engine_site_notice_show: false
11295

113-
engineblock_log_attributes: []
96+
engine_log_attributes: []
11497

11598
engine_php_memory: 256M
11699
engine_docker_networks:
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
- name: restart engine
2+
- name: Restart engine
33
community.docker.docker_container:
44
name: engineblock
55
state: started
66
restart: true
77
# avoid restarting it creates unexpected data loss according to docker_container_module notes
88
comparisons:
99
'*': ignore
10-
when: ebcontainer is success and ebcontainer is not change
10+
when: engine_container is success and engine_container is not change
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
- name: Add group engine
23
ansible.builtin.group:
34
name: "engine"
@@ -20,77 +21,79 @@
2021
group: root
2122
mode: "0755"
2223
with_items:
23-
- "{{ current_release_config_dir_name }}"
24-
- "{{ current_release_config_dir_name }}/certs"
25-
- "{{ current_release_config_dir_name }}/configs"
26-
- "{{ current_release_config_dir_name }}/images"
27-
- "{{ current_release_config_dir_name }}/languages"
24+
- "{{ _engine_config_dir }}"
25+
- "{{ _engine_config_dir }}/certs"
26+
- "{{ _engine_config_dir }}/configs"
27+
- "{{ _engine_config_dir }}/images"
28+
- "{{ _engine_config_dir }}/languages"
2829

2930
- name: Place parameters.yml
3031
ansible.builtin.template:
31-
src: parameters.yml.j2
32-
dest: "{{ current_release_config_dir_name }}/configs/parameters.yml"
32+
src: "{{ item }}.j2"
33+
dest: "{{ _engine_config_dir }}/configs/{{ item }}"
3334
mode: "0640"
34-
owner: root
35-
group: engine
36-
notify: restart engine
35+
owner: "root"
36+
group: "engine"
37+
with_items:
38+
- "parameters.yml"
39+
- "monolog.yml"
40+
notify: "Restart engine"
3741

3842
- name: Check presence of environment specific attributes.json
3943
ansible.builtin.stat:
4044
path: "{{ inventory_dir }}/files/eb/attributes.json"
41-
register: attributes_json_present
45+
register: engine_attributes_json_present
4246
become: false
4347
delegate_to: localhost
4448

4549
- name: Copy environment specific attributes.json
4650
ansible.builtin.copy:
4751
src: "{{ inventory_dir }}/files/eb/attributes.json"
48-
dest: "{{ current_release_config_dir_name }}/configs/"
52+
dest: "{{ _engine_config_dir }}/configs/"
4953
mode: "0644"
5054
owner: root
5155
group: engine
52-
when: attributes_json_present.stat.exists
56+
when: engine_attributes_json_present.stat.exists
5357

5458
- name: Check presence of language specific overrides
5559
ansible.builtin.stat:
5660
path: "{{ inventory_dir }}/files/eb/languages/"
57-
register: overrides_present
61+
register: engine_overrides_present
5862
become: false
5963
delegate_to: localhost
6064

6165
- name: Copy language specific overrides
6266
ansible.builtin.template:
6367
src: "{{ item }}"
64-
dest: "{{ current_release_config_dir_name }}/languages/"
68+
dest: "{{ _engine_config_dir }}/languages/"
6569
owner: root
6670
group: engine
6771
mode: "0644"
68-
when: overrides_present.stat.exists
72+
when: engine_overrides_present.stat.exists
6973
with_fileglob:
7074
- "{{ inventory_dir }}/files/eb/languages/*"
71-
notify:
72-
- "restart engine"
75+
notify: "Restart engine"
7376

7477
- name: Check if we have a custom logo
7578
ansible.builtin.stat:
7679
path: "{{ inventory_dir }}/files/logo.png"
77-
register: customlogo
80+
register: engine_customlogo
7881
become: false
7982
delegate_to: localhost
8083

8184
- name: Install environment specific logo
8285
ansible.builtin.copy:
8386
src: "{{ inventory_dir }}/files/logo.png"
84-
dest: "{{ current_release_config_dir_name }}/images/"
87+
dest: "{{ _engine_config_dir }}/images/"
8588
owner: root
8689
group: engine
8790
mode: "0644"
88-
when: customlogo.stat.exists
91+
when: engine_customlogo.stat.exists
8992

9093
- name: Check if we have a custom favicon
9194
ansible.builtin.stat:
9295
path: "{{ inventory_dir }}/files/favicon.ico"
93-
register: customfavicon
96+
register: engine_customfavicon
9497
become: false
9598
delegate_to: localhost
9699

@@ -101,60 +104,60 @@
101104
owner: root
102105
group: root
103106
mode: "0644"
104-
when: customfavicon.stat.exists
107+
when: engine_customfavicon.stat.exists
105108

106109
- name: Check if we have a custom background back image for the feedback page
107110
ansible.builtin.stat:
108111
path: "{{ inventory_dir }}/files/eb/background-back.svg"
109-
register: eb_customfeedbackbackground
112+
register: engine_customfeedbackbackground
110113
become: false
111114
delegate_to: localhost
112115

113116
- name: Install environment specific background back image
114117
ansible.builtin.copy:
115118
src: "{{ inventory_dir }}/files/eb/background-back.svg"
116-
dest: "{{ current_release_config_dir_name }}/images/"
119+
dest: "{{ _engine_config_dir }}/images/"
117120
owner: root
118121
group: engine
119122
mode: "0644"
120-
when: eb_customfeedbackbackground.stat.exists
123+
when: engine_customfeedbackbackground.stat.exists
121124

122125
- name: Check if we have a custom background front image for the feedback page
123126
ansible.builtin.stat:
124127
path: "{{ inventory_dir }}/files/eb/background-front.svg"
125-
register: eb_customfeedbackforeground
128+
register: engine_customfeedbackforeground
126129
become: false
127130
delegate_to: localhost
128131

129132
- name: Install environment specific background front image
130133
ansible.builtin.copy:
131134
src: "{{ inventory_dir }}/files/eb/background-front.svg"
132-
dest: "{{ current_release_config_dir_name }}/images/"
135+
dest: "{{ _engine_config_dir }}/images/"
133136
owner: root
134137
group: engine
135138
mode: "0644"
136-
when: eb_customfeedbackforeground.stat.exists
139+
when: engine_customfeedbackforeground.stat.exists
137140

138141
- name: Check if we have a Stepup GW certificate
139142
ansible.builtin.stat:
140143
path: "{{ inventory_dir }}/files/certs/stepup_gateway.pem"
141-
register: eb_stepupgwcert
144+
register: engine_stepupgwcert
142145
become: false
143146
delegate_to: localhost
144147

145148
- name: Install Stepup GW certificate
146149
ansible.builtin.copy:
147150
src: "{{ inventory_dir }}/files/certs/stepup_gateway.pem"
148-
dest: "{{ current_release_config_dir_name }}/certs/"
151+
dest: "{{ _engine_config_dir }}/certs/"
149152
owner: root
150153
group: engine
151154
mode: "0644"
152-
when: eb_stepupgwcert.stat.exists
155+
when: engine_stepupgwcert.stat.exists
153156

154157
- name: Copy over the engineblock keys
155158
ansible.builtin.copy:
156159
content: "{{ item.private_key }}"
157-
dest: "{{ current_release_config_dir_name }}/certs/{{ item.name }}.key"
160+
dest: "{{ _engine_config_dir }}/certs/{{ item.name }}.key"
158161
owner: root
159162
group: engine
160163
mode: "0440"
@@ -164,7 +167,7 @@
164167
- name: Copy engineblock certificates to correct location
165168
ansible.builtin.copy:
166169
src: "{{ inventory_dir }}/files/certs/{{ item.crt_name }}"
167-
dest: "{{ current_release_config_dir_name }}/certs/{{ item.name }}.crt"
170+
dest: "{{ _engine_config_dir }}/certs/{{ item.name }}.crt"
168171
owner: root
169172
group: engine
170173
mode: "0644"
@@ -189,7 +192,7 @@
189192
image: ghcr.io/openconext/openconext-engineblock/openconext-engineblock:{{ engine_version }}
190193
pull: true
191194
restart_policy: "always"
192-
networks: "{{ engine_docker_networks}}"
195+
networks: "{{ engine_docker_networks }}"
193196
labels:
194197
traefik.http.routers.engine.rule: "Host(`engine.{{ base_domain }}`)"
195198
traefik.http.routers.engine.service: "engineblock"
@@ -203,37 +206,55 @@
203206
APACHE_GUID: "#{{ engine_guid.gid }}"
204207
TZ: "{{ timezone }}"
205208
PHP_MEMORY_LIMIT: "{{ engine_php_memory }}"
209+
APP_ENV: "prod"
210+
APP_SECRET: "{{ engine_parameters_secret }}"
211+
APP_DEBUG: "{{ engine_debug | bool | int }}"
206212
etc_hosts:
207213
host.docker.internal: host-gateway
208214
mounts:
209-
- source: "{{ current_release_config_dir_name }}/configs/parameters.yml"
210-
target: "/var/www/html/app/config/parameters.yml"
215+
- source: "{{ _engine_config_dir }}/configs/"
216+
target: "{{ _engine_container_config_dir }}"
211217
type: bind
212-
- source: "{{ current_release_config_dir_name }}/languages/overrides.en.php"
218+
read_only: true
219+
- source: "{{ _engine_config_dir }}/languages/overrides.en.php"
213220
target: "/var/www/html/languages/overrides.en.php"
214221
type: bind
215-
- source: "{{ current_release_config_dir_name }}/languages/overrides.nl.php"
222+
read_only: true
223+
- source: "{{ _engine_config_dir }}/languages/overrides.nl.php"
216224
target: "/var/www/html/languages/overrides.nl.php"
217225
type: bind
218-
- source: "{{ current_release_config_dir_name }}/configs/attributes.json"
219-
target: "/var/www/html/app/config/attributes.json"
226+
read_only: true
227+
- source: "{{ _engine_config_dir }}/configs/attributes.json"
228+
target: "{{ _engine_container_config_dir }}/attributes.json"
220229
type: bind
221-
- source: "{{ current_release_config_dir_name }}/images/background-back.svg"
222-
target: "/var/www/html/web/images/background-back.svg"
230+
read_only: true
231+
- source: "{{ _engine_config_dir }}/images/background-back.svg"
232+
target: "/var/www/html/public/images/background-back.svg"
223233
type: bind
224-
- source: "{{ current_release_config_dir_name }}/images/background-front.svg"
225-
target: "/var/www/html/web/images/background-front.svg"
234+
read_only: true
235+
- source: "{{ _engine_config_dir }}/images/background-front.svg"
236+
target: "/var/www/html/public/images/background-front.svg"
226237
type: bind
227-
- source: "{{ current_release_config_dir_name }}/images/logo.png"
228-
target: "/var/www/html/web/images/logo.png"
238+
read_only: true
239+
- source: "{{ _engine_config_dir }}/images/logo.png"
240+
target: "/var/www/html/public/images/logo.png"
229241
type: bind
230-
- source: "{{ current_release_config_dir_name }}/certs/"
242+
read_only: true
243+
- source: "{{ _engine_config_dir }}/certs/"
231244
target: "/var/www/html/certs/"
232245
type: bind
246+
read_only: true
233247
- source: "/opt/openconext/common/favicon.ico"
234-
target: "/var/www/html/web/favicon.ico"
248+
target: "/var/www/html/public/favicon.ico"
235249
type: bind
236-
- source: engineblock_sessions
237-
target: /tmp/
250+
read_only: true
251+
- source: "engineblock_sessions"
252+
target: "/tmp/"
238253
type: volume
239-
register: ebcontainer
254+
healthcheck:
255+
test: ["CMD-SHELL", "curl --fail -s http://localhost/internal/health | grep -q '\"status\":\"UP\"'"]
256+
start_period: 60s
257+
interval: 10s
258+
timeout: 1s
259+
retries: 20
260+
register: "engine_container"

0 commit comments

Comments
 (0)