]> git.openstreetmap.org Git - chef.git/blob - cookbooks/wordpress/recipes/default.rb
Switch wawel to carto 6.0.0
[chef.git] / cookbooks / wordpress / recipes / default.rb
1 #
2 # Cookbook:: wordpress
3 # Recipe:: default
4 #
5 # Copyright:: 2013, 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 "fail2ban"
22 include_recipe "git"
23 include_recipe "mysql"
24 include_recipe "php::fpm"
25
26 package %w[
27   subversion
28   php-mbstring
29   php-mysql
30   php-igbinary
31   php-imagick
32   php-intl
33   php-xml
34 ]
35
36 group "wordpress" do
37   gid 516
38   append true
39 end
40
41 user "wordpress" do
42   uid 516
43   gid 516
44   comment "Wordpress"
45   home "/"
46   shell "/usr/sbin/nologin"
47   manage_home false
48 end
49
50 apache_module "proxy"
51 apache_module "proxy_fcgi"
52 apache_module "rewrite"
53
54 fail2ban_filter "wordpress" do
55   source "https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf"
56 end
57
58 fail2ban_jail "wordpress" do
59   filter "wordpress"
60   logpath "/var/log/auth.log"
61   ports [80, 443]
62   maxretry 6
63 end
64
65 directory "/opt/wp-cli" do
66   owner "root"
67   group "root"
68   mode "755"
69 end
70
71 remote_file "/opt/wp-cli/wp" do
72   source "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar"
73   owner "root"
74   group "root"
75   mode "755"
76 end