[Feature] strict config validation #705

Open
opened 2025-12-29 02:22:40 +01:00 by adam · 6 comments
Owner

Originally created by @SuperSandro2000 on GitHub (May 6, 2024).

Use case

I've run multiple times into issues because I've miss typed a config key name or forgot to copy a letter. Headscale should catch that and fail early in when loading the config and complain about keys it doesn't know.

Description

I am imagining something like json's DisallowUnknownFields() which complains if any field cannot be mapped into a struct.

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

No response

Originally created by @SuperSandro2000 on GitHub (May 6, 2024). ### Use case I've run multiple times into issues because I've miss typed a config key name or forgot to copy a letter. Headscale should catch that and fail early in when loading the config and complain about keys it doesn't know. ### Description I am imagining something like json's DisallowUnknownFields() which complains if any field cannot be mapped into a struct. ### Contribution - [ ] I can write the design doc for this feature - [ ] I can contribute this feature ### How can it be implemented? _No response_
adam added the enhancementno-stale-botneeds design doc labels 2025-12-29 02:22:40 +01:00
Author
Owner

@kradalby commented on GitHub (May 8, 2024):

I agree, the whole config management is a bit of a pain, I particularly does not like that it can only be loaded and not easily dumped at the moment.

@kradalby commented on GitHub (May 8, 2024): I agree, the whole config management is a bit of a pain, I particularly does not like that it can only be loaded and not easily dumped at the moment.
Author
Owner

@github-actions[bot] commented on GitHub (Aug 7, 2024):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Aug 7, 2024): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@SuperSandro2000 commented on GitHub (Aug 7, 2024):

Useless comment

@SuperSandro2000 commented on GitHub (Aug 7, 2024): Useless comment
Author
Owner

@lethedata commented on GitHub (May 25, 2025):

Ran into this today with an ACL rule containing "dsr" instead of "dst".

I think it's probably worth motioning this bug in the ACL doc page since it's something people will be writing "fully by hand" and might not realize the typos aren't caught during checks.

Example verbiage: https://github.com/juanfont/headscale/compare/main...lethedata:headscale:docs-strict-config

@lethedata commented on GitHub (May 25, 2025): Ran into this today with an ACL rule containing "dsr" instead of "dst". I think it's probably worth motioning this bug in the ACL doc page since it's something people will be writing "fully by hand" and might not realize the typos aren't caught during checks. Example verbiage: https://github.com/juanfont/headscale/compare/main...lethedata:headscale:docs-strict-config
Author
Owner

@kradalby commented on GitHub (May 25, 2025):

@lethedata which version? The new policy is a lot stricter and we keep adding more, so this would be something we can fix quickly as we control the stack.

The config is harder because of the not-so-nice-inretrospect viper stuff we use

@kradalby commented on GitHub (May 25, 2025): @lethedata which version? The new policy is a lot stricter and we keep adding more, so this would be something we can fix quickly as we control the stack. The config is harder because of the not-so-nice-inretrospect viper stuff we use
Author
Owner

@lethedata commented on GitHub (May 25, 2025):

@lethedata which version?

v0.26.0 via a container

@lethedata commented on GitHub (May 25, 2025): > [@lethedata](https://github.com/lethedata) which version? v0.26.0 via a container
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#705