ish_models 3.1.0.27 → 3.1.0.29

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: '0877cf4f0630ecaabf593722fc112a8c03415eb38cec5eb1479fc44d7da7174b'
4
- data.tar.gz: 87d3659e67c451b2f5ab56ac4bffe92a5b666bea8de2a8a8e9f097a6c457df15
3
+ metadata.gz: 19e5b5df0a1181ed7f2aa70bd246edd53498ed6ab30d05476367cf25b8b5e615
4
+ data.tar.gz: 766dee13aa038acfebb3ea16ff4159f521d0466024cf93725cd64266e91e60b9
5
5
  SHA512:
6
- metadata.gz: 3abb03c36b58a51b75d3a0cea9fdff8d8c9fe20d7fa1458019debcb863111cf2d39ea7c67cbad4aa5d8c1bdeddb813956c21c75586727173225979291d4d73fa
7
- data.tar.gz: 3f5db15afa9d22e226d0e5b3937b1a2a0fa0f7d5b5d8d90b1c1f074a94c1791f134b992a40521f4aa8b3b36013bff952354cb86139b97313c1ba9f4e6ff1ad4c
6
+ metadata.gz: 0f0ba7c47d6c8efe8d232879109d427bac250819186543bcedf86079cba71928f6375982595e3b94f826bff2b5f9d8509f577da951aa4de96516ce03e7f67f78
7
+ data.tar.gz: 2379f779878683501c74767c585c303561fb2464f256d252336cfda83279d6c6d78984e5a89173d5d1784898dcdd72b2e27f2c57a7d2d55175e49a8f52e875d4
@@ -0,0 +1,24 @@
1
+
2
+ require 'net/scp'
3
+ require 'open3'
4
+
5
+ class CertbotJob
6
+ include Sidekiq::Job
7
+ sidekiq_options queue: 'wasya_co_rb'
8
+
9
+ def perform id
10
+ puts! id, 'CertbotJob#perform...'
11
+
12
+ app = WcoHosting::Appliance.find id
13
+ cmd = "ssh #{app.serverhost.ssh_host} 'certbot run -d #{app.host} --nginx -n ' "
14
+ stdout, stderr, status = Open3.capture3(cmd)
15
+ status = status.to_s.split.last.to_i
16
+
17
+ if 0 != status && 0 != app.n_retries
18
+ app.update_attributes({ n_retries: app.n_retries - 1 })
19
+ CertbotJob.perform_in( 15.minutes, app.id.to_s )
20
+ end
21
+
22
+ end
23
+
24
+ end
File without changes
File without changes
@@ -0,0 +1,18 @@
1
+
2
+ class Wco::Publisher
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+ store_in collection: 'wco_daily_publishers'
6
+
7
+ KIND_ARTICLE = 'article'
8
+ KIND_IMAGE = 'image'
9
+ field :kind, type: :string
10
+
11
+ belongs_to :to_site, class_name: 'Wco::Site'
12
+ belongs_to :from_gallery, class_name: 'Wco::Gallery'
13
+
14
+ field :title_eval, type: :string ## "#{Time.now.strftime('%Y-%m-%d') Daily Tree}" with the quotes
15
+
16
+
17
+
18
+ end
@@ -0,0 +1,17 @@
1
+
2
+ class Wco::Site
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+ store_in collection: 'wco_sites'
6
+
7
+ KIND_DRUPAL = 'drupal'
8
+ KIND_IG = 'instagram'
9
+ KIND_WP = 'wordpress'
10
+ field :kind, type: :string
11
+
12
+ has_many :daily_publishers, class_name: 'Wco::DailyPublisher'
13
+
14
+ field :origin # http://pi.local
15
+ field :post_url # http://pi.local/node?_format=hal_json
16
+
17
+ end
@@ -60,5 +60,5 @@ class WcoEmail::ScheduledEmailAction
60
60
  end
61
61
 
62
62
  end
63
- ::Sch = WcoEmail::ScheduledEmailAction
63
+ Sch = WcoEmail::ScheduledEmailAction
64
64
 
@@ -19,9 +19,8 @@ class WcoHosting::Appliance
19
19
  def host
20
20
  "#{subdomain}.#{domain}"
21
21
  end
22
- def route53_zone
23
- WcoHosting::Domain.find_by( name: domain ).route53_zone
24
- end
22
+
23
+ field :n_retries, type: :integer, default: 3
25
24
 
26
25
  belongs_to :appliance_tmpl, class_name: 'WcoHosting::ApplianceTmpl'
27
26
  def tmpl
@@ -32,8 +32,6 @@ class WcoHosting::Serverhost
32
32
  # puts! app, 'Serverhost#create_appliance'
33
33
 
34
34
  create_subdomain( app )
35
- sleep 5
36
-
37
35
  create_volume( app )
38
36
  add_docker_service( app )
39
37
  add_nginx_site( app )
@@ -93,10 +91,6 @@ class WcoHosting::Serverhost
93
91
  cmd = "ssh #{ssh_host} 'nginx -s reload ' "
94
92
  puts! cmd, 'cmd'
95
93
  `#{cmd}`
96
-
97
- cmd = "ssh #{ssh_host} 'certbot run -d #{app.host} --nginx -n ' "
98
- puts! cmd, 'cmd'
99
- `#{cmd}`
100
94
  end
101
95
 
102
96
  def add_docker_service app
@@ -189,6 +183,7 @@ class WcoHosting::Serverhost
189
183
 
190
184
  puts! cmd, '#do_exec'
191
185
  stdout, stderr, status = Open3.capture3(cmd)
186
+ status = status.to_s.split.last.to_i
192
187
  puts "+++ +++ stdout"
193
188
  puts stdout
194
189
  # @messages.push( stdout )
@@ -196,7 +191,7 @@ class WcoHosting::Serverhost
196
191
  puts stderr
197
192
  # @errors.push( stderr )
198
193
  puts! status, 'status'
199
- # @statuses.push( status.to_s.split.last.to_i )
194
+ # @statuses.push( status )
200
195
  end
201
196
 
202
197
  def done_exec
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.27
4
+ version: 3.1.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - mac_a2141
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-24 00:00:00.000000000 Z
11
+ date: 2023-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -149,13 +149,17 @@ files:
149
149
  - app/assets/stylesheets/ish_models/application.css
150
150
  - app/controllers/ish_models/application_controller.rb
151
151
  - app/helpers/ish_models/application_helper.rb
152
- - app/jobs/ish_models/application_job.rb
152
+ - app/jobs/wco_hosting/certbot_job.rb
153
153
  - app/mailers/ish_models/application_mailer.rb
154
+ - app/models/wco/gallery.rb
154
155
  - app/models/wco/lead.rb
155
156
  - app/models/wco/leadset.rb
156
157
  - app/models/wco/newsitem.rb
157
158
  - app/models/wco/office_action.rb
159
+ - app/models/wco/photo.rb
158
160
  - app/models/wco/profile.rb
161
+ - app/models/wco/publisher.rb
162
+ - app/models/wco/site.rb
159
163
  - app/models/wco/tag.rb
160
164
  - app/models/wco_email/campaign.rb
161
165
  - app/models/wco_email/context.rb
@@ -1,4 +0,0 @@
1
- module IshModels
2
- class ApplicationJob < ActiveJob::Base
3
- end
4
- end