From 516a313b3c61eef1de357565028f095da414a756 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 2 Jan 2017 21:12:19 +0000 Subject: [PATCH] tilecache: add osm.org stale token --- .../default/nginx_generate_tilecache_qos_map.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cookbooks/tilecache/templates/default/nginx_generate_tilecache_qos_map.erb b/cookbooks/tilecache/templates/default/nginx_generate_tilecache_qos_map.erb index 166545d61..e6c17f8a9 100755 --- a/cookbooks/tilecache/templates/default/nginx_generate_tilecache_qos_map.erb +++ b/cookbooks/tilecache/templates/default/nginx_generate_tilecache_qos_map.erb @@ -2,9 +2,9 @@ # DO NOT EDIT - This file is being maintained by Chef set -e -NUM_TOKENS=3 # current + 3 +NUM_TOKENS=4 # current + 4 VALID_TOKEN=3600 # in seconds -QOS_TOKENS=($(/usr/bin/oathtool --totp --window=${NUM_TOKENS} --time-step-size=${VALID_TOKEN}s <%= tokens[:tilecache_oath_key] %>)) +QOS_TOKENS=($(/usr/bin/oathtool --totp --window=${NUM_TOKENS} --time-step-size=${VALID_TOKEN}s <%= web_passwords[:totp_key] %>)) # ${qos_tokens[3]/[-1] } = OSM.org exclusive / current # ${qos_tokens[2]/[-2] } = tile.openstreetmap.org default @@ -18,8 +18,9 @@ if [ "${#QOS_TOKENS[@]}" -ne "$((${NUM_TOKENS}+1))" ]; then fi QOS_TOKEN_OSM=${QOS_TOKENS[-1]} # Cookie set by openstreetmap.org -QOS_TOKEN_DEFAULT=${QOS_TOKENS[-2]} # Cookie presented by tile.openstreetmap.org to browsers -QOS_TOKEN_STALE=${QOS_TOKENS[-3]} # Cookie which has become stale and will be replaced +QOS_TOKEN_OSM_STALE=${QOS_TOKENS[-2]} # Cookie set by openstreetmap.org stale +QOS_TOKEN_DEFAULT=${QOS_TOKENS[-3]} # Cookie presented by tile.openstreetmap.org to browsers +QOS_TOKEN_STALE=${QOS_TOKENS[-4]} # Cookie which has become stale and will be replaced if [ -z "$QOS_TOKEN_OSM" -o -z "$QOS_TOKEN_DEFAULT" -o -z "$QOS_TOKEN_STALE" ]; then >&2 echo "ERROR: Unexpected blank token" @@ -30,6 +31,7 @@ cat </etc/nginx/conf.d/tile_qos_rates.map default 4096; # Default Rate (No QoS cookie) "${QOS_TOKEN_STALE}" 16384; # Stale "${QOS_TOKEN_DEFAULT}" 24576; # Default +"${QOS_TOKEN_OSM_STALE}" 32768; # Exclusive Stale "${QOS_TOKEN_OSM}" 32768; # Exclusive EOF -- 2.43.2