mirror of
https://github.com/livekit/livekit.git
synced 2026-11-11 14:27:57 +00:00
* config: reject out-of-range values in generated numeric flags Generated flags for uint8, uint16, uint32, int32 and float32 config fields were parsed at a wider type and then converted with reflect.Value.Convert, which wraps silently. For example LIVEKIT_TURN_RELAY_RANGE_START=70000 became 4464, and LIVEKIT_LIMIT_MAX_METADATA_SIZE=4294967296 became 0, which turns the limit off. The YAML config rejects the same values. Use the cli flag type that matches each field's width so the parse fails with the env var or flag name in the error. * config: cover uint, int8 and int16 in generated numeric flags Move the numeric cases into numericCLIFlag and add Int8Flag, Int16Flag and UintFlag, so every numeric kind gets a flag of its own width even though no config field uses these three yet. TestNumericCLIFlagWidths checks each kind directly with an in-range value and one that does not fit. * config: return an error from numericCLIFlag for unsupported kinds numericCLIFlag returned nil when no case matched, and GenerateCLIFlags appended it unchecked. It now returns (cli.Flag, error) and the caller returns the error like the default case does.