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.
31 libboost-program-options-dev
32 libboost-date-time-dev
33 libboost-filesystem-dev
35 libboost-iostreams-dev
48 directory "/opt/planet-dump-ng" do
54 git "/opt/planet-dump-ng" do
56 repository "https://github.com/zerebubuth/planet-dump-ng.git"
63 execute "/opt/planet-dump-ng/autogen.sh" do
65 command "./autogen.sh"
66 cwd "/opt/planet-dump-ng"
69 subscribes :run, "git[/opt/planet-dump-ng]"
72 execute "/opt/planet-dump-ng/configure" do
75 cwd "/opt/planet-dump-ng"
78 subscribes :run, "execute[/opt/planet-dump-ng/autogen.sh]"
81 execute "/opt/planet-dump-ng/Makefile" do
84 cwd "/opt/planet-dump-ng"
87 subscribes :run, "execute[/opt/planet-dump-ng/configure]"
90 directory "/store/planetdump" do
97 %w[planetdump planet-mirror-redirect-update].each do |program|
98 template "/usr/local/bin/#{program}" do
99 source "#{program}.erb"
106 systemd_service "planetdump@" do
107 description "Planet dump for %i"
109 exec_start "/usr/local/bin/planetdump %i"
115 "/store/planet/planet",
121 systemd_service "planetdump-trigger" do
122 description "Planet dump trigger"
124 exec_start "/usr/local/bin/planetdump-trigger"
126 restrict_address_families "AF_UNIX"
129 service "planetdump-trigger" do
130 action [:enable, :start]
133 systemd_service "planet-dump-mirror" do
134 description "Update planet dump mirrors"
135 exec_start "/usr/local/bin/planet-mirror-redirect-update"
137 sandbox :enable_network => true
138 memory_deny_write_execute false
139 read_write_paths "/store/planet/.htaccess"
142 systemd_timer "planet-dump-mirror" do
143 description "Update planet dump mirrors"
145 on_unit_inactive_sec "10min"
148 service "planet-dump-mirror.timer" do
149 action [:enable, :start]