dry-stack 0.0.82 → 0.0.83

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: 52aef15bc22cb7ef0bdadb32c686998849894138d6f2a06ae5e5f2e6b5d59a9c
4
- data.tar.gz: eac3ce3089cfa955adb72974b0f68ad685a22f5217637fc89874fec2dd6582e0
3
+ metadata.gz: 699b765bc2706a898f06c1ba3409d93723584e567865f9b21800a2f800700dad
4
+ data.tar.gz: 3a2ed784ad03723d09a19686a8f0204987a15876676e117596bbc5b24fa78419
5
5
  SHA512:
6
- metadata.gz: d57962ce0e295fe0bb8432b4f3eec4c15b68ba593a7e278f03a9b0d7632789ed3a3e7f7a25aff64b478806fecdc72b5d38506cb3fb2c99e0132315d3d4adb8b9
7
- data.tar.gz: 658c93b70b9306d935ef6b5443b4bd25a3ccdc90c9239e38bae662ea3d423c1587f38d31e12c24b633048364ab0a1aa1f7516faa40c38613953a7fd3ebac1d41
6
+ metadata.gz: 3f98d9d33f3cdc6616e484f62ba41026c1e88cdbb7d19095087412ba3bb788d5841d166f2a3a4874561eaf0a0c13303609a6abeef479d8852d855bb694162d76
7
+ data.tar.gz: 3fbd781699888422c806330c0bf3036e16a78017911bff5d46383b07834d7b6560d4b02073ce29c6813b4c841acf7689cd00dba89fdf555dd00f97ece7b26629
@@ -149,14 +149,6 @@ module Dry
149
149
  service[:deploy][:labels] ||= []
150
150
  service[:deploy][:labels] += @labels.map { "#{_1}=#{_2}" }
151
151
 
152
- if service[:basic_auth]
153
- ba_user, ba_password, salt = service[:basic_auth].split ':'
154
- hashed_password = apr1_crypt ba_password, (salt || rand(36**8).to_s(36))
155
- service[:deploy][:labels] << "traefik.http.middlewares.%{service-name}_auth.basicauth.users=#{ba_user}:#{hashed_password.gsub('$','$$')}"
156
- service[:deploy][:labels] << "traefik.http.routers.%{service-name}.middlewares=%{service-name}_auth"
157
- service.delete :basic_auth
158
- end
159
-
160
152
  if ingress[0] && (opts[:ingress] || opts[:traefik] || opts[:traefik_tls])
161
153
  service[:networks] ||= []
162
154
  service[:networks] << 'default' if service[:networks].empty?
@@ -177,6 +169,13 @@ module Dry
177
169
  ingress[0][:port] ||= service[:ports]&.first
178
170
 
179
171
  ingress.each_with_index do |ing, index|
172
+ if service[:basic_auth]
173
+ ba_user, ba_password, salt = service[:basic_auth].split ':'
174
+ hashed_password = apr1_crypt ba_password, (salt || rand(36**8).to_s(36))
175
+ service[:deploy][:labels] << "traefik.http.middlewares.#{service_name}-#{index}_auth.basicauth.users=#{ba_user}:#{hashed_password.gsub('$','$$')}"
176
+ service[:deploy][:labels] << "traefik.http.routers.#{service_name}-#{index}.middlewares=#{service_name}-#{index}_auth"
177
+ end
178
+
180
179
  ing[:port] ||= service[:ports]&.first
181
180
  service[:deploy][:labels] += [
182
181
  "traefik.http.routers.#{service_name}-#{index}.service=#{service_name}-#{index}",
@@ -210,6 +209,7 @@ module Dry
210
209
  end
211
210
  end
212
211
  end
212
+ service.delete :basic_auth
213
213
 
214
214
  service[:environment] = @environment[name].merge(service[:environment]) if @environment[name]
215
215
  service[:environment].merge! STACK_NAME: @name.to_s, STACK_SERVICE_NAME: name.to_s
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  class Stack
3
- VERSION = '0.0.82'
3
+ VERSION = '0.0.83'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.82
4
+ version: 0.0.83
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B