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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 449c9b12be881f213dffc9090686e7d73bb3f2523806c5edf41dc2e4d7d17c4b
4
- data.tar.gz: ba391871d8d5f438ba2474a8a21d8738be020636ac8c4bfcd0fd8100d7e07aec
3
+ metadata.gz: ca95c9301674a1698f766dbfa5dfd06adc99e91a286c32b7eaa77d8611e21762
4
+ data.tar.gz: 5403a4ed739f8b5901451e3e413598e85acfee1765266a66d85257c708904399
5
5
  SHA512:
6
- metadata.gz: 466befee2a5027cae8be7cb036c87e8c779e64fb4725775111b112e53ff5bf2691bc543ac86e7c229e8e75642c0c3eb0168fed1bca14a2b0598b94bf3c5245c0
7
- data.tar.gz: 68bef507bea7444722f3281b94d8ea5af0bda0d031871f82fc9ff0398614e7b83564f2b541a42d745d2eefecde9f0a409817dcd29332b01797cd13b434bd7db0
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
- headevice = entry.headevice(header_prefix: base_dir)
10
- next entry unless luks?(headevice)
9
+ next entry unless luks?(entry, base_dir)
11
10
 
12
- data = luks_data_fetcher.call(headevice)
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?(headevice)
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("Enter passphrase to unlock #{headevice}: ")
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CryptReboot
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
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.0
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-09 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-command