hephaestus 0.8.6 → 0.8.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3c1fc749a8387f060bd64519a41ff75516668a53e4960d2ad36b5f876b58d6d
|
4
|
+
data.tar.gz: 4818733c054814165462e31b131ca1edbfde01d2d1d34f8c0715a497421679c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95ca846fca450e6df9221e933c28d041fabb91715b9b57f952951d350c50bf87bce4ce183495348c4df812133a8d068b41317855dc8f3e74457ca9664d4b463e
|
7
|
+
data.tar.gz: a6ca9a870d6e9423ca066c3c11541b1ef5d458b875f4f2f02e88e6f5c0ba3c30482a84f19e5b4f52b9a4d3e202338cc9b3486112db195267c100ffae87d3c6ce
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# [v0.8.7] - 04-12-2024
|
2
|
+
## What's Changed
|
3
|
+
* Load infra better by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/77
|
4
|
+
|
5
|
+
|
6
|
+
**Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.6...v0.8.7
|
1
7
|
# [v0.8.6] - 03-12-2024
|
2
8
|
**Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.5...v0.8.6
|
3
9
|
# [v0.8.5] - 03-12-2024
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
OP_VAULT_SECRETS = {}
|
5
|
+
OP_INFRA_SECRETS = {}
|
5
6
|
|
6
7
|
def fetch_vault_secret(label:, default:)
|
7
8
|
if productionish?
|
@@ -11,9 +12,18 @@ def fetch_vault_secret(label:, default:)
|
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
14
|
-
def
|
15
|
+
def fetch_infra_secret(label:, default:)
|
16
|
+
if productionish?
|
17
|
+
OP_INFRA_SECRETS.delete(label) || raise("Secret `#{label}` not found in 1Password")
|
18
|
+
else
|
19
|
+
ENV.fetch(label, default.is_a?(Pathname) ? default.read : default)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def op_load_vault_into_env(vault:, tag: nil)
|
15
24
|
include_sudo = !Rails.env.local? ? "sudo -E " : ""
|
16
|
-
|
25
|
+
include_tag = tag ? " --tags #{tag} " : ""
|
26
|
+
%x(#{include_sudo}op item list --vault #{vault}#{include_tag}--format json | #{include_sudo}op item get - --reveal --format=json).tap do
|
17
27
|
raise "Failed to fetch value `#{vault}` for `#{tag}` from 1Password" unless $CHILD_STATUS.success?
|
18
28
|
end
|
19
29
|
end
|
@@ -22,6 +32,10 @@ def load_vault_secret(field)
|
|
22
32
|
OP_VAULT_SECRETS[field["label"]] = field["value"].gsub("\\n", "\n")
|
23
33
|
end
|
24
34
|
|
35
|
+
def load_infra_secret(field)
|
36
|
+
OP_INFRA_SECRETS[field["label"]] = field["value"].gsub("\\n", "\n")
|
37
|
+
end
|
38
|
+
|
25
39
|
def productionish?
|
26
40
|
Rails.env.production? || Rails.env.staging?
|
27
41
|
end
|
@@ -87,6 +101,15 @@ module Hephaestus
|
|
87
101
|
load_vault_secret(field)
|
88
102
|
end
|
89
103
|
end
|
104
|
+
|
105
|
+
res = JSON.parse(op_load_vault_into_env(vault: "Infra", tag: ENV["RAILS_ENV"]))
|
106
|
+
["Common"].each do |section_label|
|
107
|
+
res["fields"].select { |f| f["section"] && f["section"]["label"] }.each do |field|
|
108
|
+
next unless field["section"]["label"] == section_label
|
109
|
+
|
110
|
+
load_infra_secret(field)
|
111
|
+
end
|
112
|
+
end
|
90
113
|
end
|
91
114
|
|
92
115
|
YETTO_API_URL = "#{YETTO_URL}/api"
|
@@ -5,7 +5,7 @@ unless Rails.env.development?
|
|
5
5
|
# establish the environment for OTEL
|
6
6
|
ENV["OTEL_EXPORTER_OTLP_ENDPOINT"] = "https://api.honeycomb.io"
|
7
7
|
|
8
|
-
ENV["OTEL_EXPORTER_OTLP_HEADERS"] =
|
8
|
+
ENV["OTEL_EXPORTER_OTLP_HEADERS"] = Hephaestus::Engine.fetch_infra_secret(
|
9
9
|
label: "OTEL_EXPORTER_OTLP_HEADERS",
|
10
10
|
default: "x-honeycomb-team=your-api-key",
|
11
11
|
)
|
@@ -8,7 +8,7 @@ SlackWebhookLogger.setup do |config|
|
|
8
8
|
#
|
9
9
|
# The URL where messages will be sent.
|
10
10
|
config.webhook_url = Hephaestus::Engine.fetch_infra_secret(
|
11
|
-
label: "
|
11
|
+
label: "SLACK_LOG_URL",
|
12
12
|
default: "https://slack.com/the_log_room",
|
13
13
|
)
|
14
14
|
|
data/lib/hephaestus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hephaestus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootsnap
|