From 146b4005381d5c566a57b629ee54253187ce3620 Mon Sep 17 00:00:00 2001 From: littleskunk Date: Wed, 6 Sep 2023 19:41:01 +0200 Subject: [PATCH] receipe: new recipe for audit service --- pkg/recipe/audit.yaml | 28 ++++++++++++++++++++++++++++ pkg/recipe/default.go | 4 ++++ pkg/runtime/compose/compose.go | 3 +++ pkg/runtime/nomad/nomad.go | 3 +++ pkg/runtime/runtime/ports.go | 1 + pkg/runtime/standalone/write.go | 1 + 6 files changed, 40 insertions(+) create mode 100644 pkg/recipe/audit.yaml diff --git a/pkg/recipe/audit.yaml b/pkg/recipe/audit.yaml new file mode 100644 index 0000000..936033f --- /dev/null +++ b/pkg/recipe/audit.yaml @@ -0,0 +1,28 @@ +name: audit +description: "satellite audit service" +add: + - name: satellite-audit + label: + - storj + - core + image: img.dev.storj.io/storjup/storj:1.83.2 + command: + - satellite + - run + - auditor + - --defaults=dev + - '--identity-dir={{ Environment .This "identityDir" }}' + persistence: + - /var/lib/storj/.local/share/storj + config: + STORJ_DATABASE: '{{ Environment "cockroach" "main" }}' + STORJ_METAINFO_DATABASE_URL: '{{ Environment "cockroach" "metainfo" }}' + STORJ_DEBUG_ADDR: '{{ Host .This "listen" }}:{{ Port .This "debug"}}' + STORJ_ORDERS_ENCRYPTION_KEYS: '0100000000000000=0100000000000000000000000000000000000000000000000000000000000000' + STORJ_LOG_LEVEL: debug + STORJ_METRICS_APP_SUFFIX: sim + environment: + STORJ_WAIT_FOR_SATELLITE: 1 + STORJ_DEFAULTS: dev + STORJ_IDENTITY_DIR: '{{ Environment .This "identityDir" }}' + STORJ_USE_PREDEFINED_IDENTITY: 1 diff --git a/pkg/recipe/default.go b/pkg/recipe/default.go index 9cf82b9..03c3e52 100644 --- a/pkg/recipe/default.go +++ b/pkg/recipe/default.go @@ -43,6 +43,9 @@ var uplink []byte //go:embed repair.yaml var repair []byte +//go:embed audit.yaml +var audit []byte + // Defaults is a map for recipes included in the binary. var Defaults = map[string][]byte{ "minimal": minimal, @@ -57,4 +60,5 @@ var Defaults = map[string][]byte{ "ranged-loop": rangedLoop, "uplink": uplink, "repair": repair, + "audit": audit, } diff --git a/pkg/runtime/compose/compose.go b/pkg/runtime/compose/compose.go index 8ce996b..1cac780 100644 --- a/pkg/runtime/compose/compose.go +++ b/pkg/runtime/compose/compose.go @@ -187,6 +187,9 @@ func NewCompose(dir string) (*Compose, error) { "satellite-repair": { "identityDir": "/var/lib/storj/.local/share/storj/identity/satellite-api/", }, + "satellite-audit": { + "identityDir": "/var/lib/storj/.local/share/storj/identity/satellite-api/", + }, "linksharing": { "webDir": "/var/lib/storj/pkg/linksharing/web/", "staticDir": "/var/lib/storj/pkg/linksharing/web/static", diff --git a/pkg/runtime/nomad/nomad.go b/pkg/runtime/nomad/nomad.go index 4773d17..feb0205 100644 --- a/pkg/runtime/nomad/nomad.go +++ b/pkg/runtime/nomad/nomad.go @@ -82,6 +82,9 @@ func NewNomad(dir string, name string) (*Nomad, error) { "satellite-repair": { "identityDir": "/var/lib/storj/identities/1", }, + "satellite-audit": { + "identityDir": "/var/lib/storj/identities/1", + }, "linksharing": { "webDir": "/var/lib/storj/pkg/linksharing/web/", "staticDir": "/var/lib/storj/pkg/linksharing/web/static", diff --git a/pkg/runtime/runtime/ports.go b/pkg/runtime/runtime/ports.go index f6e3e03..50619a2 100644 --- a/pkg/runtime/runtime/ports.go +++ b/pkg/runtime/runtime/ports.go @@ -15,6 +15,7 @@ var basePorts = map[string]int{ "satellite-admin": 10400, "satellite-rangedloop": 10500, "satellite-repair": 10600, + "satellite-audit": 10700, "storagenode": 30000, "gateway-mt": 20000, "authservice": 21000, diff --git a/pkg/runtime/standalone/write.go b/pkg/runtime/standalone/write.go index de4a836..cbc069d 100644 --- a/pkg/runtime/standalone/write.go +++ b/pkg/runtime/standalone/write.go @@ -123,6 +123,7 @@ var runnerSupported = map[string]string{ "satellite-api": "storj", "satellite-rangedloop": "storj", "satellite-repair": "storj", + "satellite-audit": "storj", "satellite-gc": "storj", "satellite": "storj", "storagenode": "storj",