freydis 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: 8963ba3af539bf5e5893778cf4e19164cca071b4aa33f42c7bfed8b184016604
4
- data.tar.gz: 235dba3157fda782be2927b08094970065511aaa36f5b0898499cc1fd421f3fb
3
+ metadata.gz: aca3e518674824172a35fc8e79f45d1ccb5d435376aa46ca53e1886096640c5d
4
+ data.tar.gz: ca393f18dabf26e8e8204014f1d04b1db74e467653c8c056ab7618410bfeb60d
5
5
  SHA512:
6
- metadata.gz: 5ce910c91f09a88ca6e3fb9a47e5b64f5f76b0a5ac5d78c44baa79b81d29a60c2fe7566f631962792b7192a435ce537258469e5d3f84f1471816d10f0bad8902
7
- data.tar.gz: 8098c0c471bb5f6dbb9a71f5553244a496bfe7d29cd37ad848b95b4fd312c48ffe4c7c5c5f305d551db1a45feec5dec935a615dd1fc0a946126de9ddbbe48248
6
+ metadata.gz: d939115ae6697645af7f6e3adf044d25e6303a09c1791fa2d082924613f38791c072eb31252e3c85e42577984494669d29acd5714cde2084f28fe56f9a968ca5
7
+ data.tar.gz: d9c305c92139b2c47eb9f6ac3aa31b99de511df6d40fabac5dde40e8cc425331b302d1bca3d7fbf50d30fbec5878f8a1e31b4cfe2e5b6f8873c20a7dfbf279a5
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.1, release 2022/10/8
2
+ * Restore archive with sudo if permission are insufficient.
3
+
1
4
  ## 0.1.0, release 2022/09/20
2
5
  * New dependencies for `Freydis::Secrets`: `bsdtar`, `shred` and `gnupg`.
3
6
  * Option store a new field `gpg_recipient`.
@@ -30,7 +30,8 @@ module Freydis
30
30
 
31
31
  # Restore the most recent archive in your $HOME
32
32
  def restore
33
- last_archive = Dir.glob("#{@workdir}/*").sort[0]
33
+ last_archive = find_last_archive
34
+ error 'No archive found.' unless last_archive
34
35
 
35
36
  mkdir @restore_dir
36
37
  info "Restoring #{last_archive}..."
@@ -48,6 +49,15 @@ module Freydis
48
49
  #{@gpg.pubkey_path}])
49
50
  end
50
51
 
52
+ def find_last_archive
53
+ if Process.uid == 0
54
+ Dir.glob("#{@workdir}/#{CONFIG.gpg_recipient}*").sort[0]
55
+ else
56
+ archive = `sudo ls #{@workdir}/ | grep #{CONFIG.gpg_recipient} | sort | head -1`.chomp
57
+ "#{@workdir}/#{archive}" if archive
58
+ end
59
+ end
60
+
51
61
  private
52
62
 
53
63
  def search_paths(paths)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Freydis
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
6
6
 
data/lib/mods/exec.rb CHANGED
@@ -3,8 +3,10 @@
3
3
  module Exec
4
4
  def x(command)
5
5
  sudo = Process.uid != 0 ? 'sudo' : ''
6
- unless system("#{sudo} #{command}")
7
- Msg.error "Execute: #{command}"
6
+ cmd = "#{sudo} #{command}"
7
+ unless system(cmd)
8
+ warn "[-] Execute: #{cmd}"
9
+ exit 1
8
10
  end
9
11
  end
10
12
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freydis
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
  - szorfein
@@ -36,7 +36,7 @@ cert_chain:
36
36
  aEJeKq4/BlIwMlXPe+W5C8zp2i8hgG1/OYbwbGE1p2iRi1NIK7G/HyRqQjOqJxzE
37
37
  LLknX69FN7/G
38
38
  -----END CERTIFICATE-----
39
- date: 2022-09-20 00:00:00.000000000 Z
39
+ date: 2022-11-09 00:00:00.000000000 Z
40
40
  dependencies: []
41
41
  description: 'Freydis is a CLI tool to encrypt a disk device, backup and restore easyly.
42
42
  Freydis use `cryptsetup` and `rsync` mainly.
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - cryptsetup
95
95
  - rsync
96
- rubygems_version: 3.3.19
96
+ rubygems_version: 3.3.23
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Backup and Restore data from encrypted device.
metadata.gz.sig CHANGED
Binary file