hephaestus 0.7.4.2 → 0.7.5.1

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: d7011e0fb65732e3b327aca0f8840c8157da2f2d92b94601ce518463adf992f0
4
- data.tar.gz: 306ca2e819c749926e723a8cbd26fb6b760bcb7a1e5b30a4bbb433dc789ede12
3
+ metadata.gz: 86f3a565b2f72b7554045e961efb160be49c89ede06c633e18cf4464b2a1b098
4
+ data.tar.gz: f970244378be6c08670923ac548fb20654aa618f51dedcf99d159e9b7599995c
5
5
  SHA512:
6
- metadata.gz: 98ead706a0b2aaaada597bfc9f5df9379787020b90b755192b89160263ac2f8ba3b761f4068d67dbce6e7e1891d150b52e9a58d658332d2173b3beb7c0e9d44a
7
- data.tar.gz: 8cb5d37cca694b4fcae4b1fae68b65587c9ae8ac9764e7594ef7fd66c69560cdec84a0f9abea091c6e7693cc91c648b4acea05a6a16c8ac6d2f7be70ce7ed47d
6
+ metadata.gz: 3a7a3e78ec00d955c0b4fd160593ccf29ed4972d63302476f51b34104464a188f048e5eb0be15c511f95a6f72f8abfe997f94a5fa582695eeaafbcf488855c86
7
+ data.tar.gz: 907bf42577991b390b195e50dfab101aa7738d5f24421652e5e618a969c10cec3a57f6936a605933fb946183252388db7eccd0723fce927479fe65ad623e49a9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [v0.7.5.1] - 20-11-2024
2
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.7.5...v0.7.5.1
3
+ # [v0.7.5] - 20-11-2024
4
+ ## What's Changed
5
+ * No do by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/49
6
+
7
+
8
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.7.4.2...v0.7.5
1
9
  # [v0.7.4.2] - 20-11-2024
2
10
  ## What's Changed
3
11
  * tuck rubocop task in a check by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/47
@@ -26,14 +26,31 @@ def fetch_document_secret(document_secrets, label:, default:)
26
26
  end
27
27
 
28
28
  def op_read(label)
29
- %x(op read "#{label}").chomp
29
+ %x(#{include_sudo?}op read "#{label}").chomp.tap do
30
+ raise "Failed to fetch `#{label}` from 1Password" unless $CHILD_STATUS.success?
31
+ end
30
32
  end
31
33
 
32
34
  # technically, this gets every secret, including ones UNIQUE
33
35
  # to the platform, but we're not using those yet. feels "better"
34
36
  # to have the plugs manage those on their own
35
37
  def op_get_secrets(vault:, tag:)
36
- %x(op item list --vault #{vault} --tags #{tag} --format json | op item get - --reveal --format=json)
38
+ %x(#{include_sudo?}op item list --vault #{vault} --tags #{tag} --format json | op item get - --reveal --format=json).tap do
39
+ raise "Failed to fetch value `#{vault}` for `#{tag}` from 1Password" unless $CHILD_STATUS.success?
40
+ end
41
+ end
42
+
43
+ def check_dependencies!
44
+ raise "1Password CLI is not installed" unless cli_installed?
45
+ end
46
+
47
+ def cli_installed?
48
+ %x(#{include_sudo?}op --version 2> /dev/null)
49
+ $CHILD_STATUS.success?
50
+ end
51
+
52
+ def include_sudo?
53
+ productionish? ? "sudo -E " : ""
37
54
  end
38
55
 
39
56
  def productionish?
@@ -93,6 +110,7 @@ module Hephaestus
93
110
  # Every plug has these secrets; to reduce the amount of API calls to 1Password,
94
111
  # we can grab one document that contains all the secrets we need
95
112
  if productionish?
113
+ check_dependencies!
96
114
  fetched_secrets = op_get_secrets(vault: "Plug-#{plug_name}", tag: ENV["RAILS_ENV"])
97
115
  end
98
116
 
@@ -4,20 +4,18 @@
4
4
  require "slack_webhook_logger"
5
5
 
6
6
  Rails.application.configure do
7
- config.after_initialize do
8
- SlackWebhookLogger.setup do |config|
9
- # Webhook URL
10
- #
11
- # The URL where messages will be sent.
12
- config.webhook_url = Hephaestus::SLACK_LOG_URL
7
+ SlackWebhookLogger.setup do |config|
8
+ # Webhook URL
9
+ #
10
+ # The URL where messages will be sent.
11
+ config.webhook_url = Hephaestus::SLACK_LOG_URL
13
12
 
14
- # The minimum error level to see in Slack.
15
- #
16
- # All log levels are supported, but don't do anything less then :warn since Slack only allows one message
17
- # per minute.
18
- config.level = :WARN
13
+ # The minimum error level to see in Slack.
14
+ #
15
+ # All log levels are supported, but don't do anything less then :warn since Slack only allows one message
16
+ # per minute.
17
+ config.level = :WARN
19
18
 
20
- config.ignore_patterns = [/Can't verify CSRF token authenticity/, /is not a valid MIME type/]
21
- end
19
+ config.ignore_patterns = [/Can't verify CSRF token authenticity/, /is not a valid MIME type/]
22
20
  end
23
21
  end
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.7.4.2"
5
+ VERSION = "0.7.5.1"
6
6
  RAILS_VERSION = ">= 8.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hephaestus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4.2
4
+ version: 0.7.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -264,21 +264,6 @@ dependencies:
264
264
  - !ruby/object:Gem::Version
265
265
  version: '3.1'
266
266
  force_ruby_platform: false
267
- - !ruby/object:Gem::Dependency
268
- name: sidekiq
269
- requirement: !ruby/object:Gem::Requirement
270
- requirements:
271
- - - "~>"
272
- - !ruby/object:Gem::Version
273
- version: '7.2'
274
- type: :runtime
275
- prerelease: false
276
- version_requirements: !ruby/object:Gem::Requirement
277
- requirements:
278
- - - "~>"
279
- - !ruby/object:Gem::Version
280
- version: '7.2'
281
- force_ruby_platform: false
282
267
  - !ruby/object:Gem::Dependency
283
268
  name: slack_webhook_logger
284
269
  requirement: !ruby/object:Gem::Requirement
@@ -456,7 +441,6 @@ files:
456
441
  - config/initializers/litestream.rb
457
442
  - config/initializers/lograge.rb
458
443
  - config/initializers/opentelemetry.rb
459
- - config/initializers/sidekiq.rb
460
444
  - config/initializers/slack_webhook_logger.rb
461
445
  - config/litestream.yml
462
446
  - config/puma.rb
@@ -1,13 +0,0 @@
1
- # typed: false
2
- # frozen_string_literal: true
3
-
4
- require "sidekiq"
5
-
6
- Sidekiq.configure_server do |config|
7
- config.logger = Sidekiq::Logger.new($stdout)
8
- config.redis = { url: ENV.fetch("REDIS_URL", "redis://localhost:6379/1") }
9
- end
10
- Sidekiq.configure_client do |config|
11
- config.logger = Sidekiq::Logger.new($stdout)
12
- config.redis = { url: ENV.fetch("REDIS_URL", "redis://localhost:6379/1") }
13
- end