hephaestus 0.8.5 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44a6ef560eaf3539cd8bde7d6e0bebd03d527151d3cf1b6dc6514c8b0901f03b
4
- data.tar.gz: 59de90522a1ce2df7bc841c8d6af6ff94d3624591dcf05fc78a84146fb19abcd
3
+ metadata.gz: b3c1fc749a8387f060bd64519a41ff75516668a53e4960d2ad36b5f876b58d6d
4
+ data.tar.gz: 4818733c054814165462e31b131ca1edbfde01d2d1d34f8c0715a497421679c6
5
5
  SHA512:
6
- metadata.gz: 56f28075c9a0722b687092e376a7de1d906612e00a919cc6bd0cb7100e92d46424c223670f9311971c376dc29ec23f25de1b1fa42e552e0623dca3f0746ef527
7
- data.tar.gz: d7cc7da306bc4c19eaa56ee8eebed915d1dadf246f678d7e1eb772973c14e2a2285896571a1b7fbc5bd5c16f7e8b1749c708829aca6f416ba07b5c755062cade
6
+ metadata.gz: 95ca846fca450e6df9221e933c28d041fabb91715b9b57f952951d350c50bf87bce4ce183495348c4df812133a8d068b41317855dc8f3e74457ca9664d4b463e
7
+ data.tar.gz: a6ca9a870d6e9423ca066c3c11541b1ef5d458b875f4f2f02e88e6f5c0ba3c30482a84f19e5b4f52b9a4d3e202338cc9b3486112db195267c100ffae87d3c6ce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
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
7
+ # [v0.8.6] - 03-12-2024
8
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.5...v0.8.6
1
9
  # [v0.8.5] - 03-12-2024
2
10
  ## What's Changed
3
11
  * Queue jobs based on plug name by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/74
@@ -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 op_load_vault_into_env(vault:, tag:)
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
- %x(#{include_sudo}op item list --vault #{vault} --tags #{tag} --format json | #{include_sudo}op item get - --reveal --format=json).tap do
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"] = fetch_vault_secret(
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: "SLACK_#{Rails.env.upcase}_LOG_URL",
11
+ label: "SLACK_LOG_URL",
12
12
  default: "https://slack.com/the_log_room",
13
13
  )
14
14
 
data/config/queue.yml CHANGED
@@ -5,7 +5,7 @@ default: &default
5
5
  workers:
6
6
  - queues: [plug_<%= plug_shortname %>_high_priority*, plug_<%= plug_shortname %>_mid_priority*, plug_<%= plug_shortname %>_low_priority*]
7
7
  threads: 5
8
- - queues: "*" # default, mailers, etc
8
+ - queues: "plug_<%= plug_shortname %>_*" # default, mailers, etc
9
9
  threads: 3
10
10
 
11
11
  development:
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.8.5"
5
+ VERSION = "0.8.7"
6
6
  RAILS_VERSION = ">= 8.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
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.5
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-03 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootsnap