crypt_reboot 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/crypt_reboot/files_generator.rb +9 -4
- data/lib/crypt_reboot/luks/data_fetcher.rb +2 -2
- data/lib/crypt_reboot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca95c9301674a1698f766dbfa5dfd06adc99e91a286c32b7eaa77d8611e21762
|
4
|
+
data.tar.gz: 5403a4ed739f8b5901451e3e413598e85acfee1765266a66d85257c708904399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d633a85afa5dc298f39c144d700347cb20ae4bc03e5865ba3a92c2a1ae0ec9bc679393b612f7c18838d35578f583db8f791aab223f896a1ed3fce8bcfd78c6e8
|
7
|
+
data.tar.gz: 59442b7e7106a5d2892def87930503472315dbc45da8d9bf8919d29fc7fc998edcb2dfe69b3bc4ea0306c173bc1dc305fa5be42954bb706eb35f4104531933a3
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Cryptreboot
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/crypt_reboot.svg)](https://badge.fury.io/rb/crypt_reboot)
|
4
|
+
|
3
5
|
Convenient reboot for Linux systems with encrypted root partition.
|
4
6
|
|
5
7
|
> Just type `cryptreboot` instead of `reboot`.
|
@@ -55,9 +57,9 @@ probably already met:
|
|
55
57
|
|
56
58
|
## Installation
|
57
59
|
|
58
|
-
Make sure the required software is installed, then install the gem by executing:
|
60
|
+
Make sure the required software is installed, then install the gem system-wide by executing:
|
59
61
|
|
60
|
-
$ gem install crypt_reboot
|
62
|
+
$ sudo gem install crypt_reboot
|
61
63
|
|
62
64
|
## Usage
|
63
65
|
|
@@ -6,10 +6,9 @@ module CryptReboot
|
|
6
6
|
def call(entries, base_dir)
|
7
7
|
files = {}
|
8
8
|
modified_entries = entries.map do |entry|
|
9
|
-
|
10
|
-
next entry unless luks?(headevice)
|
9
|
+
next entry unless luks?(entry, base_dir)
|
11
10
|
|
12
|
-
data =
|
11
|
+
data = fetch_data(entry, base_dir)
|
13
12
|
keyfile = keyfile_locator.call(entry.target)
|
14
13
|
files[keyfile] = data.key
|
15
14
|
entry_converter.call(entry, data, keyfile)
|
@@ -22,10 +21,16 @@ module CryptReboot
|
|
22
21
|
CRYPTAB_PATH = '/cryptroot/crypttab'
|
23
22
|
private_constant :CRYPTAB_PATH
|
24
23
|
|
25
|
-
def luks?(
|
24
|
+
def luks?(entry, base_dir)
|
25
|
+
headevice = entry.headevice(header_prefix: base_dir)
|
26
26
|
luks_checker.call(headevice)
|
27
27
|
end
|
28
28
|
|
29
|
+
def fetch_data(entry, base_dir)
|
30
|
+
headevice = entry.headevice(header_prefix: base_dir)
|
31
|
+
luks_data_fetcher.call(headevice, entry.target)
|
32
|
+
end
|
33
|
+
|
29
34
|
attr_reader :keyfile_locator, :entry_converter, :serializer,
|
30
35
|
:luks_data_fetcher, :luks_checker
|
31
36
|
|
@@ -4,10 +4,10 @@ module CryptReboot
|
|
4
4
|
module Luks
|
5
5
|
# Fetch LUKS data including key (user will be asked for passphrase)
|
6
6
|
class DataFetcher
|
7
|
-
def call(headevice)
|
7
|
+
def call(headevice, target)
|
8
8
|
version = detector.call(headevice)
|
9
9
|
data = dumper.call(headevice, version)
|
10
|
-
pass = asker.call("
|
10
|
+
pass = asker.call("Please unlock disk #{target}: ")
|
11
11
|
key = key_fetcher.call(headevice, pass)
|
12
12
|
data.with_key(key)
|
13
13
|
end
|
data/lib/crypt_reboot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crypt_reboot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paweł Pokrywka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-command
|