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"
32 libboost-program-options-dev
33 libboost-date-time-dev
34 libboost-filesystem-dev
36 libboost-iostreams-dev
49 directory "/opt/planet-dump-ng" do
55 git "/opt/planet-dump-ng" do
57 repository "https://github.com/zerebubuth/planet-dump-ng.git"
64 execute "/opt/planet-dump-ng/autogen.sh" do
66 command "./autogen.sh"
67 cwd "/opt/planet-dump-ng"
70 subscribes :run, "git[/opt/planet-dump-ng]"
73 execute "/opt/planet-dump-ng/configure" do
76 cwd "/opt/planet-dump-ng"
79 subscribes :run, "execute[/opt/planet-dump-ng/autogen.sh]"
82 execute "/opt/planet-dump-ng/Makefile" do
85 cwd "/opt/planet-dump-ng"
88 subscribes :run, "execute[/opt/planet-dump-ng/configure]"
91 directory "/store/planetdump" do
98 %w[planetdump planetdump-trigger planet-mirror-redirect-update].each do |program|
99 template "/usr/local/bin/#{program}" do
100 source "#{program}.erb"
107 systemd_service "planetdump@" do
108 description "Planet dump for %i"
110 exec_start "/usr/local/bin/planetdump %i"
114 bind_paths "/home/planet"
118 "/store/planet/planet",
124 systemd_service "planetdump-trigger" do
125 description "Planet dump trigger"
127 exec_start "/usr/local/bin/planetdump-trigger"
129 restrict_address_families "AF_UNIX"
132 service "planetdump-trigger" do
133 action [:enable, :start]
134 subscribes :restart, "template[/usr/local/bin/planetdump-trigger]"
137 systemd_service "planet-dump-mirror" do
138 description "Update planet dump mirrors"
139 exec_start "/usr/local/bin/planet-mirror-redirect-update"
141 sandbox :enable_network => true
142 memory_deny_write_execute false
143 read_write_paths "/store/planet/.htaccess"
146 systemd_timer "planet-dump-mirror" do
147 description "Update planet dump mirrors"
149 on_unit_inactive_sec "10min"
152 service "planet-dump-mirror.timer" do
153 action [:enable, :start]