Skip to content

Commit

Permalink
DEV-187 | pyenv did not work properly - phpmyadmin need update download
Browse files Browse the repository at this point in the history
  • Loading branch information
phuonglm committed Aug 28, 2015
1 parent 0a7a4a3 commit 38ee5af
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Berksfile.lock
Expand Up @@ -15,7 +15,7 @@ DEPENDENCIES
php (= 1.5.0)
phpmyadmin
git: git@github.com:priestjim/chef-phpmyadmin.git
revision: f8b24f720d24504a5bbd0871c8f90aa24d30f7be
revision: b48c0e3f5d082924d697385888e16d015be838f5
postgresql (= 3.4.14)
pyenv
git: https://github.com/sds/chef-pyenv
Expand Down
43 changes: 15 additions & 28 deletions patches/001_phpmyadmin_recipes.patch
@@ -1,34 +1,21 @@
From 01b73ddce06b5294a07aba3eb76864cbafb14b1b Mon Sep 17 00:00:00 2001
From: Ly Minh Phuong <ly.minh.phuong.1403@gmail.com>
Date: Tue, 31 Mar 2015 04:06:15 +0700
Subject: [PATCH 1/1] DEV-139 | Add support to install phpMyAdmin - patch
phpmyadmin recipe

---
vendor-cookbooks/phpmyadmin/recipes/default.rb | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/vendor-cookbooks/phpmyadmin/recipes/default.rb b/vendor-cookbooks/phpmyadmin/recipes/default.rb
index 4e6afc8..510e5c8 100644
index 1d97a38..c264a11 100644
--- a/vendor-cookbooks/phpmyadmin/recipes/default.rb
+++ b/vendor-cookbooks/phpmyadmin/recipes/default.rb
@@ -20,11 +20,11 @@
require 'digest/sha1'
@@ -22,11 +22,11 @@ require 'digest/sha1'

# PHP Recipe includes we already know PHPMyAdmin needs
-include_recipe 'php'
-include_recipe 'php::module_mbstring'
-include_recipe 'php::module_mcrypt'
-include_recipe 'php::module_gd'
-include_recipe 'php::module_mysql'
+#include_recipe 'php'
+#include_recipe 'php::module_mbstring'
+#include_recipe 'php::module_mcrypt'
+#include_recipe 'php::module_gd'
+#include_recipe 'php::module_mysql'
if node['phpmyadmin']['stand_alone'] then
- include_recipe 'php'
- include_recipe 'php::module_mbstring'
- include_recipe 'php::module_mcrypt'
- include_recipe 'php::module_gd'
- include_recipe 'php::module_mysql'
+ # include_recipe 'php'
+ # include_recipe 'php::module_mbstring'
+ # include_recipe 'php::module_mcrypt'
+ # include_recipe 'php::module_gd'
+ # include_recipe 'php::module_mysql'

home = node['phpmyadmin']['home']
user = node['phpmyadmin']['user']
--
2.3.4

directory node['phpmyadmin']['upload_dir'] do
owner 'root'
8 changes: 7 additions & 1 deletion vendor-cookbooks/phpmyadmin/README.md
Expand Up @@ -9,6 +9,11 @@ You can clone it and import it to Chef as
git clone git://github.com/priestjim/chef-phpmyadmin.git phpmyadmin
knife cookbook upload phpmyadmin

You can also install the latest version of the cookbook using Berkshelf. Add
the following to your Berksfile:

cookbook "phpmyadmin", github: "priestjim/chef-phpmyadmin"

The latest and greatest revision of this cookbook will always be available
at https://github.com/priestjim/chef-phpmyadmin

Expand All @@ -17,7 +22,7 @@ Requirements

This cookbook requires the following cookbooks to be present and installed:

