Remove the kosmos-wordpress cookbook

This commit is contained in:
Greg Karékinian 2019-04-08 11:21:20 +02:00
parent 777b85c2ab
commit 4693b15826
7 changed files with 0 additions and 229 deletions

View File

@ -1,6 +0,0 @@
kosmos-wordpress CHANGELOG
==========================
0.1.0
-----
- [Greg Karékinian] - Initial release of kosmos-wordpress

View File

@ -1,68 +0,0 @@
kosmos-wordpress Cookbook
=========================
TODO: Enter the cookbook description here.
e.g.
This cookbook makes your favorite breakfast sandwich.
Requirements
------------
TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
e.g.
#### packages
- `toaster` - kosmos-wordpress needs toaster to brown your bagel.
Attributes
----------
TODO: List your cookbook attributes here.
e.g.
#### kosmos-wordpress::default
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>['kosmos-wordpress']['bacon']</tt></td>
<td>Boolean</td>
<td>whether to include bacon</td>
<td><tt>true</tt></td>
</tr>
</table>
Usage
-----
#### kosmos-wordpress::default
TODO: Write usage instructions for each cookbook.
e.g.
Just include `kosmos-wordpress` in your node's `run_list`:
```json
{
"name":"my_node",
"run_list": [
"recipe[kosmos-wordpress]"
]
}
```
Contributing
------------
TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
e.g.
1. Fork the repository on Github
2. Create a named feature branch (like `add_component_x`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request using Github
License and Authors
-------------------
Authors: TODO: List authors

View File

@ -1 +0,0 @@
node.default["kosmos-wordpress"]["nginx"]["domain"] = "blog.kosmos.org"

View File

@ -1,13 +0,0 @@
name 'kosmos-wordpress'
maintainer 'Kosmos'
maintainer_email 'mail@kosmos.org'
license 'All rights reserved'
description 'Installs/Configures kosmos-wordpress'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
depends 'wordpress'
depends 'php-fpm'
depends 'backup'
depends 'kosmos-base'
depends 'kosmos-nginx'

View File

@ -1,38 +0,0 @@
#
# Cookbook Name:: kosmos-wordpress
# Recipe:: default
#
# Copyright 2016, Kosmos
#
# All rights reserved - Do Not Redistribute
#
mysql_credentials = Chef::EncryptedDataBagItem.load('credentials', 'mysql')
node.override['wordpress']['db']['root_password'] = mysql_credentials["root_password"]
node.override['wordpress']['server_name'] = "blog.kosmos.org"
node.override['wordpress']['server_aliases'] = ["blog.kosmos.org"]
node.override['wordpress']['server_port'] = "443"
credentials = Chef::EncryptedDataBagItem.load('credentials', 'wordpress')
node.set['wordpress']['db']['pass'] = credentials["db_pass"]
node.set['wordpress']['keys']['auth'] = credentials["keys_auth"]
node.set['wordpress']['keys']['secure_auth'] = credentials["keys_secure_auth"]
node.set['wordpress']['keys']['logged_in'] = credentials["keys_logged_in"]
node.set['wordpress']['keys']['nonce'] = credentials["keys_nonce"]
node.set['wordpress']['salt']['auth'] = credentials["keys_auth"]
node.set['wordpress']['salt']['secure_auth'] = credentials["saltsecure_auth"]
node.set['wordpress']['salt']['logged_in'] = credentials["salt_logged_in"]
node.set['wordpress']['salt']['nonce'] = credentials["salt_nonce"]
include_recipe 'kosmos-wordpress::nginx'
unless node.chef_environment == "development"
node.override["backup"]["mysql"]["host"] = "localhost"
node.override["backup"]["mysql"]["username"] = "root"
node.override["backup"]["mysql"]["password"] = node["wordpress"]["db"]["root_password"]
unless node["backup"]["mysql"]["databases"].include? "wordpressdb"
node.override["backup"]["mysql"]["databases"] =
node["backup"]["mysql"]["databases"].to_a << "wordpressdb"
end
include_recipe "backup"
end

View File

@ -1,59 +0,0 @@
#
# Cookbook Name:: kosmos-wordpress
# Recipe:: nginx
#
# Copyright 2016, Kosmos
#
# All rights reserved - Do Not Redistribute
#
node.set_unless['php-fpm']['pools'] = []
include_recipe "php-fpm"
include_recipe 'php-fpm::repository' unless node['php-fpm']['skip_repository_install']
include_recipe "php-fpm::install"
php_fpm_pool "www" do
enable false
end
php_fpm_pool "wordpress" do
listen "127.0.0.1:9001"
user node['wordpress']['install']['user']
group node['wordpress']['install']['group']
listen_owner node['wordpress']['install']['user']
listen_group node['wordpress']['install']['group']
php_options node['wordpress']['php_options']
start_servers 5
enable true
end
include_recipe "php::module_mysql"
include_recipe "kosmos-nginx"
include_recipe "wordpress::app"
server_name = node['wordpress']['server_name']
ssl_cert = "/etc/letsencrypt/live/#{server_name}/fullchain.pem"
ssl_key = "/etc/letsencrypt/live/#{server_name}/privkey.pem"
template "#{node['nginx']['dir']}/sites-available/#{server_name}" do
source "nginx.conf.erb"
variables(
docroot: node['wordpress']['dir'],
server_name: server_name,
server_aliases: node['wordpress']['server_aliases'],
server_port: node['wordpress']['server_port'],
ssl_cert: ssl_cert,
ssl_key: ssl_key
)
action :create
notifies :reload, "service[nginx]", :delayed
end
nginx_site server_name do
action :enable
end
nginx_certbot_site server_name

View File

@ -1,44 +0,0 @@
server {
listen 80;
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
listen <%= @server_port %> ssl http2;
<% end -%>
server_name <%= @server_name %> <%= @server_aliases.join(" ") %>;
access_log /var/log/nginx/<%= @server_name %>.access.log;
error_log /var/log/nginx/<%= @server_name %>.error.log;
client_max_body_size 20m;
root <%= @docroot %>;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
set $redirect_to_ssl "no";
if ($ssl_protocol = "") {
set $redirect_to_ssl "yes";
}
if ($redirect_to_ssl = yes) {
rewrite ^(.*) https://$host$1 permanent;
}
<% end -%>
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9001;
fastcgi_param SCRIPT_FILENAME <%= @docroot %>$fastcgi_script_name;
# Remove the HTTP_PROXY parameter, protect from the HTTPoxy vulnerability
# https://www.nginx.com/blog/mitigating-the-httpoxy-vulnerability-with-nginx/
fastcgi_param HTTP_PROXY "";
}
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
ssl_certificate <%= @ssl_cert %>;
ssl_certificate_key <%= @ssl_key %>;
<% end -%>
}