wco_models 3.1.0.210 → 3.1.0.212
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 +4 -4
- data/app/assets/stylesheets/wco/main.scss +6 -1
- data/app/controllers/wco/leadsets_controller.rb +1 -1
- data/app/mailers/wco_email/application_mailer.rb +23 -24
- data/app/models/wco_hosting/appliance.rb +2 -2
- data/app/models/wco_hosting/appliance_tmpl.rb +35 -20
- data/app/models/wco_hosting/serverhost.rb +8 -2
- data/app/views/wco_email/application_mailer/test_email.html.erb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54ce9287983a420344ec45522cb35c6e8a44c77778f0c519b4de471250cb8d28
|
4
|
+
data.tar.gz: bc7c4abacc63202c4f5f6982a15571327e4f739cb156e58ad423b084b6dec3ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dda730058477e870a2b8f79879044b4b4a7b9a5473be8b72a504dbacfc656b1faf008273032017d709db31ee6633a311957d6bcfe86287f81062b3e4d1a81b6
|
7
|
+
data.tar.gz: 615c6699f124ad7357680091acbdb79d6a087186acf7641993c506bef60851725a379397a1c1c669604a3d866c62f64919cf4fa368da55384155d818cef67820
|
@@ -46,15 +46,20 @@ table.bordered {
|
|
46
46
|
// border-right: 0;
|
47
47
|
|
48
48
|
|
49
|
-
th
|
49
|
+
th {
|
50
50
|
background: #ddd;
|
51
|
+
border: 1px solid gray;
|
51
52
|
font-weight: bold;
|
53
|
+
padding: 0.5em;
|
52
54
|
}
|
53
55
|
|
54
56
|
td {
|
55
57
|
border: 1px solid gray;
|
56
58
|
border-top: 0;
|
57
59
|
border-left: 0;
|
60
|
+
|
61
|
+
padding: 0.5em;
|
62
|
+
vertical-align: top;
|
58
63
|
}
|
59
64
|
.latest-at {
|
60
65
|
width: 100px;
|
@@ -70,7 +70,7 @@ class Wco::LeadsetsController < Wco::ApplicationController
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def update
|
73
|
-
params[:leadset][:serverhost_ids].delete
|
73
|
+
params[:leadset][:serverhost_ids].present? && params[:leadset][:serverhost_ids].delete('')
|
74
74
|
@leadset = Leadset.find params[:id]
|
75
75
|
authorize! :update, @leadset
|
76
76
|
if @leadset.update_attributes params[:leadset].permit!
|
@@ -14,17 +14,6 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
|
|
14
14
|
subject: "POX::#{@msg.subject}" )
|
15
15
|
end
|
16
16
|
|
17
|
-
def shared_galleries profiles, gallery
|
18
|
-
return if profiles.count == 0
|
19
|
-
@gallery = gallery
|
20
|
-
@domain = Rails.application.config.action_mailer.default_url_options[:host]
|
21
|
-
@galleries_path = IshManager::Engine.routes.url_helpers.galleries_path
|
22
|
-
@gallery_path = IshManager::Engine.routes.url_helpers.gallery_path(@gallery.slug)
|
23
|
-
mail( :to => '314658@gmail.com',
|
24
|
-
:bcc => profiles.map { |p| p.email },
|
25
|
-
:subject => 'You got new shared galleries on pi manager' )
|
26
|
-
end
|
27
|
-
|
28
17
|
def option_alert option
|
29
18
|
@option = option
|
30
19
|
mail({
|
@@ -33,19 +22,6 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
|
|
33
22
|
})
|
34
23
|
end
|
35
24
|
|
36
|
-
def stock_alert watch_id
|
37
|
-
@watch = Iro::OptionWatch.find watch_id
|
38
|
-
mail({
|
39
|
-
to: @watch.profile.email,
|
40
|
-
subject: "Iro Watch Alert :: #{@watch.ticker} is #{@watch.direction} #{@watch.mark}."
|
41
|
-
})
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_email
|
45
|
-
mail( to: DEFAULT_RECIPIENT, subject: "Test email at #{Time.now}" )
|
46
|
-
end
|
47
|
-
|
48
|
-
|
49
25
|
def send_context_email ctx_id
|
50
26
|
@ctx = Ctx.find ctx_id
|
51
27
|
@renderer = self.class.renderer ctx: @ctx
|
@@ -85,6 +61,29 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
|
|
85
61
|
content_type: "text/html" )
|
86
62
|
end
|
87
63
|
|
64
|
+
def shared_galleries profiles, gallery
|
65
|
+
return if profiles.count == 0
|
66
|
+
@gallery = gallery
|
67
|
+
@domain = Rails.application.config.action_mailer.default_url_options[:host]
|
68
|
+
@galleries_path = IshManager::Engine.routes.url_helpers.galleries_path
|
69
|
+
@gallery_path = IshManager::Engine.routes.url_helpers.gallery_path(@gallery.slug)
|
70
|
+
mail( :to => '314658@gmail.com',
|
71
|
+
:bcc => profiles.map { |p| p.email },
|
72
|
+
:subject => 'You got new shared galleries on pi manager' )
|
73
|
+
end
|
74
|
+
|
75
|
+
def stock_alert watch_id
|
76
|
+
@watch = Iro::OptionWatch.find watch_id
|
77
|
+
mail({
|
78
|
+
to: @watch.profile.email,
|
79
|
+
subject: "Iro Watch Alert :: #{@watch.ticker} is #{@watch.direction} #{@watch.mark}."
|
80
|
+
})
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_email
|
84
|
+
mail( to: DEFAULT_RECIPIENT, subject: "Test email at #{Time.now}" )
|
85
|
+
end
|
86
|
+
|
88
87
|
|
89
88
|
def self.renderer ctx:
|
90
89
|
out = self.new
|
@@ -41,11 +41,11 @@ class WcoHosting::Appliance
|
|
41
41
|
def tmpl
|
42
42
|
appliance_tmpl
|
43
43
|
end
|
44
|
-
delegate :kind,
|
44
|
+
delegate :kind, to: :appliance_tmpl
|
45
|
+
delegate :playbook_name, to: :appliance_tmpl
|
45
46
|
|
46
47
|
belongs_to :serverhost, class_name: 'WcoHosting::Serverhost', optional: true
|
47
48
|
|
48
|
-
|
49
49
|
STATE_PENDING = 'pending'
|
50
50
|
STATE_LIVE = 'live'
|
51
51
|
STATE_TERMINATED = 'terminated'
|
@@ -7,6 +7,27 @@ class WcoHosting::ApplianceTmpl
|
|
7
7
|
include Wco::Utils
|
8
8
|
store_in collection: 'wco_appliance_tmpls'
|
9
9
|
|
10
|
+
## 2023-12-08 :: These names are impossible to change already.
|
11
|
+
KIND_CRM = 'crm' # trash
|
12
|
+
KIND_DRUPAL = 'drupal' # drupal
|
13
|
+
KIND_HELLOWORLD = 'helloworld' # static
|
14
|
+
KIND_IROWOR = 'irowor' # ror
|
15
|
+
KIND_JENKINS = 'jenkins' # jenkins
|
16
|
+
KIND_MATOMO = 'matomo' # docker
|
17
|
+
KIND_MOODLE = 'moodle' # docker
|
18
|
+
KIND_PRESTASHOP = 'prestashop' # docker
|
19
|
+
KIND_REACT = 'react' # static
|
20
|
+
KIND_SMT = 'smt' # ror
|
21
|
+
KIND_WORDPRESS = 'wordpress' # docker
|
22
|
+
KIND_TRASH = 'trash' # trash
|
23
|
+
KIND_TMP = 'tmp' # static
|
24
|
+
|
25
|
+
KINDS = [ nil, KIND_CRM, KIND_DRUPAL, KIND_HELLOWORLD, KIND_IROWOR,
|
26
|
+
KIND_JENKINS, KIND_MATOMO, KIND_MOODLE, KIND_PRESTASHOP,
|
27
|
+
KIND_REACT,
|
28
|
+
KIND_SMT,
|
29
|
+
KIND_WORDPRESS, KIND_TRASH, KIND_TMP ]
|
30
|
+
|
10
31
|
field :kind, type: :string
|
11
32
|
validates :kind, uniqueness: { scope: :version }, presence: true
|
12
33
|
|
@@ -17,6 +38,20 @@ class WcoHosting::ApplianceTmpl
|
|
17
38
|
def name
|
18
39
|
"#{kind} #{version}"
|
19
40
|
end
|
41
|
+
|
42
|
+
def playbook_name
|
43
|
+
case kind
|
44
|
+
when KIND_SMT
|
45
|
+
return 'hosted-packagedapp'
|
46
|
+
when KIND_DRUPAL
|
47
|
+
return 'hosted-drupal'
|
48
|
+
when KIND_HELLOWORLD
|
49
|
+
return 'hosted-static'
|
50
|
+
else
|
51
|
+
throw '0ip - not implemented'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
20
55
|
field :descr, type: :string
|
21
56
|
|
22
57
|
field :ecs_task_definition_erb, type: :string
|
@@ -48,26 +83,6 @@ class WcoHosting::ApplianceTmpl
|
|
48
83
|
end
|
49
84
|
end
|
50
85
|
|
51
|
-
## 2023-12-08 :: These names are impossible to change already.
|
52
|
-
KIND_CRM = 'crm'
|
53
|
-
KIND_DRUPAL = 'drupal'
|
54
|
-
KIND_HELLOWORLD = 'helloworld'
|
55
|
-
KIND_IROWOR = 'irowor'
|
56
|
-
KIND_JENKINS = 'jenkins'
|
57
|
-
KIND_MATOMO = 'matomo'
|
58
|
-
KIND_MOODLE = 'moodle'
|
59
|
-
KIND_PRESTASHOP = 'prestashop'
|
60
|
-
KIND_REACT = 'react'
|
61
|
-
KIND_SMT = 'smt'
|
62
|
-
KIND_WORDPRESS = 'wordpress'
|
63
|
-
KIND_TRASH = 'trash'
|
64
|
-
KIND_TMP = 'tmp'
|
65
|
-
|
66
|
-
KINDS = [ nil, KIND_CRM, KIND_DRUPAL, KIND_HELLOWORLD, KIND_IROWOR,
|
67
|
-
KIND_JENKINS, KIND_MATOMO, KIND_MOODLE, KIND_PRESTASHOP,
|
68
|
-
KIND_REACT,
|
69
|
-
KIND_SMT,
|
70
|
-
KIND_WORDPRESS, KIND_TRASH, KIND_TMP ]
|
71
86
|
|
72
87
|
|
73
88
|
|
@@ -44,12 +44,18 @@ class WcoHosting::Serverhost
|
|
44
44
|
# all.map { |s| [s.name, s.id] }
|
45
45
|
end
|
46
46
|
|
47
|
+
##
|
48
|
+
## @TODO: this can be very different, depending on kindset.
|
49
|
+
##
|
47
50
|
def add_docker_service app
|
48
51
|
@obj = app
|
49
52
|
cmd =<<~AOL
|
50
53
|
cd #{ANSIBLE_ROOT}
|
51
54
|
. zenv/bin/activate
|
52
|
-
ansible-playbook -i inventory/do.yml --limit #{self.name} playbooks
|
55
|
+
ansible-playbook -i inventory/do.yml --limit #{self.name} playbooks/#{app.playbook_name}.yml --extra-vars '{
|
56
|
+
"appliance_slug": "#{app.slug}",
|
57
|
+
"codebase_zip": "#{app.tmpl.volume_zip_url}",
|
58
|
+
"app_port": "#{app.port}"}'
|
53
59
|
AOL
|
54
60
|
do_exec cmd
|
55
61
|
end
|
@@ -78,7 +84,7 @@ class WcoHosting::Serverhost
|
|
78
84
|
def create_subdomain app
|
79
85
|
@obj = app
|
80
86
|
Wco::Log.puts! @obj, 'Creating subdomain...', obj: @obj
|
81
|
-
client = DropletKit::Client.new(access_token: DO_DOMAIN_TOKEN)
|
87
|
+
client = DropletKit::Client.new(access_token: ::DO_DOMAIN_TOKEN)
|
82
88
|
record = DropletKit::DomainRecord.new(
|
83
89
|
type: 'A',
|
84
90
|
name: app.subdomain,
|
@@ -0,0 +1 @@
|
|
1
|
+
<p>This is a test email.</p>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wco_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.0.
|
4
|
+
version: 3.1.0.212
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ahoy_matey
|
@@ -686,6 +686,7 @@ files:
|
|
686
686
|
- app/views/wco_email/application_mailer/_footer_unsubscribe.html.erb
|
687
687
|
- app/views/wco_email/application_mailer/_header_logo.html.erb
|
688
688
|
- app/views/wco_email/application_mailer/forwarder_notify.html.erb
|
689
|
+
- app/views/wco_email/application_mailer/test_email.html.erb
|
689
690
|
- app/views/wco_email/contexts/_form_reply_mini.haml
|
690
691
|
- app/views/wco_email/conversations/_table.haml
|
691
692
|
- app/views/wco_email/email_layouts/_m20221201react.html.erb
|