* chef-php from https://github.com/priestjim/chef-php
* [chef-php](https://github.com/priestjim/chef-php)

It also suggests the following:

Expand Down Expand Up @@ -59,6 +64,7 @@ This cookbook supports the following attributes:
* `default_display`: The default display of rows inside PMA
* `query_history`: Enable or disable the Javascript query history
* `query_history_size`: Set the maximum size of the Javascript query history
* `force_ssl`: Enable or disable SSL force

LWRP Methods
============
Expand Down
13 changes: 10 additions & 3 deletions vendor-cookbooks/phpmyadmin/attributes/default.rb
Expand Up @@ -17,12 +17,13 @@
# limitations under the License.
#

default['phpmyadmin']['version'] = '4.3.1'
default['phpmyadmin']['checksum'] = '944e42f33cb59b62bbc56165ea785216667198b98d254dff1265ba5793b8268e'
default['phpmyadmin']['mirror'] = 'http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin'
default['phpmyadmin']['version'] = '4.3.13.1'
default['phpmyadmin']['checksum'] = '2e5c2ca358d9510c793bb709338f0836c56f4c151018ad36a74da1d32df9fcd3'
default['phpmyadmin']['mirror'] = 'https://files.phpmyadmin.net/phpMyAdmin/'
default['phpmyadmin']['server_name'] = node['fqdn']

default['phpmyadmin']['fpm'] = true
default['phpmyadmin']['stand_alone'] = true

default['phpmyadmin']['home'] = '/opt/phpmyadmin'
default['phpmyadmin']['user'] = 'phpmyadmin'
Expand All @@ -47,3 +48,9 @@
default['phpmyadmin']['default_display'] = 'horizontal'
default['phpmyadmin']['query_history'] = true
default['phpmyadmin']['query_history_size'] = 100

default['phpmyadmin']['config_template'] = 'config.inc.php.erb'
default['phpmyadmin']['config_template_cookbook'] = 'phpmyadmin'

default['phpmyadmin']['force_ssl'] = false

49 changes: 27 additions & 22 deletions vendor-cookbooks/phpmyadmin/recipes/default.rb
Expand Up @@ -17,14 +17,33 @@
# limitations under the License.
#

require 'etc'
require 'digest/sha1'

# PHP Recipe includes we already know PHPMyAdmin needs
#include_recipe 'php'
#include_recipe 'php::module_mbstring'
#include_recipe 'php::module_mcrypt'
#include_recipe 'php::module_gd'
#include_recipe 'php::module_mysql'
if node['phpmyadmin']['stand_alone'] then
# include_recipe 'php'
# include_recipe 'php::module_mbstring'
# include_recipe 'php::module_mcrypt'
# include_recipe 'php::module_gd'
# include_recipe 'php::module_mysql'

directory node['phpmyadmin']['upload_dir'] do
owner 'root'
group 'root'
mode 01777
recursive true
action :create
end

directory node['phpmyadmin']['save_dir'] do
owner 'root'
group 'root'
mode 01777
recursive true
action :create
end
end

home = node['phpmyadmin']['home']
user = node['phpmyadmin']['user']
Expand All @@ -42,6 +61,7 @@
home home
shell '/usr/sbin/nologin'
supports :manage_home => true
not_if { (! Etc.getpwnam(user).gecos.eql?('PHPMyAdmin User')) rescue false }
end

directory home do
Expand All @@ -52,22 +72,6 @@
action :create
end

directory node['phpmyadmin']['upload_dir'] do
owner 'root'
group 'root'
mode 01777
recursive true
action :create
end

directory node['phpmyadmin']['save_dir'] do
owner 'root'
group 'root'
mode 01777
recursive true
action :create
end

# Download the selected PHPMyAdmin archive
remote_file "#{Chef::Config['file_cache_path']}/phpMyAdmin-#{node['phpmyadmin']['version']}-all-languages.tar.gz" do
owner user
Expand Down Expand Up @@ -108,9 +112,10 @@
end

template "#{home}/config.inc.php" do
source 'config.inc.php.erb'
source node['phpmyadmin']['config_template']
owner user
group group
cookbook node['phpmyadmin']['config_template_cookbook']
mode 00644
end

Expand Down
Expand Up @@ -96,6 +96,12 @@ $cfg['QueryHistoryDB'] = <%= node['phpmyadmin']['query_history'] %>;
*/
$cfg['QueryHistoryMax'] = <%= node['phpmyadmin']['query_history_size'] %>;

/**
* Whether to force using https while accessing phpMyAdmin. In a reverse proxy setup,
* setting this to true is not supported.
*/
$cfg['ForceSSL'] = <%= node['phpmyadmin']['force_ssl'] %>;

/*
* You can find more configuration options in Documentation.html
* or here: http://wiki.phpmyadmin.net/pma/Config
Expand Down

0 comments on commit 38ee5af

Please sign in to comment.