harbr 0.1.72 → 0.1.73

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: b5054ebf15d9d0bec7cde169764a09820d29a462660dc8667734bef23394044f
4
- data.tar.gz: 2f73e1a49ea2a481c409daed12950e2e0462926ba33f54e80150c7680bb832f5
3
+ metadata.gz: 2af05eeb95471c30ca49d2044fa8ff37880d14c523781f6570402b9d13a83648
4
+ data.tar.gz: c37e3f40874254aa84237dc34558fcaf5c805465cc99b965c552da463871e7a4
5
5
  SHA512:
6
- metadata.gz: 394ef33e9bbfe3d13f8cc82922ec5df08441f820183e04fde4668fc76761d76b0432d188dfb7bc4de14e4ce21bc13b89a4929c45861e53c42e248464e0fa8fc8
7
- data.tar.gz: 15b7485e267dc9cdf7a780c06c908fb422da03039f60f6bbe0396360ec89bd5830775e4a13a874769d1cba3ed146468d677cbe6512ca4fddeb34f9d9070f26b0
6
+ metadata.gz: df8e612c5e99e600126e6a9b8d3467501dbce9dea55a172ae9e9a5d0f8b0c38fae3da4603f526a20b97757bd1524df6bfde729136b5c5429ab6fc20605117e9a
7
+ data.tar.gz: b8632e8fe04571fa1981733b0953a0de91bd31dee2f963177667cddbcb55457ea64bd8621af4f9321d476a85a424951075d2510ec96c5060e5f75f317df94e9e
@@ -1,7 +1,7 @@
1
1
  module Harbr
2
2
  class Container
3
3
  include Dddr::Entity
4
- attr_accessor :name, :host_header, :ip, :port
4
+ attr_accessor :name, :host_header, :ip, :port, :host_header_aliases
5
5
 
6
6
  queries do
7
7
  def find_by_header(host_header)
data/lib/harbr/job.rb CHANGED
@@ -39,17 +39,21 @@ module Harbr
39
39
  puts "Traefik configuration written to /etc/traefik/harbr.toml"
40
40
  end
41
41
 
42
- def collate_containers(name, host, port)
42
+ def collate_containers(name, host, port, host_header_aliases = [])
43
43
  containers = Harbr::Container::Repository.new
44
44
  container = containers.find_by_header(host)
45
+
46
+ host_header_aliases << host
45
47
 
46
48
  if container.nil?
47
- container = Harbr::Container.new
48
- container.name = name
49
- container.host_header = host
50
- container.ip = "127.0.0.1"
51
- container.port = port
52
- containers.create(container)
49
+ host_header_aliases.each do |host_header_alias|
50
+ container = Harbr::Container.new
51
+ container.name = name
52
+ container.host_header = host_header_alias
53
+ container.ip = "127.0.0.1"
54
+ container.port = port
55
+ containers.create(container)
56
+ end
53
57
  else
54
58
  container.port = port
55
59
  containers.update(container)
data/lib/harbr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Harbr
4
- VERSION = "0.1.72"
4
+ VERSION = "0.1.73"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.72
4
+ version: 0.1.73
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-01 00:00:00.000000000 Z
11
+ date: 2024-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen