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 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"
99 protect_system "strict"
101 read_write_directories "/srv/gps-tile.openstreetmap.org"
102 no_new_privileges true
106 service "gps-update" do
107 action [:enable, :start]
108 subscribes :restart, "git[/srv/gps-tile.openstreetmap.org/updater]"
109 subscribes :restart, "systemd_service[gps-update]"
112 remote_directory "/srv/gps-tile.openstreetmap.org/html" do
117 files_owner "gpstile"
118 files_group "gpstile"
122 apache_module "headers"
123 apache_module "rewrite"
125 ssl_certificate "gps-tile.openstreetmap.org" do
126 domains ["gps-tile.openstreetmap.org",
127 "a.gps-tile.openstreetmap.org",
128 "b.gps-tile.openstreetmap.org",
129 "c.gps-tile.openstreetmap.org",
130 "gps.tile.openstreetmap.org",
131 "gps-a.tile.openstreetmap.org",
132 "gps-b.tile.openstreetmap.org",
133 "gps-c.tile.openstreetmap.org"]
134 notifies :reload, "service[apache2]"
137 apache_site "gps-tile.openstreetmap.org" do
138 template "apache.erb"