jatai 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85122c82b155efd22ee855b4d8e538be1013e93cccbde96c19b695bbf2fbff96
4
- data.tar.gz: 0bc52ba21340fc3c77f775373397d97a7f9ff194f17559817a34fb7e14045355
3
+ metadata.gz: 3bf8aed477b1220c2ffd5b71fc309ac1f407a51404b43603f9ce08ad7f29f78c
4
+ data.tar.gz: 2514d15c7bcdc3460193c286ff6657b27aae26817524b66121cbc96ccc28a03c
5
5
  SHA512:
6
- metadata.gz: b9194f0bf98aedc96cf0357260ebc531c2ba82edc2e58ef36f42888fc9e7f8b330c5f86367a48cde2408c183ea12cd751e499c8c578c0f96d48c1531b3e1ecd0
7
- data.tar.gz: 07bde3b740fcb1a5fedea4c0d5f0da6122000fbbbd1cb27fe4e8b0a9543f45279410eb335bc3564b9f13ad405f406e97bc11cae83f0396d93570815bd9e5460a
6
+ metadata.gz: 3d6f9195e30feeb5798276c198ffcddcd8ef429bbd65c4bd9444adf50089c0983ee124afe8a8bd72e342b7199248c46477241deb2083f3d7e9caf4438238a963
7
+ data.tar.gz: a6d364146dd82c0321773da507e2eea74b40b637601c27b7cabe45d5cea9b4f61d7a007125b38d25fd346a20a00862733db5945c6af97dfcff1d9a88b41cd09b
@@ -33,8 +33,12 @@ module Jatai
33
33
  result = helper.api.post("/api/v1/apps/#{slug}/domains", body: { domain: { hostname: hostname } })
34
34
  app = helper.api.get("/api/v1/apps/#{slug}")
35
35
  helper.success("Domínio #{hostname} adicionado.")
36
- helper.info("Token de verificação: #{result["verification_token"]}")
37
- helper.info("Adicione um registro CNAME apontando para #{app["subdomain"]}.usebrasa.com.br")
36
+ # Alvo do CNAME vem da URL canônica do servidor (marca atual); o
37
+ # fallback local cobre servidor antigo sem o campo "url".
38
+ target = cname_target(app, slug)
39
+ helper.info("Opção 1 (CNAME): aponte #{hostname} para #{target}")
40
+ helper.info("Opção 2 (TXT): crie um registro TXT em #{hostname} com o valor #{result["verification_token"]}")
41
+ helper.info("Domínio raiz (apex)? CNAME não é permitido no apex: use a Opção 2 (TXT) e crie um registro A — o IP está na aba Domínios do dashboard.")
38
42
  rescue Api::Client::ValidationError => e
39
43
  helper.error("Erro: #{e.message}")
40
44
  rescue Api::Client::ApiError => e
@@ -84,6 +88,12 @@ module Jatai
84
88
 
85
89
  private
86
90
 
91
+ def cname_target(app, slug)
92
+ return app["url"].sub(%r{\Ahttps?://}, "") if app["url"].to_s.start_with?("http")
93
+
94
+ "#{app["subdomain"] || slug}.jataiapp.com.br"
95
+ end
96
+
87
97
  def helper
88
98
  @helper ||= begin
89
99
  h = DomainsHelper.new
data/lib/jatai/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jatai
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jatai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jataí Cloud