]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tilelog/templates/default/tilelog.erb
Respond with 429 to abusive "ping" requests
[chef.git] / cookbooks / tilelog / templates / default / tilelog.erb
1 #!/bin/sh
2
3 if [ -z "$DATE" ]
4 then
5   DATE=$(date -d "1 day ago" "+%Y-%m-%d")
6 fi
7
8 OUTDIR="<%= @output_dir %>"
9 TMPDIR=$(mktemp -d -t tilelog.XXXXXXXXX)
10
11 cd $TMPDIR
12
13 export AWS_ACCESS_KEY_ID="AKIASQUXHPE7JFCFMOUP"
14 export AWS_SECRET_ACCESS_KEY="<%= @aws_key %>"
15 export AWS_REGION="eu-west-1"
16
17 nice -n 19 /opt/tilelog/bin/tilelog --date ${DATE} && mv tiles-${DATE}.txt.xz "${OUTDIR}"
18
19 rm -rf $TMPDIR