From 1bf044b6368ff9fe4e3d52f2edaf15ee9695fc49 Mon Sep 17 00:00:00 2001 From: Alexander Mattoni <5110855+mattoni@users.noreply.github.com> Date: Tue, 30 Jun 2026 12:38:12 +0000 Subject: [PATCH] add new gateway config options --- .../services/GatewayEnvironmentService.yml | 7 ++++-- .../services/gateway/GatewayConfig.yml | 16 ++++++++++++ .../environments/services/gateway/tasks.yml | 4 +++ stackspec/schema/StackSpec.yml | 5 ++++ .../gateway/StackSpecGatewayConfig.yml | 25 +++++++++++++++++++ .../gateway/StackSpecGatewayService.yml | 15 +++++++++++ 6 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 components/schemas/environments/services/gateway/GatewayConfig.yml create mode 100644 stackspec/schema/services/gateway/StackSpecGatewayConfig.yml create mode 100644 stackspec/schema/services/gateway/StackSpecGatewayService.yml diff --git a/components/schemas/environments/services/GatewayEnvironmentService.yml b/components/schemas/environments/services/GatewayEnvironmentService.yml index 152d5c0d..f35879b6 100644 --- a/components/schemas/environments/services/GatewayEnvironmentService.yml +++ b/components/schemas/environments/services/GatewayEnvironmentService.yml @@ -5,7 +5,6 @@ required: - enable - container_id - high_availability - - config properties: enable: type: boolean @@ -15,9 +14,13 @@ properties: description: The ID of the gateway service container high_availability: type: boolean - description: + description: | A boolean representing if this service container is set to high availability mode or not. auto_update: type: boolean description: A boolean where `true` represents the desire to automatically update the environment gateway service. + config: + anyOf: + - $ref: ./gateway/GatewayConfig.yml + - type: "null" diff --git a/components/schemas/environments/services/gateway/GatewayConfig.yml b/components/schemas/environments/services/gateway/GatewayConfig.yml new file mode 100644 index 00000000..699453c1 --- /dev/null +++ b/components/schemas/environments/services/gateway/GatewayConfig.yml @@ -0,0 +1,16 @@ +title: GatewayConfig +type: object +required: + - ipv4 + - ipv6 + - performance +properties: + performance: + type: boolean + description: Enable / disable performance mode. If enabled, gateway can use much more RAM and CPU. + ipv4: + type: boolean + description: Allow / disallow traffic to be routed via IPv4. + ipv6: + type: boolean + description: Allow / disallow traffic to be routed via IPv6. diff --git a/platform/paths/environments/services/gateway/tasks.yml b/platform/paths/environments/services/gateway/tasks.yml index 2632dfd0..72f4650e 100644 --- a/platform/paths/environments/services/gateway/tasks.yml +++ b/platform/paths/environments/services/gateway/tasks.yml @@ -34,6 +34,10 @@ post: - boolean - "null" description: A boolean where `true` represents the desire to automatically update the environment gateway service. + config: + anyOf: + - $ref: ../../../../../components/schemas/environments/services/gateway/GatewayConfig.yml + - type: "null" responses: 202: diff --git a/stackspec/schema/StackSpec.yml b/stackspec/schema/StackSpec.yml index 22604433..a28ad483 100644 --- a/stackspec/schema/StackSpec.yml +++ b/stackspec/schema/StackSpec.yml @@ -73,6 +73,11 @@ properties: - $ref: services/scheduler/StackSpecSchedulerService.yml - $ref: StackVariable.yml - type: "null" + gateway: + anyOf: + - $ref: services/gateway/StackSpecGatewayService.yml + - $ref: StackVariable.yml + - type: "null" vpn: anyOf: - $ref: services/vpn/StackSpecVpnService.yml diff --git a/stackspec/schema/services/gateway/StackSpecGatewayConfig.yml b/stackspec/schema/services/gateway/StackSpecGatewayConfig.yml new file mode 100644 index 00000000..87345652 --- /dev/null +++ b/stackspec/schema/services/gateway/StackSpecGatewayConfig.yml @@ -0,0 +1,25 @@ +title: StackSpecGatewayConfig +description: Gateway specific configuration options. +type: + - object + - "null" +required: + - ipv4 + - ipv6 + - performance +properties: + performance: + description: Enable / disable performance mode. If enabled, gateway can use much more RAM and CPU. + oneOf: + - type: boolean + - $ref: ../../StackVariable.yml + ipv4: + description: Allow / disallow traffic to be routed via IPv4. + oneOf: + - type: boolean + - $ref: ../../StackVariable.yml + ipv6: + description: Allow / disallow traffic to be routed via IPv6. + oneOf: + - type: boolean + - $ref: ../../StackVariable.yml diff --git a/stackspec/schema/services/gateway/StackSpecGatewayService.yml b/stackspec/schema/services/gateway/StackSpecGatewayService.yml new file mode 100644 index 00000000..920900d4 --- /dev/null +++ b/stackspec/schema/services/gateway/StackSpecGatewayService.yml @@ -0,0 +1,15 @@ +title: StackSpecGatewayService +description: Configuration options for the gateway service. +type: object +additionalProperties: false +properties: + service: + anyOf: + - $ref: ../StackService.yml + - $ref: ../../StackVariable.yml + - type: "null" + config: + anyOf: + - $ref: ./StackSpecGatewayConfig.yml + - $ref: ../../StackVariable.yml + - type: "null"