ISSUE / docker speckle server deployment

Hi Dimitrie,

Maybe you remember me. Julian, friend of Pauls. We went for lunch at some point in Barcelona and had a BBQ on your balcony i guess. :wink: Dont remember exactly. I am working for Herzog & DeMeuron (Design Technologies) now. I am trying to set up a speckle server internally here to play around with it and figure out if its of good use for us here. Seems very cool, especially when its starting to work with Revit. Thank you for making that possible. Its amazing work. But my question is related to the server setup:

<server url> is setup (docker-compose 1.9.7).
apache virtual host setup.

What works on the client side: Registering, Signing up, Streaming and Receiving from Rhino.

What doesnt work on the client side: Streaming Objects from Revit (Stream shown but nothing inside, seems to be expired?). Console shows this:

So there is a little server problem. I guess it has something to do with the ssl and letsencrypt thingy but my knowledge is a bit limited.

Visible server problem: No Frontend page shown:
When entering <server url> i am getting this back from the server:

It is working when i use https://app.speckle.systems to connect.

Still there is no data for my Revit streams and I would like to make the frontend happen without this workaround.It would be amazing if you have an idea for that or any hint that will give me a good direction to fix the problem or talk about it with the IT department.

Here is the response when i start up docker-compose (if thats of any interest):

Ok, sorry to start with such a big message but I would love to get it to work here. Paul already offered a little intro to the frontend and how to work with it as soon as we are up and running. Looking forward to be able to use it.

Hope you get a picture of the problem. If not, or you need some more info, let me know.

Have a nice evening. And lets have some beers in London soon.
Best,
Julian

2020-01-13%2019_20_23-Speckle%20-%20OneNote

Hello @julian! welcome around these parts, glad to see you here. The Barcelona balcony actually belongs to Mr. Bob McNeel, so kudos to him and @luis for those good times!

I’ll unpack a few things, step by step:

Chapter 1: SSL (https): if you have nginx proxying the requests to your server (from web → localhost:3000, or whatever port docker was exposing there), then getting it set up is quite a breeze. I always refer to this guide.

Chapter 2: Websockets not working is a common problem, and it’s part of setting up nginx (or your proxy server) to correctly handle this. Had some fun just last week with @mswaidan on this one :smiley:

Here’s my current server block file:

server {
	# SSL configuration
	listen 443 ssl http2;
	listen [::]:443 ssl http2;

	root /root/apps/SpeckleHestia/static;

	server_name hestia.speckle.works;

	gzip on;
	gzip_proxied any;
	gzip_types text/plain text/xml text/css application/x-javascript application/json;
	gzip_vary on;
	gzip_disable "MSIE [1-6]\.(?!.*SV1)";

	location ~ /.well-known {
        	allow all;
    	}

	location / {
		#allow for longer requests (5 minutes)
		proxy_read_timeout 300s;
		#http trafic
		proxy_pass http://localhost:3030;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header Host $host;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

		#ws support
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
	}


    ssl_certificate /etc/letsencrypt/live/hestia.speckle.works/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/hestia.speckle.works/privkey.pem; # managed by Certbot
}

The important part for websockets is under the #ws support comment.

Chapter 3: Frontend For the frontend, using app.speckle.etc is actually the easiest way to go now. If you want to deploy it yourself, with docker it’s a bit of a problem, which involves executing a set of commands inside the container itself; this will be lost when upgrading. I keep on meaning to write a proper docker-compose-up script that includes the admin but i keep not finding the time for it.

If you don’t deploy with docker, it’s rather easy… once you’ve cloned the speckle server repo, you:

  • cd speckle server folder/plugins
  • git clone speckleadmin.git (use the correct url!)
  • cd speckle server folder/plugins/speckleadmin/
  • npm install
  • npm run build
  • restart the server, and you’re good to go!

Chapter 4: No data from revit streams - that’s a separate issue; does it work with hestia though? we’ll pick it up from there.

Hi dimitrie,

Yeah. Thanks to Bob of course! And Luis. Of course he was involved there as well. The whole McNeel crew. Haha.

Thanks for this complete answer. SSL seems to work. I think I will try to figure this websocket handshake out. Have to do it with apache. Will keep you updated if I can make it work.

Good to know that the frontend thingy can not really work yet. But step by step, that’s the next thing.

I will keep you updated.

Thanks man,
Best,
Julian

Here’s what I quickly googled: https://www.happyassassin.net/2018/11/23/reverse-proxying-websockets-with-apache-a-generic-approach-that-works-even-with-firefox/

No worries, and i forgot, it’s a bit busy here, but we can/should do some beers!

PS: the ws endpoint is prefixed by wss, not https.

Update: In the end I wasn’t able to solve the handshake but the functionality in Revit somehow worked (receiving and sending) and I was able to run some tests. Thank you for your help!

For the record:
I added the following in the apache config:

    	RewriteEngine on
	RewriteCond %{HTTP:Upgrade} websocket [NC]
	RewriteCond %{HTTP:Connection} upgrade [NC]
	RewriteRule .* "wss://localhost:3000%{REQUEST_URI}" [P]

    	ProxyPreserveHost       On
    	ProxyRequests           On
    	ProxyPass               /               http://localhost:3000/
    	ProxyPassReverse        /               http://localhost:3000/

This resulted in the following error:

1 Like