tailscale/util/syspolicy
Nick Khyl 2336c340c4 util/syspolicy: implement a syspolicy store that reads settings from environment variables
In this PR, we implement (but do not use yet, pending #13727 review) a syspolicy/source.Store
that reads policy settings from environment variables. It converts a CamelCase setting.Key,
such as AuthKey or ExitNodeID, to a SCREAMING_SNAKE_CASE, TS_-prefixed environment
variable name, such as TS_AUTH_KEY and TS_EXIT_NODE_ID. It then looks up the variable
and attempts to parse it according to the expected value type. If the environment variable
is not set, the policy setting is considered not configured in this store (the syspolicy package
will still read it from other sources). Similarly, if the environment variable has an invalid value
for the setting type, it won't be used (though the reported/logged error will differ).

Updates #13193
Updates #12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2024-10-30 11:12:22 -05:00
..
internal util/syspolicy: implement a syspolicy store that reads settings from environment variables 2024-10-30 11:12:22 -05:00
rsop util/syspolicy: add rsop package that provides access to the resultant policy 2024-10-16 00:06:14 -05:00
setting util/syspolicy: implement a syspolicy store that reads settings from environment variables 2024-10-30 11:12:22 -05:00
source util/syspolicy: implement a syspolicy store that reads settings from environment variables 2024-10-30 11:12:22 -05:00
handler.go util/syspolicy, ipn/ipnlocal: update syspolicy package to utilize syspolicy/rsop 2024-10-25 12:41:07 -05:00
policy_keys_test.go util/syspolicy, ipn/ipnlocal: update syspolicy package to utilize syspolicy/rsop 2024-10-25 12:41:07 -05:00
policy_keys.go util/syspolicy, ipn/ipnlocal: update syspolicy package to utilize syspolicy/rsop 2024-10-25 12:41:07 -05:00
syspolicy_test.go util/syspolicy, ipn/ipnlocal: update syspolicy package to utilize syspolicy/rsop 2024-10-25 12:41:07 -05:00
syspolicy_windows.go util/syspolicy, ipn/ipnlocal: update syspolicy package to utilize syspolicy/rsop 2024-10-25 12:41:07 -05:00
syspolicy.go util/syspolicy, ipn/ipnlocal: update syspolicy package to utilize syspolicy/rsop 2024-10-25 12:41:07 -05:00