mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-20 07:00:58 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc08133ab2 |
+3
-2
@@ -14,11 +14,12 @@
|
|||||||
FROM python:3.12-slim-bookworm
|
FROM python:3.12-slim-bookworm
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
# Common tools: ripgrep / curl / vim, plus a set of recon staples (add/remove as needed).
|
# Common tools: ripgrep / curl / vim, plus a set of recon staples (add/remove as needed).
|
||||||
# Node 20.x comes from NodeSource: bookworm's apt nodejs is 18, but Playwright requires >=20.
|
# Node 22.x comes from NodeSource: bookworm's apt nodejs is 18, Playwright requires >=20,
|
||||||
|
# and 20 is end-of-life. 22 matches the CI and release workflows.
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates ripgrep curl wget vim git jq unzip \
|
ca-certificates ripgrep curl wget vim git jq unzip \
|
||||||
dnsutils iputils-ping netcat-openbsd inetutils-telnet whois nmap \
|
dnsutils iputils-ping netcat-openbsd inetutils-telnet whois nmap \
|
||||||
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
||||||
&& apt-get install -y --no-install-recommends nodejs \
|
&& apt-get install -y --no-install-recommends nodejs \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# Web-recon toolbox (drost-community take 1, #100): pinned release binaries installed
|
# Web-recon toolbox (drost-community take 1, #100): pinned release binaries installed
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"os"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -36,30 +34,3 @@ func TestScrubSecretEnvHidesSecretsFromChildren(t *testing.T) {
|
|||||||
t.Errorf("non-secret variable did not reach the child process")
|
t.Errorf("non-secret variable did not reach the child process")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// New must apply the options it receives. An earlier version accepted
|
|
||||||
// ...Option and never called them, so the binary kept the secrets in the
|
|
||||||
// environment while the unit test above still passed.
|
|
||||||
func TestNewAppliesSecretScrubOption(t *testing.T) {
|
|
||||||
// t.Setenv restores both after the test: the scrub unsets them for the rest
|
|
||||||
// of this process, and later tests still need the DSN.
|
|
||||||
if dsn := os.Getenv("ARTEX_PG_DSN"); dsn != "" {
|
|
||||||
t.Setenv("ARTEX_PG_DSN", dsn)
|
|
||||||
}
|
|
||||||
t.Setenv("ANTHROPIC_API_KEY", "scrub-probe")
|
|
||||||
t.Setenv("OPENAI_API_KEY", "scrub-probe")
|
|
||||||
|
|
||||||
m, err := NewManager(t.TempDir(), "")
|
|
||||||
if err != nil {
|
|
||||||
t.Skipf("no manager: %v", err)
|
|
||||||
}
|
|
||||||
t.Cleanup(func() { m.Close() })
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
|
||||||
cancel()
|
|
||||||
_ = New(ctx, m, t.TempDir(), t.TempDir(), t.TempDir(), WithSecretScrub())
|
|
||||||
|
|
||||||
if os.Getenv("ANTHROPIC_API_KEY") != "" || os.Getenv("OPENAI_API_KEY") != "" {
|
|
||||||
t.Fatal("New did not apply WithSecretScrub: the secrets are still in the environment")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -156,9 +156,6 @@ func New(ctx context.Context, m *Manager, skillDir string, dataDir string, keyDi
|
|||||||
profChatAgents: map[int64]*agent.ChatAgent{},
|
profChatAgents: map[int64]*agent.ChatAgent{},
|
||||||
provByProfile: map[int64]*provEntry{}, llmHealth: newLLMHealthRegistry(m.pg),
|
provByProfile: map[int64]*provEntry{}, llmHealth: newLLMHealthRegistry(m.pg),
|
||||||
taskAgents: map[string]*taskAgentBundle{}, archiveWake: make(chan struct{}, 1)}
|
taskAgents: map[string]*taskAgentBundle{}, archiveWake: make(chan struct{}, 1)}
|
||||||
for _, o := range opts {
|
|
||||||
o(s)
|
|
||||||
}
|
|
||||||
s.initSetupToken()
|
s.initSetupToken()
|
||||||
s.initSideQuestions()
|
s.initSideQuestions()
|
||||||
// Circuit-breaker thresholds/cooldowns are hot parameters on the failure path; push the global retry policy to the Registry once at startup,
|
// Circuit-breaker thresholds/cooldowns are hot parameters on the failure path; push the global retry policy to the Registry once at startup,
|
||||||
|
|||||||
Reference in New Issue
Block a user