avm-eac_webapp_base0 0.6.1 → 0.8.0

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: ef908a36e6548511db94039c83e10cdc43a98a47bcde978b9a1d0a884c6202d3
4
- data.tar.gz: d4eafd0f5270d85c49ec87e78f43ca6f81a5fa66464db449629eb0fd40b4ac10
3
+ metadata.gz: c54900f40cbb246d07176ed3e482e002249df9a1f4253107d51c148bc8043c4e
4
+ data.tar.gz: 35faefcc23749106207ec0e41a7cc032beea459f81bc152ea441481bb35762bc
5
5
  SHA512:
6
- metadata.gz: d0afe6e4dd2bc5582225a9ad332c89ff3b33ab12b40726c97597b81a2ea55640ec236c654e81d58972de1a28b84a73dd91f35c12d48e28756757eaf1616b6dbd
7
- data.tar.gz: d0c7a37bb94ec9c11320ce783f47b95df52d1ecf48c0f74197479945dfd790a078393f4b8592ccfa2ccaf8fd221244cfb7a05fd109e683617e772ebf9a38de0e
6
+ metadata.gz: b2a120a192f25621e2111037d53683635cee565f5fd9f4805d7b4ea1056d6e884421b82d6842df05b8644f76302b5a34598cd5647220e5e24e0c6f7329f2ea47
7
+ data.tar.gz: 53add19e7a64aca1b4c244d9b6e4a1bc2b36918ae9364dfcd116b7aa914bc6fe173d1ccb304701cd212e767511bc4abc9dda4679b4074f105a66420e9f63b749
@@ -8,10 +8,15 @@ require 'eac_templates/core_ext'
8
8
  module Avm
9
9
  module EacWebappBase0
10
10
  class ApacheHost
11
+ APACHE_DIRECTORY_EXTRA_CONFIG_KEY = 'install.apache_directory_extra_config'
11
12
  JOBS = %w[write_available_no_ssl_site enable_no_ssl_site remove_ssl_site reload_apache
12
13
  run_certbot enable_ssl_site reload_apache].freeze
13
14
  include ::Avm::Jobs::Base
14
15
 
16
+ def directory_extra_config
17
+ instance.entry(APACHE_DIRECTORY_EXTRA_CONFIG_KEY).value.if_present { |v| " #{v}\n" }
18
+ end
19
+
15
20
  def no_ssl_site_content
16
21
  ::Avm::EacWebappBase0::ApacheHost
17
22
  .template.child('no_ssl.conf')
@@ -61,7 +66,7 @@ module Avm
61
66
  instance.host_env.command(
62
67
  'sudo', 'certbot', '--apache', '--domain', instance.read_entry('web.hostname'),
63
68
  '--redirect', '--non-interactive', '--agree-tos',
64
- '--email', instance.read_entry('admin.email')
69
+ '--email', instance.install_email
65
70
  ).system!
66
71
  end
67
72
 
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacWebappBase0
7
+ module Instances
8
+ module Runners
9
+ class ApacheHost
10
+ runner_with :help do
11
+ desc 'Configure Apache virtual host for instance.'
12
+ bool_opt '-c', '--certbot', 'Install certbot.'
13
+ end
14
+
15
+ def run
16
+ result = stereotype_apache_host_class.new(runner_context.call(:instance),
17
+ stereotype_apache_host_options).run
18
+ if result.error?
19
+ fatal_error result.to_s
20
+ else
21
+ infov 'Result', result.label
22
+ end
23
+ end
24
+
25
+ def stereotype_apache_host_class
26
+ "#{runner_context.call(:instance).class.name.deconstantize}::ApacheHost".constantize
27
+ end
28
+
29
+ def stereotype_apache_host_options
30
+ { certbot: parsed.certbot? }
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacWebappBase0
7
+ module Instances
8
+ module Runners
9
+ class ApachePath
10
+ runner_with :help do
11
+ desc 'Configure Apache path configuration for instance.'
12
+ end
13
+
14
+ def run
15
+ if result.error?
16
+ fatal_error result.to_s
17
+ else
18
+ infov 'Result', result.label
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ def apache_path_uncached
25
+ stereotype_apache_path_class.new(runner_context.call(:instance))
26
+ end
27
+
28
+ def result_uncached
29
+ apache_path.run
30
+ end
31
+
32
+ def stereotype_apache_path_class
33
+ "#{runner_context.call(:instance).class.name.deconstantize}::ApachePath".constantize
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/runner'
4
+ require 'avm/path_string'
5
+ require 'eac_cli/core_ext'
6
+
7
+ module Avm
8
+ module EacWebappBase0
9
+ module Instances
10
+ module Runners
11
+ class Deploy
12
+ runner_with :help do
13
+ desc 'Deploy for instance.'
14
+ arg_opt '-r', '--reference', 'Git reference to deploy.'
15
+ arg_opt '-a', '--append-dirs', 'Append directories to deploy (List separated by ":").'
16
+ bool_opt '-T', '--no-request-test', 'Do not test web interface after deploy.'
17
+ end
18
+
19
+ def deploy_class
20
+ runner_context.call(:stereotype_module).const_get('Instances').const_get('Deploy')
21
+ rescue ::NameError
22
+ runner_context.call(:stereotype_module).const_get('Deploy')
23
+ end
24
+
25
+ def run
26
+ result = deploy_class.new(runner_context.call(:instance), deploy_options).run
27
+ if result.error?
28
+ fatal_error result.to_s
29
+ else
30
+ infov 'Result', result.label
31
+ end
32
+ end
33
+
34
+ def deploy_options
35
+ { reference: parsed.reference,
36
+ appended_directories: ::Avm::PathString.paths(parsed.append_dirs),
37
+ no_request_test: parsed.no_request_test? }
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacWebappBase0
5
- VERSION = '0.6.1'
5
+ VERSION = '0.8.0'
6
6
  end
