Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

How to set management token without run consul acl bootstrap? #176

Open
4n70w4 opened this issue Oct 2, 2021 · 2 comments
Open

How to set management token without run consul acl bootstrap? #176

4n70w4 opened this issue Oct 2, 2021 · 2 comments

Comments

@4n70w4
Copy link

4n70w4 commented Oct 2, 2021

Hi! I can't google info about set up my own management token for ACL.

I would like to set this token through environment variables or something else.

@dvoltaire
Copy link

dvoltaire commented Mar 13, 2022

Add this to your acl entry:

acl {
  enabled                  = true
  default_policy           = "deny"
  enable_token_persistence = true
  tokens {
    initial_management = "your-token-value-in-base64"
  }
}

@blake
Copy link
Member

blake commented Mar 13, 2022

I would like to set this token through environment variables or something else.

You can use the CONSUL_LOCAL_CONFIG environment variable to pass this configuration into the container. Here's an example of using this with Docker compose.

# docker-compose.yml
---
version: "3.8"
services:
  consul:
    image: hashicorp/consul:1.11.4
    environment:
      CONSUL_LOCAL_CONFIG: |
        {
          "acl": {
            "enabled": true,
            "default_policy": "deny",
            "enable_token_persistence": true,
            "tokens": {
              "initial_management": "UUID of the initial management token",
            }
          }
        }

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

No branches or pull requests

3 participants