spior 0.0.8 → 0.0.9
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +5 -0
- data/lib/spior/copy.rb +6 -4
- data/lib/spior/options.rb +6 -1
- data/lib/spior/reload.rb +13 -0
- data/lib/spior/status.rb +1 -2
- data/spior.gemspec +1 -1
- metadata +3 -2
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 99feec0241976ee0c1fb2113f6b4ac1c72d8593e5d5901e559e642408c37f0ef
         | 
| 4 | 
            +
              data.tar.gz: b74ce8165d4fc6538651769fac0ce6b7c79a1d05ab5ddcb68763f548569b2925
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d98ee9554cc7218957d7d3ff00240af12e5fb7e373ce2f080903182354f2cbb09d2fb7e2caa3b45a4a5065dd55b698d2c62d267007ca0d4ef03899529643e3cc
         | 
| 7 | 
            +
              data.tar.gz: eb7ab480de17e9ab34ccae56c6da96408ce2206492f7071083702f8cbc8df0ad2cb183ba42bf9bf98173e3cca69d14293dc7caa06c6d98a01a93d5f00412eab6
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        data.tar.gz.sig
    CHANGED
    
    | Binary file | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,3 +1,8 @@ | |
| 1 | 
            +
            ## 0.0.9
         | 
| 2 | 
            +
            * Add an option to reload TOR -r|--reload
         | 
| 3 | 
            +
            * Cleanup few characters from -s|--status
         | 
| 4 | 
            +
            * Correct path for search config files
         | 
| 5 | 
            +
             | 
| 1 6 | 
             
            ## 0.0.8, release 2020-05-06
         | 
| 2 7 | 
             
            * Always make a copy and replace original file, do not ask, the program is dependent of his config file for now.
         | 
| 3 8 | 
             
            * Correct install where Dir.chdir don't back to the previous location.
         | 
    
        data/lib/spior/copy.rb
    CHANGED
    
    | @@ -7,9 +7,10 @@ module Spior | |
| 7 7 | 
             
              class Copy
         | 
| 8 8 |  | 
| 9 9 | 
             
                def self.config_files
         | 
| 10 | 
            -
                   | 
| 11 | 
            -
                  copy_file(" | 
| 12 | 
            -
                  copy_file(" | 
| 10 | 
            +
                  @conf_dir = File.expand_path('../..' + '/conf', __dir__)
         | 
| 11 | 
            +
                  copy_file(@conf_dir + "/torrc", "/etc/tor/torrc")
         | 
| 12 | 
            +
                  copy_file(@conf_dir + "/resolv.conf", "/etc/resolv.conf")
         | 
| 13 | 
            +
                  copy_file(@conf_dir + "/ipt_mod.conf", "/etc/modules-load.d/ipt_mod.conf")
         | 
| 13 14 | 
             
                end
         | 
| 14 15 |  | 
| 15 16 | 
             
                def self.restore_files
         | 
| @@ -20,7 +21,7 @@ module Spior | |
| 20 21 | 
             
                private
         | 
| 21 22 |  | 
| 22 23 | 
             
                def self.copy_file(conf, target)
         | 
| 23 | 
            -
                  @config_file =  | 
| 24 | 
            +
                  @config_file = conf
         | 
| 24 25 | 
             
                  return if check_hash(@config_file, target)
         | 
| 25 26 | 
             
                  if File.exist? target then
         | 
| 26 27 | 
             
                    if ! previous_copy target
         | 
| @@ -40,6 +41,7 @@ module Spior | |
| 40 41 | 
             
                end
         | 
| 41 42 |  | 
| 42 43 | 
             
                def self.check_hash(src, target)
         | 
| 44 | 
            +
                  return if not File.exist?(target)
         | 
| 43 45 | 
             
                  sha256conf = Digest::SHA256.file src
         | 
| 44 46 | 
             
                  sha256target = Digest::SHA256.file target
         | 
| 45 47 | 
             
                  sha256conf === sha256target
         | 
    
        data/lib/spior/options.rb
    CHANGED
    
    | @@ -1,4 +1,5 @@ | |
| 1 1 | 
             
            require 'optparse'
         | 
| 2 | 
            +
            require_relative 'reload'
         | 
| 2 3 | 
             
            require_relative 'status'
         | 
| 3 4 | 
             
            require_relative 'clear'
         | 
| 4 5 |  | 
| @@ -17,7 +18,7 @@ module Spior | |
| 17 18 |  | 
| 18 19 | 
             
                def parse(argv)
         | 
| 19 20 | 
             
                  OptionParser.new do |opts|
         | 
| 20 | 
            -
                    opts.on("-i", "--install", "Install dependencies") do
         | 
| 21 | 
            +
                    opts.on("-i", "--install", "Install and update dependencies") do
         | 
| 21 22 | 
             
                      @install = true
         | 
| 22 23 | 
             
                    end
         | 
| 23 24 |  | 
| @@ -33,6 +34,10 @@ module Spior | |
| 33 34 | 
             
                      @tor = true
         | 
| 34 35 | 
             
                    end
         | 
| 35 36 |  | 
| 37 | 
            +
                    opts.on("-r", "--reload", "Reload TOR to change your ip") do
         | 
| 38 | 
            +
                      Spior::Reload::tor
         | 
| 39 | 
            +
                    end
         | 
| 40 | 
            +
             | 
| 36 41 | 
             
                    opts.on("-c", "--clear", "Clear iptables rules and restore files") do
         | 
| 37 42 | 
             
                      Spior::Clear::all
         | 
| 38 43 | 
             
                    end
         | 
    
        data/lib/spior/reload.rb
    ADDED
    
    
    
        data/lib/spior/status.rb
    CHANGED
    
    | @@ -1,7 +1,6 @@ | |
| 1 1 | 
             
            #!/usr/bin/env ruby
         | 
| 2 2 |  | 
| 3 3 | 
             
            require 'open-uri'
         | 
| 4 | 
            -
            require 'json'
         | 
| 5 4 |  | 
| 6 5 | 
             
            module Spior
         | 
| 7 6 | 
             
              class Status
         | 
| @@ -12,7 +11,7 @@ module Spior | |
| 12 11 | 
             
                  uri = URI.parse("https://ipleak.net/json")
         | 
| 13 12 | 
             
                  uri.open {|f|
         | 
| 14 13 | 
             
                    f.each_line {|line|
         | 
| 15 | 
            -
                      p line
         | 
| 14 | 
            +
                      p line.chomp.delete("/\",{}")
         | 
| 16 15 | 
             
                    }
         | 
| 17 16 | 
             
                  }
         | 
| 18 17 | 
             
                end
         | 
    
        data/spior.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: spior
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.9
         | 
| 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- | 
| 38 | 
            +
            date: 2020-05-07 00:00:00.000000000 Z
         | 
| 39 39 | 
             
            dependencies:
         | 
| 40 40 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 41 41 | 
             
              name: rainbow
         | 
| @@ -120,6 +120,7 @@ files: | |
| 120 120 | 
             
            - lib/spior/msg.rb
         | 
| 121 121 | 
             
            - lib/spior/network.rb
         | 
| 122 122 | 
             
            - lib/spior/options.rb
         | 
| 123 | 
            +
            - lib/spior/reload.rb
         | 
| 123 124 | 
             
            - lib/spior/runner.rb
         | 
| 124 125 | 
             
            - lib/spior/status.rb
         | 
| 125 126 | 
             
            - lib/spior/tor.rb
         | 
    
        metadata.gz.sig
    CHANGED
    
    | Binary file |