mihari 4.11.0 → 4.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/README.md +13 -3
  4. data/build_frontend.sh +0 -3
  5. data/docker/Dockerfile +11 -12
  6. data/images/Tines-Full_Logo-Tines_Black.png +0 -0
  7. data/lib/mihari/commands/web.rb +4 -2
  8. data/lib/mihari/version.rb +1 -1
  9. data/lib/mihari/web/app.rb +10 -4
  10. data/lib/mihari/web/public/assets/{fa-brands-400.c7ae37d3.ttf → fa-brands-400-b1d1c1b0.ttf} +0 -0
  11. data/lib/mihari/web/public/assets/fa-brands-400-c61287c2.woff2 +0 -0
  12. data/lib/mihari/web/public/assets/fa-regular-400-5da313b0.woff2 +0 -0
  13. data/lib/mihari/web/public/assets/{fa-regular-400.fdc1f753.ttf → fa-regular-400-d7b19fe2.ttf} +0 -0
  14. data/lib/mihari/web/public/assets/fa-solid-900-8f06540f.woff2 +0 -0
  15. data/lib/mihari/web/public/assets/{fa-solid-900.6d53c706.ttf → fa-solid-900-e4f6a7e9.ttf} +0 -0
  16. data/lib/mihari/web/public/assets/{fa-v4compatibility.4d73f280.ttf → fa-v4compatibility-2ddb3b41.ttf} +0 -0
  17. data/lib/mihari/web/public/assets/fa-v4compatibility-f46715c9.woff2 +0 -0
  18. data/lib/mihari/web/public/assets/{index.e1e67d84.css → index-07aa1ba2.css} +2 -2
  19. data/lib/mihari/web/public/assets/index-a7fe697b.js +63 -0
  20. data/lib/mihari/web/public/index.html +3 -3
  21. data/mihari.gemspec +13 -13
  22. metadata +40 -39
  23. data/lib/mihari/web/public/assets/fa-brands-400.3fe890d0.woff2 +0 -0
  24. data/lib/mihari/web/public/assets/fa-regular-400.fe69d948.woff2 +0 -0
  25. data/lib/mihari/web/public/assets/fa-solid-900.d27bc752.woff2 +0 -0
  26. data/lib/mihari/web/public/assets/fa-v4compatibility.7d1c2ce5.woff2 +0 -0
  27. data/lib/mihari/web/public/assets/index.d3a61a69.js +0 -68
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eda042a7f3e0c70bb86a1008d24556b2daf4264142e01936e4bdab3da275ff39
4
- data.tar.gz: a5e3711ecb0fb982ce6280fbed12261d753e2224966e3961ac2cfe2b83e0e15d
3
+ metadata.gz: 16412e44a6aa5eb9fb7022aa531b950249df76f074136e71c6621e5f2d3c7d44
4
+ data.tar.gz: 403f780911934e891ef072c87a3a6ae48d31f1854c8806d4c9ece884faf9ec62
5
5
  SHA512:
6
- metadata.gz: f33e198db0d4964eb15372b30ef6733aaf3efe51b31640e62e33da2412089e30f618ea9509cc86d57a6e38ae65eac1dd5c7f3fab9c2dc1d5793d005bdcb95862
7
- data.tar.gz: d7824b329d6117c2539e62044374b989538e4d22fd7641eb63b11db3b766ef52943f3559cb6a43be440b60f55609a763e316661e69196d6749486c8027cad5b2
6
+ metadata.gz: edde8ae3fb93a7e3719788c6727782f7f9a9e2ae53eaa9d804342e545e0ca5e9ec6bb96d633f9c26a33f98e4addaf8693b6da37de8930f8770847a531665baa0
7
+ data.tar.gz: afda1bef59be058cbb5972d771bf7615820cc4588cae6cc53c2f2d39333e02edce9a3165dee30caf0996195ab09565392316d116040ce5cc93dbdac28b04c239
@@ -43,7 +43,7 @@ jobs:
43
43
  strategy:
44
44
  fail-fast: false
45
45
  matrix:
46
- ruby: [2.7, "3.0", 3.1]
46
+ ruby: [2.7, "3.0", 3.1, 3.2]
47
47
 
48
48
  steps:
49
49
  - uses: actions/checkout@v3
