avm 0.31.0 → 0.32.0

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: aea575c3e0ebcc43678325a4a682ea17c915ecae1eb6d133335b3e94ace56ca3
4
- data.tar.gz: 2ed8fc21068a44f5ae816aa098a866650f32511b09afca2e75af2b620cd89f9b
3
+ metadata.gz: fc4f095582fb4fb51a80f667437b95281791bf218ba89e43ff402e337baaeb3a
4
+ data.tar.gz: 3b4a59e42bf16ab8ace7031604f43f7e9efb876836c4b3bc33342b1862ba7fa9
5
5
  SHA512:
6
- metadata.gz: 3c87d398c755f55f71a827167bfbe0131d08d5df55af5497ccc7fd239cd059e59c9f251dbe448ca13df30c31da76e147dc2bd8e0d1501130000a219313b5e39d
7
- data.tar.gz: e188963cfc504522f52eb86e7de7490427c194496c61e2d6771bdfdd697de9d9e6647cc0c1c772c6f19b3799bdd05c3054f999caa8168708a29e910d19398431
6
+ metadata.gz: ab5e8effc7ce4575c18922fa0c777b2e61bd97cf20cfdb40981a81b166970e00b7fdd3d49b16b3155715743b59b063585e5d8bbc4b7c6edab7c2927597dc36e7
7
+ data.tar.gz: 7cfaaaf7877b87c4a5de68d4c84ae70c1424f6287635b97b26468f97350d9000e858c1559758eabb8004b98765574cf63d928d8c6f3f609129c68bf5f4a19a98
@@ -6,11 +6,11 @@ module Avm
6
6
  module AutoValues
7
7
  module Admin
8
8
  def auto_admin_email
9
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'admin.email')
9
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'admin.email')
10
10
  end
11
11
 
12
12
  def auto_admin_name
13
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'admin.name')
13
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'admin.name')
14
14
  end
15
15
  end
16
16
  end
@@ -61,7 +61,7 @@ module Avm
61
61
  def database_auto_common(suffix)
62
62
  database_key = ::Avm::Instances::EntryKeys.const_get("database_#{suffix}".upcase)
63
63
  inherited_entry_value(::Avm::Instances::EntryKeys::DATABASE_ID, database_key) ||
64
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, database_key)
64
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, database_key)
65
65
  end
66
66
 
67
67
  def database_port_by_system
@@ -8,29 +8,30 @@ module Avm
8
8
  module AutoValues
9
9
  module Filesystem
10
10
  def auto_fs_path
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
11
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
12
12
  ::Avm::Instances::EntryKeys::FS_PATH) { |v| v + '/' + id }
13
13
  end
14
14
 
15
15
  def auto_data_fs_path
16
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
16
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
17
17
  ::Avm::Instances::EntryKeys::DATA_FS_PATH) { |v| v + '/' + id }
18
18
  end
19
19
 
20
20
  def auto_fs_url
21
- auto_fs_url_with_ssh || auto_fs_url_without_ssh
21
+ auto_fs_url_with_install || auto_fs_url_without_install
22
22
  end
23
23
 
24
- def auto_fs_url_with_ssh
25
- read_entry_optional('ssh.url').if_present do |ssh_url|
24
+ def auto_fs_url_with_install
25
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL)
26
+ .if_present do |install_url|
26
27
  read_entry_optional('fs_path').if_present do |fs_path|
27
- "#{ssh_url}#{fs_path}"
28
+ "#{install_url}#{fs_path}"
28
29
  end
29
30
  end
30
31
  end
31
32
 
32
- def auto_fs_url_without_ssh
33
- return nil if read_entry_optional('ssh.url').present?
33
+ def auto_fs_url_without_install
34
+ return nil if read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL).present?
34
35
 
35
36
  read_entry_optional('fs_path').if_present do |fs_path|
36
37
  "file://#{fs_path}"
@@ -12,22 +12,22 @@ module Avm
12
12
  end
13
13
 
14
14
  def auto_install_hostname
15
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
15
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
16
16
  ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME)
17
17
  end
18
18
 
19
19
  def auto_install_port
20
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
20
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
21
21
  ::Avm::Instances::EntryKeys::INSTALL_PORT) || 22
22
22
  end
23
23
 
24
24
  def auto_install_username
25
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
25
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
26
26
  ::Avm::Instances::EntryKeys::INSTALL_USERNAME)
27
27
  end
28
28
 
29
29
  def auto_install_url
30
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
30
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
31
31
  ::Avm::Instances::EntryKeys::INSTALL_URL) ||
32
32
  auto_install_url_by_parts
33
33
  end
@@ -17,9 +17,9 @@ module Avm
17
17
  end
18
18
 
19
19
  def auto_mailer_id
20
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
20
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
21
21
  ::Avm::Instances::EntryKeys::MAILER_ID) ||
22
- read_entry_optional(::Avm::Instances::EntryKeys::HOST_ID)
22
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_ID)
23
23
  end
24
24
 
25
25
  private
@@ -6,7 +6,7 @@ module Avm
6
6
  module AutoValues
7
7
  module Ruby
8
8
  def auto_ruby_version
9
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'ruby.version')
9
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'ruby.version')
10
10
  end
11
11
  end
12
12
  end
@@ -8,12 +8,12 @@ module Avm
8
8
  module AutoValues
9
9
  module System
10
10
  def auto_system_username
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'system.username') ||
12
- read_entry_optional('ssh.username')
11
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'system.username') ||
12
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
13
13
  end
14
14
 
15
15
  def auto_system_groupname
16
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'system.groupname') ||
16
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'system.groupname') ||
17
17
  read_entry_optional('system.username')
18
18
  end
19
19
  end
@@ -1,15 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/require_sub'
4
- ::EacRubyUtils.require_sub(__FILE__)
3
+ require 'eac_ruby_utils/core_ext'
5
4
 
6
5
  module Avm
7
6
  module Instances
8
7
  class Base
9
8
  module AutoValues
10
- extend ::ActiveSupport::Concern
9
+ require_sub __FILE__
11
10
 
12
- included do
11
+ common_concern do
13
12
  %w[Admin Data Database Filesystem Install Mailer Ruby Source System Web]
14
13
  .each do |class_name|
15
14
  include const_get(class_name)
@@ -51,11 +51,11 @@ module Avm
51
51
  end
52
52
 
53
53
  def host_env_uncached
54
- access = read_entry(:access, list: ::Avm::Instances::Base.lists.access.values)
55
- case access
54
+ install_uri = entry(::Avm::Instances::EntryKeys::INSTALL_URL).value.to_uri
55
+ case install_uri.scheme
56
56
  when 'local' then ::EacRubyUtils::Envs.local
57
- when 'ssh' then ::EacRubyUtils::Envs.ssh(read_entry('ssh.url'))
58
- else raise("Unmapped access value: \"#{access}\"")
57
+ when 'ssh' then ::EacRubyUtils::Envs.ssh(install_uri)
58
+ else raise("Unmapped access value: \"#{install_uri}\"")
59
59
  end
60
60
  end
61
61
 
@@ -44,12 +44,12 @@ module Avm
44
44
  end
45
45
 
46
46
  {
47
- '' => %w[data_fs_path fs_path host_id name source_instance_id],
47
+ '' => %w[data_fs_path fs_path name source_instance_id],
48
48
  admin: URI_FIELDS + %w[api_key],
49
49
  database: URI_FIELDS + %w[id limit name system timeout extra],
50
50
  docker: %w[registry],
51
51
  fs: %w[url],
52
- install: URI_FIELDS,
52
+ install: URI_FIELDS + %w[id],
53
53
  mailer: {
54
54
  '' => %w[id from reply_to],
55
55
  smtp: URI_FIELDS + %w[address domain authentication openssl_verify_mode starttls_auto tls]
data/lib/avm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.31.0'
4
+ VERSION = '0.32.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-01 00:00:00.000000000 Z
11
+ date: 2022-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli