MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / Run

Method Run

internal/doctor/checks.go:91–116  ·  view source on GitHub ↗
(_ context.Context, r Reporter)

Source from the content-addressed store, hash-verified

89
90func (c EnvCheck) Name() string { return "Environment File Check" }
91func (c EnvCheck) Run(_ context.Context, r Reporter) Result {
92 res := Result{}
93 path, err := envfile.Find(c.Custom, false)
94 if err != nil {
95 if errors.Is(err, envfile.ErrNotFound) {
96 res.Issues++
97 r.Warn("No .env file found", "Create one for sensitive credentials")
98 return res
99 }
100 res.Issues++
101 r.Fail("Unable to locate .env", err.Error())
102 return res
103 }
104 r.Pass(fmt.Sprintf("Environment file found: %s", path))
105 if info, err := os.Stat(path); err == nil {
106 perms := info.Mode().Perm()
107 if perms == 0o600 || perms == 0o400 {
108 r.Pass("Environment file has secure permissions")
109 } else {
110 res.Issues++
111 r.Warn(fmt.Sprintf("Environment file permissions: %o", perms),
112 "Consider chmod 600 for secure storage of API keys")
113 }
114 }
115 return res
116}
117
118// EndpointFormatCheck verifies every endpoint URL starts with http(s)://.
119type EndpointFormatCheck struct {

Callers

nothing calls this directly

Calls 5

FindFunction · 0.92
WarnMethod · 0.65
FailMethod · 0.65
PassMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected