pgchief 0.5.0 → 0.5.2
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 +4 -4
- data/CHANGELOG.md +38 -14
- data/README.md +3 -0
- data/config/pgchief.toml +1 -1
- data/lib/pgchief/config/s3.rb +4 -4
- data/lib/pgchief/config.rb +4 -4
- data/lib/pgchief/database/backups.rb +0 -1
- data/lib/pgchief/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 613ce14b91c64d69a6fa16449f8ea8aa2a3dfcab054684efaefe978eaae0f564
|
4
|
+
data.tar.gz: 7116499bc9a4ea6e30b850bbe07e953e7068b7c2b8c03b32daef87dde6fe0061
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3725ab140a34f5e8c41fb13e9c737835a96ca440d2519ee377991921af672109321984e8d089813be6042af732642a4c94127da2d8873d1214f32c0073583299
|
7
|
+
data.tar.gz: f560244827039f3258151f2e8e573b5d4584847cd5ddccf84e085b00104f21b45fa77af1c6a85df54d8ee2ace45a5915d4240ef06ee24ae5714625072eb5ec46
|
data/CHANGELOG.md
CHANGED
@@ -13,18 +13,39 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
|
|
13
13
|
|
14
14
|
### Fixes
|
15
15
|
|
16
|
+
## [0.5.2]
|
17
|
+
|
18
|
+
### Changes
|
19
|
+
|
20
|
+
* Change S3 config option `s3_path_prefix` to `s3_objects_path`.
|
21
|
+
* Above change retains backwards compatibility with the old `s3_path_prefix` option.
|
22
|
+
|
23
|
+
### Fixes
|
24
|
+
|
25
|
+
* Fix S3 regex to allow `-` in the path.
|
26
|
+
|
27
|
+
## [0.5.1]
|
28
|
+
|
29
|
+
### Changes
|
30
|
+
|
31
|
+
* Update README to note that libpq-dev is a required dependency in order to build.
|
32
|
+
|
33
|
+
### Fixes
|
34
|
+
|
35
|
+
* Remove `pry` from being required.
|
36
|
+
|
16
37
|
## [0.5.0]
|
17
38
|
|
18
39
|
### Additions
|
19
40
|
|
20
|
-
* Restore database from local file(s)
|
21
|
-
* Restore database from s3
|
41
|
+
* Restore database from local file(s).
|
42
|
+
* Restore database from s3.
|
22
43
|
|
23
44
|
## [0.4.0]
|
24
45
|
|
25
46
|
### Changes
|
26
47
|
|
27
|
-
* Clean up the config object
|
48
|
+
* Clean up the config object.
|
28
49
|
|
29
50
|
### Additions
|
30
51
|
|
@@ -33,7 +54,7 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
|
|
33
54
|
### Fixes
|
34
55
|
|
35
56
|
* Capture error where the config file does not exist and provide some guidance.
|
36
|
-
* Make a `PG::ConnectionBad` error a little less scary(?)
|
57
|
+
* Make a `PG::ConnectionBad` error a little less scary(?).
|
37
58
|
* Do not inherit the base `Command` class in `ConfigCreate`. It doesn't need to connect to the DB.
|
38
59
|
|
39
60
|
## [0.3.1]
|
@@ -53,24 +74,24 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
|
|
53
74
|
|
54
75
|
### Additions
|
55
76
|
|
56
|
-
- Refactor `exe/pgchief` to utilize `TTY::Option` for kicking off config initialization
|
57
|
-
- `pgchief --init` now creates a toml config file in your `$HOME
|
77
|
+
- Refactor `exe/pgchief` to utilize `TTY::Option` for kicking off config initialization.
|
78
|
+
- `pgchief --init` now creates a toml config file in your `$HOME`.
|
58
79
|
- Added ability to store credentials if your config sets `credentials_file`
|
59
|
-
when db's and users are created
|
80
|
+
when db's and users are created.
|
60
81
|
- Added `ConnectionString` class that abstracts the base db connection,
|
61
|
-
allowing for additions of users and db's
|
62
|
-
- Load everything in the config file to the Config attributes
|
82
|
+
allowing for additions of users and db's.
|
83
|
+
- Load everything in the config file to the Config attributes.
|
63
84
|
|
64
85
|
### Changes
|
65
86
|
|
66
|
-
- Default location of config changed from `~/.pgchief.toml` to `~/.config/pgchief/config.toml
|
67
|
-
- Automatically require 'pry' in the test suite
|
87
|
+
- Default location of config changed from `~/.pgchief.toml` to `~/.config/pgchief/config.toml`.
|
88
|
+
- Automatically require 'pry' in the test suite.
|
68
89
|
|
69
90
|
### Fixes
|
70
91
|
|
71
92
|
- When dropping user, ignore whenever a database has no privileges for the
|
72
|
-
selected user
|
73
|
-
- Retroactive addition of tests to cover any regressions
|
93
|
+
selected user.
|
94
|
+
- Retroactive addition of tests to cover any regressions.
|
74
95
|
|
75
96
|
## [0.2.0] - 2024-08-30
|
76
97
|
|
@@ -98,7 +119,10 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
|
|
98
119
|
- Drop user ✅
|
99
120
|
- List databases ✅
|
100
121
|
|
101
|
-
[Unreleased]: https://github.com/jayroh/pgchief/compare/v0.
|
122
|
+
[Unreleased]: https://github.com/jayroh/pgchief/compare/v0.5.2...HEAD
|
123
|
+
[0.5.2]: https://github.com/jayroh/pgchief/releases/tag/v0.5.2
|
124
|
+
[0.5.1]: https://github.com/jayroh/pgchief/releases/tag/v0.5.1
|
125
|
+
[0.5.0]: https://github.com/jayroh/pgchief/releases/tag/v0.5.0
|
102
126
|
[0.4.0]: https://github.com/jayroh/pgchief/releases/tag/v0.4.0
|
103
127
|
[0.3.1]: https://github.com/jayroh/pgchief/releases/tag/v0.3.1
|
104
128
|
[0.3.0]: https://github.com/jayroh/pgchief/releases/tag/v0.3.0
|
data/README.md
CHANGED
@@ -24,6 +24,7 @@ below for the feature check-list and current progress.
|
|
24
24
|
## Usage
|
25
25
|
|
26
26
|
```sh
|
27
|
+
# System dependency `libpq-dev` must be installed
|
27
28
|
gem install pgchief
|
28
29
|
|
29
30
|
# To initialize the config file at `~/.config/pgchief/config.toml`:
|
@@ -136,3 +137,5 @@ Give "rando-username" access to database(s):
|
|
136
137
|
* [x] Restore remote database @ S3
|
137
138
|
* [ ] Quickly back up via command line option
|
138
139
|
* [ ] Quickly restore via command line option
|
140
|
+
* [ ] Task for inclusion in a Rakefile
|
141
|
+
* [ ] Support environment variables in config
|
data/config/pgchief.toml
CHANGED
data/lib/pgchief/config/s3.rb
CHANGED
@@ -13,9 +13,9 @@ module Pgchief
|
|
13
13
|
:s3_key,
|
14
14
|
:s3_secret,
|
15
15
|
:s3_region,
|
16
|
-
:
|
16
|
+
:s3_objects_path
|
17
17
|
|
18
|
-
PREFIX_REGEX = %r{\As3://(?<bucket>(\w|-)*)/(?<path>(\w
|
18
|
+
PREFIX_REGEX = %r{\As3://(?<bucket>(\w|-)*)/(?<path>(\w|/|-)*/)\z}
|
19
19
|
|
20
20
|
attr_reader :config
|
21
21
|
|
@@ -44,14 +44,14 @@ module Pgchief
|
|
44
44
|
s3_key,
|
45
45
|
s3_secret,
|
46
46
|
s3_region,
|
47
|
-
|
47
|
+
s3_objects_path
|
48
48
|
].none?(&:nil?)
|
49
49
|
end
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
53
|
def s3_match
|
54
|
-
@s3_match ||=
|
54
|
+
@s3_match ||= s3_objects_path.match(PREFIX_REGEX)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
data/lib/pgchief/config.rb
CHANGED
@@ -14,7 +14,7 @@ module Pgchief
|
|
14
14
|
attr_writer :pgurl
|
15
15
|
|
16
16
|
attr_reader \
|
17
|
-
:
|
17
|
+
:s3_objects_path,
|
18
18
|
:backup_dir,
|
19
19
|
:credentials_file
|
20
20
|
|
@@ -26,7 +26,7 @@ module Pgchief
|
|
26
26
|
self.s3_key = config[:s3_key]
|
27
27
|
self.s3_secret = config[:s3_secret]
|
28
28
|
self.s3_region = config[:s3_region]
|
29
|
-
self.
|
29
|
+
self.s3_objects_path = config[:s3_objects_path] || config[:s3_path_prefix]
|
30
30
|
rescue Errno::ENOENT
|
31
31
|
puts config_missing_error(toml_file)
|
32
32
|
end
|
@@ -43,8 +43,8 @@ module Pgchief
|
|
43
43
|
@backup_dir = value ? "#{value.chomp("/")}/".gsub("~", Dir.home) : "/tmp/"
|
44
44
|
end
|
45
45
|
|
46
|
-
def
|
47
|
-
@
|
46
|
+
def s3_objects_path=(value)
|
47
|
+
@s3_objects_path = value ? "#{value.chomp("/")}/" : nil
|
48
48
|
end
|
49
49
|
|
50
50
|
def credentials_file=(value)
|
data/lib/pgchief/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgchief
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
|
-
rubygems_version: 3.5.
|
163
|
+
rubygems_version: 3.5.23
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: A simple ruby script to manage postgresql databases and users
|