forked from ory/kratos-selfservice-ui-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchitect.yml
225 lines (217 loc) · 6.26 KB
/
architect.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
version: v2
variables:
allowed_return_urls:
description: URLs that the service can safely redirect to after auth flows
merge: true
default:
- ${{ ingresses.auth.url }}
dependencies:
smtp: architectio/smtp4dev
databases:
kratos:
type: postgres:15
builds:
kratos-ui:
context: ./
dockerfile: Dockerfile
debug:
dockerfile: Dockerfile-dev
deployments:
kratos:
image: oryd/kratos:v1.0
entrypoint: [""]
command:
- sh
- -c
- |
mkdir ./kratos
echo "$IDENTITY_SCHEMA" > ./kratos/identity.schema.json
echo "$CONFIG" > ./kratos/.kratos.yml
kratos -c ./kratos/.kratos.yml migrate sql -e --yes
kratos serve -c ./kratos/.kratos.yml --watch-courier --dev
environment:
CONFIG: |
version: v0.13.0
dsn: ${{ databases.kratos.url }}?max_conns=20&max_idle_conns=4
serve:
public:
base_url: ${{ ingresses.kratos-public.url }}
cors:
enabled: false
admin:
base_url: ${{ services.kratos-admin.url }}
selfservice:
default_browser_return_url: ${{ ingresses.auth.url }}
allowed_return_urls: ${{ variables.allowed_return_urls }}
methods:
password:
enabled: true
totp:
config:
issuer: Kratos
enabled: true
code:
enabled: true
link:
enabled: true
lookup_secret:
enabled: true
flows:
error:
ui_url: ${{ ingresses.auth.url }}/error
settings:
ui_url: ${{ ingresses.auth.url }}/settings
privileged_session_max_age: 15m
required_aal: highest_available
logout:
after:
default_browser_return_url: ${{ ingresses.auth.url }}
login:
ui_url: ${{ ingresses.auth.url }}/login
lifespan: 10m
registration:
ui_url: ${{ ingresses.auth.url }}/registration
lifespan: 10m
after:
password:
hooks:
- hook: session
- hook: show_verification_ui
verification:
enabled: true
ui_url: ${{ ingresses.auth.url }}/verification
use: code
after:
default_browser_return_url: ${{ ingresses.auth.url }}
recovery:
enabled: true
ui_url: ${{ ingresses.auth.url }}/recovery
use: code
courier:
smtp:
connection_uri: ${{ dependencies.smtp.services.smtp.url }}/?skip_ssl_verify=true
log:
level: info
format: text
leak_sensitive_values: true
secrets:
cookie:
- PLEASE-CHANGE-ME-I-AM-VERY-INSECURE
cipher:
- 32-LONG-SECRET-NOT-SECURE-AT-ALL
ciphers:
algorithm: xchacha20-poly1305
hashers:
algorithm: bcrypt
bcrypt:
cost: 8
identity:
default_schema_id: default
schemas:
- id: default
url: file://./kratos/identity.schema.json
cookies:
domain: ${{ ingresses.kratos-public.dns_zone }}
path: /
same_site: Lax
IDENTITY_SCHEMA: |
{
"$id": "https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Person",
"type": "object",
"properties": {
"traits": {
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email",
"title": "E-Mail",
"minLength": 3,
"ory.sh/kratos": {
"credentials": {
"password": {
"identifier": true
}
},
"verification": {
"via": "email"
},
"recovery": {
"via": "email"
}
}
},
"username": {
"type": "string",
"minLength": 1,
"title": "Username",
"ory.sh/kratos": {
"credentials": {
"password": {
"identifier": true
}
}
}
},
"name": {
"type": "object",
"properties": {
"first": {
"title": "First Name",
"type": "string"
},
"last": {
"title": "Last Name",
"type": "string"
}
}
}
},
"required": [
"email",
"username"
],
"additionalProperties": false
}
}
}
ui:
image: ${{ builds.kratos-ui.image }}
environment:
PORT: "4455"
KRATOS_PUBLIC_URL: ${{ services.kratos-public.url }}
KRATOS_BROWSER_URL: ${{ ingresses.kratos-public.url }}
debug:
volumes:
src:
host_path: ./src
mount_path: /usr/src/app/src
views:
host_path: ./views
mount_path: /usr/src/app/views
public:
host_path: ./public
mount_path: /usr/src/app/public
services:
kratos-public:
deployment: kratos
port: 4433
kratos-admin:
deployment: kratos
port: 4434
frontend:
deployment: ui
port: 4455
ingresses:
kratos-public:
service: kratos-public
headers:
Access-Control-Allow-Origin: ${{ variables.allowed_return_urls }}
Access-Control-Allow-Methods:
'["GET", "OPTIONS", "POST", "PUT", "DELETE"]'
Access-Control-Allow-Headers: "*"
Access-Control-Allow-Credentials: "true"
auth:
service: frontend