Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting ForcedTags using the acls.hujson config file #1490

Conversation

networkException
Copy link

@networkException networkException commented Jun 17, 2023

This pull request introduces a declarative way to set ForcedTags for machines.

If a "forcedTags" field is set in the acls.hujson file, the ForcedTags of machines will be overriden in the database based on the tags defined in the config file.

{
    "hosts": {
        "a": "fd7a:115c:a1e0::1",
        "b": "fd7a:115c:a1e0::2"
    },
    "forcedTags": {
        "tag:some-tag": [
            "a",
            "tag:some-other-tag"
        ],
        "tag:some-other-tag": [
            "b"
        ]
    }
}
  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

@networkException networkException force-pushed the declarative-forced-tags branch from f58f641 to f1cb8dd Compare June 17, 2023 20:48
@networkException
Copy link
Author

I asked about how this could be implemented on Discord but nobody responded.

Any kind of feedback is welcome, I'd like to get this to an upstreamable state eventually but I'll just carry this patch in production until then.

My specific use case is supporting this in the NixOS module. It doesn't have a convenient way of configuring acls currently but I'm planning to upstream that to nixpkgs soon as well regardless of this pr

This patch introduces a declarative way to set ForcedTags for machines.

If a "forcedTags" field is set in the acls.hujson file, the ForcedTags
of machines will be overriden in the database based on the tags defined
in the config file.

```json
{
    "hosts": {
        "a": "fd7a:115c:a1e0::1",
        "b": "fd7a:115c:a1e0::2"
    },
    "forcedTags": {
        "tag:some-tag": [
            "a",
            "tag:some-other-tag"
        ],
        "tag:some-other-tag": [
            "b"
        ]
    }
}
```
@networkException networkException force-pushed the declarative-forced-tags branch 2 times, most recently from 089fd3d to 1dd7f19 Compare June 18, 2023 12:28
@kradalby
Copy link
Collaborator

Hi! as part of #1473, we have reorganised a lot of the code.

To clear PRs that needs to be rebased or redone, we are closing open PRs that will require significant code change to be merged.

In addition, the issue of the PR might in some cases have been fixed, change or no longer relevant, so it would be great if this is considered as well.

Thank you for your contribution!

If it is still relevant and the PR is reopened, we will aim at getting the changes into the next release after the reorg if accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants