publish: carry the Windows product into the projection

The tree adds the installer, service and test paths admitted by this source commit. Nothing else changes about what may cross.

Source-Sha: 3e4a3aa4ce092e9e3f51bc78daf3ddc14d9638f8

Policy-Sha: 3e4a3aa4ce092e9e3f51bc78daf3ddc14d9638f8

Tree-Digest: 89d6fce3828a0e0de0c8eeb41ee6750f4462217e2a04b5190297134d7f4a50c3
This commit is contained in:
Fimeg 2026-09-09 12:47:34 -04:00
commit 765ec4188f
35 changed files with 1425 additions and 379 deletions

View file

@ -49,24 +49,24 @@ type Config struct {
Timezone string
LatestAgentVersion string
MinAgentVersion string `env:"MIN_AGENT_VERSION" default:"0.1.26"`
SigningPrivateKey string `env:"REDFLAG_SIGNING_PRIVATE_KEY"`
SigningPrivateKey string `env:"REDFLAG_SIGNING_PRIVATE_KEY"`
// At-rest symmetric keys (base64, 32-byte AES-256). Provisioned by
// resolveAtRestKeys onto the single secret rail: Docker secret, then env,
// then a persisted key file under the data dir. Never stored in the DB.
SettingsEncryptionKey string `env:"REDFLAG_SETTINGS_ENCRYPTION_KEY"`
TokenEncryptionKey string `env:"REDFLAG_TOKEN_ENC_KEY"`
BinaryStoragePath string `env:"REDFLAG_BINARY_STORAGE_PATH" default:"./binaries"`
DebugEnabled bool `env:"REDFLAG_DEBUG" default:"false"` // Enable debug logging
SecurityLogging struct {
Enabled bool `env:"REDFLAG_SECURITY_LOG_ENABLED" default:"true"`
Level string `env:"REDFLAG_SECURITY_LOG_LEVEL" default:"warning"` // none, error, warn, info, debug
LogSuccesses bool `env:"REDFLAG_SECURITY_LOG_SUCCESSES" default:"false"`
FilePath string `env:"REDFLAG_SECURITY_LOG_PATH" default:"/var/log/redflag/security.json"`
MaxSizeMB int `env:"REDFLAG_SECURITY_LOG_MAX_SIZE" default:"100"`
MaxFiles int `env:"REDFLAG_SECURITY_LOG_MAX_FILES" default:"10"`
RetentionDays int `env:"REDFLAG_SECURITY_LOG_RETENTION" default:"90"`
LogToDatabase bool `env:"REDFLAG_SECURITY_LOG_TO_DB" default:"true"`
HashIPAddresses bool `env:"REDFLAG_SECURITY_LOG_HASH_IP" default:"true"`
BinaryStoragePath string `env:"REDFLAG_BINARY_STORAGE_PATH" default:"./binaries"`
DebugEnabled bool `env:"REDFLAG_DEBUG" default:"false"` // Enable debug logging
SecurityLogging struct {
Enabled bool `env:"REDFLAG_SECURITY_LOG_ENABLED" default:"true"`
Level string `env:"REDFLAG_SECURITY_LOG_LEVEL" default:"warning"` // none, error, warn, info, debug
LogSuccesses bool `env:"REDFLAG_SECURITY_LOG_SUCCESSES" default:"false"`
FilePath string `env:"REDFLAG_SECURITY_LOG_PATH" default:"/var/log/redflag/security.json"`
MaxSizeMB int `env:"REDFLAG_SECURITY_LOG_MAX_SIZE" default:"100"`
MaxFiles int `env:"REDFLAG_SECURITY_LOG_MAX_FILES" default:"10"`
RetentionDays int `env:"REDFLAG_SECURITY_LOG_RETENTION" default:"90"`
LogToDatabase bool `env:"REDFLAG_SECURITY_LOG_TO_DB" default:"true"`
HashIPAddresses bool `env:"REDFLAG_SECURITY_LOG_HASH_IP" default:"true"`
}
}
@ -309,7 +309,11 @@ func loadOrCreateKey(name string) (string, error) {
return v, nil
}
dir := getEnv("REDFLAG_DATA_DIR", "/app/data")
defaultDataDir := "/app/data"
if runtime.GOOS == "windows" {
defaultDataDir = filepath.Join(os.Getenv("ProgramData"), "RedFlag", "server")
}
dir := getEnv("REDFLAG_DATA_DIR", defaultDataDir)
if err := os.MkdirAll(dir, 0700); err != nil {
return "", fmt.Errorf("create data dir %s: %w", dir, err)
}
@ -332,7 +336,6 @@ func loadOrCreateKey(name string) (string, error) {
return encoded, nil
}
// RunSetupWizard is deprecated - configuration is now handled via web interface
func RunSetupWizard() error {
return fmt.Errorf("CLI setup wizard is deprecated. Please use the web interface at http://localhost:8080/setup for configuration")