data/README.md CHANGED
@@ -5,9 +5,19 @@
5
5
  [![Coverage Status](https://coveralls.io/repos/github/ninoseki/mihari/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/mihari?branch=master)
6
6
  [![CodeFactor](https://www.codefactor.io/repository/github/ninoseki/mihari/badge)](https://www.codefactor.io/repository/github/ninoseki/mihari)
7
7
 
8
- ![img](https://github.com/ninoseki/mihari/raw/master/images/logo.png)
9
-
10
- [![](images/tines.png)](https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki)
8
+ ---
9
+
10
+ <p align="center">
11
+ <img src="https://github.com/ninoseki/mihari/raw/master/images/logo.png"/>
12
+ <br/>
13
+ <a href="https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki">
14
+ <img src="https://github.com/ninoseki/mihari/raw/master/images/Tines-Full_Logo-Tines_Black.png"/>
15
+ </a>
16
+ <br/>
17
+ Mihari is proudly supported by <a href="https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki">Tines</a>
18
+ </p>
19
+
20
+ ---
11
21
 
12
22
  Mihari is a tool for OSINT based threat hunting.
13
23
 
data/build_frontend.sh CHANGED
@@ -15,8 +15,5 @@ trash -r ${CURRENT_DIR}/lib/mihari/web/public/
15
15
  mkdir -p ${CURRENT_DIR}/lib/mihari/web/public/
16
16
  cp -r dist/* ${CURRENT_DIR}/lib/mihari/web/public
17
17
 
18
- # replace favicon path
19
- sed -i "" 's/href="\/favicon.ico"/href="\/static\/favicon.ico"/' ${CURRENT_DIR}/lib/mihari/web/public/index.html
20
-
21
18
  # remove tmp dir
22
19
  rm -rf ${CURRENT_DIR}/tmp/mihari-frontend
data/docker/Dockerfile CHANGED
@@ -1,15 +1,14 @@
1
- FROM ruby:3.0.3-alpine3.13
2
-
3
- RUN apk --no-cache add git build-base ruby-dev sqlite-dev postgresql-dev mysql-client mysql-dev \
4
- && gem install pg mysql2 \
5
- && cd /tmp/ \
6
- && git clone https://github.com/ninoseki/mihari.git \
7
- && cd mihari \
8
- && gem build mihari.gemspec -o mihari.gem \
9
- && gem install mihari.gem \
10
- && rm -rf /tmp/mihari \
11
- && apk del --purge git build-base ruby-dev
1
+ FROM ruby:3.1.3-alpine3.17
2
+
3
+ RUN apk --no-cache add git build-base ruby-dev sqlite-dev postgresql-dev mysql-client mysql-dev && \
4
+ gem install pg mysql2
5
+
6
+ ARG MIHARI_VERSION=4.11.0
7
+
8
+ RUN gem install mihari -v ${MIHARI_VERSION}
9
+
10
+ RUN apk del --purge git build-base ruby-dev
12
11
 
13
12
  ENTRYPOINT ["mihari"]
14
13
 
15
- CMD ["--help"]
14
+ CMD ["--help"]
@@ -8,18 +8,20 @@ module Mihari
8
8
  desc "web", "Launch the web app"
9
9
  method_option :port, type: :numeric, default: 9292, desc: "Hostname to listen on"
10
10
  method_option :host, type: :string, default: "localhost", desc: "Port to listen on"
11
- method_option :threads, type: :string, default: "1:1", desc: "min:max threads to use"
11
+ method_option :threads, type: :string, default: "0:5", desc: "min:max threads to use"
12
12
  method_option :verbose, type: :boolean, default: true, desc: "Report each request"
13
+ method_option :worker_timeout, type: :numeric, default: 60, desc: "Worker timeout value (in seconds)"
13
14
  def web
14
15
  port = options["port"]
15
16
  host = options["host"]
16
17
  threads = options["threads"]
17
18
  verbose = options["verbose"]
19
+ worker_timeout = options["worker_timeout"]
18
20
 
19
21
  # set rack env as production
20
22
  ENV["RACK_ENV"] ||= "production"
21
23
 
22
- Mihari::App.run!(port: port, host: host, threads: threads, verbose: verbose)
24
+ Mihari::App.run!(port: port, host: host, threads: threads, verbose: verbose, worker_timeout: worker_timeout)
23
25
  end
24
26
  end
25
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "4.11.0"
4
+ VERSION = "4.12.0"
5
5
  end
@@ -31,7 +31,7 @@ module Mihari
31
31
  use Rack::Cors do
32
32
  allow do
33
33
  origins "*"
34
- resource "*", headers: :any, methods: [:get, :post, :put, :delete, :options]
34
+ resource "*", headers: :any, methods: %i[get post put delete options]
35
35
  end
36
36
  end
37
37
 
@@ -42,7 +42,7 @@ module Mihari
42
42
  end.to_app
43
43
  end
44
44
 
45
- def run!(port: 9292, host: "localhost", threads: "1:1", verbose: false)
45
+ def run!(port: 9292, host: "localhost", threads: "0:5", verbose: false, worker_timeout: 60)
46
46
  url = "http://#{host}:#{port}"
47
47
 
48
48
  # set maximum number of threads to use as PARALLEL_PROCESSOR_COUNT (if it is not set)
@@ -50,8 +50,14 @@ module Mihari
50
50
  # TODO: is this the best way?
51
51
  _min_thread, max_thread = threads.split(":")
52
52
  ENV["PARALLEL_PROCESSOR_COUNT"] = max_thread if ENV["PARALLEL_PROCESSOR_COUNT"].nil?
53
-
54
- Rack::Handler::Puma.run(instance, Port: port, Host: host, Threads: threads, Verbose: verbose) do |_launcher|
53
+ Rack::Handler::Puma.run(
54
+ instance,
55
+ Port: port,
56
+ Host: host,
57
+ Threads: threads,
58
+ Verbose: verbose,
59
+ worker_timeout: worker_timeout
60
+ ) do |_launcher|
55
61
  Launchy.open(url) if ENV["RACK_ENV"] != "development"
56
62
  rescue Launchy::CommandNotFoundError
57
63
  # ref. https://github.com/ninoseki/mihari/issues/477