]> git.openstreetmap.org Git - chef.git/blob - cookbooks/dmca/recipes/default.rb
Require php-pear for dmca.openstreetmap.org
[chef.git] / cookbooks / dmca / recipes / default.rb
1 #
2 # Cookbook:: dmca
3 # Recipe:: default
4 #
5 # Copyright:: 2018, OpenStreetMap Foundation
6 #
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
10 #
11 #     https://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19
20 include_recipe "apache"
21 include_recipe "php::fpm"
22
23 package "php-pear"
24
25 apache_module "proxy"
26 apache_module "proxy_fcgi"
27
28 directory "/srv/dmca.openstreetmap.org" do
29   owner "root"
30   group "root"
31   mode "755"
32 end
33
34 remote_directory "/srv/dmca.openstreetmap.org/html" do
35   source "html"
36   owner "root"
37   group "root"
38   mode "755"
39   files_owner "root"
40   files_group "root"
41   files_mode "644"
42 end
43
44 ssl_certificate "dmca.openstreetmap.org" do
45   domains ["dmca.openstreetmap.org", "dmca.osm.org"]
46   notifies :reload, "service[apache2]"
47 end
48
49 php_fpm "dmca.openstreetmap.org" do
50   php_admin_values "open_basedir" => "/srv/dmca.openstreetmap.org/html/:/usr/share/php/:/tmp/",
51                    "disable_functions" => "exec,shell_exec,system,passthru,popen,proc_open"
52   prometheus_port 11201
53 end
54
55 apache_site "dmca.openstreetmap.org" do
56   template "apache.erb"
57   directory "/srv/dmca.openstreetmap.org"
58   variables :aliases => ["dmca.osm.org"]
59 end