7
7
  end
@@ -7,5 +7,5 @@
7
7
  Allow from all
8
8
  Options -MultiViews
9
9
  Require all granted
10
- </Directory>
10
+ %%DIRECTORY_EXTRA_CONFIG%% </Directory>
11
11
  </VirtualHost>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-eac_webapp_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-20 00:00:00.000000000 Z
11
+ date: 2022-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.41'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.41.1
19
+ version: '0.42'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.41'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.41.1
26
+ version: '0.42'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: avm-eac_generic_base0
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +72,14 @@ dependencies:
78
72
  requirements:
79
73
  - - "~>"
80
74
  - !ruby/object:Gem::Version
81
- version: '0.102'
75
+ version: '0.103'
82
76
  type: :runtime
83
77
  prerelease: false
84
78
  version_requirements: !ruby/object:Gem::Requirement
85
79
  requirements:
86
80
  - - "~>"
87
81
  - !ruby/object:Gem::Version
88
- version: '0.102'
82
+ version: '0.103'
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: eac_ruby_gem_support
91
85
  requirement: !ruby/object:Gem::Requirement
@@ -119,13 +113,13 @@ files:
119
113
  - lib/avm/eac_webapp_base0/instances/base.rb
120
114
  - lib/avm/eac_webapp_base0/instances/base/subcommand_parent.rb
121
115
  - lib/avm/eac_webapp_base0/instances/runners.rb
116
+ - lib/avm/eac_webapp_base0/instances/runners/apache_host.rb
117
+ - lib/avm/eac_webapp_base0/instances/runners/apache_path.rb
122
118
  - lib/avm/eac_webapp_base0/instances/runners/data.rb
123
119
  - lib/avm/eac_webapp_base0/instances/runners/data/dump.rb
124
120
  - lib/avm/eac_webapp_base0/instances/runners/data/load.rb
121
+ - lib/avm/eac_webapp_base0/instances/runners/deploy.rb
125
122
  - lib/avm/eac_webapp_base0/runner.rb
126
- - lib/avm/eac_webapp_base0/runner/apache_host.rb
127
- - lib/avm/eac_webapp_base0/runner/apache_path.rb
128
- - lib/avm/eac_webapp_base0/runner/deploy.rb
129
123
  - lib/avm/eac_webapp_base0/sources.rb
130
124
  - lib/avm/eac_webapp_base0/sources/base.rb
131
125
  - lib/avm/eac_webapp_base0/version.rb
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/instances/runner'
4
- require 'eac_cli/core_ext'
5
-
6
- module Avm
7
- module EacWebappBase0
8
- class Runner < ::Avm::Instances::Runner
9
- class ApacheHost
10
- runner_with :help do
11
- desc 'Configure Apache virtual host for instance.'
12
- bool_opt '-c', '--certbot', 'Install certbot.'
13
- end
14
-
15
- def run
16
- result = stereotype_apache_host_class.new(runner_context.call(:instance),
17
- stereotype_apache_host_options).run
18
- if result.error?
19
- fatal_error result.to_s
20
- else
21
- infov 'Result', result.label
22
- end
23
- end
24
-
25
- def stereotype_apache_host_class
26
- "#{runner_context.call(:instance).class.name.deconstantize}::ApacheHost".constantize
27
- end
28
-
29
- def stereotype_apache_host_options
30
- { certbot: parsed.certbot? }
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/core_ext'
4
- require 'avm/instances/runner'
5
- require 'avm/eac_webapp_base0/runner/apache_host'
6
- require 'avm/eac_rails_base0/apache_path'
7
-
8
- module Avm
9
- module EacWebappBase0
10
- class Runner < ::Avm::Instances::Runner
11
- class ApachePath
12
- runner_with :help do
13
- desc 'Configure Apache path configuration for instance.'
14
- end
15
-
16
- def run
17
- if result.error?
18
- fatal_error result.to_s
19
- else
20
- infov 'Result', result.label
21
- end
22
- end
23
-
24
- private
25
-
26
- def apache_path_uncached
27
- stereotype_apache_path_class.new(runner_context.call(:instance))
28
- end
29
-
30
- def result_uncached
31
- apache_path.run
32
- end
33
-
34
- def stereotype_apache_path_class
35
- "#{runner_context.call(:instance).class.name.deconstantize}::ApachePath".constantize
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/instances/runner'
4
- require 'avm/path_string'
5
- require 'eac_cli/core_ext'
6
-
7
- module Avm
8
- module EacWebappBase0
9
- class Runner < ::Avm::Instances::Runner
10
- class Deploy
11
- runner_with :help do
12
- desc 'Deploy for instance.'
13
- arg_opt '-r', '--reference', 'Git reference to deploy.'
14
- arg_opt '-a', '--append-dirs', 'Append directories to deploy (List separated by ":").'
15
- bool_opt '-T', '--no-request-test', 'Do not test web interface after deploy.'
16
- end
17
-
18
- def deploy_class
19
- runner_context.call(:stereotype_module).const_get('Instances').const_get('Deploy')
20
- rescue ::NameError
21
- runner_context.call(:stereotype_module).const_get('Deploy')
22
- end
23
-
24
- def run
25
- result = deploy_class.new(runner_context.call(:instance), deploy_options).run
26
- if result.error?
27
- fatal_error result.to_s
28
- else
29
- infov 'Result', result.label
30
- end
31
- end
32
-
33
- def deploy_options
34
- { reference: parsed.reference,
35
- appended_directories: ::Avm::PathString.paths(parsed.append_dirs),
36
- no_request_test: parsed.no_request_test? }
37
- end
38
- end
39
- end
40
- end
41
- end