From 6c1d8ae5cb3e2005225e46b21005a90cbce6ec45 Mon Sep 17 00:00:00 2001 From: Maarten de Kruijf <16100232+MaartendeKruijf@users.noreply.github.com> Date: Tue, 5 Aug 2025 22:14:00 +0200 Subject: [PATCH 1/2] Add environment variable HOST to main --- cmd/soarca/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/soarca/main.go b/cmd/soarca/main.go index fbb248131..52fced920 100644 --- a/cmd/soarca/main.go +++ b/cmd/soarca/main.go @@ -42,12 +42,13 @@ func main() { fmt.Print(banner) log.Info("Version: ", Version) log.Info("Buildtime: ", Buildtime) + log.Info("Host: ", Host) err := godotenv.Load(".env") if err != nil { log.Warning("Failed to read env variable, but will continue") } - Host = "localhost:" + utils.GetEnv("PORT", "8080") + Host = utils.GetEnv("HOST", "localhost") + ":" + utils.GetEnv("PORT", "8080") api.SwaggerInfo.Host = Host // Version is only available here From 0b33c6f2a1d27a5f10c10a67b88bf9979595fa7e Mon Sep 17 00:00:00 2001 From: Maarten de Kruijf <16100232+MaartendeKruijf@users.noreply.github.com> Date: Tue, 5 Aug 2025 22:29:41 +0200 Subject: [PATCH 2/2] Added documentation options --- .env.example | 1 + deployments/docker/soarca/docker-compose.yml | 1 + docs/content/en/docs/getting-started/_index.md | 1 + .../en/docs/installation-configuration/_index.md | 13 ++++++++----- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 83a5bc2f3..853690534 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ PORT: 8080 +HOST: localhost ENABLE_TLS: false CERT_FILE: "/certs/server.crt" CERT_KEY_FILE: "/certs/server.key" diff --git a/deployments/docker/soarca/docker-compose.yml b/deployments/docker/soarca/docker-compose.yml index e2332cdc6..d2ece1bf3 100644 --- a/deployments/docker/soarca/docker-compose.yml +++ b/deployments/docker/soarca/docker-compose.yml @@ -60,6 +60,7 @@ services: image: docker.io/cossas/soarca:latest container_name: soarca_server environment: + HOST: localhost PORT: 8080 SOARCA_ALLOWED_ORIGINS: "*" GIN_MODE: "release" diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index 365894631..400cdcf1a 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -78,6 +78,7 @@ SOARCA reads its configuration from the environment variables or a `.env` file. {{< tabpane langEqualsHeader=false >}} {{< tab header="`.env`" lang="txt" >}} +HOST: localhost PORT: 8080 SOARCA_ALLOWED_ORIGINS: "*" GIN_MODE: "release" diff --git a/docs/content/en/docs/installation-configuration/_index.md b/docs/content/en/docs/installation-configuration/_index.md index 2ccfe091e..fe12fa0cf 100644 --- a/docs/content/en/docs/installation-configuration/_index.md +++ b/docs/content/en/docs/installation-configuration/_index.md @@ -14,6 +14,7 @@ After completing the [Getting Started](/docs/getting-started/_index.md) setup fo | Variable | Content | Description | |----------------------------|-----------------------------------|-----------------------------------------------------------------------------| +| HOST | `localhost` | Set the host of SOARCA so the swagger GUI is correctly pointed to the SOARCA API. Default is `localhost`. | | PORT | `8080` | Set the exposed port of SOARCA. Default is `8080`. | | ENABLE_TLS | `false` | Enable TLS for secure communication. Default is `false`. | | CERT_FILE | `"/certs/server.crt"` | Path to the TLS certificate file. Default is `"/certs/server.crt"`. | @@ -44,11 +45,13 @@ After completing the [Getting Started](/docs/getting-started/_index.md) setup fo #### The Hive -| Variable | Content | Description | -|----------------------|-----------------------------------|---------------------------------------------------------| -| THEHIVE_ACTIVATE | `false` | Enable integration with The Hive. Default is `false`. | -| THEHIVE_API_TOKEN | `your_token` | Set the API token for The Hive integration. | -| THEHIVE_API_BASE_URL | `http://your.thehive.instance/api/v1/` | Set the base URL for The Hive API. Default is `""`. | +| Variable | Content | Description | +|----------------------------|----------------------------------|---------------------------------------------------------| +| THEHIVE_ACTIVATE | `false` | Enable integration with The Hive. Default is `false`. | +| THEHIVE_REPORTER | `false` | Enable case reporting integration with The Hive. Default is `false`. | +| THEHIVE_ALLOW_INSECURE | `true` | Allow insecure connection to the hive. Default is `true`. | +| THEHIVE_API_TOKEN | `your_token` | Set the API token for The Hive integration. | +| THEHIVE_API_BASE_URL | `http://your.thehive.instance/api/v1/` | Set the base URL for The Hive API. Default is `""`. | -----