Skip to content

Commit

Permalink
Merge pull request #13 from girorme/feature/rename-project
Browse files Browse the repository at this point in the history
rename main name
  • Loading branch information
girorme authored Dec 4, 2023
2 parents 543aa2a + 584c8da commit cd30d27
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ erl_crash.dump
*.ez

# Ignore package tarball (built via "mix hex.build").
binoculo_daemon-*.tar
binoculo-*.tar

# Temporary files, for example, from tests.
/tmp/
Expand Down
4 changes: 2 additions & 2 deletions .iex.exs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
alias BinoculoDaemon.{Maestro, Msearch, Results, Util, Worker}
alias BinoculoDaemon.Stub.Server
alias Binoculo.{Maestro, Msearch, Results, Util, Worker}
alias Binoculo.Stub.Server
14 changes: 7 additions & 7 deletions lib/binoculo_daemon.ex → lib/binoculo.ex
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
defmodule BinoculoDaemon do
defmodule Binoculo do
@moduledoc """
Documentation for `BinoculoDaemon`.
Documentation for `Binoculo`.
"""

alias BinoculoDaemon.Results
alias BinoculoDaemon.Maestro
alias BinoculoDaemon.Args
alias BinoculoDaemon.Util
alias Binoculo.Results
alias Binoculo.Maestro
alias Binoculo.Args
alias Binoculo.Util

def main(argv) do
parsed_args = Args.parse_args(argv)
Expand All @@ -18,7 +18,7 @@ defmodule BinoculoDaemon do

IO.puts(Util.banner())

IO.puts("BinoculoDaemon started!")
IO.puts("Binoculo started!")
IO.puts("[*] Host: #{host_notation}")
IO.puts("[*] Ports: #{port_count}: #{Enum.join(Enum.take(ports, 5), ", ")}...")
IO.puts("[*] Total hosts to scan: #{qty_to_run}, with #{port_count} ports each")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule BinoculoDaemon.Api.Connector do
defmodule Binoculo.Api.Connector do
@moduledoc """
Socket client "interface"
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
defmodule BinoculoDaemon.Application do
defmodule Binoculo.Application do
@moduledoc """
Main application
"""
use Application

alias BinoculoDaemon.Maestro
alias Binoculo.Maestro

@impl true
def start(_type, _args) do
Expand All @@ -15,7 +15,7 @@ defmodule BinoculoDaemon.Application do
[]
end

opts = [strategy: :one_for_one, name: BinoculoDaemon.Supervisor]
opts = [strategy: :one_for_one, name: Binoculo.Supervisor]
Supervisor.start_link(children, opts)
end
end
4 changes: 2 additions & 2 deletions lib/binoculo_daemon/args.ex → lib/binoculo/args.ex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
defmodule BinoculoDaemon.Args do
defmodule Binoculo.Args do
@moduledoc """
Parse arguments
"""

alias BinoculoDaemon.Util
alias Binoculo.Util

def parse_args(argv) do
version = Util.version()
Expand Down
6 changes: 3 additions & 3 deletions lib/binoculo_daemon/maestro.ex → lib/binoculo/maestro.ex
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
defmodule BinoculoDaemon.Maestro do
defmodule Binoculo.Maestro do
@moduledoc """
Coordinate workers spawn and result saving"
"""
use GenServer

require Logger
alias BinoculoDaemon.Msearch
alias BinoculoDaemon.{Results, Worker, Util}
alias Binoculo.Msearch
alias Binoculo.{Results, Worker, Util}

def start_get_banner_workers(host_notation, ports) do
{:ok, range} = Util.parse_range_or_cidr_notation(host_notation)
Expand Down
2 changes: 1 addition & 1 deletion lib/binoculo_daemon/msearch.ex → lib/binoculo/msearch.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule BinoculoDaemon.Msearch do
defmodule Binoculo.Msearch do
@moduledoc """
Handle msearch operations
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/binoculo_daemon/results.ex → lib/binoculo/results.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule BinoculoDaemon.Results do
defmodule Binoculo.Results do
@moduledoc """
Store workers results
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule BinoculoDaemon.Stub.Server do
defmodule Binoculo.Stub.Server do
@moduledoc """
Module used to stub a server connection in tests
"""
Expand Down
4 changes: 2 additions & 2 deletions lib/binoculo_daemon/util.ex → lib/binoculo/util.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule BinoculoDaemon.Util do
defmodule Binoculo.Util do
@moduledoc """
Util functions
"""
Expand All @@ -10,7 +10,7 @@ defmodule BinoculoDaemon.Util do
alias IP

def version() do
:application.get_key(:binoculo_daemon, :vsn)
:application.get_key(:binoculo, :vsn)
|> elem(1)
|> List.to_string()
end
Expand Down
4 changes: 2 additions & 2 deletions lib/binoculo_daemon/worker.ex → lib/binoculo/worker.ex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
defmodule BinoculoDaemon.Worker do
defmodule Binoculo.Worker do
@moduledoc """
Main Worker
"""

alias BinoculoDaemon.Util
alias Binoculo.Util

@type host() :: String.t()
@type host_port() :: integer()
Expand Down
10 changes: 5 additions & 5 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
defmodule BinoculoDaemon.MixProject do
defmodule Binoculo.MixProject do
use Mix.Project

def project do
[
app: :binoculo_daemon,
app: :binoculo,
version: "0.1.0",
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
test_coverage: [ignore_modules: [BinoculoDaemon]],
test_coverage: [ignore_modules: [Binoculo]],
escript: escript()
]
end

def escript do
[
main_module: BinoculoDaemon,
main_module: Binoculo,
path: "bin/binoculo"
]
end
Expand All @@ -24,7 +24,7 @@ defmodule BinoculoDaemon.MixProject do
def application do
[
extra_applications: [:logger, :crypto],
mod: {BinoculoDaemon.Application, []}
mod: {Binoculo.Application, []}
]
end

Expand Down
2 changes: 1 addition & 1 deletion test/result_test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule ResultTest do
use ExUnit.Case

alias BinoculoDaemon.Results
alias Binoculo.Results

setup do
Results.init_db()
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ExUnit.start()
# Mox.defmock(ConnectorMock, for: BinoculoDaemon.ConnectorApi)
# Mox.defmock(ConnectorMock, for: Binoculo.ConnectorApi)
2 changes: 1 addition & 1 deletion test/util_test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule UtilTest do
use ExUnit.Case, async: true

alias BinoculoDaemon.Util
alias Binoculo.Util

test "should parse range or subnet based on user input" do
input = %{
Expand Down
4 changes: 2 additions & 2 deletions test/worker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ defmodule WorkerTest do
"""
use ExUnit.Case, async: true

alias BinoculoDaemon.Worker
alias BinoculoDaemon.Stub.Server
alias Binoculo.Worker
alias Binoculo.Stub.Server

describe "Testing the banner grab function" do
test "get banner passing ip + port" do
Expand Down

0 comments on commit cd30d27

Please sign in to comment.