-
Notifications
You must be signed in to change notification settings - Fork 26
/
templates.go
68 lines (64 loc) · 1.44 KB
/
templates.go
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
package cmd
type templateParams struct {
PolicyName string
Resource string
Authorization string
EdgeDirectory bool
SeedMetadata bool
}
const configTemplate = templatePreamble + `
opa:
instance_id: "-"
graceful_shutdown_period_seconds: 2
local_bundles:
paths: []
skip_verification: true
config:
services:
ghcr:
url: https://ghcr.io
type: "oci"
response_header_timeout_seconds: 5
bundles:
{{ .PolicyName }}:
service: ghcr
resource: "{{ .Resource }}"
persist: false
config:
polling:
min_delay_seconds: 60
max_delay_seconds: 120
`
const templatePreamble = `---
logging:
prod: true
log_level: info
directory_service:
edge:
db_path: /db/directory.db
seed_metadata: {{ .SeedMetadata }}
{{if .EdgeDirectory}}
remote:
address: "0.0.0.0:9292"
insecure: true
{{end}}
api:
grpc:
connection_timeout_seconds: 2
listen_address: "0.0.0.0:8282"
certs:
tls_key_path: "/certs/grpc.key"
tls_cert_path: "/certs/grpc.crt"
tls_ca_cert_path: "/certs/grpc-ca.crt"
gateway:
listen_address: "0.0.0.0:8383"
allowed_origins:
- https://*.aserto.com
- https://*aserto-console.netlify.app
certs:
tls_key_path: "/certs/gateway.key"
tls_cert_path: "/certs/gateway.crt"
tls_ca_cert_path: "/certs/gateway-ca.crt"
health:
listen_address: "0.0.0.0:8484"
`