Commit cdd80b1a authored by André Kerkhoff's avatar André Kerkhoff
Browse files

Add resource foswiki_patches for unofficial patches

parent 6feabfee
......@@ -5,5 +5,5 @@ DEPENDENCIES
GRAPH
apache2 (5.2.1)
foswiki (2.4.0)
foswiki (2.5.0)
apache2 (< 6.0)
......@@ -136,6 +136,18 @@ foswiki_extensions_web name do
end
```
## Unofficial patches
This cookbook provides some unofficial patches for Foswiki which can be controlled with attributes under `['foswiki']['patches']` or a `foswiki_patches` resource.
```ruby
foswiki_patches name do
holidaylistplugin # Make HolidaylistPlugin compatible with newer Perl versions and add option "priopubholidays"
noproxy # Add the configuration item {PROXY}{NoProxy} (https://foswiki.org/Development/AddNoProxyFeature)
owner # owner of patched files
group # used group for patched files
end
## robots.txt
Foswiki's robots.txt can be configured with `['foswiki']['robots']['crawl_delay']` (Integer) and `['foswiki']['robots']['disallow']` (List). For custom installations the template `templates/robots.txt.erb` can be used.
......
......@@ -43,5 +43,9 @@ default['foswiki']['config']['TemplateDir'] = '{install}/templates'
default['foswiki']['config']['ToolsDir'] = '{install}/tools'
default['foswiki']['config']['WorkingDir'] = '{install}/working'
# Unofficial patches
default['foswiki']['patches']['holidaylistplugin'] = false
default['foswiki']['patches']['noproxy'] = false
# Contents of topics
default['foswiki']['topics'] = {}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -37,6 +37,9 @@ suites:
server_alias: wiki.localhost
server_name: localhost
extensions_web: Extensions
patch:
holidaylistplugin: true
noproxy: true
plugins:
- HolidaylistPlugin
robots:
......
......@@ -3,7 +3,7 @@ maintainer 'HPC'
maintainer_email 'hpc@gsi.de'
license 'All rights reserved'
description 'Installs/Configures Foswiki'
version '2.4.0'
version '2.5.0'
depends 'apache2', '< 6.0'
supports 'debian'
supports 'ubuntu'
......@@ -164,6 +164,14 @@ unless node['foswiki']['extensions_web'].nil?
end
end
# Apply patches which are not available in upstream
foswiki_patches 'default' do
holidaylistplugin node['foswiki']['patches']['holidaylistplugin']
noproxy node['foswiki']['patches']['noproxy']
owner node['apache']['user']
group node['apache']['group']
end
# Manage Cron job
template '/etc/cron.d/foswiki' do
source 'foswiki-cron.erb'
......
resource_name 'foswiki_patches'
property :group, String, default: 'www-data'
property :holidaylistplugin, [true, false], default: false
property :noproxy, [true, false], default: false
property :owner, String, default: 'www-data'
action :update do
if new_resource.holidaylistplugin
patch_file 'Foswiki/Plugins/HolidaylistPlugin/Core.pm', 'HolidaylistPluginCore.pm'
end
if new_resource.noproxy
patch_file 'Foswiki/Net.pm', 'FoswikiNet.pm'
patch_file 'Foswiki.spec', 'Foswiki.spec'
end
end
action_class do
def patch_file(filename, asource)
cookbook_file "#{foswiki_dir('install')}/lib/#{filename}" do
source asource
owner new_resource.owner
group new_resource.group
mode '0444'
notifies :restart, 'service[apache2]'
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment