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 +4 -4
- data/lib/jatai/commands/domains.rb +12 -2
- data/lib/jatai/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: 3bf8aed477b1220c2ffd5b71fc309ac1f407a51404b43603f9ce08ad7f29f78c
|
|
4
|
+
data.tar.gz: 2514d15c7bcdc3460193c286ff6657b27aae26817524b66121cbc96ccc28a03c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
37
|
-
|
|
36
|
+
# Alvo do CNAME vem da URL canônica do servidor (marca atual); o
|
|
37
|
+
# fallback local só 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