harbr 0.1.99 → 0.2.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: 52649fe0f492d23abe98964937b545745b93d50929d1ea5d282826216d081f19
4
- data.tar.gz: f34b8e0088b230a905e48e0500d5b6a0247410a7454b13af5321a076143f0b05
3
+ metadata.gz: 46c7ecffea48ede3af2a8ec861789af5fd25db85ce788220a904b8bb99c0b8c9
4
+ data.tar.gz: a8f7121f6a306b30440e20566580695e4313d27357baa2f15d5cccd7dd1b4e57
5
5
  SHA512:
6
- metadata.gz: 165aa6e0f4d46857054bebce4147d9377ed9a0e3c7d7afd18665a84c1311f814cca9699101a0b9d2e849230d261b5c7e7c8440f4efdb799ae1dece12c0edb651
7
- data.tar.gz: bc3b12f75986c672f98747fe5368a6e109daa9328ce9215c2306eacde3bfd542b2bdefc63f8596e63395c81b55c9e6af4cdcc9913de1bf38ea1f013cdccd2feb
6
+ metadata.gz: 4fe1698d6e251800ce45aa4125febba459c3b5f69a89e5f124a9b9519d6bcb3e68f1a760cc32e41ff2da890122c12affb9964b23bb77ef82495dfca1d967e538
7
+ data.tar.gz: 076feb114f3323ba74c8ae421f6c006e8a09c6632660cdcbb04bde5020d2c53c93929aba6404c02c54206bbcf9c402ca3ccff44cabe784ec1814018b3baa970f
data/exe/harbr CHANGED
@@ -48,6 +48,39 @@ class HarbrCLI < Thor
48
48
  system("sudo apt install #{package}") or raise "Failed to install #{package}"
49
49
  end
50
50
 
51
+ def create_traefik_config(containers)
52
+ config = {
53
+ "http" => {
54
+ "routers" => {},
55
+ "services" => {}
56
+ }
57
+ }
58
+
59
+ containers.each do |container|
60
+ container.ip = "127.0.0.1"
61
+ name = container.name.tr(".", "-")
62
+
63
+ router_key = "#{name}-router-secure"
64
+ config["http"]["routers"][router_key] = {
65
+ "rule" => "Host(`#{container.host_header}`)",
66
+ "service" => "#{name}-service",
67
+ "entryPoints" => ["https"],
68
+ "tls" => {
69
+ "certResolver" => "myresolver"
70
+ }
71
+ }
72
+
73
+ config["http"]["services"]["#{name}-service"] = {
74
+ "loadBalancer" => {
75
+ "servers" => [{"url" => "http://#{container.ip}:#{container.port}"}]
76
+ }
77
+ }
78
+ end
79
+
80
+ File.write("/etc/traefik/harbr.toml", TomlRB.dump(config))
81
+ puts "Traefik configuration written to /etc/traefik/harbr.toml"
82
+ end
83
+
51
84
  end
52
85
 
53
86
  desc "destroy", "Destroy a container and remove all traces"
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.99"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/harbr.rb CHANGED
@@ -52,7 +52,3 @@ module Harbr
52
52
  send_notification("Harbr: #{name} failed to deploy", html_content)
53
53
  end
54
54
  end
55
-
56
- Dddr.configure do |config|
57
- config.data_dir = Harbr::DEFAULT_DIRECTORY_DATA_DIR
58
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.99
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke