dry-stack 0.1.17 → 0.1.18

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: 564df6a1d13aa1bee43bbeffe9df029c89efe2d258bba2f661564d11c208f473
4
- data.tar.gz: '010148312840649614e0a764d8c0033fce189363ffd4229ffcb58baba6b9e053'
3
+ metadata.gz: 54829c262a7ebcc4f610e60677db92468afdc9ef8d0f96a40b25146586182906
4
+ data.tar.gz: a9aef297aa9089a01dec3dfba63b06eebd9ea8465f724fab13c2abb3c725f560
5
5
  SHA512:
6
- metadata.gz: a4e90f05692e8660643c869fbe6bbabaa64d51a517b7ceff61c6dac9cc9981956642251950bf03f58326b8eaf9e31286438f7c570ff4d6fc42349177f15d7410
7
- data.tar.gz: 0bfb77155f6bbf2e8ace9fcb00998073c0c09895420f17adef5785e5ff61166e7f67c808a84e88c77652ccfee93a53ee1b90047fcd4b5ea4176453d13324bb94
6
+ metadata.gz: 0dc83172b86117389996574cfbd7a351b9dfb195037ee1727ec2510954daddb7970904ea2798d00632844041fecd611f1e1697a0d21b2a147a69300071f90953
7
+ data.tar.gz: 89e35595ec63f7005ce4427622171d657785c9092001db88d0807214566b3f05a5b9dcb32a04e722fb4cabd81ce5b882eeeca9de141265a65b8d738837bcc819
@@ -206,23 +206,26 @@ module Dry
206
206
  rule << "PathPrefix(`#{nginx_host2regexp ing[:path]}`)" if ing[:path]
207
207
  rule << "#{ing[:rule]}" if ing[:rule]
208
208
 
209
+ middlewares = []
210
+
209
211
  if ing[:basic_auth]
210
212
  ba_user, ba_password, salt = ing[:basic_auth].split ':'
211
213
  hashed_password = apr1_crypt ba_password, (salt || rand(36**8).to_s(36))
212
214
  service[:deploy][:labels] << "traefik.http.middlewares.#{service_name}-#{index}_auth.basicauth.users=#{ba_user}:#{hashed_password.gsub('$','$$')}"
213
- service[:deploy][:labels] << "traefik.http.routers.#{service_name}-#{index}.middlewares=#{service_name}-#{index}_auth"
215
+ middlewares << "#{service_name}-#{index}_auth"
214
216
  end
215
217
 
216
-
217
218
  service[:deploy][:labels] << "traefik.http.routers.#{service_name}-#{index}.rule=#{rule.join ' && '}"
218
219
 
219
220
  if ing[:path_sub]
221
+ middlewares << "#{service_name}-#{index}-path_sub"
220
222
  service[:deploy][:labels] += [
221
- "traefik.http.routers.#{service_name}-#{index}.middlewares=#{service_name}-#{index}-path_sub",
222
223
  "traefik.http.middlewares.#{service_name}-#{index}-path_sub.replacepathregex.regex=#{ing[:path_sub][0]}",
223
224
  "traefik.http.middlewares.#{service_name}-#{index}-path_sub.replacepathregex.replacement=#{ing[:path_sub][1].gsub('$','$$')}"
224
225
  ]
225
226
  end
227
+
228
+ service[:deploy][:labels] << "traefik.http.routers.#{service_name}-#{index}.middlewares=#{middlewares.join ","}" unless middlewares.empty?
226
229
  end
227
230
  end
228
231
  service.delete :ingress
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  class Stack
3
- VERSION = '0.1.17'
3
+ VERSION = '0.1.18'
4
4
  end
5
5
  end
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.1.17
4
+ version: 0.1.18
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-09-12 00:00:00.000000000 Z
11
+ date: 2024-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake