diff --git a/.gitignore b/.gitignore index 1014ade9..e4531d40 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ images/data/ data/ images/.env images/tiler.yml -values.dev.yaml \ No newline at end of file +values.dev.yaml +secrets +tegola \ No newline at end of file diff --git a/compose/tiler.yml b/compose/tiler.yml new file mode 100644 index 00000000..054efd6b --- /dev/null +++ b/compose/tiler.yml @@ -0,0 +1,15 @@ +version: '3.8' +services: + tiler: + image: ohm-tiler-server:v1 + build: + context: ../images/tiler-server + dockerfile: Dockerfile + volumes: + - ../data/tiler-server-data:/mnt/data + - ../images/tiler-server:/app + ports: + - "9090:9090" + env_file: + - ../envs/.env.tiler.example + restart: always diff --git a/images/docker-compose.yml b/compose/web.yml similarity index 69% rename from images/docker-compose.yml rename to compose/web.yml index c9e1645f..ad5c56a3 100644 --- a/images/docker-compose.yml +++ b/compose/web.yml @@ -1,26 +1,26 @@ -version: '3.4' +version: '3.8' services: db: platform: linux/amd64 image: osmseed-db:v1 build: - context: ../images/db + context: ./../images/db dockerfile: Dockerfile ports: - '5432:5432' volumes: - ./data/db-data:/var/lib/postgresql/data env_file: - - ./.env.example + - ./.env.web.example web: image: osmseed-web:v1 build: - context: ./web + context: ./../images/web dockerfile: Dockerfile ports: - '80:80' env_file: - - ./.env.example + - ./.env.web.example ####### Enable for development mode # volumes: - # - ./../../ohm-website:/var/www \ No newline at end of file + # - ./../../ohm-website:/var/www diff --git a/envs/.env.tiler.example b/envs/.env.tiler.example new file mode 100644 index 00000000..83a37062 --- /dev/null +++ b/envs/.env.tiler.example @@ -0,0 +1,23 @@ +####################################### +# Environment variables for tiler database +####################################### +POSTGRES_HOST=host.docker.internal +POSTGRES_DB=tiler-osm +POSTGRES_USER=postgres +POSTGRES_PASSWORD=1234 +POSTGRES_PORT=5432 +POSTGRES_DB_MAX_CONNECTIONS=200 + +# ####################################### +# tiler-serve env variables, +# ####################################### +TILER_SERVER_PORT=9090 +TILER_CACHE_BASEPATH=/mnt/data +TILER_CACHE_MAX_ZOOM=22 +TILER_CACHE_TYPE=file +TILER_CACHE_TYPE=file +TILER_CACHE_BUCKET=osmseed-staging +TILER_CACHE_BASEPATH=tegola +TILER_CACHE_REGION=us-east-1 +TILER_CACHE_AWS_ACCESS_KEY_ID=... +TILER_CACHE_AWS_SECRET_ACCESS_KEY=... diff --git a/envs/.env.web.example b/envs/.env.web.example new file mode 100644 index 00000000..7b1f3126 --- /dev/null +++ b/envs/.env.web.example @@ -0,0 +1,7 @@ +POSTGRES_DB=openstreetmap +POSTGRES_PASSWORD=abcd +POSTGRES_USER=postgres +POSTGRES_PORT=5432 +POSTGRES_HOST=host.docker.internal +SERVER_URL=localhost +SERVER_PROTOCOL=http \ No newline at end of file diff --git a/images/tiler-server/Dockerfile b/images/tiler-server/Dockerfile index 0f1f7dd4..d0479d79 100644 --- a/images/tiler-server/Dockerfile +++ b/images/tiler-server/Dockerfile @@ -1,48 +1,29 @@ -FROM golang:1.14.1-alpine3.11 AS build -ENV VERSION="v0.8.1" -RUN apk update +FROM gospatial/tegola:v0.19.0 -RUN apk add musl-dev=1.1.24-r3 \ - gcc=9.3.0-r0 \ - bash \ - git \ - postgresql \ - postgresql-contrib - -RUN mkdir -p /go/src/github.com/go-spatial/tegola -RUN git clone https://github.com/go-spatial/tegola.git /go/src/github.com/go-spatial/tegola -RUN cd /go/src/github.com/go-spatial/tegola && git checkout v0.13.0 -RUN cd /go/src/github.com/go-spatial/tegola/cmd/tegola \ - && go build -gcflags "-N -l" -o /opt/tegola \ - && chmod a+x /opt/tegola -RUN ln -s /opt/tegola /usr/bin/tegola - -RUN apk add --update \ - python \ - py-pip \ - py-cffi \ - py-cryptography \ - && pip install --upgrade pip \ - && apk add --virtual build-deps \ +RUN apk --no-cache add \ gcc \ libffi-dev \ - python-dev \ + python3 \ + py3-pip \ + py3-cffi \ + py3-cryptography \ linux-headers \ musl-dev \ - openssl-dev + openssl-dev \ + bash \ + git \ + postgresql-client \ + coreutils \ + jq -# Install aws-cli -RUN pip3 install awscli +RUN pip install --upgrade pip && pip3 install awscli mercantile -RUN pip3 install mercantile \ - && apk del build-deps \ - && rm -rf /var/cache/apk/* \ - && apk --purge -v del py-pip +# Cleanup to reduce image size +RUN rm -rf /var/cache/apk/* \ + && apk del py3-pip -RUN apk add --update coreutils jq && rm -rf /var/cache/apk/* +RUN ln -s /opt/tegola /usr/bin/tegola -# Volumen -VOLUME /mnt/data # Copy config and exec files COPY ./config/config.toml /opt/tegola_config/config.toml COPY ./tile2bounds.py . @@ -52,4 +33,5 @@ COPY ./seed-by-diffs.sh . COPY ./tile_cache_downloader.sh . COPY ./cache_cleaner.sh . COPY ./rm_tegola_ps.sh . -# CMD ./start.sh & ./tile_cache_downloader.sh & ./expire-watcher.sh +ENTRYPOINT ["/bin/bash", "-c"] +CMD ./start.sh & ./tile_cache_downloader.sh & ./expire-watcher.sh \ No newline at end of file diff --git a/images/tiler-server/config/config.toml b/images/tiler-server/config/config.toml index 4ab1d712..af103e03 100644 --- a/images/tiler-server/config/config.toml +++ b/images/tiler-server/config/config.toml @@ -30,15 +30,57 @@ user = "${POSTGRES_USER}" password = "${POSTGRES_PASSWORD}" # srid = 3857 max_connections = 40 + # Land + [[providers.layers]] + name = "land_0-2" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_3-5" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 200),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_6-7" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 70),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_8-9" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 30),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" [[providers.layers]] - name = "land_0-20" + name = "land_10-12" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(wkb_geometry,!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 10),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" - # #Water + [[providers.layers]] + name = "land_13-15" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 5),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_16-20" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + # Water [[providers.layers]] name = "water_areas" geometry_fieldname = "geometry" @@ -88,47 +130,55 @@ max_connections = 40 id_fieldname = "osm_id" sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, ABS(osm_id) as osm_id, name, type, tags->'bridge' as bridge, tags->'surface' as surface, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_lines_gen1 WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') AND geometry && !BBOX!" + # Admin boundaries [[providers.layers]] name = "admin_boundaries_0-2" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2) AND geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(geometry, 500),!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2) AND geometry && !BBOX!" [[providers.layers]] name = "admin_boundaries_3-5" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4) AND geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(geometry, 200),!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4) AND geometry && !BBOX!" [[providers.layers]] name = "admin_boundaries_6-7" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6) AND geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(geometry, 100),!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6) AND geometry && !BBOX!" [[providers.layers]] name = "admin_boundaries_8-9" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8) AND geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(geometry, 50),!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9) AND geometry && !BBOX!" [[providers.layers]] - name = "admin_boundaries_9-10" + name = "admin_boundaries_10-12" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9) AND geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(geometry, 20),!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) AND geometry && !BBOX!" [[providers.layers]] - name = "admin_boundaries_11-20" + name = "admin_boundaries_13-15" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) AND geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(geometry, 5),!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) AND geometry && !BBOX!" + + [[providers.layers]] + name = "admin_boundaries_16-20" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(geometry, 1),!BBOX!) AS geometry, id, osm_id, admin_level, name, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) AND geometry && !BBOX!" # Land Use [[providers.layers]] @@ -195,14 +245,14 @@ max_connections = 40 geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, ABS(osm_id) as osm_id, type, tunnel, bridge, ref, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_transport_lines_gen0 WHERE type IN ('motorway','trunk','motorway_link','trunk_link','primary') AND tunnel = 0 AND bridge = 0 AND geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, ABS(osm_id) as osm_id, type, tunnel, bridge, ref, tags->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_transport_lines_gen0 WHERE type IN ('motorway','trunk','motorway_link','trunk_link','primary') AND tunnel = 0 AND bridge = 0 AND geometry && !BBOX!" [[providers.layers]] name = "transport_lines_gen1" geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" - sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, osm_id, ref, class, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate + sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, osm_id, ref, class, type, tags->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_transport_lines_gen1 WHERE type IN ('motorway', 'trunk', 'primary', 'primary_link', 'secondary', 'motorway_link', 'trunk_link', 'rail', 'subway', 'light_rail', 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', 'funicular', 'taxiway', 'runway', 'proposed', 'construction', 'disused', 'abandoned', 'razed', 'ferry') AND geometry && !BBOX!""" @@ -212,7 +262,7 @@ max_connections = 40 geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" - sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service, ford, tags->'construction' as construction, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate + sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service, ford, tags->'construction' as construction, tags->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_transport_lines WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', 'funicular', 'taxiway', 'runway', 'proposed', 'construction', 'disused', 'abandoned', 'razed', 'apron', 'ferry') AND geometry && !BBOX!""" @@ -222,7 +272,7 @@ max_connections = 40 geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "id" - sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, name, ref, class, type, tunnel, bridge, access, service, ford, tags->'construction' as construction, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate + sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, name, ref, class, type, tunnel, bridge, access, service, ford, tags->'construction' as construction, tags->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_transport_lines WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', 'funicular', 'taxiway', 'runway', 'residential', 'taxiway', 'runway', 'proposed', 'construction', 'disused', 'abandoned', 'razed', 'apron', 'ferry') AND geometry && !BBOX!""" @@ -232,7 +282,7 @@ max_connections = 40 geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "id" - sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, name, ref, class, type, tunnel, bridge, access, service, ford, tags->'construction' as construction, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate + sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, name, ref, class, type, tunnel, bridge, access, service, ford, tags->'construction' as construction, tags->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_transport_lines WHERE geometry && !BBOX!""" @@ -315,12 +365,58 @@ name = "osm" attribution = "OpenStreetMap" # map attribution center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part of the TileJSON spec + # Zoom levels 0-2,Tolerance=500 => ~1000 meters + # Zoom levels 3-5,Tolerance=200=> ~500 meters + # Zoom levels 6-7,Tolerance=100=> ~200 meters + # Zoom levels 8-9,Tolerance=50=> ~100 meters + # Zoom levels 10-12,Tolerance=20=> ~50 meters + # Zoom levels 13-15,Tolerance=5=> ~20 meters + # Zoom levels 16-20,Tolerance=1=> ~5 meters + + # Land [[maps.layers]] name = "land" - provider_layer = "osm.land_0-20" + provider_layer = "osm.land_0-2" min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_6-7" + min_zoom = 6 + max_zoom = 7 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_8-9" + min_zoom = 8 + max_zoom = 9 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_10-12" + min_zoom = 10 + max_zoom = 12 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_13-15" + min_zoom = 13 + max_zoom = 15 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_16-20" + min_zoom = 16 max_zoom = 20 + # Admin boundaries [[maps.layers]] name = "land_ohm" provider_layer = "osm.admin_boundaries_0-2" @@ -347,14 +443,20 @@ center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part [[maps.layers]] name = "land_ohm" - provider_layer = "osm.admin_boundaries_9-10" - min_zoom = 9 - max_zoom = 10 + provider_layer = "osm.admin_boundaries_10-12" + min_zoom = 10 + max_zoom = 12 [[maps.layers]] name = "land_ohm" - provider_layer = "osm.admin_boundaries_11-20" - min_zoom = 11 + provider_layer = "osm.admin_boundaries_13-15" + min_zoom = 13 + max_zoom = 15 + + [[maps.layers]] + name = "land_ohm" + provider_layer = "osm.admin_boundaries_16-20" + min_zoom = 16 max_zoom = 20 # [[maps.layers]] @@ -567,4 +669,5 @@ center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part name = "transport_associated_streets" provider_layer = "osm.transport_associated_streets" min_zoom = 7 - max_zoom = 20 \ No newline at end of file + max_zoom = 20 + \ No newline at end of file diff --git a/images/web/Dockerfile b/images/web/Dockerfile index ec85bdf1..a6477c71 100644 --- a/images/web/Dockerfile +++ b/images/web/Dockerfile @@ -48,13 +48,13 @@ RUN npm install -g svgo # Install openstreetmap-website RUN rm -rf $workdir/html -ENV OPENHISTORICALMAP_WEBSITE_GITSHA=4ce9b914ba7277593fe86bc35f3f5851430fd39b +ENV OPENHISTORICALMAP_WEBSITE_GITSHA=2af1cb7b4257ac0ec1ba63a050d9161d8d9698e3 RUN git clone -b staging https://github.com/OpenHistoricalMap/ohm-website.git $workdir WORKDIR $workdir RUN git checkout $OPENHISTORICALMAP_WEBSITE_GITSHA # change the echo here with a reason for changing the commithash -RUN echo 'reorder railway style, update help, latest translations' +RUN echo 'update map styles, oauth2 code, latest translations' RUN git fetch # Install Ruby packages diff --git a/images/web/config/settings.yml b/images/web/config/settings.yml index 173f3db8..7d6c4023 100644 --- a/images/web/config/settings.yml +++ b/images/web/config/settings.yml @@ -147,3 +147,9 @@ initial_changeset_comments_per_hour: 6 max_changeset_comments_per_hour: 60 moderator_changeset_comments_per_hour: 36000 embed_server_url: "https://embed.openhistoricalmap.org/" + +# Private key for signing id_tokens +doorkeeper_signing_key: | + -----BEGIN PRIVATE KEY----- + PRIVATE_KEY + -----END PRIVATE KEY----- diff --git a/images/web/start.sh b/images/web/start.sh index acb73a8e..a17b5921 100755 --- a/images/web/start.sh +++ b/images/web/start.sh @@ -45,6 +45,12 @@ sed -i -e 's/overpass-api.de/'$OVERPASS_URL'/g' $workdir/config/settings.yml sed -i -e 's/overpass-api.de/'$OVERPASS_URL'/g' $workdir/app/views/site/export.html.erb sed -i -e 's/overpass-api.de/'$OVERPASS_URL'/g' $workdir/app/assets/javascripts/index/export.js +# ADD DOORKEEPER_SIGNING_KEY +openssl genpkey -algorithm RSA -out private.pem +chmod 400 /var/www/private.pem +export DOORKEEPER_SIGNING_KEY=$(cat /var/www/private.pem | sed -e '1d;$d' | tr -d '\n') +sed -i "s#PRIVATE_KEY#${DOORKEEPER_SIGNING_KEY}#" $workdir/config/settings.yml + #### CHECK IF DB IS ALREADY UP AND START THE APP flag=true while "$flag" = true; do diff --git a/ohm/requirements.yaml b/ohm/requirements.yaml index 09fe3313..8cfa0ec2 100644 --- a/ohm/requirements.yaml +++ b/ohm/requirements.yaml @@ -1,4 +1,4 @@ dependencies: - name: osm-seed - version: '0.1.0-n776.h230d7d8' + version: '0.1.0-n775.h6785acb' repository: https://devseed.com/osm-seed-chart/ diff --git a/values.production.template.yaml b/values.production.template.yaml index b642ed17..a202b245 100644 --- a/values.production.template.yaml +++ b/values.production.template.yaml @@ -108,6 +108,7 @@ osm-seed: OVERPASS_URL: overpass-api.openhistoricalmap.org NEW_RELIC_LICENSE_KEY: {{PRODUCTION_NEW_RELIC_LICENSE_KEY}} NEW_RELIC_APP_NAME: {{PRODUCTION_NEW_RELIC_APP_NAME}} + ORGANIZATION_NAME: OpenHistoricalMap resources: enabled: true requests: @@ -706,8 +707,8 @@ osm-seed: osmchaApi: enabled: true image: - name: "ghcr.io/willemarcel/osmcha-django" - tag: "2975f9242b7bf70a840120b3dae6778c9d12146b" + name: "ghcr.io/openhistoricalmap/osmcha-django" + tag: "a1bcea85dc1f7c27566c20bafe7fff7aaa1e38a4" env: DJANGO_SETTINGS_MODULE: "config.settings.production" OSMCHA_FRONTEND_VERSION: "v0.86.0-production" diff --git a/values.staging.template.yaml b/values.staging.template.yaml index c3f3465d..ee81f010 100644 --- a/values.staging.template.yaml +++ b/values.staging.template.yaml @@ -118,6 +118,7 @@ osm-seed: OVERPASS_URL: overpass-api-staging.openhistoricalmap.org NEW_RELIC_LICENSE_KEY: {{STAGING_NEW_RELIC_LICENSE_KEY}} NEW_RELIC_APP_NAME: {{STAGING_NEW_RELIC_APP_NAME}} + ORGANIZATION_NAME: OpenHistoricalMap resources: enabled: true requests: @@ -741,8 +742,8 @@ osm-seed: osmchaApi: enabled: true image: - name: "ghcr.io/willemarcel/osmcha-django" - tag: "2975f9242b7bf70a840120b3dae6778c9d12146b" + name: "ghcr.io/openhistoricalmap/osmcha-django" + tag: "a1bcea85dc1f7c27566c20bafe7fff7aaa1e38a4" env: DJANGO_SETTINGS_MODULE: "config.settings.production" OSMCHA_FRONTEND_VERSION: "v0.86.0-production"