-
Notifications
You must be signed in to change notification settings - Fork 900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websocket proxy worker for HTM5 consoles #7078
Conversation
0b2020e
to
ca3c515
Compare
ca3c515
to
ec5dd27
Compare
If this is going to take a while to merge, Do you want to pull out the change in API that supports passing the protocol? (but we'd just pass |
f3347d3
to
a7a2d17
Compare
ff48981
to
85d7778
Compare
@@ -0,0 +1,5 @@ | |||
class AddOpenedToConsoles < ActiveRecord::Migration[5.0] | |||
def change | |||
add_column :consoles, :opened, :boolean, :default => false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid default database values...prefer default_value_for
in the model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fryguy fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this has never been merged, can you just collapse the two migrations together, to reduce the migration churn?
a9c112f
to
27680ac
Compare
@@ -0,0 +1,16 @@ | |||
class Console < ApplicationRecord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I like this class name as it can be confused with the Rails::Console. Not sure what a better name might be, though...RemoteConsole?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SystemConsole
or ComputerSystemConsole
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SystemConsole
sounds good to me
76aa935
to
d21f697
Compare
d21f697
to
ebbf3ea
Compare
905ae81
to
957d2eb
Compare
Pairing = Struct.new(:is_ws, :proxy) | ||
|
||
def initialize | ||
@pairing = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a concurrent hash for @pairing
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kbrock nope, the read is guarded by the critical section of @sockets
This is a bit big for me to wrap my head around, but it looks good. |
if (!host || !port || !password) { | ||
spice_error(__("must set host, port and password")); | ||
var secret = "#{@secret}"; | ||
var url = "#{@url}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two probably need to be escaped...
957d2eb
to
5aec6be
Compare
<github_pr_commenter_batch />Some comments on commits skateman/manageiq@5ee925a~...5aec6be |
Checked commits skateman/manageiq@5ee925a~...5aec6be with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1 app/controllers/api_controller/vms.rb
app/controllers/vm_common.rb
app/models/manageiq/providers/redhat/infra_manager/vm/remote_console.rb
app/models/manageiq/providers/vmware/infra_manager/vm/remote_console.rb
app/models/miq_server/role_management.rb
app/models/miq_ui_worker.rb
app/models/miq_web_service_worker.rb
app/models/miq_websocket_worker.rb
app/models/mixins/miq_web_server_worker_mixin.rb
gems/pending/spec/util/miq_apache/conf_spec.rb
gems/pending/util/miq_apache/miq_apache.rb
lib/websocket_proxy.rb
lib/websocket_server.rb
|
We should revisit how the API is defined and if it should remain as it is now. But that can be done in a separate PR. |
yay! |
context.cert = OpenSSL::X509::Certificate.new(File.open('certs/server.cer')) | ||
context.key = OpenSSL::PKey::RSA.new(File.open('certs/server.cer.key')) | ||
context.ssl_version = :SSLv23 | ||
context.verify_depth = OpenSSL::SSL::VERIFY_NONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skateman accidentally came across this line, I think it's assigning apples to oranges. perhaps you meant:
context.verify_mode = OpenSSL::SSL::VERIFY_NONE
verify_depth
is an integer, limits length of chain: https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_verify_depth.html
VERIFY_NONE
is conceptually an enum, one of the valid values for verify_mode
. It happens to be the integer 0. But verify_depth = 0
doesn't even mean "always accept" nor "never accept", because the root trust anchor and the validated cert don't count towards the depth; AFAICT it means the arbitrary "verify but reject if there are any intermediate certs in the chain"...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I thought you were going to say "Let's please avoid VERIFY_NONE
.
Parent issue: #2451
List of changes:
RACK_APPLICATION
with a web workerWebsocketWorker
running a dummy rack application on port 5000PROTOCOL
option into theMiqApache::Conf
class for loadbalancing websocket workersMiqApache
modulewebsocket-driver
gem