capistrano-fiftyfive 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a062ce89eef2c928f8db7af57f9c5023c8978e72
4
- data.tar.gz: 151f2d436bbe25871a3d6ae6a931d11b5d571648
3
+ metadata.gz: c1ad4e92fe008acf75a2a3281becf8f61cecf67a
4
+ data.tar.gz: bebf97f80cd64e0cf52bca965318d8605f966737
5
5
  SHA512:
6
- metadata.gz: f0c71a57c1b2296cf4a7d95781c717c471da935419aba27311126f717ad53a9ff2e987b4382d558b0d4c90b46bcd854f46a21dd0efa115bc811292172fb6509c
7
- data.tar.gz: 0c709af0de8a65728a44b92be2b9053f7bf428c052cdaa47959b541b7f79d9fae5dc039cbefad84eed85fc857f35ccd2c0a33b9f6924601e858faf4f23ca2bd7
6
+ metadata.gz: 791fd196392a42c2b7c694a869e774479a5b821058e2f1fa668d6fdfe5ebda1ee5f47b548291d0cce4705c164feef8d052b80e72976ce436d9c5d1d9c529000c
7
+ data.tar.gz: 8a2bc6793637ae88835cbc2ed0eb8ab9319b2c562144e7eaef945919779fdba4e4b2566d74f81bf7fc3eb2082c57da7cff8e0eb87043e468e4abe2cf4f71f9cb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # capistrano-fiftyfive Changelog
2
2
 
3
+ ## `0.11.1`
4
+
5
+ Fixes errors caused by PostgreSQL password containing shell-unsafe characters. Passwords are now safely hashed with MD5 before being used in the `CREATE USER` command.
6
+
3
7
  ## `0.11.0`
4
8
 
5
9
  * INFO log messages are now included in abbreviated output (e.g. upload/download progress).
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Fiftyfive
3
- VERSION = "0.11.0"
3
+ VERSION = "0.11.1"
4
4
  end
5
5
  end
@@ -1,3 +1,4 @@
1
+ require "digest"
1
2
  require "monitor"
2
3
  require "capistrano/fiftyfive/version"
3
4
  require "capistrano/fiftyfive/compatibility"
@@ -45,7 +45,9 @@ namespace :fiftyfive do
45
45
 
46
46
  unless test("sudo -u postgres psql -c '\\du' | grep -q #{user}")
47
47
  passwd = fetch(:fiftyfive_postgresql_password)
48
- execute %Q[sudo -u postgres psql -c "create user #{user} with password '#{passwd}';"]
48
+ md5 = Digest::MD5.hexdigest(passwd + user)
49
+ execute "sudo -u postgres psql -c " +
50
+ %Q["CREATE USER #{user} PASSWORD 'md5#{md5}';"]
49
51
  end
50
52
  end
51
53
  end
@@ -64,11 +66,22 @@ namespace :fiftyfive do
64
66
 
65
67
  desc "Generate database.yml"
66
68
  task :database_yml do
69
+ yaml = {
70
+ fetch(:rails_env).to_s => {
71
+ "adapter" => "postgresql",
72
+ "encoding" => "unicode",
73
+ "database" => fetch(:fiftyfive_postgresql_database).to_s,
74
+ "pool" => fetch(:fiftyfive_postgresql_pool_size).to_i,
75
+ "username" => fetch(:fiftyfive_postgresql_user).to_s,
76
+ "password" => fetch(:fiftyfive_postgresql_password).to_s,
77
+ "host" => fetch(:fiftyfive_postgresql_host).to_s
78
+ }
79
+ }
67
80
  fetch(:fiftyfive_postgresql_password)
68
81
  on release_roles(:all) do
69
- template "postgresql.yml.erb",
70
- "#{shared_path}/config/database.yml",
71
- :mode => "600"
82
+ put YAML.dump(yaml),
83
+ "#{shared_path}/config/database.yml",
84
+ :mode => "600"
72
85
  end
73
86
  end
74
87
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-fiftyfive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-02 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -110,7 +110,6 @@ files:
110
110
  - lib/capistrano/fiftyfive/templates/nginx_unicorn.erb
111
111
  - lib/capistrano/fiftyfive/templates/pgpass.erb
112
112
  - lib/capistrano/fiftyfive/templates/postgresql-backup-logrotate.erb
113
- - lib/capistrano/fiftyfive/templates/postgresql.yml.erb
114
113
  - lib/capistrano/fiftyfive/templates/rbenv_bashrc
115
114
  - lib/capistrano/fiftyfive/templates/sidekiq_init.erb
116
115
  - lib/capistrano/fiftyfive/templates/ssl_setup
@@ -1,8 +0,0 @@
1
- <%= fetch(:rails_env) %>:
2
- adapter: postgresql
3
- encoding: unicode
4
- database: <%= fetch(:fiftyfive_postgresql_database) %>
5
- pool: <%= fetch(:fiftyfive_postgresql_pool_size) %>
6
- username: <%= fetch(:fiftyfive_postgresql_user) %>
7
- password: <%= fetch(:fiftyfive_postgresql_password) %>
8
- host: <%= fetch(:fiftyfive_postgresql_host) %>