linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Enable docker-compose to run on MacOS displays. #110

Closed billgeo closed 4 years ago

billgeo commented 4 years ago

Fixes: #107

Change Description:

Enable docker-compose to run on MacOS displays. Removed unix socket identifier which is not supported on MacOS. Seems to still work on Ubuntu fine, maybe because unix socket is the default?

Notes for Testing:

Tested on: MacOS 10.15.4 (with XQuartz 2.7.11 (xorg-server 1.18.4)) Ubuntu 18.04

Source Code Documentation Tasks:

User Documentation Tasks:

Testing Tasks:

Pull Request Management:

palmerj commented 4 years ago

Do you still need to run xhost manually before running the make command?

billgeo commented 4 years ago

Do you still need to run xhost manually before running the make command?

No don't seem to need to. I followed steps 1-5 here and then ran the make command. https://gist.github.com/billgeo/e279312c8dc75b2555d007177bd06d0d

palmerj commented 4 years ago

Actually I see you have xhost + in the command. This is generally bad practise as it will completely disable access control, and clients can connect from any host. You should definitely limit that to the localhost. You should run somthing like xhost + 127.0.0.1 before running docker to allow access from the localhost only, and after finishing with docker run xhost - 127.0.0.1 to disable localhost access.

billgeo commented 4 years ago

Maybe @SPlanzer can comment on that. Was there a reason xhost + was there?

strk commented 4 years ago

Your patch works for me. The xhost + line was mine, simplified things at that time. I agree it's not good practice to open display connection so open. The need is for the IP of the docker container to connect to the X server on the host computer, or you get:

Warning: QXcbConnection: Could not connect to display :0 Critical: Could not connect to any X display.

Note that 127.0.0.1 will NOT work, but rather you need the IP of the running container (better deal with this issue in a seperate PR, for this one about Display it works for me)

billgeo commented 4 years ago

Thanks @strk.

Note that 127.0.0.1 will NOT work, but you need the IP of the running container. (better deal with this issue in a seperate PR, for this one about Display it works for me)

Agreed. I had a quick look and there doesn't seem t be a cross-platform way to get container/host local IP.

SPlanzer commented 4 years ago

I would normally rely on CI for a change like this.

Should CI be now testing against the mac OS?

billgeo commented 4 years ago

Should CI be now testing against the mac OS?

I don't think we need that. Although willing to have my mind changed. Would be a separate PR anyway.

Useful to support development from Mac though, which is what I was using the make targets for (I assume that's appropriate?).