2 # Cookbook Name:: gps-tile
 
   5 # Copyright 2013, OpenStreetMap Foundation
 
   7 # Licensed under the Apache License, Version 2.0 (the "License");
 
   8 # you may not use this file except in compliance with the License.
 
   9 # You may obtain a copy of the License at
 
  11 #     http://www.apache.org/licenses/LICENSE-2.0
 
  13 # Unless required by applicable law or agreed to in writing, software
 
  14 # distributed under the License is distributed on an "AS IS" BASIS,
 
  15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  16 # See the License for the specific language governing permissions and
 
  17 # limitations under the License.
 
  20 include_recipe "apache"
 
  23 package "build-essential"
 
  27 package "libarchive-dev"
 
  28 package "libexpat1-dev"
 
  31 package "libcache-memcached-perl"
 
  33 directory "/srv/gps-tile.openstreetmap.org" do
 
  39 git "/srv/gps-tile.openstreetmap.org/import" do
 
  41   repository "git://github.com/ericfischer/gpx-import.git"
 
  47 execute "/srv/gps-tile.openstreetmap.org/import/src/Makefile" do
 
  50   cwd "/srv/gps-tile.openstreetmap.org/import/src"
 
  53   subscribes :run, "git[/srv/gps-tile.openstreetmap.org/import]"
 
  56 git "/srv/gps-tile.openstreetmap.org/datamaps" do
 
  58   repository "git://github.com/ericfischer/datamaps.git"
 
  64 execute "/srv/gps-tile.openstreetmap.org/datamaps/Makefile" do
 
  67   cwd "/srv/gps-tile.openstreetmap.org/datamaps"
 
  70   subscribes :run, "git[/srv/gps-tile.openstreetmap.org/datamaps]"
 
  73 git "/srv/gps-tile.openstreetmap.org/updater" do
 
  75   repository "git://github.com/ericfischer/gpx-updater.git"
 
  81 systemd_service "gps-update" do
 
  82   description "GPS tile update daemon"
 
  83   after ["network.target", "memcached.service"]
 
  84   wants ["memcached.service"]
 
  86   working_directory "/srv/gps-tile.openstreetmap.org"
 
  87   exec_start "/srv/gps-tile.openstreetmap.org/updater/update"
 
  92   no_new_privileges true
 
  96 service "gps-update" do
 
  97   action [:enable, :start]
 
  98   subscribes :restart, "git[/srv/gps-tile.openstreetmap.org/updater]"
 
  99   subscribes :restart, "systemd_service[gps-update]"
 
 102 remote_directory "/srv/gps-tile.openstreetmap.org/html" do
 
 107   files_owner "gpstile"
 
 108   files_group "gpstile"
 
 112 apache_module "headers"
 
 114 ssl_certificate "gps-tile.openstreetmap.org" do
 
 115   domains ["gps-tile.openstreetmap.org",
 
 116            "a.gps-tile.openstreetmap.org",
 
 117            "b.gps-tile.openstreetmap.org",
 
 118            "c.gps-tile.openstreetmap.org",
 
 119            "gps.tile.openstreetmap.org",
 
 120            "gps-a.tile.openstreetmap.org",
 
 121            "gps-b.tile.openstreetmap.org",
 
 122            "gps-c.tile.openstreetmap.org"]
 
 123   notifies :reload, "service[apache2]"
 
 126 apache_site "gps-tile.openstreetmap.org" do
 
 127   template "apache.erb"