amnesie 0.0.5 → 0.0.6

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: 233d7f8f3157dd7508337cdcf3400768b4d68e16abd1f186a30cc9cec94fe5d7
4
- data.tar.gz: fa77a1ad923ced06d8a0eac3d5039690a87f73dfb5b8450702696f84380553ae
3
+ metadata.gz: 570877fce9e8b2a8b960dbb07352186c5a90d93650172d4b2c443104cbce4b45
4
+ data.tar.gz: 0154e2c00c893f94dc0323e131c4ae76f6bfb75f29e2088d62334b90c3724733
5
5
  SHA512:
6
- metadata.gz: 21b9bda9e1aaaa409195ec6f271ae6547a5c2aab821858ab4be015b82480481ddc0934d76309c3e10d9dac3ac291e94b864e284881084b20dc661b67f71611b1
7
- data.tar.gz: d534d1bb2a6550a88a591c92c2e602107fc0a5bd1dd3b7593ac5c919bd0cdd9b64da3ea3f4de935a6ca47310748f2c1f073261f3135c4b59d1ecca1e39bf3ba5
6
+ metadata.gz: 4a8b05b0343bde64c8d646015c798db099145a70560c10663b090aecbd41b68f8a79735612d72ce709e55a9f4d02716b03d102da599405e4c71c98a711b8331d
7
+ data.tar.gz: 9816484179011680de5d36a5956e3830e444bbb4b6a112d18d520fc8fa41476ad6a3fb037618f7d240c0fa775192cf4479a2168de1f14fa45c4ba5c7764b1b55
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.0.6, release 2020-05-20
2
+ * Init a doc with RDoc.
3
+ * Add -i|--init to start init process properly.
4
+ * Add dhcpcd to the mac@.service, dhclient doesn't seem necessary.
5
+ * Correct the mac@.service.
6
+
1
7
  ## 0.0.5, release 2020-05-19
2
8
  * Create a amnesie-mac@.service (work only if the gem is install system-wide)
3
9
  * Add -p|--persist
