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 #     https://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 "accounts"
 
  21 include_recipe "apache"
 
  23 include_recipe "memcached"
 
  35   libcache-memcached-perl
 
  38 directory "/srv/gps-tile.openstreetmap.org" do
 
  44 git "/srv/gps-tile.openstreetmap.org/import" do
 
  46   repository "https://github.com/ericfischer/gpx-import.git"
 
  53 execute "/srv/gps-tile.openstreetmap.org/import/src/Makefile" do
 
  55   command "make DB=none LDFLAGS=-lm"
 
  56   cwd "/srv/gps-tile.openstreetmap.org/import/src"
 
  59   subscribes :run, "git[/srv/gps-tile.openstreetmap.org/import]"
 
  62 git "/srv/gps-tile.openstreetmap.org/datamaps" do
 
  64   repository "https://github.com/ericfischer/datamaps.git"
 
  71 execute "/srv/gps-tile.openstreetmap.org/datamaps/Makefile" do
 
  74   cwd "/srv/gps-tile.openstreetmap.org/datamaps"
 
  77   subscribes :run, "git[/srv/gps-tile.openstreetmap.org/datamaps]"
 
  80 git "/srv/gps-tile.openstreetmap.org/updater" do
 
  82   repository "https://github.com/ericfischer/gpx-updater.git"
 
  89 systemd_service "gps-update" do
 
  90   description "GPS tile update daemon"
 
  91   after ["network.target", "memcached.service"]
 
  92   wants ["memcached.service"]
 
  94   working_directory "/srv/gps-tile.openstreetmap.org"
 
  95   exec_start "/srv/gps-tile.openstreetmap.org/updater/update"
 
 100   no_new_privileges true
 
 104 service "gps-update" do
 
 105   action [:enable, :start]
 
 106   subscribes :restart, "git[/srv/gps-tile.openstreetmap.org/updater]"
 
 107   subscribes :restart, "systemd_service[gps-update]"
 
 110 remote_directory "/srv/gps-tile.openstreetmap.org/html" do
 
 115   files_owner "gpstile"
 
 116   files_group "gpstile"
 
 120 apache_module "headers"
 
 121 apache_module "rewrite"
 
 123 ssl_certificate "gps-tile.openstreetmap.org" do
 
 124   domains ["gps-tile.openstreetmap.org",
 
 125            "a.gps-tile.openstreetmap.org",
 
 126            "b.gps-tile.openstreetmap.org",
 
 127            "c.gps-tile.openstreetmap.org",
 
 128            "gps.tile.openstreetmap.org",
 
 129            "gps-a.tile.openstreetmap.org",
 
 130            "gps-b.tile.openstreetmap.org",
 
 131            "gps-c.tile.openstreetmap.org"]
 
 132   notifies :reload, "service[apache2]"
 
 135 apache_site "gps-tile.openstreetmap.org" do
 
 136   template "apache.erb"