-
Notifications
You must be signed in to change notification settings - Fork 1
/
spin.toml
90 lines (73 loc) · 2.99 KB
/
spin.toml
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
spin_manifest_version = 2
[application]
name = "mqtt-booth-volume"
version = "0.2.0"
authors = ["Kate Goldenring <kate.goldenring@fermyon.com>"]
description = "Triggered by MQTT"
[variables]
mqtt_topic = { default = "booth/+" }
mqtt_broker_uri = { default = "test.mosquitto.org" }
mqtt_username = { default = "" }
mqtt_password = { default = "" }
# sqlite_username = { required = true }
# sqlite_password = { required = true }
[application.trigger.mqtt]
address = "{{ mqtt_broker_uri }}"
username = "{{ mqtt_username }}"
password = "{{ mqtt_password }}"
keep_alive_interval = "30" # seconds
[[trigger.mqtt]]
component = "mqtt-message-persister"
topic = "{{ mqtt_topic }}"
# The quality of service (QoS) level for the MQTT client. 1 indicates that
# messages must be delivered at least once.
qos = "1"
[component.mqtt-message-persister]
source = "mqtt-message-persister/target/wasm32-wasi/release/mqtt_message_persister.wasm"
allowed_outbound_hosts = []
sqlite_databases = ["default"]
[component.mqtt-message-persister.build]
command = "cargo build --target wasm32-wasi --release --manifest-path mqtt-message-persister/Cargo.toml"
watch = ["src/**/*.rs", "Cargo.toml"]
[[trigger.http]]
route = "/api/..."
component = "api"
[component.api]
source = "api/target/wasm32-wasi/release/api.wasm"
allowed_outbound_hosts = []
sqlite_databases = ["default"]
[component.api.build]
command = "cargo build --target wasm32-wasi --release"
workdir = "api"
watch = ["src/**/*.rs", "Cargo.toml"]
[[trigger.http]]
route = "/..."
component = "frontend"
[component.frontend]
source = { url = "https://github.com/fermyon/spin-fileserver/releases/download/v0.2.1/spin_static_fs.wasm", digest = "sha256:5f05b15f0f7cd353d390bc5ebffec7fe25c6a6d7a05b9366c86dcb1a346e9f0f" }
files = [{ source = "frontend/", destination = "/" }]
[[trigger.http]]
route = "/"
component = "redirect-index"
[component.redirect-index]
source = { url = "https://github.com/fermyon/spin-redirect/releases/download/v0.1.0/redirect.wasm", digest = "sha256:8bee959843f28fef2a02164f5840477db81d350877e1c22cb524f41363468e52" }
environment = { DESTINATION = "/index.html", STATUSCODE = "301" }
[[trigger.http]]
route = "/index.html"
component = "frontend-personalization"
[component.frontend-personalization]
source = "frontend-personalization/target/wasm32-wasi/release/frontend_personalization.wasm"
allowed_outbound_hosts = ["*://self:*"]
[component.frontend-personalization.build]
command = "cargo build --target wasm32-wasi --release"
workdir = "frontend-personalization"
watch = ["src/**/*.rs", "Cargo.toml"]
# [[trigger.http]]
# component = "sqlite-explorer"
# route = "/internal/sqlite/..."
# [component.sqlite-explorer]
# source = { url = "https://github.com/karthik2804/spin-sqlite-web-cli/releases/download/v0.1.0/spin-sqlite-web-cli.wasm", digest = "sha256:2bab8dca3c50bc082c543ce9e9b367aec03e9de1efd62c6b748035bd9de48356" }
# sqlite_databases = ["default"]
# [component.sqlite-explorer.variables]
# sqlite_username = "{{ sqlite_username }}"
# sqlite_password = "{{ sqlite_password }}"