Skip to content

Commit 7bdc233

Browse files
committed
Refactor config to have multiple trees
1 parent 781d4d2 commit 7bdc233

21 files changed

+86
-59
lines changed

docs/source/explanations/security.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ This is a complete working example:
111111
allow_anonymous_access: true
112112
trees:
113113
- path: /
114-
tree: tiled.examples.generated_minimal:tree
114+
tree:
115+
type: tiled.examples.generated_minimal:tree
115116
```
116117
117118
```
@@ -181,7 +182,8 @@ authenticators:
181182
provider: local
182183
trees:
183184
- path: /
184-
tree: tiled.examples.generated_minimal:tree
185+
tree:
186+
type: tiled.examples.generated_minimal:tree
185187
```
186188
187189
```
@@ -278,7 +280,8 @@ authenticators:
278280
cara: ${CARA_PASSWORD}
279281
trees:
280282
- path: /
281-
tree: tiled.examples.generated_minimal:tree
283+
tree:
284+
type: tiled.examples.generated_minimal:tree
282285
```
283286

284287
```
@@ -295,7 +298,8 @@ authenticators:
295298
type: tiled.authenticators:DummyAuthenticator
296299
trees:
297300
- path: /
298-
tree: tiled.examples.generated_minimal:tree
301+
tree:
302+
type: tiled.examples.generated_minimal:tree
299303
```
300304

301305
```

docs/source/explanations/specialized-formats.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,14 @@ Now take the following simple server configuration:
8585
# config.yml
8686
trees:
8787
- path: /
88-
tree: tiled.catalog:from_uri
89-
args:
90-
uri: ./catalog.db
91-
readable_storage:
92-
- ./data/
93-
adapters_by_mimetype:
94-
application/x-xdi: tiled.examples.xdi:read_xdi
88+
tree:
89+
type: tiled.catalog:from_uri
90+
args:
91+
uri: ./catalog.db
92+
readable_storage:
93+
- ./data/
94+
adapters_by_mimetype:
95+
application/x-xdi: tiled.examples.xdi:read_xdi
9596
```
9697
9798
and serve it:
@@ -206,7 +207,8 @@ Add new sections to the configuration as follows.
206207
```yaml
207208
trees:
208209
- path: /
209-
tree: tiled.catalog:from_uri
210+
tree:
211+
type: tiled.catalog:from_uri
210212
args:
211213
uri: ./catalog.db
212214
readable_storage:

docs/source/how-to/custom-export-formats.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ media_types:
7474
# And provide some example data to try it with....
7575
trees:
7676
- path: /
77-
tree: tiled.examples.generated_minimal:tree
77+
tree:
78+
type: tiled.examples.generated_minimal:tree
7879
```
7980
8081
The term `application/x-smileys` is a "media type", also known as "MIME type".
@@ -174,7 +175,8 @@ media_types:
174175
image/jpeg: custom_exporters:to_jpeg
175176
trees:
176177
- path: /
177-
tree: tiled.examples.generated_minimal:tree
178+
tree:
179+
type: tiled.examples.generated_minimal:tree
178180
```
179181
180182
Start the server again

docs/source/how-to/profiles.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ my_profile:
171171
direct:
172172
trees:
173173
- path: /
174-
tree: tiled.catalog:from_uri
175-
args:
176-
uri: "/path/to/catalog.db"
174+
tree:
175+
type: tiled.catalog:from_uri
176+
args:
177+
uri: "/path/to/catalog.db"
177178
```
178179
179180
This takes the place of the `uri:` parameter. A profile must contain
@@ -187,7 +188,8 @@ my_profile:
187188
direct:
188189
trees:
189190
- path: /
190-
tree: tiled.catalog:from_uri
191+
tree:
192+
type: tiled.catalog:from_uri
191193
args:
192194
directory: "/path/to/catalog.db"
193195
cache:

docs/source/how-to/read-custom-formats.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ needed.
243243
```yaml
244244
# config.yml
245245
trees:
246-
- tree: catalog
247-
path: /
246+
- path: /
247+
tree:
248+
type: catalog
248249
args:
249250
uri: ./catalog.db
250251
readable_storage:

example_configs/google_auth.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ authenticators:
1111
confirmation_message: "You have logged in with Google as {id}."
1212
trees:
1313
# Just some arbitrary example data...
14-
# The point of this example is the authenticaiton above.
15-
- tree: tiled.examples.generated_minimal:tree
14+
# The point of this example is the authentication above.
15+
- tree:
16+
type: tiled.examples.generated_minimal:tree
1617
path: /

example_configs/multiple_providers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ authenticators:
2222
cara: ${CARA_PASSWORD}
2323
trees:
2424
- path: /
25-
tree: tiled.examples.toy_authentication:tree
25+
tree:
26+
type: tiled.examples.toy_authentication:tree

example_configs/orcid_auth.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ authenticators:
1212
trees:
1313
# Just some arbitrary example data...
1414
# The point of this example is the authenticaiton above.
15-
- tree: tiled.examples.generated_minimal:tree
15+
- tree:
16+
type: tiled.examples.generated_minimal:tree
1617
path: /

example_configs/saml.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ authenticators:
2626
x509cert: ""
2727
trees:
2828
- path: /
29-
tree: tiled.examples.toy_authentication:tree
29+
tree:
30+
type: tiled.examples.toy_authentication:tree

example_configs/single_catalog_single_user.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
allow_anonymous_access: false
44
trees:
55
- path: /
6-
tree: catalog
7-
args:
8-
uri: "sqlite:////storage/catalog.db"
9-
writable_storage: "/storage/data"
10-
# This creates the database if it does not exist. This is convenient, but in
11-
# a horizonally-scaled deployment, this can be a race condition and multiple
12-
# containers may simultanouesly attempt to create the database.
13-
# If that is a problem, set this to false, and run:
14-
#
15-
# tiled catalog init URI
16-
#
17-
# separately.
18-
init_if_not_exists: true
6+
tree:
7+
type: catalog
8+
args:
9+
uri: "sqlite:////storage/catalog.db"
10+
writable_storage: "/storage/data"
11+
# This creates the database if it does not exist. This is convenient, but in
12+
# a horizonally-scaled deployment, this can be a race condition and multiple
13+
# containers may simultanouesly attempt to create the database.
14+
# If that is a problem, set this to false, and run:
15+
#
16+
# tiled catalog init URI
17+
#
18+
# separately.
19+
init_if_not_exists: true

0 commit comments

Comments
 (0)