influxdata/influxdb

Add --no-onboarding flag

Open

#15761 opened on Nov 5, 2019

View on GitHub
 (5 comments) (6 reactions) (0 assignees)Rust (31,498 stars) (3,707 forks)batch import
area/2.xhelp wanted

Description

Proposal: Users should be able to disable onboarding.

Current behavior: When you run influxdb2 for the first time, you have to fill out a one-time form. This sure seems nice for GUI users who are prompted with a handy web page to get started. However, it behaves poorly with automation scripts or resource management softwares such as Terraform. Indeed, the onboarding is not really a resource since it cannot be updated or deleted. Also, automation-wise, it is pretty pointless since one could simply create an admin, an org, buckets, etc.

Desired behavior: Add a --no-onboarding or --disable-onboarding flag to influxdb that does exactly what it says.

But then, we need a way to create the admin account. Here are two solutions:

  • the closest one to the existing behavior: add an API route such as /firstadmin with POST and GET which is only available once and will return {"existing": true}, akin to /onboarding
  • the annoying one: add a command (such as createadmin) which can only be executed by the binary running the current influx server, which means you need container/host access to run the command, which is generally secure but not very handy
  • the standard one: add the ADMIN_PASSWORD environment variable which, if not empty, will be used by influx to create an admin account at start if no account exists already

Alternatives considered: PR https://github.com/influxdata/influxdb/pull/11418 doesn't actually solve the problem because everything needs to be on the command line, included the admin password, which is not secure enough for a production environment. Also, the org and first bucket have to be here, and not in the automation script with the other resources. This doesn't really change anything to the current situation.

Contributor guide