crypt_reboot 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +169 -0
- data/exe/cryptreboot +9 -0
- data/lib/basic_loader.rb +60 -0
- data/lib/crypt_reboot/boot_config.rb +24 -0
- data/lib/crypt_reboot/cli/exiter.rb +25 -0
- data/lib/crypt_reboot/cli/happy_exiter.rb +14 -0
- data/lib/crypt_reboot/cli/params/definition.rb +125 -0
- data/lib/crypt_reboot/cli/params/flattener.rb +24 -0
- data/lib/crypt_reboot/cli/params/help_generator.rb +22 -0
- data/lib/crypt_reboot/cli/params/parser.rb +29 -0
- data/lib/crypt_reboot/cli/params_parsing_executor.rb +73 -0
- data/lib/crypt_reboot/cli/sad_exiter.rb +14 -0
- data/lib/crypt_reboot/cli.rb +8 -0
- data/lib/crypt_reboot/concatenator.rb +24 -0
- data/lib/crypt_reboot/config.rb +20 -0
- data/lib/crypt_reboot/crypt_tab/deserializer.rb +28 -0
- data/lib/crypt_reboot/crypt_tab/entry.rb +39 -0
- data/lib/crypt_reboot/crypt_tab/entry_deserializer.rb +51 -0
- data/lib/crypt_reboot/crypt_tab/entry_serializer.rb +21 -0
- data/lib/crypt_reboot/crypt_tab/keyfile_locator.rb +21 -0
- data/lib/crypt_reboot/crypt_tab/luks_to_plain_converter.rb +39 -0
- data/lib/crypt_reboot/crypt_tab/serializer.rb +29 -0
- data/lib/crypt_reboot/files_generator.rb +44 -0
- data/lib/crypt_reboot/files_writer.rb +17 -0
- data/lib/crypt_reboot/gziper.rb +22 -0
- data/lib/crypt_reboot/initramfs/archiver.rb +35 -0
- data/lib/crypt_reboot/initramfs/decompressor/intolerant_decompressor.rb +65 -0
- data/lib/crypt_reboot/initramfs/decompressor/tolerant_decompressor.rb +28 -0
- data/lib/crypt_reboot/initramfs/decompressor.rb +12 -0
- data/lib/crypt_reboot/initramfs/extractor.rb +36 -0
- data/lib/crypt_reboot/initramfs/patcher.rb +47 -0
- data/lib/crypt_reboot/initramfs_patch_squeezer.rb +28 -0
- data/lib/crypt_reboot/instantiable_config.rb +52 -0
- data/lib/crypt_reboot/kexec/loader.rb +30 -0
- data/lib/crypt_reboot/kexec_patching_loader.rb +28 -0
- data/lib/crypt_reboot/lazy_config.rb +22 -0
- data/lib/crypt_reboot/luks/checker.rb +27 -0
- data/lib/crypt_reboot/luks/data.rb +37 -0
- data/lib/crypt_reboot/luks/data_fetcher.rb +30 -0
- data/lib/crypt_reboot/luks/dumper/luks_v1_parser.rb +64 -0
- data/lib/crypt_reboot/luks/dumper/luks_v2_parser.rb +62 -0
- data/lib/crypt_reboot/luks/dumper.rb +30 -0
- data/lib/crypt_reboot/luks/key_fetcher.rb +50 -0
- data/lib/crypt_reboot/luks/version_detector.rb +32 -0
- data/lib/crypt_reboot/passphrase_asker.rb +15 -0
- data/lib/crypt_reboot/patched_initramfs_generator.rb +21 -0
- data/lib/crypt_reboot/rebooter.rb +20 -0
- data/lib/crypt_reboot/runner/binary.rb +12 -0
- data/lib/crypt_reboot/runner/boolean.rb +18 -0
- data/lib/crypt_reboot/runner/generic.rb +46 -0
- data/lib/crypt_reboot/runner/lines.rb +13 -0
- data/lib/crypt_reboot/runner/no_result.rb +13 -0
- data/lib/crypt_reboot/runner/text.rb +12 -0
- data/lib/crypt_reboot/runner.rb +8 -0
- data/lib/crypt_reboot/safe_temp/directory.rb +28 -0
- data/lib/crypt_reboot/safe_temp/file_name.rb +23 -0
- data/lib/crypt_reboot/safe_temp/mounter.rb +33 -0
- data/lib/crypt_reboot/single_assign_restricted_map.rb +26 -0
- data/lib/crypt_reboot/version.rb +5 -0
- data/lib/crypt_reboot.rb +17 -0
- metadata +138 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CryptReboot
|
4
|
+
# Hash-like class allowing to assign value only once to a list of allowed keys
|
5
|
+
class SingleAssignRestrictedMap
|
6
|
+
AlreadyAssigned = Class.new StandardError
|
7
|
+
|
8
|
+
def []=(field, value)
|
9
|
+
raise AlreadyAssigned, "Value already assigned for `#{field}` field" if data.key? field
|
10
|
+
|
11
|
+
data[field] = value
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_h
|
15
|
+
data
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
attr_reader :data
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
@data = {}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/crypt_reboot.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'basic_loader'
|
5
|
+
rescue LoadError => e
|
6
|
+
raise if e.path != 'basic_loader'
|
7
|
+
|
8
|
+
require 'zeitwerk'
|
9
|
+
loader = Zeitwerk::Loader.for_gem
|
10
|
+
loader.setup
|
11
|
+
end
|
12
|
+
|
13
|
+
# Main module
|
14
|
+
module CryptReboot
|
15
|
+
end
|
16
|
+
|
17
|
+
CryptReboot.const_set(:CODE_LOADER, loader)
|
metadata
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: crypt_reboot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Paweł Pokrywka
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-07-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tty-command
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.10'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tty-option
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.3'
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- pepawel@users.noreply.github.com
|
44
|
+
executables:
|
45
|
+
- cryptreboot
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- CHANGELOG.md
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- exe/cryptreboot
|
53
|
+
- lib/basic_loader.rb
|
54
|
+
- lib/crypt_reboot.rb
|
55
|
+
- lib/crypt_reboot/boot_config.rb
|
56
|
+
- lib/crypt_reboot/cli.rb
|
57
|
+
- lib/crypt_reboot/cli/exiter.rb
|
58
|
+
- lib/crypt_reboot/cli/happy_exiter.rb
|
59
|
+
- lib/crypt_reboot/cli/params/definition.rb
|
60
|
+
- lib/crypt_reboot/cli/params/flattener.rb
|
61
|
+
- lib/crypt_reboot/cli/params/help_generator.rb
|
62
|
+
- lib/crypt_reboot/cli/params/parser.rb
|
63
|
+
- lib/crypt_reboot/cli/params_parsing_executor.rb
|
64
|
+
- lib/crypt_reboot/cli/sad_exiter.rb
|
65
|
+
- lib/crypt_reboot/concatenator.rb
|
66
|
+
- lib/crypt_reboot/config.rb
|
67
|
+
- lib/crypt_reboot/crypt_tab/deserializer.rb
|
68
|
+
- lib/crypt_reboot/crypt_tab/entry.rb
|
69
|
+
- lib/crypt_reboot/crypt_tab/entry_deserializer.rb
|
70
|
+
- lib/crypt_reboot/crypt_tab/entry_serializer.rb
|
71
|
+
- lib/crypt_reboot/crypt_tab/keyfile_locator.rb
|
72
|
+
- lib/crypt_reboot/crypt_tab/luks_to_plain_converter.rb
|
73
|
+
- lib/crypt_reboot/crypt_tab/serializer.rb
|
74
|
+
- lib/crypt_reboot/files_generator.rb
|
75
|
+
- lib/crypt_reboot/files_writer.rb
|
76
|
+
- lib/crypt_reboot/gziper.rb
|
77
|
+
- lib/crypt_reboot/initramfs/archiver.rb
|
78
|
+
- lib/crypt_reboot/initramfs/decompressor.rb
|
79
|
+
- lib/crypt_reboot/initramfs/decompressor/intolerant_decompressor.rb
|
80
|
+
- lib/crypt_reboot/initramfs/decompressor/tolerant_decompressor.rb
|
81
|
+
- lib/crypt_reboot/initramfs/extractor.rb
|
82
|
+
- lib/crypt_reboot/initramfs/patcher.rb
|
83
|
+
- lib/crypt_reboot/initramfs_patch_squeezer.rb
|
84
|
+
- lib/crypt_reboot/instantiable_config.rb
|
85
|
+
- lib/crypt_reboot/kexec/loader.rb
|
86
|
+
- lib/crypt_reboot/kexec_patching_loader.rb
|
87
|
+
- lib/crypt_reboot/lazy_config.rb
|
88
|
+
- lib/crypt_reboot/luks/checker.rb
|
89
|
+
- lib/crypt_reboot/luks/data.rb
|
90
|
+
- lib/crypt_reboot/luks/data_fetcher.rb
|
91
|
+
- lib/crypt_reboot/luks/dumper.rb
|
92
|
+
- lib/crypt_reboot/luks/dumper/luks_v1_parser.rb
|
93
|
+
- lib/crypt_reboot/luks/dumper/luks_v2_parser.rb
|
94
|
+
- lib/crypt_reboot/luks/key_fetcher.rb
|
95
|
+
- lib/crypt_reboot/luks/version_detector.rb
|
96
|
+
- lib/crypt_reboot/passphrase_asker.rb
|
97
|
+
- lib/crypt_reboot/patched_initramfs_generator.rb
|
98
|
+
- lib/crypt_reboot/rebooter.rb
|
99
|
+
- lib/crypt_reboot/runner.rb
|
100
|
+
- lib/crypt_reboot/runner/binary.rb
|
101
|
+
- lib/crypt_reboot/runner/boolean.rb
|
102
|
+
- lib/crypt_reboot/runner/generic.rb
|
103
|
+
- lib/crypt_reboot/runner/lines.rb
|
104
|
+
- lib/crypt_reboot/runner/no_result.rb
|
105
|
+
- lib/crypt_reboot/runner/text.rb
|
106
|
+
- lib/crypt_reboot/safe_temp/directory.rb
|
107
|
+
- lib/crypt_reboot/safe_temp/file_name.rb
|
108
|
+
- lib/crypt_reboot/safe_temp/mounter.rb
|
109
|
+
- lib/crypt_reboot/single_assign_restricted_map.rb
|
110
|
+
- lib/crypt_reboot/version.rb
|
111
|
+
homepage: https://phantomno.de/cryptreboot
|
112
|
+
licenses:
|
113
|
+
- MIT
|
114
|
+
metadata:
|
115
|
+
homepage_uri: https://phantomno.de/cryptreboot
|
116
|
+
source_code_uri: https://github.com/phantom-node/cryptreboot
|
117
|
+
changelog_uri: https://github.com/phantom-node/cryptreboot/blob/master/CHANGELOG.md
|
118
|
+
rubygems_mfa_required: 'true'
|
119
|
+
post_install_message:
|
120
|
+
rdoc_options: []
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: 2.7.0
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
requirements: []
|
134
|
+
rubygems_version: 3.1.6
|
135
|
+
signing_key:
|
136
|
+
specification_version: 4
|
137
|
+
summary: Linux utility for automatic and secure unlocking of encrypted disks on reboot
|
138
|
+
test_files: []
|