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/e-n-f/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/e-n-f/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/openstreetmap/gpx-updater.git"
89 directory "/srv/gps-tile.openstreetmap.org/tracks" do
95 directory "/srv/gps-tile.openstreetmap.org/shapes" do
101 systemd_service "gps-update" do
102 description "GPS tile update daemon"
103 after ["network.target", "memcached.service"]
104 wants ["memcached.service"]
106 working_directory "/srv/gps-tile.openstreetmap.org"
107 exec_start "/srv/gps-tile.openstreetmap.org/updater/update"
109 sandbox :enable_network => true
110 read_write_paths "/srv/gps-tile.openstreetmap.org"
114 service "gps-update" do
115 action [:enable, :start]
116 subscribes :restart, "git[/srv/gps-tile.openstreetmap.org/updater]"
117 subscribes :restart, "systemd_service[gps-update]"
120 remote_directory "/srv/gps-tile.openstreetmap.org/html" do
125 files_owner "gpstile"
126 files_group "gpstile"
130 apache_module "headers"
131 apache_module "rewrite"
133 ssl_certificate "gps-tile.openstreetmap.org" do
134 domains ["gps-tile.openstreetmap.org",
135 "a.gps-tile.openstreetmap.org",
136 "b.gps-tile.openstreetmap.org",
137 "c.gps-tile.openstreetmap.org",
138 "gps.tile.openstreetmap.org",
139 "gps-a.tile.openstreetmap.org",
140 "gps-b.tile.openstreetmap.org",
141 "gps-c.tile.openstreetmap.org"]
142 notifies :reload, "service[apache2]"
145 apache_site "gps-tile.openstreetmap.org" do
146 template "apache.erb"