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 +4 -4
- data/lib/dry-stack/stack.rb +8 -8
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 699b765bc2706a898f06c1ba3409d93723584e567865f9b21800a2f800700dad
|
4
|
+
data.tar.gz: 3a2ed784ad03723d09a19686a8f0204987a15876676e117596bbc5b24fa78419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f98d9d33f3cdc6616e484f62ba41026c1e88cdbb7d19095087412ba3bb788d5841d166f2a3a4874561eaf0a0c13303609a6abeef479d8852d855bb694162d76
|
7
|
+
data.tar.gz: 3fbd781699888422c806330c0bf3036e16a78017911bff5d46383b07834d7b6560d4b02073ce29c6813b4c841acf7689cd00dba89fdf555dd00f97ece7b26629
|
data/lib/dry-stack/stack.rb
CHANGED
@@ -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