boxafe 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/Gemfile +1 -0
- data/README.md +10 -2
- data/VERSION +1 -1
- data/lib/boxafe/box.rb +14 -3
- data/lib/boxafe/config.rb +1 -0
- data/lib/boxafe/encfs.rb +22 -4
- data/lib/boxafe.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmRhNGVkMDIxZjM2MjUyYTVhYTcxZDU5NDUwNzJhMWY3YjcxZTcxYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
MGUzZWM0OWE1NThjN2U0ZmJlNzNkM2RkMDQ3MDU3YzU0N2RhMTBmNQ==
|
7
|
+
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGY5MTBjNDBmOTRmMTQ3NGM3NDAwMzQ1NDUyMzg1ODI3ODNiZTM5MjI5MTc3
|
10
|
+
ZWRkYzI5ZTNiMGVmOTFmMzI5ZTU1NjUyMjMwY2EwNTBmYjMzNzNhZjNmZGY1
|
11
|
+
MDAwNWQ4MGUzOTgzZTVkNDZlZDljNjg3YzI2NzAxZGVjNWMzZTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTc0ODMyYWQzYTU3Zjc5Mzg4OWI3YmY3NTQ4YWM3OGU1YjU5OTIxMzQ4NDI2
|
14
|
+
ZTk2ODVjM2JiMjgyNjllMzI5ZjY3Yzc5ZWY1YmRhZDNhNmU1YjMxYzI5MDE3
|
15
|
+
OWVjMjkwYTg4NDYzNjM2ZTllMWJlZWE5ODNlMzdiZGE4YjI4OWY=
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[![Build Status](https://secure.travis-ci.org/AlphaHydrae/boxafe.png)](http://travis-ci.org/AlphaHydrae/boxafe)
|
6
6
|
|
7
7
|
Boxafe mounts EncFS filesystems or "boxes" that you define in a configuration file with a friendly DSL.
|
8
|
-
It can also mount them on startup.
|
8
|
+
It can also mount them on startup. [EncFS](http://www.arg0.net/encfs) must be installed separately.
|
9
9
|
|
10
10
|
**Note: Currently supports OS X. Partial Linux support.**
|
11
11
|
|
@@ -27,6 +27,14 @@ end
|
|
27
27
|
# this command is run:
|
28
28
|
# encfs "/secure/abox" "/Volumes/abox" -- -ovolname="A box"
|
29
29
|
|
30
|
+
# get the password from a file
|
31
|
+
box do
|
32
|
+
name 'Password file box'
|
33
|
+
root '/secure/password-file-box'
|
34
|
+
mount '/Volumes/password-file-box'
|
35
|
+
password_file '/secret/password'
|
36
|
+
end
|
37
|
+
|
30
38
|
# get the password from the OS X keychain
|
31
39
|
box do
|
32
40
|
name 'Keychain box'
|
@@ -117,7 +125,7 @@ This is the list of planned features/changes:
|
|
117
125
|
|
118
126
|
* Complete test suite.
|
119
127
|
* Growl/OS X notifications.
|
120
|
-
*
|
128
|
+
* "Repair" feature to un-quarantine files on OS X.
|
121
129
|
* Cron scheduling with [whenever](https://github.com/javan/whenever).
|
122
130
|
|
123
131
|
## Meta
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/lib/boxafe/box.rb
CHANGED
@@ -3,7 +3,7 @@ require 'fileutils'
|
|
3
3
|
|
4
4
|
class Boxafe::Box
|
5
5
|
|
6
|
-
OPTION_KEYS = [ :name, :root, :mount, :volume, :encfs_config, :keychain ]
|
6
|
+
OPTION_KEYS = [ :name, :root, :mount, :volume, :encfs_config, :keychain, :password_file ]
|
7
7
|
|
8
8
|
def initialize options = {}
|
9
9
|
|
@@ -60,7 +60,11 @@ class Boxafe::Box
|
|
60
60
|
end
|
61
61
|
|
62
62
|
s << "\nVolume Name: #{opts[:volume]}"
|
63
|
-
|
63
|
+
if opts[:password_file]
|
64
|
+
s << "\nPassword File: #{opts[:password_file]}"
|
65
|
+
elsif opts[:keychain]
|
66
|
+
s << "\nKeychain Password: #{opts[:keychain]}"
|
67
|
+
end
|
64
68
|
s << "\nEncFS Config: #{opts[:encfs_config]}" if opts[:encfs_config]
|
65
69
|
|
66
70
|
s << "\nCommand: #{Paint[encfs.command, :yellow]}" if verbose
|
@@ -85,11 +89,18 @@ class Boxafe::Box
|
|
85
89
|
|
86
90
|
def options
|
87
91
|
@options.tap do |opts|
|
92
|
+
|
88
93
|
opts[:root] = File.expand_path opts[:root] || "~/Dropbox/#{opts[:name]}"
|
89
94
|
opts[:mount] = File.expand_path opts[:mount] || "/Volumes/#{opts[:name]}"
|
90
95
|
opts[:encfs_config] = File.expand_path opts[:encfs_config] if opts[:encfs_config]
|
91
96
|
opts[:volume] ||= opts[:name]
|
92
|
-
|
97
|
+
|
98
|
+
if opts[:password_file]
|
99
|
+
opts[:password_file] = File.expand_path opts[:password_file]
|
100
|
+
opts.delete :keychain
|
101
|
+
elsif opts[:keychain] == true
|
102
|
+
opts[:keychain] = opts[:name]
|
103
|
+
end
|
93
104
|
end
|
94
105
|
end
|
95
106
|
|
data/lib/boxafe/config.rb
CHANGED
data/lib/boxafe/encfs.rb
CHANGED
@@ -8,18 +8,36 @@ class Boxafe::Encfs
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def command
|
11
|
-
|
12
|
-
|
11
|
+
[
|
12
|
+
encfs_config,
|
13
|
+
Shellwords.escape(@options[:encfs]),
|
14
|
+
Shellwords.escape(absolute_root_dir),
|
15
|
+
Shellwords.escape(absolute_mount_dir),
|
16
|
+
extpass,
|
17
|
+
'--',
|
18
|
+
volname
|
19
|
+
].compact.join ' '
|
13
20
|
end
|
14
21
|
|
15
22
|
private
|
16
23
|
|
24
|
+
def absolute_root_dir
|
25
|
+
# TODO: remove Dir.pwd once fakefs is fixed (multiple occurrences in this file)
|
26
|
+
File.expand_path @options[:root], Dir.pwd
|
27
|
+
end
|
28
|
+
|
29
|
+
def absolute_mount_dir
|
30
|
+
File.expand_path @options[:mount], Dir.pwd
|
31
|
+
end
|
32
|
+
|
17
33
|
def volname
|
18
34
|
%/-ovolname=#{Shellwords.escape @options[:volume]}/
|
19
35
|
end
|
20
36
|
|
21
37
|
def extpass
|
22
|
-
if @options[:
|
38
|
+
if @options[:password_file]
|
39
|
+
%|--extpass="head -n 1 #{Shellwords.escape @options[:password_file]}"|
|
40
|
+
elsif @options[:keychain]
|
23
41
|
%*--extpass="security 2>&1 >/dev/null find-generic-password -gl '#{@options[:keychain]}' |grep password|cut -d \\\\\\" -f 2"*
|
24
42
|
else
|
25
43
|
nil
|
@@ -27,6 +45,6 @@ class Boxafe::Encfs
|
|
27
45
|
end
|
28
46
|
|
29
47
|
def encfs_config
|
30
|
-
@options[:encfs_config] ? %/ENCFS6_CONFIG=#{Shellwords.escape File.expand_path(@options[:encfs_config])}/ : nil
|
48
|
+
@options[:encfs_config] ? %/ENCFS6_CONFIG=#{Shellwords.escape File.expand_path(@options[:encfs_config], Dir.pwd)}/ : nil
|
31
49
|
end
|
32
50
|
end
|
data/lib/boxafe.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxafe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AlphaHydrae
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paint
|
@@ -234,6 +234,20 @@ dependencies:
|
|
234
234
|
- - ! '>='
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: fakefs
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ! '>='
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ! '>='
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
237
251
|
description: Boxafe encrypts and auto-mounts a folder with encfs and whenever.
|
238
252
|
email: hydrae.alpha@gmail.com
|
239
253
|
executables:
|
@@ -280,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
294
|
version: '0'
|
281
295
|
requirements: []
|
282
296
|
rubyforge_project:
|
283
|
-
rubygems_version: 2.
|
297
|
+
rubygems_version: 2.1.5
|
284
298
|
signing_key:
|
285
299
|
specification_version: 4
|
286
300
|
summary: Secure your Dropbox with encfs.
|