Skip to content

Commit 7530f65

Browse files
committed
Pass vtiles subdomain to the web container
1 parent f5c32cc commit 7530f65

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

images/web/start.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,14 @@ setup_production() {
130130

131131
# Update map styles. This line should be removed later, as the configuration should come from the module.
132132
SERVER_URL_="${SERVER_URL/www./}"
133+
# Tiler host. Defaults to vtiles.<server domain>; override VTILES_DOMAIN to use a
134+
# shared tiler (e.g. a preview that has no tiler of its own).
135+
VTILES_DOMAIN="${VTILES_DOMAIN:-vtiles.${SERVER_URL_}}"
133136
find /var/www/node_modules/@openhistoricalmap/map-styles/dist/ -type f -name "*.json" -exec sed -i.bak "s|openhistoricalmap.github.io|${SERVER_URL}|g" {} +
134137
find /var/www/node_modules/@openhistoricalmap/map-styles/dist/ -type f -name "*.json" -exec sed -i.bak "s|http://localhost:8888|https://${SERVER_URL}/map-styles|g" {} +
135138
find /var/www/node_modules/@openhistoricalmap/map-styles/dist/ -type f -name "*.json" -exec sed -i.bak "s|www.openhistoricalmap.org|${SERVER_URL}|g" {} +
136-
find /var/www/node_modules/@openhistoricalmap/map-styles/dist/ -type f -name "*.json" -exec sed -i.bak "s|vtiles.openhistoricalmap.org|vtiles.${SERVER_URL_}|g" {} +
137-
find /var/www/node_modules/@openhistoricalmap/map-styles/dist/ -type f -name "*.json" -exec sed -i.bak "s|vtiles.staging.openhistoricalmap.org|vtiles.${SERVER_URL_}|g" {} +
139+
find /var/www/node_modules/@openhistoricalmap/map-styles/dist/ -type f -name "*.json" -exec sed -i.bak "s|vtiles.openhistoricalmap.org|${VTILES_DOMAIN}|g" {} +
140+
find /var/www/node_modules/@openhistoricalmap/map-styles/dist/ -type f -name "*.json" -exec sed -i.bak "s|vtiles.staging.openhistoricalmap.org|${VTILES_DOMAIN}|g" {} +
138141

139142
# Replace URLs in the public directory
140143
find "/var/www/public" -type f \( \
@@ -152,8 +155,8 @@ setup_production() {
152155
-e "s|openhistoricalmap.github.io|${SERVER_URL}|g" \
153156
-e "s|http://localhost:8888|https://${SERVER_URL}/map-styles|g" \
154157
-e "s|www.openhistoricalmap.org|${SERVER_URL}|g" \
155-
-e "s|vtiles.openhistoricalmap.org|vtiles.${SERVER_URL_}|g" \
156-
-e "s|vtiles.staging.openhistoricalmap.org|vtiles.${SERVER_URL_}|g" \
158+
-e "s|vtiles.openhistoricalmap.org|${VTILES_DOMAIN}|g" \
159+
-e "s|vtiles.staging.openhistoricalmap.org|${VTILES_DOMAIN}|g" \
157160
"$file"
158161
done
159162

values.k3s.preview.template.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ osm-seed:
3131
MAILER_FROM: web@noreply.openhistoricalmap.org
3232
NOMINATIM_URL: nominatim.openhistoricalmap.org
3333
OVERPASS_URL: overpass-api.openhistoricalmap.org
34+
VTILES_DOMAIN: vtiles.openhistoricalmap.org
35+
3436
NEW_RELIC_LICENSE_KEY: "none"
3537
NEW_RELIC_APP_NAME: "none"
3638
ORGANIZATION_NAME: OpenHistoricalMap
@@ -39,7 +41,6 @@ osm-seed:
3941
RAILS_MASTER_KEY: "ceadf340a26657419e5343d46b60798c"
4042
RAILS_ENV: production
4143
RAILS_LOG_LEVEL: debug
42-
4344
OPENSTREETMAP_id_key: "tCygIMWpJVZ2c-vWYC_kI_YnMow3WmGbKLp2Rq_WgHI"
4445
OAUTH_CLIENT_ID: "Zj5OnOQLXJKgGYFMwsisuhsHR-FAg1khf-wr0nE3OWo"
4546
OAUTH_KEY: "OGNWJkSOmeJ8X08iL6Srv0oTaETIcwftD5OyFPbbY3A"

values.production.template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ osm-seed:
131131
MAILER_FROM: web@noreply.penhistoricalmap.org
132132
NOMINATIM_URL: nominatim.openhistoricalmap.org
133133
OVERPASS_URL: overpass-api.openhistoricalmap.org
134+
VTILES_DOMAIN: vtiles.openhistoricalmap.org
135+
134136
NEW_RELIC_LICENSE_KEY: 'none'
135137
NEW_RELIC_APP_NAME: 'none'
136138
ORGANIZATION_NAME: OpenHistoricalMap

values.staging.template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ osm-seed:
133133
MAILER_FROM: web@noreply.openhistoricalmap.org
134134
NOMINATIM_URL: nominatim.ohmstaging.org
135135
OVERPASS_URL: overpass-api.ohmstaging.org
136+
VTILES_DOMAIN: vtiles.ohmstaging.org
137+
136138
NEW_RELIC_LICENSE_KEY: "none"
137139
NEW_RELIC_APP_NAME: "none"
138140
ORGANIZATION_NAME: OpenHistoricalMap

0 commit comments

Comments
 (0)