archsight 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80cb12962c9a8df468f3d644135ad4a19f4253f931655b971f3c8f537a8f339c
4
- data.tar.gz: e901fd680848d138dd069322adb0ffc60704cc081e19a2855ae080d1cfbbc9bf
3
+ metadata.gz: 8e034f34ed93ea73f50f64d3711b71b7ee9a76d82394b6f5994b9a09f1cc4283
4
+ data.tar.gz: bccbff115bd3dfd32e20a636774d718e56ce055d9e49d8b7f2b5beb52231cb47
5
5
  SHA512:
6
- metadata.gz: 2cb304a5d1699e21bfe51e50882ece47a8ec245b8c86e0088b19d167a4662a719152d4e547d61ce0ee1aa6aa9b4fe19e9cb89ee16a1e566f3b18057b2872ef75
7
- data.tar.gz: d4fa392608acd1ed9c2d09efe0c1b5313b7fb10e48b17a8283b505c3f212241223e07f9effac546c4ac2bccd431bd561c9c202bf9ab5e43ecdac7785935d54b0
6
+ metadata.gz: 2653347eb3682c1ce0b92ce09e6fe7cf9897a3b801d037c590545e2f7834a936316f64cdd79acdf7e96437f9c9221b10854b030f929c5727517a6031b2b9108a
7
+ data.tar.gz: fabb6af091e2df63674c4933054270280cea3a7b192675c0cf0dea83d695d042e3e53436373541135253533e806150437febc162a2a2e3f8e3320f409fc6d316
@@ -2,5 +2,5 @@ apiVersion: v2
2
2
  name: archsight
3
3
  description: A Helm chart for ArchSight
4
4
  type: application
5
- version: 0.1.1
6
- appVersion: "0.1.4"
5
+ version: 0.2.0
6
+ appVersion: "0.2.3"
@@ -44,6 +44,17 @@ spec:
44
44
  value: {{ .Values.app.resourcesDir | quote }}
45
45
  - name: APP_ENV
46
46
  value: {{ .Values.app.env | quote }}
47
+ {{- if .Values.restart.enabled }}
48
+ - name: ARCHSIGHT_RESTART_ENABLED
49
+ value: "true"
50
+ {{- if or .Values.restart.token .Values.restart.existingSecret }}
51
+ - name: ARCHSIGHT_RESTART_TOKEN
52
+ valueFrom:
53
+ secretKeyRef:
54
+ name: {{ .Values.restart.existingSecret | default (printf "%s-restart-token" (include "archsight.fullname" .)) }}
55
+ key: {{ .Values.restart.secretKey | default "restart-token" }}
56
+ {{- end }}
57
+ {{- end }}
47
58
  {{- if .Values.args }}
48
59
  args:
49
60
  {{- toYaml .Values.args | nindent 12 }}
@@ -0,0 +1,11 @@
1
+ {{- if and .Values.restart.enabled .Values.restart.token (not .Values.restart.existingSecret) }}
2
+ apiVersion: v1
3
+ kind: Secret
4
+ metadata:
5
+ name: {{ include "archsight.fullname" . }}-restart-token
6
+ labels:
7
+ {{- include "archsight.labels" . | nindent 4 }}
8
+ type: Opaque
9
+ data:
10
+ {{ default "restart-token" .Values.restart.secretKey }}: {{ .Values.restart.token | b64enc | quote }}
11
+ {{- end }}
@@ -79,6 +79,20 @@ app:
79
79
  resourcesDir: /resources
80
80
  env: production
81
81
 
82
+ # Restart endpoint configuration
83
+ # Enables POST /maintenance/restart to trigger a rolling restart (useful with imagePullPolicy: Always)
84
+ restart:
85
+ enabled: false
86
+ # Plain-text token value. A Kubernetes Secret will be created automatically.
87
+ # If set, the app requires this value in the X-Restart-Token header.
88
+ # If neither token nor existingSecret is set, the restart endpoint is enabled without token protection.
89
+ token: ""
90
+ # Use an existing Secret instead of creating one. The Secret must contain the token.
91
+ # If set, the app requires the referenced Secret value in the X-Restart-Token header.
92
+ existingSecret: ""
93
+ # Key inside the Secret that holds the token (default: "restart-token")
94
+ secretKey: "restart-token"
95
+
82
96
  # Strategy for populating the /resources directory
83
97
  # Options are "emptyDir", "configMap", "persistence" (PVC), or usage of "extraVolumes"
84
98
  content:
data/docs/kubernetes.md CHANGED
@@ -157,16 +157,19 @@ For simple deployments where you want to trigger a pod restart (and image re-pul
157
157
  image:
158
158
  pullPolicy: Always # Pull a fresh image on every pod restart
159
159
 
160
- args:
161
- - web
162
- - "--port"
163
- - "4567"
164
- - "-H"
165
- - "0.0.0.0"
166
- - "--production"
167
- - "--enable-restart" # Opt-in: exposes POST /maintenance/restart
168
- - "--restart-token"
169
- - "your-secret-token" # Recommended: require a shared secret
160
+ restart:
161
+ enabled: true
162
+ token: "your-secret-token" # Stored as a Kubernetes Secret automatically
163
+ ```
164
+
165
+ The chart creates a `Secret` containing the token and injects it as `ARCHSIGHT_RESTART_TOKEN`
166
+ into the container. To use a pre-existing Secret instead:
167
+
168
+ ```yaml
169
+ restart:
170
+ enabled: true
171
+ existingSecret: "my-restart-secret"
172
+ secretKey: "restart-token" # key inside the Secret (default)
170
173
  ```
171
174
 
172
175
  **Trigger a restart:**
data/lib/archsight/cli.rb CHANGED
@@ -32,8 +32,11 @@ module Archsight
32
32
  Archsight::Web::Application.configure_environment!(env, logging: options[:enable_logging])
33
33
  Archsight::Web::Application.set :reload_enabled, !options[:disable_reload]
34
34
  Archsight::Web::Application.set :inline_edit_enabled, options[:inline_edit]
35
- Archsight::Web::Application.set :restart_enabled, options[:enable_restart]
36
- Archsight::Web::Application.set :restart_token, options[:restart_token]
35
+
36
+ restart_enabled = options[:enable_restart] || ENV["ARCHSIGHT_RESTART_ENABLED"] == "true"
37
+ restart_token = options[:restart_token] || ENV.fetch("ARCHSIGHT_RESTART_TOKEN", nil)
38
+ Archsight::Web::Application.set :restart_enabled, restart_enabled
39
+ Archsight::Web::Application.set :restart_token, restart_token
37
40
  Archsight::Web::Application.setup_mcp!
38
41
  Archsight::Web::Application.run!(port: options[:port], bind: options[:host])
39
42
  rescue Archsight::ResourceError => e
@@ -4,5 +4,5 @@
4
4
  # Do not edit manually.
5
5
 
6
6
  module Archsight
7
- VERSION = "0.2.2"
7
+ VERSION = "0.2.3"
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: archsight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Landgraf
@@ -215,6 +215,7 @@ files:
215
215
  - chart/archsight/templates/ingress.yaml
216
216
  - chart/archsight/templates/resources-configmap.yaml
217
217
  - chart/archsight/templates/resources-pvc.yaml
218
+ - chart/archsight/templates/restart-secret.yaml
218
219
  - chart/archsight/templates/service.yaml
219
220
  - chart/archsight/templates/serviceaccount.yaml
220
221
  - chart/archsight/values.yaml