WIP: Consul ACLs #117

Draft
max wants to merge 8 commits from pr-consul-acl into master
Owner
No description provided.
max added 8 commits 2024-08-23 00:34:30 +03:00
max reviewed 2024-08-23 01:14:16 +03:00
@ -31,0 +51,4 @@
script = ''
while ! test -e /run/locksmith/consul-systemManagementToken; do
echo Waiting for System Management Token
systemctl start locksmith.service
Author
Owner

Find a way to make Locksmith work better while bootstrapping. Polling like this is pretty fucked up. Maybe there should be a proper "Consul is ready without SMT" level and Locksmith and the Chant Listener should be configured to work with that level.

Find a way to make Locksmith work better while bootstrapping. Polling like this is pretty fucked up. Maybe there should be a proper "Consul is ready without SMT" level and Locksmith and the Chant Listener should be configured to work with that level.
@ -31,0 +55,4 @@
sleep 5
done
export CONSUL_HTTP_TOKEN_FILE=/run/locksmith/consul-systemManagementToken
consul acl set-agent-token default "$(< /run/locksmith/consul-systemManagementToken)" # TODO: don't leak token on cmdline
Author
Owner

Setting the default token means it's no longer required to present a token when connecting to this agent. Should probably limit this to automatic actions only (dns, replication token types?)

Setting the default token means it's no longer required to present a token when connecting to this agent. Should probably limit this to automatic actions only (`dns`, `replication` token types?)
@ -52,2 +52,4 @@
};
};
systemd.targets.consul-ready = {
Author
Owner

This entire thing is ugly

This entire thing is ugly
@ -12,3 +8,3 @@
nodes = [ n for n in machines if n != nowhere ]
for machine in nodes:
machine.succeed("systemctl start consul-ready.service")
machine.succeed("systemctl start consul-ready.target")
Author
Owner

ugly

ugly
@ -46,2 +46,2 @@
Requires=consul-ready.service
After=consul-ready.service
Requires=consul-ready.target
After=consul-ready.target
Author
Owner

ugly

ugly
@ -12,6 +12,7 @@ let
consulRegisterScript = pkgs.writeShellScript "consul-register" ''
export CONSUL_HTTP_ADDR='${consulHttpAddr}'
export CONSUL_HTTP_TOKEN_FILE=/run/locksmith/consul-systemManagementToken
Author
Owner

This should definitely be statically optional, i.e. can disable ACL support in this module.

This should probably be dynamically optional, i.e. check for the existence of the token file first. This could be useful for registering and/or running distributed Consul services before the ACL bootstrap is complete.

This should definitely be statically optional, i.e. can disable ACL support in this module. This should probably be *dynamically* optional, i.e. check for the existence of the token file first. This could be useful for registering and/or running distributed Consul services before the ACL bootstrap is complete.
@ -84,2 +86,2 @@
after = [ "consul-ready.service" ];
requires = [ "consul-ready.service" ];
after = [ "consul-ready.target" ];
requires = [ "consul-ready.target" ];
Author
Owner

ugly

ugly
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin pr-consul-acl:pr-consul-acl
git checkout pr-consul-acl

Merge

Merge the changes and update on Forgejo.
git checkout master
git merge --no-ff pr-consul-acl
git checkout master
git merge --ff-only pr-consul-acl
git checkout pr-consul-acl
git rebase master
git checkout master
git merge --no-ff pr-consul-acl
git checkout master
git merge --squash pr-consul-acl
git checkout master
git merge --ff-only pr-consul-acl
git checkout master
git merge pr-consul-acl
git push origin master
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: privatevoid.net/depot#117
No description provided.