enviroblyd 0.5.0 → 0.6.0

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: 329d9e7586d58e8b529d2a94d46be76130efb24bf688a4d53efe17dfeaf3e7e0
4
- data.tar.gz: 47cf08b7ecf7231460aeed688aa76705abff6cdcfdf770148f9f86f378ee513e
3
+ metadata.gz: cf14c9c81dfe5bf5842d0cfca53466605c2c053149096a74c955a506132ae30a
4
+ data.tar.gz: 45c8f5812463f757a9a56ab906d1a15e61fb3ed5ae6c84fc123b86b12e887f74
5
5
  SHA512:
6
- metadata.gz: f57916ca0d0615cd05cffcf15527f506a8ca60a47cec03f5d9ea4262b4ce0b298ae764cace907c764c4de9307f870659657610629c98e7ebd8d8c81388000623
7
- data.tar.gz: a260266cb641e0b7e99d2e35f21cde3fcd82f80570782ce5628c4081c4e6f9773ee35ea4d660514267407ccc000146b3db1b504b60370518653f2b61c13ba719
6
+ metadata.gz: a2c0a0d8077062a6149ad420e2e1a3769bc5ce16c47815bf65f4b96ab3ef15f5c7e3d1f93c5eb7ba862e822dbbb8cfb39c2c42122a823298e54e9a9c82e314cc
7
+ data.tar.gz: c82f027d69d99d30a3aa17b51adc6ed26e0474910aa89041747091193ddcd2ec8c2bb548c91574a4bbfd8eeb429b679c7b351f5cfdc5be71ae84e47ade290034
@@ -2,6 +2,8 @@
2
2
 
3
3
  require "open3"
4
4
  require "json"
5
+ require "zlib"
6
+ require "base64"
5
7
 
6
8
  class Enviroblyd::Command
7
9
  DEFAULT_TIMEOUT_SECONDS = 5 * 60
@@ -10,7 +12,7 @@ class Enviroblyd::Command
10
12
  def initialize(message)
11
13
  params = parse_message message
12
14
  @url = params.fetch "url"
13
- @script = params.fetch "script"
15
+ @script = decode_and_decompress params.fetch("script")
14
16
  @runtime = params.fetch "runtime", DEFAULT_RUNTIME
15
17
  @timeout = params.fetch "timeout", DEFAULT_TIMEOUT_SECONDS
16
18
  @stdout = @stderr = @exit_code = nil
@@ -54,4 +56,8 @@ class Enviroblyd::Command
54
56
  rescue
55
57
  nil
56
58
  end
59
+
60
+ def decode_and_decompress(encoded_data)
61
+ Zlib::Inflate.inflate Base64.decode64(encoded_data)
62
+ end
57
63
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Enviroblyd
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "net/http"
4
4
  require "uri"
5
- require "open3"
6
5
  require "fileutils"
7
6
  require "pathname"
8
7
  require "json"
@@ -10,7 +9,6 @@ require "json"
10
9
  class Enviroblyd::Web
11
10
  USER_AGENT = "enviroblyd #{Enviroblyd::VERSION}"
12
11
  CONTENT_TYPE = "application/json"
13
- API_HOST = ENV.fetch("ENVIROBLYD_API_HOST", "envirobly.com")
14
12
  WORKING_DIR = Pathname.new ENV.fetch("ENVIROBLYD_WORKING_DIR", "/var/envirobly/daemon")
15
13
  INITIALIZED_FILE = WORKING_DIR.join "initialized"
16
14
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enviroblyd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Starsi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-13 00:00:00.000000000 Z
11
+ date: 2024-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor