panopticon 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 269d46d754fd186a8baf0e84d3fdca49d5ffd46c
4
- data.tar.gz: 7c3bc274ea36810f190488372c3ab613f8e6337a
2
+ SHA256:
3
+ metadata.gz: ddd1d3f40a65a40b6425280fa40790a9fe01ea2ce66cfd53ee8938e6d066d895
4
+ data.tar.gz: 83eefa3358db159468e147f8986af1ec012f47a899de9515e38cbc98015fc90a
5
5
  SHA512:
6
- metadata.gz: 6fd35ad8afc8d6babe5e2da3bba73c28d56d21790b2b37cb87122f806c6b2dded4dd1d9aa6a95d656851dd546e2c2d1678782b5c4550818bb4afe97576ca167a
7
- data.tar.gz: fba64db2a28a7b00d25d18689f70c45e5d3d3d0cb30d8b6d885c43cfbd811a08f42286812abc3e05e69daa8f794270d6a242e23a928943cdd5a23493b705300c
6
+ metadata.gz: 82b81f376e64fe652a4be95dbd5696ad2e3ad64debea65fe843276167f281ff96b630f7becb329adbfa5592820d90435314f72b7ca30f43211f7286320eb2b88
7
+ data.tar.gz: 6c49609447875b6ad646cfe3b7d6e9b1afb26e0a25bdbf4cb30d67c37c1b3aa47197626809196be63d5b36649cc0b9e559cd800e8a771b37c8d34a920b252ba8
@@ -48,5 +48,4 @@ rescue
48
48
  usage $!.to_s
49
49
  end
50
50
 
51
- $log = Log.new(:output => OPTS[:log_file])
52
51
  Panopticon::Daemon.new(OPTS).run
@@ -0,0 +1,6 @@
1
+ {
2
+ "port": 8080,
3
+ "ifname": "wlxcce1d5396dfc",
4
+ "capture_path": "/tmp/",
5
+ "log_file": "/tmp/panopticond.log"
6
+ }
@@ -1,5 +1,6 @@
1
1
  module Panopticon
2
2
  require "panopticon/log"
3
+ require "json"
3
4
 
4
5
  class Daemon
5
6
  DEFAULT_CONFIG_PATH="/etc/panopticon.conf"
@@ -36,12 +37,15 @@ module Panopticon
36
37
  end
37
38
 
38
39
  def run
40
+ $log = Log.new(:output => @arg[:log_file])
39
41
  Panopticon::APIServer.run!(@arg)
40
42
  end
41
43
 
42
44
  def read_config path
43
- # notimp
44
- @arg
45
+ data = File.read(path)
46
+ conf = JSON.parse(data, :symbolize_names => true)
47
+ @arg = @arg.merge(conf)
48
+ return @arg
45
49
  end
46
50
  end
47
51
  end
@@ -1,3 +1,3 @@
1
1
  module Panopticon
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -80,7 +80,7 @@ module Panopticon
80
80
  end
81
81
 
82
82
  def init_device
83
- unless @ifname.match(/^wlan\d+$/)
83
+ unless @ifname.match(/^(wlan\d+|wlx.+)$/)
84
84
  $log.debug("non-wlan device skips device initialization")
85
85
  return
86
86
  end
@@ -100,7 +100,7 @@ module Panopticon
100
100
  end
101
101
 
102
102
  def move_channel current, channels
103
- unless @ifname.match(/^wlan\d+$/)
103
+ unless @ifname.match(/^(wlan\d+|wlx.+)$/)
104
104
  $log.debug("non-wlan device skips channel transition")
105
105
  return
106
106
  end
@@ -75,7 +75,7 @@ module Panopticon
75
75
  end
76
76
 
77
77
  def current_data
78
- unless @ifname.match(/^wlan\d+$/)
78
+ unless @ifname.match(/^(wlan\d+|wlx.+)$/)
79
79
  $log.debug("non-wlan skips utilization acquirement")
80
80
  return [0, 0, 0, 0]
81
81
  end
@@ -117,7 +117,7 @@ module Panopticon
117
117
  end
118
118
 
119
119
  def interface_exists?(ifname)
120
- return system("ifconfig #{ifname} 1>/dev/null 2>&1")
120
+ return system("ip link show ${ifname} 1>/dev/null 2>&1")
121
121
  end
122
122
  end
123
123
  end
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.11"
25
- spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "bundler", "~> 2.0"
25
+ spec.add_development_dependency "rake", "~> 12.3.3"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
27
 
28
28
  spec.add_dependency 'pidfile', "~> 0.3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panopticon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - enukane
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-04 00:00:00.000000000 Z
11
+ date: 2020-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.4.7
83
- description:
83
+ description:
84
84
  email:
85
85
  - enukane@glenda9.org
86
86
  executables:
@@ -115,6 +115,7 @@ files:
115
115
  - extra/public/js/canvasjs.min.js
116
116
  - extra/public/js/jquery-3.1.0.min.js
117
117
  - extra/public/js/script.js
118
+ - extra/test-config.json
118
119
  - lib/panopticon.rb
119
120
  - lib/panopticon/api.rb
120
121
  - lib/panopticon/command/panopticond.rb
@@ -128,7 +129,7 @@ homepage: https://github.com/enukane/panopticon
128
129
  licenses:
129
130
  - MIT
130
131
  metadata: {}
131
- post_install_message:
132
+ post_install_message:
132
133
  rdoc_options: []
133
134
  require_paths:
134
135
  - lib
@@ -143,9 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
144
  - !ruby/object:Gem::Version
144
145
  version: '0'
145
146
  requirements: []
146
- rubyforge_project:
147
- rubygems_version: 2.4.5
148
- signing_key:
147
+ rubygems_version: 3.1.2
148
+ signing_key:
149
149
  specification_version: 4
150
150
  summary: Wi-Fi packet capture software set on Raspberry Pi
151
151
  test_files: []