dry-stack 0.0.85 → 0.0.86
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 +9 -10
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0030379ed099994251cd619cde54371206b3cc12028e7fb2a17b6d56296f0e37'
|
4
|
+
data.tar.gz: 6aa330ee8d7456a70eba51f961a4084c5a466b3ff0e3dfd819dc58ffa24452d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57a60be8b72a438f818904b412970e49f26fbe049cb5a926ca30d3d8414b7e7cdba1aded7c7b7d00efbcb6a2f873807a0f11a4c8b1bf339c9ca1400802e09315
|
7
|
+
data.tar.gz: 6a7359355a1068dda4ef13873742ae3603925c868cf55b1a30ec98a798a2e11850dfad3846bfbd4938d9419d0aec734d90181b8f240573dcb44d5f4e2ff57c18
|
data/lib/dry-stack/stack.rb
CHANGED
@@ -58,7 +58,6 @@ module Dry
|
|
58
58
|
def logging(opts) = (@service[:logging] ||= {}).merge! opts
|
59
59
|
def user(user) = @service[:user] = user # "${UID}:${GID}", "www-data:www-data"
|
60
60
|
def network(names) = (@service[:networks] ||= []) << names
|
61
|
-
def basic_auth(user_and_password) = @service[:basic_auth] = user_and_password
|
62
61
|
def ingress(ing) = ((@service[:ingress] ||=[]) << ing).flatten!
|
63
62
|
end
|
64
63
|
|
@@ -173,14 +172,6 @@ module Dry
|
|
173
172
|
ingress[0][:port] ||= service[:ports]&.first
|
174
173
|
|
175
174
|
ingress.each_with_index do |ing, index|
|
176
|
-
|
177
|
-
if service[:basic_auth]
|
178
|
-
ba_user, ba_password, salt = service[:basic_auth].split ':'
|
179
|
-
hashed_password = apr1_crypt ba_password, (salt || rand(36**8).to_s(36))
|
180
|
-
service[:deploy][:labels] << "traefik.http.middlewares.#{service_name}-#{index}_auth.basicauth.users=#{ba_user}:#{hashed_password.gsub('$','$$')}"
|
181
|
-
service[:deploy][:labels] << "traefik.http.routers.#{service_name}-#{index}.middlewares=#{service_name}-#{index}_auth"
|
182
|
-
end
|
183
|
-
|
184
175
|
ing[:port] ||= service[:ports]&.first
|
185
176
|
service[:deploy][:labels] += [
|
186
177
|
"traefik.http.routers.#{service_name}-#{index}.service=#{service_name}-#{index}",
|
@@ -200,9 +191,18 @@ module Dry
|
|
200
191
|
|
201
192
|
rule = []
|
202
193
|
rule << "HostRegexp(`{name:#{nginx_host2regexp ing[:host]}}`)" if ing[:host]
|
194
|
+
rule << "ClientIP(#{[ing[:client_ip]].flatten.map{ "`#{_1}`" }.join ','})" if ing[:client_ip]
|
203
195
|
rule << "PathPrefix(`#{nginx_host2regexp ing[:path]}`)" if ing[:path]
|
204
196
|
rule << "#{ing[:rule]}" if ing[:rule]
|
205
197
|
|
198
|
+
if ing[:basic_auth]
|
199
|
+
ba_user, ba_password, salt = ing[:basic_auth].split ':'
|
200
|
+
hashed_password = apr1_crypt ba_password, (salt || rand(36**8).to_s(36))
|
201
|
+
service[:deploy][:labels] << "traefik.http.middlewares.#{service_name}-#{index}_auth.basicauth.users=#{ba_user}:#{hashed_password.gsub('$','$$')}"
|
202
|
+
service[:deploy][:labels] << "traefik.http.routers.#{service_name}-#{index}.middlewares=#{service_name}-#{index}_auth"
|
203
|
+
end
|
204
|
+
|
205
|
+
|
206
206
|
service[:deploy][:labels] << "traefik.http.routers.#{service_name}-#{index}.rule=#{rule.join ' && '}"
|
207
207
|
|
208
208
|
if ing[:path_sub]
|
@@ -214,7 +214,6 @@ module Dry
|
|
214
214
|
end
|
215
215
|
end
|
216
216
|
end
|
217
|
-
service.delete :basic_auth
|
218
217
|
service.delete :ingress
|
219
218
|
|
220
219
|
service[:environment] = @environment[name].merge(service[:environment]) if @environment[name]
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.86
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artyom B
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|