fix: acknowledge pi maintenance barrier

This commit is contained in:
2026-08-04 19:32:05 +02:00
parent 0b9ad7f53f
commit 5b3ce93e31
11 changed files with 168 additions and 52 deletions
@@ -164,6 +164,16 @@ func (i Installation) SecretFiles() ([]string, error) {
return files, nil
}
// EnvironmentValue returns one declared installation value without exposing dotenv parsing to
// callers. It is used only for operator-visible file locations, never for secret content.
func (i Installation) EnvironmentValue(name string) (string, error) {
contents, err := safeio.ReadCanonicalRegular(i.EnvFile, maxEnvironmentFileBytes)
if err != nil { return "", errors.New("installation environment could not be read") }
values, err := parseComposeDotenv(contents)
if err != nil { return "", errors.New("installation environment could not be read") }
return values[name], nil
}
func parseComposeDotenv(contents []byte) (map[string]string, error) {
dotenvParseMu.Lock()
defer dotenvParseMu.Unlock()