check subdomain for license

This commit is contained in:
Thein Lin Kyaw
2020-02-13 14:57:16 +06:30
parent 746bbcf7a3
commit 123d4a4c15
3 changed files with 54 additions and 13 deletions

View File

@@ -195,6 +195,20 @@ class License
end
end
def self.check_license_subdomain(lookup)
aes = MyAesCrypt.new
aes_key, aes_iv = aes.export_key(license_key)
server_mode = ENV["SERVER_MODE"]
unless ENV["SERVER_MODE"] == "cloud"
server_mode = "application"
end
params = { query: { lookup_type: server_mode, lookup: lookup, iv_key: aes_iv} }
response = self.class.get("/subdomain", params)
response.parsed_response["status"]
end
# Check License File exists
def self.check_license_file(lookup)
return unless File.exist?("config/license.yml")