<commit_before>#
# Cookbook Name:: server_base
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#

#logwatch
package "logwatch" do
  action :upgrade
end

template "/etc/logwatch/conf/logwatch.conf" do
  source "logwatch.conf.erb"
  mode 0644
  owner "root"
  group "root"
  variables ({
    :mail_to => node[:server_base][:mail_to]
  })
end

#nginx
template "/usr/share/nginx/www/index.php" do
  source "index.php.erb"
  mode 0644
  owner "root"
  group "root"
end

template "/etc/nginx/sites-available/phptest" do
  source "phptest.erb"<commit_msg>bugfix that logwatch does not work.<commit_after>#
# Cookbook Name:: server_base
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#

#logwatch
directory "/var/cache/logwatch" do
  owner "root"
  group "root"
  mode 0644
  action :create
end

package "logwatch" do
  action :upgrade
  notifies :run, "execute[copy_logwatch_services]"
end

execute "copy_logwatch_services" do
  command <<-EOH
  rm -rf ./*
  cp /usr/share/logwatch/default.conf/services/* .
  logwatch
  EOH
  cwd "/etc/logwatch/conf/services"
  user "root"
  action :nothing
end

template "/etc/logwatch/conf/logwatch.conf" do
  source "logwatch.conf.erb"
  mode 0644
  owner "root"
  group "root"
  variables ({
    :mail_to => node[:server_base][:mail_to]
  })
end

#nginx
template "/usr/share/nginx/www/index.php" do
  source "index.php.erb"
  mode 0644
  owner "root"
  group "root"
end

template "/etc/nginx/sites-available/phptest" do
  source "phptest.erb"
{'fraction_non_alphanumeric': 0.12365930599369085, 'fraction_numerical': 0.017665615141955835, 'mean_word_length': 3.850152905198777, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2757831', 'n_tokens_mistral': 618, 'n_tokens_neox': 587, 'n_words': 147}