avm 0.92.0 → 0.93.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/entries/entry.rb +5 -0
- data/lib/avm/instances/base/auto_values/data.rb +5 -0
- data/lib/avm/instances/base/auto_values/source.rb +4 -1
- data/lib/avm/instances/base/production.rb +34 -0
- data/lib/avm/instances/base.rb +6 -0
- data/lib/avm/instances/data/loading_denied_error.rb +10 -0
- data/lib/avm/instances/data/unit.rb +10 -0
- data/lib/avm/instances/entry_keys.rb +1 -1
- data/lib/avm/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c1fee20bfe64a0b6d97f7866255914971859fb503ab18825eaf9be01a137aad
|
4
|
+
data.tar.gz: 964391eaa0ac606596e4aeb3b87ecd0c4ffcc1c78cadb86e98569e6ab660e06d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03a07968e45e58c41fcf6a5aed935b78f116b51e4fc536c9cd408b316404d5f8ac24ae262bd1d77e584fda8ad62641a13062b529a859483895389ac7ca6db732
|
7
|
+
data.tar.gz: a1f51632e1d257cfbf50197c60bc9f8bd3acd18a9e136911387b12257b296373f72bf640de5b5cf09c187770ca47b0e3b8cf5a0b18efb264d0757893924c7db8
|
data/lib/avm/entries/entry.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/applications/base/local_instance'
|
4
|
+
|
3
5
|
module Avm
|
4
6
|
module Instances
|
5
7
|
class Base
|
6
8
|
module AutoValues
|
7
9
|
module Source
|
8
10
|
def auto_source_instance_id
|
9
|
-
|
11
|
+
[application.id, ::Avm::Applications::Base::LocalInstance::LOCAL_INSTANCE_SUFFIX]
|
12
|
+
.join('_')
|
10
13
|
end
|
11
14
|
end
|
12
15
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'addressable'
|
4
|
+
require 'avm/instances/entry_keys'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Instances
|
8
|
+
class Base
|
9
|
+
module Production
|
10
|
+
DEFAULT_PRODUCTION = true
|
11
|
+
PRODUCTION_KEY = 'production'
|
12
|
+
|
13
|
+
# @return [Boolean]
|
14
|
+
def default_production?
|
15
|
+
DEFAULT_PRODUCTION
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [Boolean]
|
19
|
+
def production?
|
20
|
+
if production_entry.found?
|
21
|
+
production_entry.value.to_bool
|
22
|
+
else
|
23
|
+
default_production?
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# @return [Avm::Entries::Entry]
|
28
|
+
def production_entry
|
29
|
+
entry(PRODUCTION_KEY)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/avm/instances/base.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/instances/ids'
|
4
|
+
require 'avm/applications/base/local_instance'
|
4
5
|
require 'avm/with/application_stereotype'
|
5
6
|
require 'avm/with/extra_subcommands'
|
6
7
|
require 'eac_ruby_utils/require_sub'
|
@@ -61,6 +62,11 @@ module Avm
|
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
65
|
+
# @return [Boolean]
|
66
|
+
def local?
|
67
|
+
suffix == ::Avm::Applications::Base::LocalInstance::LOCAL_INSTANCE_SUFFIX
|
68
|
+
end
|
69
|
+
|
64
70
|
private
|
65
71
|
|
66
72
|
def source_instance_uncached
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/data/unit_with_commands'
|
4
|
+
require 'avm/instances/data/loading_denied_error'
|
4
5
|
require 'eac_ruby_utils/core_ext'
|
5
6
|
|
6
7
|
module Avm
|
@@ -9,6 +10,14 @@ module Avm
|
|
9
10
|
class Unit < ::Avm::Data::UnitWithCommands
|
10
11
|
common_constructor :instance
|
11
12
|
|
13
|
+
# @return [void]
|
14
|
+
# @raise Avm::Instances::Data::Unit
|
15
|
+
def check_load_permission!
|
16
|
+
return if instance.data_allow_loading
|
17
|
+
|
18
|
+
raise ::Avm::Instances::Data::LoadingDeniedError, "Instance: #{instance}"
|
19
|
+
end
|
20
|
+
|
12
21
|
# @return [Pathname]
|
13
22
|
def data_default_dump_path
|
14
23
|
instance.data_default_dump_path.to_pathname.basename_sub('.*') do |b|
|
@@ -22,6 +31,7 @@ module Avm
|
|
22
31
|
end
|
23
32
|
|
24
33
|
def load(...)
|
34
|
+
check_load_permission!
|
25
35
|
instance.on_disabled_processes { super }
|
26
36
|
end
|
27
37
|
end
|
@@ -28,7 +28,7 @@ module Avm
|
|
28
28
|
{
|
29
29
|
'' => %w[name source_instance_id],
|
30
30
|
admin: URI_FIELDS + %w[api_key],
|
31
|
-
data: %w[default_dump_path],
|
31
|
+
data: %w[allow_loading default_dump_path],
|
32
32
|
database: URI_FIELDS + %w[id limit name system timeout extra],
|
33
33
|
docker: %w[registry],
|
34
34
|
install: URI_FIELDS + %w[id data_path email groupname],
|
data/lib/avm/version.rb
CHANGED
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.
|
4
|
+
version: 0.93.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: 2024-05
|
11
|
+
date: 2024-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eac_cli
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.42'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.42'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: eac_config
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,10 +257,12 @@ files:
|
|
257
257
|
- lib/avm/instances/base/entry_keys.rb
|
258
258
|
- lib/avm/instances/base/install.rb
|
259
259
|
- lib/avm/instances/base/processes.rb
|
260
|
+
- lib/avm/instances/base/production.rb
|
260
261
|
- lib/avm/instances/base/subcommand_parent.rb
|
261
262
|
- lib/avm/instances/base/web.rb
|
262
263
|
- lib/avm/instances/data.rb
|
263
264
|
- lib/avm/instances/data/files_unit.rb
|
265
|
+
- lib/avm/instances/data/loading_denied_error.rb
|
264
266
|
- lib/avm/instances/data/package.rb
|
265
267
|
- lib/avm/instances/data/unit.rb
|
266
268
|
- lib/avm/instances/docker_image.rb
|