Skip to content

Commit 25f9fb2

Browse files
authored
Merge pull request #23 from theopenlane/feat-fixui
fix fall back / lower confidence reporting
2 parents 9bb1000 + 5fde1ad commit 25f9fb2

30 files changed

+1639
-214
lines changed

Taskfile.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ tasks:
7979
docker:run:
8080
desc: Run sleuth in Docker
8181
cmds:
82-
- docker run -p 8080:8080 sleuth:latest
82+
- docker run -p 17710:17710 sleuth:latest
8383

8484
specs:generate:
8585
desc: Generate OpenAPI specifications
@@ -121,10 +121,10 @@ tasks:
121121
vars:
122122
DOMAIN: '{{default "theopenlane.io" .DOMAIN}}'
123123
cmds:
124-
- docker run -d --rm -p 8080:8080 --name sleuth-scan sleuth:latest
124+
- docker run -d --rm -p 17710:17710 --name sleuth-scan sleuth:latest
125125
- sleep 2
126126
- >
127-
curl -s -X POST -H "Content-Type: application/json" -d '{"domain":"{{.DOMAIN}}"}' http://localhost:8080/api/scan
127+
curl -s -X POST -H "Content-Type: application/json" -d '{"domain":"{{.DOMAIN}}"}' http://localhost:17710/api/scan
128128
- docker stop sleuth-scan >/dev/null
129129

130130
service:start:
@@ -145,10 +145,16 @@ tasks:
145145
- tail -f .tasktmp/sleuth.log
146146

147147
ui:
148-
desc: Rebuild, restart the service, and open the UI in a browser
148+
desc: Rebuild and run the service in the foreground with live console logs (opens browser after startup)
149149
cmds:
150150
- task: service:stop
151-
- task: service:start
151+
- task: go:build
152+
- cmd: sh -c '(sleep 2 && open http://localhost:17710/ui) &'
153+
- ./bin/sleuth serve
154+
155+
ui:open:
156+
desc: Open the Sleuth UI in the default browser (use when service is already running)
157+
cmds:
152158
- open http://localhost:17710/ui
153159

154160
call:health:
@@ -167,7 +173,7 @@ tasks:
167173
call:intel-hydrate:
168174
desc: Trigger threat intelligence hydration
169175
cmds:
170-
- curl -s -X POST http://localhost:8080/api/intel/hydrate | jq
176+
- curl -s -X POST http://localhost:17710/api/intel/hydrate | jq
171177

172178
call:enrich:
173179
desc: Enrich a domain or email via Cloudflare Browser Rendering

client/client/sleuth_client.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SLEUTH_SERVER_LISTEN=":8080"
1+
SLEUTH_SERVER_LISTEN=":17710"
22
SLEUTH_SERVER_READTIMEOUT="30s"
33
SLEUTH_SERVER_WRITETIMEOUT="3m0s"
44
SLEUTH_SERVER_SHUTDOWNGRACEPERIOD="30s"

config/config.example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ scanner:
2020
timeout: 2m0s
2121
verbose: false
2222
server:
23-
listen: :8080
23+
listen: :17710
2424
maxbodysize: 102400
2525
readtimeout: 30s
2626
shutdowngraceperiod: 30s

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type Server struct {
4343
// Pretty enables pretty logging output, set via command line flag
4444
Pretty bool `json:"-" koanf:"-" default:"false"`
4545
// Listen sets the address and port to serve on
46-
Listen string `json:"listen" koanf:"listen" default:":8080"`
46+
Listen string `json:"listen" koanf:"listen" default:":17710"`
4747
// ReadTimeout is the maximum duration for reading the entire request
4848
ReadTimeout time.Duration `json:"readtimeout" koanf:"readtimeout" default:"30s"`
4949
// WriteTimeout is the maximum duration before timing out writes of the response

config/config_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
func TestNew(t *testing.T) {
1010
cfg := New()
1111

12-
if cfg.Server.Listen != ":8080" {
13-
t.Errorf("expected default listen :8080, got %s", cfg.Server.Listen)
12+
if cfg.Server.Listen != ":17710" {
13+
t.Errorf("expected default listen :17710, got %s", cfg.Server.Listen)
1414
}
1515

1616
if cfg.Server.ReadTimeout != 30*time.Second {
@@ -45,8 +45,8 @@ func TestNew(t *testing.T) {
4545
t.Errorf("expected default storage dir data/intel, got %s", cfg.Intel.StorageDir)
4646
}
4747

48-
if cfg.Cloudflare.RequestTimeout != 30*time.Second {
49-
t.Errorf("expected default cloudflare request timeout 30s, got %v", cfg.Cloudflare.RequestTimeout)
48+
if cfg.Cloudflare.RequestTimeout != 120*time.Second {
49+
t.Errorf("expected default cloudflare request timeout 120s, got %v", cfg.Cloudflare.RequestTimeout)
5050
}
5151

5252
if cfg.Cloudflare.AccountID != "" {
@@ -165,8 +165,8 @@ func TestLoadWithMissingFile(t *testing.T) {
165165
t.Fatalf("expected no error with missing config file, got %v", err)
166166
}
167167

168-
if cfg.Server.Listen != ":8080" {
169-
t.Errorf("expected default listen :8080 with missing file, got %s", cfg.Server.Listen)
168+
if cfg.Server.Listen != ":17710" {
169+
t.Errorf("expected default listen :17710 with missing file, got %s", cfg.Server.Listen)
170170
}
171171
}
172172

0 commit comments

Comments
 (0)