Skip to content

Commit

Permalink
embed static files into Bitcrook binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
ax-i-om committed Oct 12, 2023
1 parent bb99cf0 commit f39027d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ enabled = true
[[analyzers]]
name = "javascript"
enabled = true
environment = ["jquery"]

[analyzers.meta]
environment = ["jquery"]
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://pkg.go.dev/github.com/ax-i-om/bitcrook"><img src="https://pkg.go.dev/badge/github.com/ax-i-om/tempest.svg" alt="Documentation"></a>
<a href="https://goreportcard.com/report/github.com/ax-i-om/bitcrook"><img src="https://goreportcard.com/badge/github.com/ax-i-om/bitcrook" alt="Go Report Card"></a>
<a><img src="https://img.shields.io/badge/tests-8&#47;8-green.svg" alt="Tests"></a>
<a><img src="https://img.shields.io/badge/version-2.0.1-blue.svg" alt="v2.0.1"></a><br>
<a><img src="https://img.shields.io/badge/version-2.1.0-blue.svg" alt="v2.1.0"></a><br>
<a href="https://app.deepsource.com/gh/ax-i-om/bitcrook/" target="_blank"><img alt="DeepSource" title="DeepSource" src="https://app.deepsource.com/gh/ax-i-om/bitcrook.svg/?label=active+issues&show_trend=true"/></a><br>
Centralize and expedite OSINT investigations<br>
<a href="https://github.com/users/ax-i-om/projects/1">View the roadmap</a><br>
Expand Down Expand Up @@ -40,18 +40,21 @@ It is the end user's responsibility to obey all applicable local, state, and fed

### Changelog

Bitcrook v2.0.0 has been released as of October 11, 2023, only one day after v1.0.0 due to some significant changes to project structure.
Bitcrook v2.0.0 has been released as of October 11, 2023, only one day after v1.0.0 due to some significant changes to project structure. Here are some highlights of the recent changes in the v1.0.0 and v2.0.0 releases:

- Switch web framework from Fiber to Go (enabled Bitcrook to be more lightweight)
- Completely revamped the CLI output scheme
- Proper docker implementation
- Binary release to support `go install`
- Switched secret configuration from .json to .env, see [Authentication](#authentication)
- Enabled API key support in web app
- Fixed CORS error when accessing web app over LAN
- Username lookup command now only displays valid results
- Packages now grouped based on field type rather than authentication type
- Added HaveIBeenPwned breach check to email and domain lookup commands
- Altered .env support, see [Authentication](#authentication)
- Removed Caselaw package due to instability, will replace
- Packages now grouped based on field type rather than authentication type
- Fixed tests and some documentation
- Bug fixes and general optimizations
- Removed Caselaw package due to instability, will replace

Although this release hasn't changed much of the foundations of Bitcrook, it does illuminate
a path of where it will be taken next.

### Preview

Expand Down Expand Up @@ -92,7 +95,7 @@ You can also host the Bitcrook webapp via docker:

1. Navigate to the root directory of Bitcrook via `cd`
2. Build the Docker image: `docker build -t bitcrook .`
3. Run Bitcrook via Docker: `docker run --env-file .env -d -p 6174:6174 bitcrook`
3. Run Bitcrook via Docker: `docker run --env-file .env --name bitcrook -d -p 6174:6174 bitcrook`
4. Access the interface via `http://127.0.0.1:6174`

### Authentication
Expand Down
10 changes: 9 additions & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.
package api

import (
"embed"
"fmt"
"net/http"
"os"
Expand All @@ -33,13 +34,20 @@ import (
"github.com/labstack/echo/v4/middleware"
)

//go:embed static
var sFiles embed.FS

func StartServer() {
e := echo.New()

e.HideBanner = true
e.HidePort = true

e.Use(middleware.Static("./api/static"))
e.Use(middleware.StaticWithConfig(middleware.StaticConfig{
Root: "static",
Browse: true,
Filesystem: http.FS(sFiles),
}))

e.GET("/ip/:ip", func(c echo.Context) error {
ipInfo, err := ip.IPAPILookup(c.Param("ip"))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.17.0
golang.org/x/net v0.16.0
golang.org/x/net v0.17.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos=
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func main() {
fmt.Println(" ___ __________________ ____ ____ __ __")
fmt.Println(" / _ )/ _/_ __/ ___/ _ \\/ __ \\/ __ \\/ //_/")
fmt.Println(" / _ |/ / / / / /__/ , _/ /_/ / /_/ / ,< ")
fmt.Println("/____/___/ /_/ \\___/_/|_|\\____/\\____/_/|_| " + color.Colorize(color.Green, "v2.0.1"))
fmt.Println("/____/___/ /_/ \\___/_/|_|\\____/\\____/_/|_| " + color.Colorize(color.Green, "v2.1.0"))
fmt.Println()
fmt.Println("Bitcrook Copyright (C) 2021 Axiom\nThis program comes with ABSOLUTELY NO WARRANTY")
fmt.Println()
Expand Down

0 comments on commit f39027d

Please sign in to comment.