]> git.openstreetmap.org Git - chef.git/blob - cookbooks/mediawiki/recipes/default.rb
daa2f7dc8d212f30c4f88c2209c157fd31100635
[chef.git] / cookbooks / mediawiki / recipes / default.rb
1 #
2 # Cookbook Name:: mediawiki
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 "memcached"
21 include_recipe "apache"
22 include_recipe "mysql"
23 include_recipe "git"
24
25 # Mediawiki Base Requirements
26 package %w[
27   php
28   php-cli
29   php-curl
30   php-gd
31   php-intl
32   php-mbstring
33   php-mysql
34   php-xml
35   composer
36 ]
37
38 # Mediawiki enhanced difference engine
39 package "php-wikidiff2"
40
41 # Mediawiki Image + SVG support
42 package %w[
43   imagemagick
44   librsvg2-bin
45 ]
46
47 # Mediawiki PDF support via Extension:PdfHandler
48 package %w[
49   ghostscript
50   poppler-utils
51 ]
52
53 # Mediawiki backup
54 package %w[
55   xz-utils
56   liblz4-tool
57 ]
58
59 # Mediawiki packages for VisualEditor support
60 package %w[
61   curl
62   parsoid
63 ]
64
65 # Mediawiki packages for SyntaxHighight support
66 package "python-pygments"
67
68 file "/etc/mediawiki/parsoid/settings.js" do
69   action :delete
70 end
71
72 template "/etc/mediawiki/parsoid/config.yaml" do
73   source "parsoid-config.yaml.erb"
74   owner "root"
75   group "root"
76   mode 0o644
77 end
78
79 service "parsoid" do
80   action [:enable]
81   supports :status => false, :restart => true, :reload => false
82   subscribes :restart, "file[/etc/mediawiki/parsoid/settings.js]"
83   subscribes :restart, "template[/etc/mediawiki/parsoid/config.yaml]"
84 end
85
86 apache_module "php7.2"
87
88 link "/etc/php/7.2/apache2/conf.d/20-wikidiff2.ini" do
89   to "../../mods-available/wikidiff2.ini"
90 end
91
92 apache_module "rewrite"