data/README.md CHANGED
@@ -10,7 +10,7 @@ Inspiration come from a post found on [Qubes-OS](https://www.qubes-os.org/doc/an
10
10
  ## Install
11
11
  Amnesie is cryptographically signed, so add my public key (if you haven’t already) as a trusted certificate.
12
12
 
13
- $ gem cert --add <(curl -Ls https://raw.githubusercontent.com/szorfein/spior/master/certs/szorfein.pem)
13
+ $ gem cert --add <(curl -Ls https://raw.githubusercontent.com/szorfein/amnesie/master/certs/szorfein.pem)
14
14
 
15
15
  And install the gem
16
16
 
@@ -28,10 +28,14 @@ To change the MAC address for eth0:
28
28
 
29
29
  $ amnesie -n eth0 -m
30
30
 
31
+ Create or Disable all systemd services for a network card:
32
+
33
+ $ amnesie -p -n wlp2s0
34
+
31
35
  ## Left Over
32
36
 
33
37
  ### Issues
34
- For any questions, comments, feedback or issues, submit a [new issue](https://github.com/szorfein/spior/issues/new).
38
+ For any questions, comments, feedback or issues, submit a [new issue](https://github.com/szorfein/amnesie/issues/new).
35
39
 
36
40
  ### links
37
41
  + https://rubyreferences.github.io/rubyref
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ namespace :gem do
12
12
  task :build do
13
13
  Dir["amnesie*.gem"].each {|f| File.unlink(f) }
14
14
  system("gem build amnesie.gemspec")
15
- system("gem install amnesie-0.0.5.gem -P MediumSecurity")
15
+ system("gem install amnesie-0.0.6.gem -P MediumSecurity")
16
16
  end
17
17
  end
18
18
 
data/amnesie.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "amnesie"
3
- s.version = "0.0.5"
3
+ s.version = "0.0.6"
4
4
  s.summary = "A tool to make your computer amnesic"
5
5
  s.description = <<-EOF
6
6
  A tool to make your computer amnesic"
@@ -2,7 +2,7 @@ require 'optparse'
2
2
 
3
3
  module Amnesie
4
4
  class Options
5
- attr_reader :mac, :netcard, :persist
5
+ attr_reader :init, :mac, :netcard, :persist
6
6
 
7
7
  def initialize(argv)
8
8
  parse(argv)
@@ -11,6 +11,10 @@ module Amnesie
11
11
  def parse(argv)
12
12
  OptionParser.new do |opts|
13
13
 
14
+ opts.on("-i", "--init", "Used with init process (systemd, etc...)") do
15
+ @init = true
16
+ end
17
+
14
18
  opts.on("-m", "--mac", "What is my MAC address?") do
15
19
  @mac = true
16
20
  end
@@ -1,5 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'tempfile'
3
+ require 'tty-which'
3
4
  require_relative 'helpers'
4
5
 
5
6
  module Amnesie
@@ -21,18 +22,22 @@ module Amnesie
21
22
  end
22
23
 
23
24
  def mac_service
24
- amnesie_path=Dir.pwd + "/" + $0
25
+ dhcp=''
26
+ if TTY::Which.exist?('dhcpcd')
27
+ dhcp='dhcpcd.service'
28
+ end
25
29
  @string=<<EOF
26
30
  [Unit]
27
31
  Description=MAC Change %I
28
32
  Wants=network-pre.target
29
- Before=network-pre.target
33
+ Before=network-pre.target #{dhcp}
30
34
  BindsTo=sys-subsystem-net-devices-%i.device
31
35
  After=sys-subsystem-net-devices-%i.device
32
36
 
33
37
  [Service]
34
38
  Type=oneshot
35
- ExecStart=#{amnesie_path} -m -n %I
39
+ ExecStart=/usr/bin/env bash -lc "amnesie -i -m -n %I"
40
+ TimeoutSec=30
36
41
 
37
42
  [Install]
38
43
  WantedBy=multi-user.target
@@ -60,17 +65,13 @@ EOF
60
65
  end
61
66
 
62
67
  def menu_mac
63
- print "amnesie-mac@.service for #{@card}? (enable,disable,start,stop) "
68
+ print "amnesie-mac@.service for #{@card}? (enable,disable) "
64
69
  answer = gets.chomp
65
70
  case answer
66
71
  when /^enable/
67
72
  mac_enable
68
73
  when /^disable/
69
74
  mac_disable
70
- when /^stop/
71
- mac_stop
72
- when /^start/
73
- mac_start
74
75
  end
75
76
  end
76
77
 
@@ -79,15 +80,10 @@ EOF
79
80
  def mac_enable
80
81
  @systemctl.run("enable amnesie-mac@#{@card}.service")
81
82
  end
83
+
82
84
  def mac_disable
83
85
  @systemctl.run("disable amnesie-mac@#{@card}.service")
84
86
  end
85
- def mac_stop
86
- @systemctl.run("stop amnesie-mac@#{@card}.service")
87
- end
88
- def mac_start
89
- @systemctl.run("start amnesie-mac@#{@card}.service")
90
- end
91
87
 
92
88
  def search_systemd_dir
93
89
  if Dir.exist? "/lib/systemd/system"
@@ -21,12 +21,12 @@ module Amnesie
21
21
  process = Amnesie::Process.new(@network.card)
22
22
  card = Amnesie::MAC.new(@network.card)
23
23
 
24
- process.kill
24
+ process.kill unless @options.init
25
25
  card.save_origin
26
26
  card.rand
27
27
  card.apply
28
28
  puts card.to_s
29
- process.restart
29
+ process.restart unless @options.init
30
30
  end
31
31
  if @options.persist then
32
32
  if not @network
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amnesie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - szorfein
@@ -35,7 +35,7 @@ cert_chain:
35
35
  J/zT/q2Ac7BWpSLbv6p9lChBiEnD9j24x463LR5QQjDNS5SsjzRQfFuprsa9Nqf2
36
36
  Tw==
37
37
  -----END CERTIFICATE-----
38
- date: 2020-05-19 00:00:00.000000000 Z
38
+ date: 2020-05-20 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rake
metadata.gz.sig CHANGED
Binary file