]> git.openstreetmap.org Git - chef.git/blob - cookbooks/dmca/recipes/default.rb
Merge remote-tracking branch 'github/pull/350' into master
[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 apache_module "proxy"
24 apache_module "proxy_fcgi"
25
26 directory "/srv/dmca.openstreetmap.org" do
27   owner "root"
28   group "root"
29   mode "755"
30 end
31
32 remote_directory "/srv/dmca.openstreetmap.org/html" do
33   source "html"
34   owner "root"
35   group "root"
36   mode "755"
37   files_owner "root"
38   files_group "root"
39   files_mode "644"
40 end
41
42 ssl_certificate "dmca.openstreetmap.org" do
43   domains ["dmca.openstreetmap.org", "dmca.osm.org"]
44   notifies :reload, "service[apache2]"
45 end
46
47 php_fpm "dmca.openstreetmap.org" do
48   php_admin_values "open_basedir" => "/srv/dmca.openstreetmap.org/html/:/usr/share/php/:/tmp/",
49                    "disable_functions" => "exec,shell_exec,system,passthru,popen,proc_open"
50   prometheus_port 11201
51 end
52
53 apache_site "dmca.openstreetmap.org" do
54   template "apache.erb"
55   directory "/srv/dmca.openstreetmap.org"
56   variables :aliases => ["dmca.osm.org"]
57 end