trocla 0.5.1 → 0.7.0
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 +11 -0
- data/README.md +32 -1
- data/lib/trocla/hooks.rb +33 -0
- data/lib/trocla/version.rb +6 -15
- data/lib/trocla.rb +9 -0
- metadata +56 -75
- data/.document +0 -4
- data/.github/workflows/ruby.yml +0 -24
- data/.rspec +0 -1
- data/Gemfile +0 -24
- data/Rakefile +0 -53
- data/ext/redhat/rubygem-trocla.spec +0 -120
- data/lib/VERSION +0 -4
- data/spec/data/.keep +0 -0
- data/spec/spec_helper.rb +0 -302
- data/spec/trocla/encryptions/none_spec.rb +0 -22
- data/spec/trocla/encryptions/ssl_spec.rb +0 -26
- data/spec/trocla/formats/pgsql_spec.rb +0 -25
- data/spec/trocla/formats/sshkey_spec.rb +0 -52
- data/spec/trocla/formats/x509_spec.rb +0 -382
- data/spec/trocla/store/memory_spec.rb +0 -6
- data/spec/trocla/store/moneta_spec.rb +0 -6
- data/spec/trocla/util_spec.rb +0 -54
- data/spec/trocla_spec.rb +0 -291
- data/trocla.gemspec +0 -105
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e516b5dbf1bdca34c4c47a440672337c3c7f8694593ff2b06ae2a2602a6b907
|
|
4
|
+
data.tar.gz: ce60947349c3faf08f7d0cda00fa3ddeeae6c09a1b8f8947695134c74e72b101
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 900ce53ad161c3a8819353205c685ebae03d95f303df6af34e5cd4771ab1fc4711684aad9411bdd9aab85d8426873ea179a03f288b47e38c9351b1c49c757528
|
|
7
|
+
data.tar.gz: eb344684031b86e4e56cd75c2530f9542d051fc1e395141c4c68070f03e4ba53784d6bdfcdbcf08d563af62e770526b1a7e2d9a1ac56c7daf6371ac6120a5397
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## to 0.7.0
|
|
4
|
+
|
|
5
|
+
* bump support for various dependencies and ruby versions
|
|
6
|
+
* get rid off jeweler gem
|
|
7
|
+
|
|
8
|
+
## to 0.6.0
|
|
9
|
+
|
|
10
|
+
* move away from sha1 since they are not supported anymore on all distributions
|
|
11
|
+
* fix tests on various platforms and newer ruby versions
|
|
12
|
+
* introduce hooks for set and delete actions
|
|
13
|
+
|
|
3
14
|
## to 0.5.1
|
|
4
15
|
|
|
5
16
|
* support more moneta versions (#78) - Thank you [jcharaoui](https://github.com/jcharaoui)
|
data/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# trocla
|
|
2
|
-
[](https://github.com/duritong/trocla/actions/workflows/ruby.yml)
|
|
3
3
|
|
|
4
4
|
Trocla provides you a simple way to create and store (random) passwords on a
|
|
5
5
|
central server, which can be retrieved by other applications. An example for
|
|
@@ -373,6 +373,37 @@ encryption_options:
|
|
|
373
373
|
:public_key: '/var/lib/puppet/ssl/public_keys/trocla.pem'
|
|
374
374
|
```
|
|
375
375
|
|
|
376
|
+
## Hooks
|
|
377
|
+
|
|
378
|
+
You can specify hooks to be called whenever trocla sets or deletes a password. The idea is that this allows you to run custom code that can trigger further actions based on deleting or setting a password.
|
|
379
|
+
|
|
380
|
+
Enabling hooks is done through the following configuration:
|
|
381
|
+
|
|
382
|
+
```YAML
|
|
383
|
+
hooks:
|
|
384
|
+
set:
|
|
385
|
+
my_hook: /path/to/my_hook_file.rb
|
|
386
|
+
delete:
|
|
387
|
+
other_hook: /path/to/my_other_hook_file.rb
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
A hook must have the following implementation based on the above config:
|
|
391
|
+
|
|
392
|
+
```Ruby
|
|
393
|
+
class Trocla
|
|
394
|
+
module Hooks
|
|
395
|
+
def self.my_hook(trocla, key, format, options)
|
|
396
|
+
# [... your code ...]
|
|
397
|
+
end
|
|
398
|
+
end
|
|
399
|
+
end
|
|
400
|
+
```
|
|
401
|
+
You can specify only either one or both kinds of hooks.
|
|
402
|
+
|
|
403
|
+
Hooks must not raise any exceptions or interrupt the flow itself. They can also not change the value that was set or revert a deletion.
|
|
404
|
+
|
|
405
|
+
However, they have Trocla itself available (through `trocla`) and you must ensure to not create infinite loops.
|
|
406
|
+
|
|
376
407
|
## Update & Changes
|
|
377
408
|
|
|
378
409
|
See [Changelog](CHANGELOG.md)
|
data/lib/trocla/hooks.rb
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
class Trocla
|
|
2
|
+
module Hooks
|
|
3
|
+
class Runner
|
|
4
|
+
attr_reader :trocla
|
|
5
|
+
def initialize(trocla)
|
|
6
|
+
@trocla = trocla
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def run(action, key, format, options)
|
|
10
|
+
return unless hooks[action]
|
|
11
|
+
hooks[action].each do |cmd|
|
|
12
|
+
Trocla::Hooks.send(cmd, trocla, key, format, options)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def hooks
|
|
19
|
+
@hooks ||= begin
|
|
20
|
+
res = {}
|
|
21
|
+
(trocla.config['hooks'] || {}).each do |action,action_hooks|
|
|
22
|
+
res[action] ||= []
|
|
23
|
+
action_hooks.each do |cmd,file|
|
|
24
|
+
require File.join(file)
|
|
25
|
+
res[action] << cmd
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
res
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
data/lib/trocla/version.rb
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
class Trocla
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
next if type =~ /^\s+$/ || value =~ /^\s+$/
|
|
10
|
-
|
|
11
|
-
version[type] = value
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
MAJOR = version['major']
|
|
15
|
-
MINOR = version['minor']
|
|
16
|
-
PATCH = version['patch']
|
|
17
|
-
BUILD = version['build']
|
|
4
|
+
module VERSION
|
|
5
|
+
MAJOR = 0
|
|
6
|
+
MINOR = 7
|
|
7
|
+
PATCH = 0
|
|
8
|
+
BUILD = nil
|
|
18
9
|
|
|
19
10
|
STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
|
|
20
11
|
|
data/lib/trocla.rb
CHANGED
|
@@ -3,6 +3,7 @@ require 'trocla/util'
|
|
|
3
3
|
require 'trocla/formats'
|
|
4
4
|
require 'trocla/encryptions'
|
|
5
5
|
require 'trocla/stores'
|
|
6
|
+
require 'trocla/hooks'
|
|
6
7
|
|
|
7
8
|
# Trocla class
|
|
8
9
|
class Trocla
|
|
@@ -67,6 +68,7 @@ class Trocla
|
|
|
67
68
|
|
|
68
69
|
def delete_password(key, format = nil, options = {})
|
|
69
70
|
v = store.delete(key, format)
|
|
71
|
+
hooks_runner.run('delete', key, format, options)
|
|
70
72
|
if v.is_a?(Hash)
|
|
71
73
|
Hash[*v.map do |f, encrypted_value|
|
|
72
74
|
[f, render(format, decrypt(encrypted_value), options)]
|
|
@@ -78,6 +80,7 @@ class Trocla
|
|
|
78
80
|
|
|
79
81
|
def set_password(key, format, password, options = {})
|
|
80
82
|
store.set(key, format, encrypt(password), options)
|
|
83
|
+
hooks_runner.run('set', key, format, options)
|
|
81
84
|
render(format, password, options)
|
|
82
85
|
end
|
|
83
86
|
|
|
@@ -122,6 +125,12 @@ class Trocla
|
|
|
122
125
|
clazz.new(config['store_options'], self)
|
|
123
126
|
end
|
|
124
127
|
|
|
128
|
+
def hooks_runner
|
|
129
|
+
@hooks_runner ||= begin
|
|
130
|
+
Trocla::Hooks::Runner.new(self)
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
125
134
|
def read_config
|
|
126
135
|
if @config_file.nil?
|
|
127
136
|
default_config
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trocla
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mh
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: highline
|
|
@@ -16,161 +15,153 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
18
|
+
version: '3.1'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
25
|
+
version: '3.1'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
27
|
name: moneta
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - "~>"
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '1.
|
|
32
|
+
version: '1.6'
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - "~>"
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '1.
|
|
39
|
+
version: '1.6'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: bcrypt
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
|
-
- - "
|
|
44
|
+
- - "~>"
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
46
|
+
version: '3.1'
|
|
48
47
|
type: :runtime
|
|
49
48
|
prerelease: false
|
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
50
|
requirements:
|
|
52
|
-
- - "
|
|
51
|
+
- - "~>"
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
53
|
+
version: '3.1'
|
|
55
54
|
- !ruby/object:Gem::Dependency
|
|
56
55
|
name: sshkey
|
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
|
58
57
|
requirements:
|
|
59
|
-
- - "
|
|
58
|
+
- - "~>"
|
|
60
59
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
60
|
+
version: '3.0'
|
|
62
61
|
type: :runtime
|
|
63
62
|
prerelease: false
|
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements:
|
|
66
|
-
- - "
|
|
65
|
+
- - "~>"
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
67
|
+
version: '3.0'
|
|
69
68
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
69
|
+
name: base64
|
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
|
72
71
|
requirements:
|
|
73
|
-
- - "
|
|
72
|
+
- - "~>"
|
|
74
73
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
76
|
-
type: :
|
|
74
|
+
version: 0.3.0
|
|
75
|
+
type: :runtime
|
|
77
76
|
prerelease: false
|
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
78
|
requirements:
|
|
80
|
-
- - "
|
|
79
|
+
- - "~>"
|
|
81
80
|
- !ruby/object:Gem::Version
|
|
82
|
-
version:
|
|
81
|
+
version: 0.3.0
|
|
83
82
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
83
|
+
name: pstore
|
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
|
86
85
|
requirements:
|
|
87
|
-
- - "
|
|
86
|
+
- - "~>"
|
|
88
87
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: '0'
|
|
90
|
-
type: :
|
|
88
|
+
version: '0.2'
|
|
89
|
+
type: :runtime
|
|
91
90
|
prerelease: false
|
|
92
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
92
|
requirements:
|
|
94
|
-
- - "
|
|
93
|
+
- - "~>"
|
|
95
94
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '0'
|
|
95
|
+
version: '0.2'
|
|
97
96
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
97
|
+
name: rake
|
|
99
98
|
requirement: !ruby/object:Gem::Requirement
|
|
100
99
|
requirements:
|
|
101
100
|
- - "~>"
|
|
102
101
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '
|
|
102
|
+
version: '13.0'
|
|
104
103
|
type: :development
|
|
105
104
|
prerelease: false
|
|
106
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
106
|
requirements:
|
|
108
107
|
- - "~>"
|
|
109
108
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: '
|
|
109
|
+
version: '13.0'
|
|
111
110
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
111
|
+
name: rspec
|
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
|
114
113
|
requirements:
|
|
115
|
-
- - "
|
|
114
|
+
- - "~>"
|
|
116
115
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '
|
|
116
|
+
version: '3.13'
|
|
118
117
|
type: :development
|
|
119
118
|
prerelease: false
|
|
120
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
120
|
requirements:
|
|
122
|
-
- - "
|
|
121
|
+
- - "~>"
|
|
123
122
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '
|
|
123
|
+
version: '3.13'
|
|
125
124
|
- !ruby/object:Gem::Dependency
|
|
126
|
-
name: rspec
|
|
125
|
+
name: rspec-pending_for
|
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
|
128
127
|
requirements:
|
|
129
|
-
- - "
|
|
128
|
+
- - "~>"
|
|
130
129
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: '0'
|
|
130
|
+
version: '0.1'
|
|
132
131
|
type: :development
|
|
133
132
|
prerelease: false
|
|
134
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
134
|
requirements:
|
|
136
|
-
- - "
|
|
135
|
+
- - "~>"
|
|
137
136
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: '0'
|
|
137
|
+
version: '0.1'
|
|
139
138
|
- !ruby/object:Gem::Dependency
|
|
140
|
-
name:
|
|
139
|
+
name: rdoc
|
|
141
140
|
requirement: !ruby/object:Gem::Requirement
|
|
142
141
|
requirements:
|
|
143
|
-
- - "
|
|
142
|
+
- - "~>"
|
|
144
143
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: '0'
|
|
144
|
+
version: '7.0'
|
|
146
145
|
type: :development
|
|
147
146
|
prerelease: false
|
|
148
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
148
|
requirements:
|
|
150
|
-
- - "
|
|
149
|
+
- - "~>"
|
|
151
150
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: '0'
|
|
151
|
+
version: '7.0'
|
|
153
152
|
description: Trocla helps you to generate random passwords and to store them in various
|
|
154
|
-
formats (plain, MD5, bcrypt) for later
|
|
155
|
-
email:
|
|
153
|
+
formats (plain, MD5, bcrypt) for later retrieval.
|
|
154
|
+
email:
|
|
155
|
+
- mh+trocla@immerda.ch
|
|
156
156
|
executables:
|
|
157
157
|
- trocla
|
|
158
158
|
extensions: []
|
|
159
|
-
extra_rdoc_files:
|
|
160
|
-
- LICENSE.txt
|
|
161
|
-
- README.md
|
|
159
|
+
extra_rdoc_files: []
|
|
162
160
|
files:
|
|
163
|
-
- ".document"
|
|
164
|
-
- ".github/workflows/ruby.yml"
|
|
165
|
-
- ".rspec"
|
|
166
161
|
- CHANGELOG.md
|
|
167
|
-
- Gemfile
|
|
168
162
|
- LICENSE.txt
|
|
169
163
|
- README.md
|
|
170
|
-
- Rakefile
|
|
171
164
|
- bin/trocla
|
|
172
|
-
- ext/redhat/rubygem-trocla.spec
|
|
173
|
-
- lib/VERSION
|
|
174
165
|
- lib/trocla.rb
|
|
175
166
|
- lib/trocla/default_config.yaml
|
|
176
167
|
- lib/trocla/encryptions.rb
|
|
@@ -189,6 +180,7 @@ files:
|
|
|
189
180
|
- lib/trocla/formats/sshkey.rb
|
|
190
181
|
- lib/trocla/formats/wireguard.rb
|
|
191
182
|
- lib/trocla/formats/x509.rb
|
|
183
|
+
- lib/trocla/hooks.rb
|
|
192
184
|
- lib/trocla/store.rb
|
|
193
185
|
- lib/trocla/stores.rb
|
|
194
186
|
- lib/trocla/stores/memory.rb
|
|
@@ -196,23 +188,13 @@ files:
|
|
|
196
188
|
- lib/trocla/stores/vault.rb
|
|
197
189
|
- lib/trocla/util.rb
|
|
198
190
|
- lib/trocla/version.rb
|
|
199
|
-
- spec/data/.keep
|
|
200
|
-
- spec/spec_helper.rb
|
|
201
|
-
- spec/trocla/encryptions/none_spec.rb
|
|
202
|
-
- spec/trocla/encryptions/ssl_spec.rb
|
|
203
|
-
- spec/trocla/formats/pgsql_spec.rb
|
|
204
|
-
- spec/trocla/formats/sshkey_spec.rb
|
|
205
|
-
- spec/trocla/formats/x509_spec.rb
|
|
206
|
-
- spec/trocla/store/memory_spec.rb
|
|
207
|
-
- spec/trocla/store/moneta_spec.rb
|
|
208
|
-
- spec/trocla/util_spec.rb
|
|
209
|
-
- spec/trocla_spec.rb
|
|
210
|
-
- trocla.gemspec
|
|
211
191
|
homepage: https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/
|
|
212
192
|
licenses:
|
|
213
|
-
-
|
|
214
|
-
metadata:
|
|
215
|
-
|
|
193
|
+
- GPL-3.0-or-later
|
|
194
|
+
metadata:
|
|
195
|
+
homepage_uri: https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/
|
|
196
|
+
source_code_uri: https://github.com/duritong/trocla
|
|
197
|
+
changelog_uri: https://github.com/duritong/trocla/blob/master/CHANGELOG.md
|
|
216
198
|
rdoc_options: []
|
|
217
199
|
require_paths:
|
|
218
200
|
- lib
|
|
@@ -220,15 +202,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
220
202
|
requirements:
|
|
221
203
|
- - ">="
|
|
222
204
|
- !ruby/object:Gem::Version
|
|
223
|
-
version:
|
|
205
|
+
version: 2.5.0
|
|
224
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
207
|
requirements:
|
|
226
208
|
- - ">="
|
|
227
209
|
- !ruby/object:Gem::Version
|
|
228
210
|
version: '0'
|
|
229
211
|
requirements: []
|
|
230
|
-
rubygems_version:
|
|
231
|
-
signing_key:
|
|
212
|
+
rubygems_version: 4.0.3
|
|
232
213
|
specification_version: 4
|
|
233
214
|
summary: Trocla a simple password generator and storage
|
|
234
215
|
test_files: []
|
data/.document
DELETED
data/.github/workflows/ruby.yml
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Ruby
|
|
3
|
-
on: [push, pull_request]
|
|
4
|
-
jobs:
|
|
5
|
-
spec:
|
|
6
|
-
runs-on: ubuntu-latest
|
|
7
|
-
steps:
|
|
8
|
-
- name: check out repository
|
|
9
|
-
uses: actions/checkout@v3
|
|
10
|
-
- name: set up Ruby
|
|
11
|
-
uses: ruby/setup-ruby@v1
|
|
12
|
-
with:
|
|
13
|
-
bundler-cache: true
|
|
14
|
-
ruby-version: ${{ matrix.ruby }}
|
|
15
|
-
- name: install dependencies
|
|
16
|
-
run: bundle install
|
|
17
|
-
- name: install wireguard
|
|
18
|
-
run: sudo apt install -y wireguard
|
|
19
|
-
- name: run rspec
|
|
20
|
-
run: bundle exec rake spec
|
|
21
|
-
strategy:
|
|
22
|
-
fail-fast: false
|
|
23
|
-
matrix:
|
|
24
|
-
ruby: ['2.5','2.7', '3.0', '3.1','head','jruby','jruby-head']
|
data/.rspec
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--color --format documentation
|
data/Gemfile
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
source 'http://rubygems.org'
|
|
2
|
-
# Add dependencies required to use your gem here.
|
|
3
|
-
# Example:
|
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
|
5
|
-
|
|
6
|
-
gem 'highline', '~> 2.0.0'
|
|
7
|
-
gem 'moneta', '~> 1.0'
|
|
8
|
-
|
|
9
|
-
if defined?(RUBY_ENGINE) && (RUBY_ENGINE == 'jruby')
|
|
10
|
-
gem 'jruby-openssl'
|
|
11
|
-
end
|
|
12
|
-
gem 'bcrypt'
|
|
13
|
-
gem 'sshkey'
|
|
14
|
-
|
|
15
|
-
# Add dependencies to develop your gem here.
|
|
16
|
-
# Include everything needed to run rake, tests, features, etc.
|
|
17
|
-
group :development do
|
|
18
|
-
gem 'rake'
|
|
19
|
-
gem 'addressable'
|
|
20
|
-
gem 'jeweler', '~> 2.0'
|
|
21
|
-
gem 'rdoc'
|
|
22
|
-
gem 'rspec'
|
|
23
|
-
gem 'rspec-pending_for'
|
|
24
|
-
end
|
data/Rakefile
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'rubygems'
|
|
4
|
-
require 'bundler'
|
|
5
|
-
begin
|
|
6
|
-
Bundler.setup(:default, :development)
|
|
7
|
-
rescue Bundler::BundlerError => e
|
|
8
|
-
$stderr.puts e.message
|
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
|
10
|
-
exit e.status_code
|
|
11
|
-
end
|
|
12
|
-
require 'rake'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
require 'jeweler'
|
|
16
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
|
17
|
-
require 'trocla'
|
|
18
|
-
Jeweler::Tasks.new do |gem|
|
|
19
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
|
20
|
-
gem.name = "trocla"
|
|
21
|
-
gem.homepage = "https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/"
|
|
22
|
-
gem.license = "GPLv3"
|
|
23
|
-
gem.summary = "Trocla a simple password generator and storage"
|
|
24
|
-
gem.description = "Trocla helps you to generate random passwords and to store them in various formats (plain, MD5, bcrypt) for later retrival."
|
|
25
|
-
gem.email = "mh+trocla@immerda.ch"
|
|
26
|
-
gem.authors = ["mh"]
|
|
27
|
-
gem.version = Trocla::VERSION::STRING
|
|
28
|
-
# dependencies defined in Gemfile
|
|
29
|
-
end
|
|
30
|
-
Jeweler::RubygemsDotOrgTasks.new
|
|
31
|
-
|
|
32
|
-
require 'rspec/core'
|
|
33
|
-
require 'rspec/core/rake_task'
|
|
34
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
35
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
|
39
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
|
40
|
-
spec.rcov = true
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
task :default => :spec
|
|
44
|
-
|
|
45
|
-
gem 'rdoc'
|
|
46
|
-
require 'rdoc/task'
|
|
47
|
-
RDoc::Task.new do |rdoc|
|
|
48
|
-
version = Trocla::VERSION::STRING
|
|
49
|
-
rdoc.rdoc_dir = 'rdoc'
|
|
50
|
-
rdoc.title = "trocla #{version}"
|
|
51
|
-
rdoc.rdoc_files.include('README*')
|
|
52
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
53
|
-
end
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# Generated from trocla-0.1.2.gem by gem2rpm -*- rpm-spec -*-
|
|
2
|
-
%global gem_name trocla
|
|
3
|
-
|
|
4
|
-
Name: rubygem-%{gem_name}
|
|
5
|
-
Version: 0.3.0
|
|
6
|
-
Release: 1%{?dist}
|
|
7
|
-
Summary: Trocla a simple password generator and storage
|
|
8
|
-
Group: Development/Languages
|
|
9
|
-
License: GPLv3
|
|
10
|
-
URL: https://tech.immerda.ch/2011/12/trocla-get-hashed-passwords-out-of-puppet-manifests/
|
|
11
|
-
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
12
|
-
Requires: rubygem-moneta
|
|
13
|
-
Requires: rubygem-bcrypt
|
|
14
|
-
Requires: rubygem-highline
|
|
15
|
-
BuildRequires: rubygem-moneta = 0.7.20
|
|
16
|
-
BuildRequires: rubygem-bcrypt
|
|
17
|
-
BuildRequires: rubygem-highline
|
|
18
|
-
%if 0%{?rhel} >= 7
|
|
19
|
-
BuildRequires: ruby(release)
|
|
20
|
-
%endif
|
|
21
|
-
BuildRequires: rubygems-devel
|
|
22
|
-
BuildRequires: ruby
|
|
23
|
-
# BuildRequires: rubygem(mocha)
|
|
24
|
-
# BuildRequires: rubygem(rspec) => 2.4
|
|
25
|
-
# BuildRequires: rubygem(rspec) < 3
|
|
26
|
-
# BuildRequires: rubygem(jeweler) => 1.6
|
|
27
|
-
# BuildRequires: rubygem(jeweler) < 2
|
|
28
|
-
BuildArch: noarch
|
|
29
|
-
|
|
30
|
-
%description
|
|
31
|
-
Trocla helps you to generate random passwords and to store them in various
|
|
32
|
-
formats (plain, MD5, bcrypt) for later retrival.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
%package doc
|
|
36
|
-
Summary: Documentation for %{name}
|
|
37
|
-
Group: Documentation
|
|
38
|
-
Requires: %{name} = %{version}-%{release}
|
|
39
|
-
BuildArch: noarch
|
|
40
|
-
|
|
41
|
-
%description doc
|
|
42
|
-
Documentation for %{name}.
|
|
43
|
-
|
|
44
|
-
%prep
|
|
45
|
-
gem unpack %{SOURCE0}
|
|
46
|
-
|
|
47
|
-
%setup -q -D -T -n %{gem_name}-%{version}
|
|
48
|
-
|
|
49
|
-
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
|
50
|
-
|
|
51
|
-
%build
|
|
52
|
-
# Create the gem as gem install only works on a gem file
|
|
53
|
-
gem build %{gem_name}.gemspec
|
|
54
|
-
|
|
55
|
-
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
|
|
56
|
-
# by default, so that we can move it into the buildroot in %%install
|
|
57
|
-
%gem_install
|
|
58
|
-
|
|
59
|
-
%install
|
|
60
|
-
mkdir -p %{buildroot}%{gem_dir}
|
|
61
|
-
cp -a .%{gem_dir}/* \
|
|
62
|
-
%{buildroot}%{gem_dir}/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
mkdir -p %{buildroot}%{_bindir}
|
|
66
|
-
mkdir -p %{buildroot}%{_sysconfdir}
|
|
67
|
-
mkdir -p %{buildroot}/%{_sharedstatedir}/%{gem_name}
|
|
68
|
-
touch %{buildroot}/%{_sharedstatedir}/%{gem_name}/%{gem_name}_data.yaml
|
|
69
|
-
|
|
70
|
-
cp -pa .%{_bindir}/* \
|
|
71
|
-
%{buildroot}%{_bindir}/
|
|
72
|
-
|
|
73
|
-
chmod a+x %{buildroot}%{gem_instdir}/bin/%{gem_name}
|
|
74
|
-
|
|
75
|
-
cat <<EOF > %{buildroot}/%{_sysconfdir}/%{gem_name}rc.yaml
|
|
76
|
-
---
|
|
77
|
-
store: :moneta
|
|
78
|
-
store_options:
|
|
79
|
-
adapter: :YAML
|
|
80
|
-
adapter_options:
|
|
81
|
-
:file: '%{_sharedstatedir}/%{gem_name}/%{gem_name}_data.yaml'
|
|
82
|
-
EOF
|
|
83
|
-
|
|
84
|
-
# Run the test suite
|
|
85
|
-
%check
|
|
86
|
-
pushd .%{gem_instdir}
|
|
87
|
-
|
|
88
|
-
popd
|
|
89
|
-
|
|
90
|
-
%files
|
|
91
|
-
%dir %{gem_instdir}
|
|
92
|
-
%{_bindir}/trocla
|
|
93
|
-
%{gem_instdir}/.rspec
|
|
94
|
-
%exclude %{gem_instdir}/.travis.yml
|
|
95
|
-
%exclude %{gem_instdir}/.rspec
|
|
96
|
-
%exclude %{gem_instdir}/ext/redhat/%{name}.spec
|
|
97
|
-
%license %{gem_instdir}/LICENSE.txt
|
|
98
|
-
%{gem_instdir}/bin
|
|
99
|
-
%{gem_libdir}
|
|
100
|
-
%exclude %{gem_cache}
|
|
101
|
-
%{gem_spec}
|
|
102
|
-
%config(noreplace) %{_sysconfdir}/%{gem_name}rc.yaml
|
|
103
|
-
%dir %attr(-, -, -) %{_sharedstatedir}/%{gem_name}
|
|
104
|
-
%config(noreplace) %attr(660, root, root) %{_sharedstatedir}/%{gem_name}/%{gem_name}_data.yaml
|
|
105
|
-
|
|
106
|
-
%files doc
|
|
107
|
-
%doc %{gem_docdir}
|
|
108
|
-
%doc %{gem_instdir}/.document
|
|
109
|
-
%{gem_instdir}/Gemfile
|
|
110
|
-
%doc %{gem_instdir}/README.md
|
|
111
|
-
%doc %{gem_instdir}/CHANGELOG.md
|
|
112
|
-
%{gem_instdir}/Rakefile
|
|
113
|
-
%{gem_instdir}/spec
|
|
114
|
-
%{gem_instdir}/trocla.gemspec
|
|
115
|
-
|
|
116
|
-
%changelog
|
|
117
|
-
* Mon Dec 21 2015 mh - 0.2.0-1
|
|
118
|
-
- Release of v0.2.0
|
|
119
|
-
* Sun Jun 21 2015 mh - 0.1.2-1
|
|
120
|
-
- Initial package
|
data/lib/VERSION
DELETED