diff --git a/app/assets/javascripts/editor_edit.js b/app/assets/javascripts/editor_edit.js.erb similarity index 89% rename from app/assets/javascripts/editor_edit.js rename to app/assets/javascripts/editor_edit.js.erb index b1251cf9..fa3d40fc 100644 --- a/app/assets/javascripts/editor_edit.js +++ b/app/assets/javascripts/editor_edit.js.erb @@ -1,5 +1,6 @@ $(function() { - var ACE_FILES_PATH = '/assets/ace/'; + // ruby part adds the relative_url_root, if it is set. + var ACE_FILES_PATH = '<%= (defined? config.relative_url_root) && config.relative_url_root != nil && config.relative_url_root != "" ? config.relative_url_root : "" %>' + '/assets/ace/'; var THEME = 'ace/theme/textmate'; var configureEditors = function() { diff --git a/codeocean-dockerconfig.md b/codeocean-dockerconfig.md new file mode 100644 index 00000000..4facaee4 --- /dev/null +++ b/codeocean-dockerconfig.md @@ -0,0 +1,9 @@ +In order to make containers accessible for codeocean, they need to be reachable via tcp. +For this, the docker daemon has to be started with the following options: + +DOCKER_OPTS='-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --iptables=false' + +This binds the daemon to the specified socket (for access via the command line on the machine) as well as the specified tcp url. +Either pass these options to the starting call, or specify them in the docker config file. + +In Ubuntu, this file is located under: /ect/default/docker \ No newline at end of file diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 1cb098cb..5dfdae13 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -23,7 +23,7 @@ Rails.application.configure do config.serve_static_assets = false # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier + # config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. diff --git a/lib/docker_client.rb b/lib/docker_client.rb index 6bcf7392..7fe02d02 100644 --- a/lib/docker_client.rb +++ b/lib/docker_client.rb @@ -72,7 +72,10 @@ class DockerClient # Headers are required by Docker headers = {'Origin' => 'http://localhost'} - socket = Faye::WebSocket::Client.new(DockerClient.config['ws_host'] + '/containers/' + @container.id + '/attach/ws?' + query_params, [], :headers => headers) + socket_url = DockerClient.config['ws_host'] + '/containers/' + @container.id + '/attach/ws?' + query_params + socket = Faye::WebSocket::Client.new(socket_url, [], :headers => headers) + + Rails.logger.debug "Opening Websocket on URL " + socket_url socket.on :error do |event| Rails.logger.info "Websocket error: " + event.message