c3d 0.4.12 → 0.4.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/c3d +4 -3
- data/lib/c3d.rb +6 -3
- data/lib/c3d/util/processes.rb +11 -6
- data/lib/c3d/util/setup.rb +1 -1
- data/lib/c3d/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68fdaea8fa034d2aefb0e72483a761459e11dfcf
|
4
|
+
data.tar.gz: f358999385e9dbf5a7d9be9f0d51da89bd1def5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 997c6f2884c10755f65089e70da21b34e221da3ca26195e6ac00a62843504fcbfa17c29d98119130fb01e7a3f577d010fa4feffe839de8d4ed82ae1373425f35
|
7
|
+
data.tar.gz: bf21fa0a59af1902efe071a91417d8443d8b284f46fa9cbe716ad68d7fe56c30bddc0f396799af1366f45c2dbf81b623e0ecd406d819fd29f4a208bce9458502
|
data/bin/c3d
CHANGED
@@ -10,11 +10,12 @@ program :description, 'Contract Controlled Content Dissemination Server.'
|
|
10
10
|
## Package Workflow Commands
|
11
11
|
##
|
12
12
|
command :start do |c|
|
13
|
-
c.syntax = 'c3d start'
|
13
|
+
c.syntax = 'c3d start [key]'
|
14
|
+
c.option '--key STRING', String, 'Start the server with a specific public key'
|
14
15
|
c.description = 'Start your default c3d server.'
|
15
|
-
c.action do
|
16
|
+
c.action do |args, options|
|
16
17
|
print "Please be patient, this will take a few seconds.\n"
|
17
|
-
C3D.start
|
18
|
+
C3D.start options.key
|
18
19
|
print "Server has started.\n"
|
19
20
|
end
|
20
21
|
end
|
data/lib/c3d.rb
CHANGED
@@ -24,9 +24,11 @@ Dir[File.dirname(__FILE__) + '/c3d/util/*.rb'].each {|file| require file }
|
|
24
24
|
module C3D
|
25
25
|
extend self
|
26
26
|
|
27
|
-
def start
|
27
|
+
def start key=''
|
28
|
+
unless key == ''
|
29
|
+
ENV['ETH_KEY'] = key
|
30
|
+
end
|
28
31
|
C3D::SetupC3D.new
|
29
|
-
|
30
32
|
C3D::ConnectTorrent.supervise_as :puller, {
|
31
33
|
username: ENV['TORRENT_USER'],
|
32
34
|
password: ENV['TORRENT_PASS'],
|
@@ -41,8 +43,9 @@ module C3D
|
|
41
43
|
end
|
42
44
|
|
43
45
|
def restart
|
46
|
+
key = Celluloid::Actor[:eth].get_key
|
44
47
|
C3D.stop
|
45
|
-
C3D.start
|
48
|
+
C3D.start key
|
46
49
|
end
|
47
50
|
|
48
51
|
def blob args
|
data/lib/c3d/util/processes.rb
CHANGED
@@ -13,12 +13,17 @@ module C3D
|
|
13
13
|
|
14
14
|
def is_trans_running?
|
15
15
|
a = `ps ux`.split("\n").select{|e| e[/transmission-daemon/]}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
if ! a.empty?
|
17
|
+
print "Please stop your default Transmission Server with `sudo service transmission-daemon stop` and then restart.\n"
|
18
|
+
print "Would you like to override this message and start c3d anyway? (Y/n)\n"
|
19
|
+
override = STDIN.gets.chomp
|
20
|
+
if override == 'Y' || override == 'y'
|
21
|
+
return true
|
22
|
+
else
|
23
|
+
exit 0
|
24
|
+
end
|
20
25
|
end
|
21
|
-
return (!
|
26
|
+
return (! a.empty?)
|
22
27
|
end
|
23
28
|
end
|
24
29
|
|
@@ -45,7 +50,7 @@ module C3D
|
|
45
50
|
elsif mine == ("on" || "true")
|
46
51
|
mine = "-m on"
|
47
52
|
end
|
48
|
-
key =
|
53
|
+
key = ENV['ETH_KEY'] || ""
|
49
54
|
if key != ""
|
50
55
|
key = "-s #{key}"
|
51
56
|
end
|
data/lib/c3d/util/setup.rb
CHANGED
@@ -59,7 +59,7 @@ module C3D
|
|
59
59
|
ENV['ETH_ZMQ_ADDR'] = config['eth_zmq_addr']
|
60
60
|
ENV['ETH_HOST'] = config['eth_rpc_host']
|
61
61
|
ENV['ETH_PORT'] = config['eth_rpc_port']
|
62
|
-
ENV['ETH_KEY']
|
62
|
+
ENV['ETH_KEY'] ||= config['primary_account_key']
|
63
63
|
end
|
64
64
|
|
65
65
|
def set_trans_config config
|
data/lib/c3d/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION ||= "0.4.
|
1
|
+
VERSION ||= "0.4.13"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c3d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Casey Kuhlman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|