gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.55k stars 822 forks source link

Remote connection to the PreviewServer with docker-compose up kosmtik #3415

Closed d3netxer closed 6 years ago

d3netxer commented 6 years ago

I followed the Quickstart instructions in the Docker Readme file on an Ubuntu 16.04 instance in AWS. The security group rules allow all traffic. After running docker-compose up kosmtik Everything seemed to be in order, here is the end of the output:

kosmtik_1  | Waiting for PostgreSQL to be running
kosmtik_1  | PostgreSQL running
kosmtik_1  |
kosmtik_1  | Starting get-shapefiles.py...
kosmtik_1  | ...script completed.
kosmtik_1  |
kosmtik_1  | [Core] Loading config from .kosmtik-config.yml
kosmtik_1  | [Core] Loading plugin from ../plugins/base-exporters/index.js
kosmtik_1  | [Core] Loading plugin from ../plugins/hash/index.js
kosmtik_1  | [Core] Loading plugin from ../plugins/local-config/index.js
kosmtik_1  | [Core] Loading plugin from ../plugins/datasource-loader/index.js
kosmtik_1  | [Core] Loading plugin from kosmtik-overpass-layer
kosmtik_1  | [Core] Loading plugin from kosmtik-fetch-remote
kosmtik_1  | [Core] Loading plugin from kosmtik-overlay
kosmtik_1  | [Core] Loading plugin from kosmtik-open-in-josm
kosmtik_1  | [Core] Loading plugin from kosmtik-map-compare
kosmtik_1  | [Core] Loading plugin from kosmtik-osm-data-overlay
kosmtik_1  | [Core] Loading plugin from kosmtik-mapnik-reference
kosmtik_1  | [Core] Loading plugin from kosmtik-geojson-overlay
kosmtik_1  | [Core] Loading project from project.mml
kosmtik_1  | [Core] PreviewServer started, you can browse http://0.0.0.0:6789
kosmtik_1  | [Core] Creating metatiles cache dir tmp/openstreetmap-carto/meta
kosmtik_1  | [Core] Deleting previous metatiles tmp/openstreetmap-carto/meta
kosmtik_1  | [Core] Created vector cache dir tmp/openstreetmap-carto/vector
kosmtik_1  | [Local Config] Unable to load local config from /openstreetmap-carto/localconfig.js
kosmtik_1  | [Error: File not found: /openstreetmap-carto/localconfig.js]
kosmtik_1  | [Fetch Remote] Done.
kosmtik_1  | [Core] Generating Mapnik XML…
kosmtik_1  | [Core] Using mapnik version 3.0.20
kosmtik_1  | [Core] Loading map…
kosmtik_1  | [Core] Map ready
kosmtik_1  | [Core] Loading map…
kosmtik_1  | [Core] Map ready

Expected behavior

connect to my server from a distant location (http://MyServerIP:6789), and view the preview server

Actual behavior

I went to the server address (http://MyServerIP:6789), and it displayed "This site can't be reached"

ImreSamu commented 6 years ago

imho: this is a security restiction.

  1. for a good security the SSH tunneling is the best

  2. not recomended / not secure : you can open the port by modifying the port settings in the docker-compose.yml https://github.com/gravitystorm/openstreetmap-carto/blob/master/docker-compose.yml#L13

from

    ports:
      - "127.0.0.1:6789:6789"

to

    ports:
      - "6789:6789"
kocio-pl commented 6 years ago

Thanks for the report, however this is installation specific problem, not a problem with this style, so I will close it now.

SomeoneElseOSM commented 6 years ago

Thanks for the report, however this is installation specific problem, not a problem with this style, so I will close it now.

It's something that really ought to be in the Docker Readme though - I wouldn't assume that everyone following these instructions is aware that this is even an option.

d3netxer commented 6 years ago

Thank you very much @ImreSamu. This worked for me and was very helpful!

kocio-pl commented 6 years ago

You have used different environment, from security point of view it's better to not allow reading this port from another machine.

matthijsmelissen commented 5 years ago

It seems my Docker-based installation somehow stopped working for me :(. I cannot connect to the PreviewServer anymore, even though I'm running Docker on my local machine.

In the output from Docker it shows:

[Core] PreviewServer started, you can browse http://0.0.0.0:6789

Despite this, on http://0.0.0.0:6789 (and http://localhost:6789) I get the message "This site can’t be reached".

I'm using Docker for Mac OS, if it matters.

Does anybody have any idea how I could fix this?

jeisenbe commented 5 years ago

Have you already quit and restarted docker? I occasionally have to do this. On Wed, Feb 13, 2019 at 6:35 AM Matthijs Melissen notifications@github.com wrote:

It seems my Docker-based installation somehow stopped working for me :(. I cannot connect to the PreviewServer anymore, even though I'm running Docker on my local machine.

In the output from Docker it shows:

[Core] PreviewServer started, you can browse http://0.0.0.0:6789

Despite this, on http://0.0.0.0:6789 (and http://localhost:6789) I get the message "This site can’t be reached".

I'm using Docker for Mac OS, if it matters.

Does anybody have any idea how I could fix this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gravitystorm/openstreetmap-carto/issues/3415#issuecomment-462945198, or mute the thread https://github.com/notifications/unsubscribe-auth/AoxshPwpI8xFwRGWpyC8KY7bs7-VMlsEks5vMzO9gaJpZM4W480Y .

matthijsmelissen commented 5 years ago

Have you already quit and restarted docker?

Yes, I have.

jeisenbe commented 5 years ago

Did you also restart the OS?

What browser are you using?

Changing branches didn’t help?

What messages are you getting in terminal? On Wed, Feb 13, 2019 at 7:09 AM Matthijs Melissen notifications@github.com wrote:

Have you already quit and restarted docker?

Yes, I have.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/gravitystorm/openstreetmap-carto/issues/3415#issuecomment-462956597, or mute the thread https://github.com/notifications/unsubscribe-auth/AoxshFWhBdtKK-0plEzphhyL4KpNpUvPks5vMzuSgaJpZM4W480Y .

matthijsmelissen commented 5 years ago

I reset docker now, which solved the problem (Preferences-Reset-Reset to factory defaults).

I had restarted the OS already, and changing branches did not help. No unexpected messages in Terminal. Anyway it's solved now.

jeisenbe commented 5 years ago

Weird! Glad it’s fixed On Wed, Feb 13, 2019 at 8:10 AM Matthijs Melissen notifications@github.com wrote:

I reset docker now, which solved the problem (Preferences-Reset-Reset to factory defaults).

I had restarted the OS already, and changing branches did not help. No unexpected messages in Terminal. Anyway it's solved now.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/gravitystorm/openstreetmap-carto/issues/3415#issuecomment-462977952, or mute the thread https://github.com/notifications/unsubscribe-auth/AoxshOT-EDjDBxRAk_Vm-4EIDWp4A2mWks5vM0nYgaJpZM4W480Y .

HolgerJeromin commented 5 years ago

The ip address 0.0.0.0 is special. Assuming you have a network with 192.168.1.x range. You have a loopback device with 127.0.0.1, too. If a program opens a webserver on the IP address 127.0.0.1 it will be reachable only from the same host. But if a program listen on 0.0.0.0 it will be available from everywhere, but you cannot connect to 0.0.0.0, but the corresponding 127.0.0.1 (localhost) or 192.168.1.42 for example.