Skip to content

Commit 64c66a7

Browse files
committed
Make setup for automatic updates optional through UPDATES variable
1 parent 626158f commit 64c66a7

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,19 @@ If the container exits without errors, then your data has been successfully impo
2222

2323
### Automatic updates (optional)
2424

25-
If your import is an extract of the planet and has polygonal bounds associated with it, like those from geofabrik.de, then it is possible to set your server up for automatic updates. Make sure to reference both the OSM file and the polygon file during the import process to facilitate this:
25+
If your import is an extract of the planet and has polygonal bounds associated with it, like those from geofabrik.de, then it is possible to set your server up for automatic updates. Make sure to reference both the OSM file and the polygon file during the import process to facilitate this, and also include the `UPDATES=enabled` variable:
2626

2727
```
2828
docker run \
29+
-e UPDATES=enabled \
2930
-v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf \
3031
-v /absolute/path/to/luxembourg.poly:/data.poly \
3132
-v openstreetmap-data:/var/lib/postgresql/12/main \
3233
overv/openstreetmap-tile-server \
3334
import
3435
```
3536

36-
Refer to the section *Automatic updating and tile expiry* to actually enable the updates.
37+
Refer to the section *Automatic updating and tile expiry* to actually enable the updates while running the tile server.
3738

3839
## Running the server
3940

@@ -67,7 +68,7 @@ docker run \
6768

6869
### Enabling automatic updating (optional)
6970

70-
Given that you've specified both the OSM data and polygon as specified in the *Automatic updates* section during server setup, you can enable the updating process by setting the variable `UPDATES` to `enabled`:
71+
Given that you've set up your import as described in the *Automatic updates* section during server setup, you can enable the updating process by setting the `UPDATES` variable while running your server as well:
7172

7273
```
7374
docker run \

run.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ if [ "$1" = "import" ]; then
4242
wget -nv http://download.geofabrik.de/europe/luxembourg.poly -O /data.poly
4343
fi
4444

45-
# determine and set osmosis_replication_timestamp (for consecutive updates)
46-
osmium fileinfo /data.osm.pbf > /var/lib/mod_tile/data.osm.pbf.info
47-
osmium fileinfo /data.osm.pbf | grep 'osmosis_replication_timestamp=' | cut -b35-44 > /var/lib/mod_tile/replication_timestamp.txt
48-
REPLICATION_TIMESTAMP=$(cat /var/lib/mod_tile/replication_timestamp.txt)
45+
if [ "$UPDATES" = "enabled" ]; then
46+
# determine and set osmosis_replication_timestamp (for consecutive updates)
47+
osmium fileinfo /data.osm.pbf > /var/lib/mod_tile/data.osm.pbf.info
48+
osmium fileinfo /data.osm.pbf | grep 'osmosis_replication_timestamp=' | cut -b35-44 > /var/lib/mod_tile/replication_timestamp.txt
49+
REPLICATION_TIMESTAMP=$(cat /var/lib/mod_tile/replication_timestamp.txt)
4950

50-
# initial setup of osmosis workspace (for consecutive updates)
51-
sudo -u renderer openstreetmap-tiles-update-expire $REPLICATION_TIMESTAMP
51+
# initial setup of osmosis workspace (for consecutive updates)
52+
sudo -u renderer openstreetmap-tiles-update-expire $REPLICATION_TIMESTAMP
53+
fi
5254

5355
# copy polygon file if available
5456
if [ -f /data.poly ]; then

0 commit comments

Comments
 (0)