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