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

[FEAT]Ability to define a custom password for the influxDB via the compose file. #432

Closed
DrFrankensteinUK opened this issue Jan 19, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@DrFrankensteinUK
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I have been reading through the documentation in relation to the InfluxDB and can see how I would go about defining an API key etc on an already existing database or install via Scrutiny. However, a password change for the admin user would have to be done via the containers' console as there is no way to define a password in the InfluxDB web ui.

Describe the solution you'd like
It would be great if we could define a username or just password via environment variables in the docker compose in order to secure the database on initial setup, this could then be removed past the initial setup.

Additional context
In the interim I am going to update the Synology guide to work around this by including additional instructions on how to change the password and then setup API access instead.

@AnalogJ
Copy link
Owner

AnalogJ commented Jan 19, 2023

This is possible, though not as well documented as I'd like (though the options are visible in the code:

During first startup Scrutiny will connect to the unprotected InfluxDB server, start the setup process (via API) using a username and password of admin:password12345 and then create an API token of scrutiny-default-admin-token.

After thats complete, it will use the api token for all subsequent communication with InfluxDB.

You can configure the values for the Admin username, password and token using the config file, or env variables:

Config File Example

web:
  influxdb:
    token: 'my-custom-token'
    init_username: 'my-custom-username'
    init_password: 'my-custom-password'

Environmental Variables Example

SCRUTINY_WEB_INFLUXDB_TOKEN , SCRUTINY_WEB_INFLUXDB_INIT_USERNAME and SCRUTINY_WEB_INFLUXDB_INIT_PASSWORD

If you'd like to change your Admin username/password after the fact, go ahead, only the API token is required after the initial setup is complete.

Hope that answers all your questions?
I'll close this issue after I update the docs.

@AnalogJ AnalogJ added the documentation Improvements or additions to documentation label Jan 19, 2023
@DrFrankensteinUK
Copy link
Contributor Author

DrFrankensteinUK commented Jan 19, 2023

Thanks very useful information – I will get my guide updated with the environment variables above as makes things easier for people setting up the first time.

Quick EDIT - I just realised you would install influx CLI on the host and connect to the database! So below might be a stupid question!

I do have a final question. How on earth do I change the password after the fact – I thought incorrectly I could pass the command inside the container 'influx user password -n admin'. However, I don't think Influx CLI is installed, so it fails with 'influx' command not found.

@AnalogJ
Copy link
Owner

AnalogJ commented Jan 20, 2023

Hey @DrFrankensteinUK
IIRC I changed the InfluxDB password in the webui. TBH I haven't documented a flow for changing the username/password after the fact.

@AnalogJ
Copy link
Owner

AnalogJ commented Jan 20, 2023

I updated the docs with the instructions discussed here - 97f7370

@DrFrankensteinUK
Copy link
Contributor Author

Hey @DrFrankensteinUK IIRC I changed the InfluxDB password in the webui. TBH I haven't documented a flow for changing the username/password after the fact.

Oh! we have been hunting for it and couldn't find that anywhere – even the documentation for Influx says it can't be changed – Maybe on older versions?

@AnalogJ
Copy link
Owner

AnalogJ commented Jan 23, 2023

Looks like I may have lied to you @DrFrankensteinUK I wasn't able to find any "change my password" wizard in the InfluxDB admin UI, however I was able to find this API endpoint - https://docs.influxdata.com/influxdb/v2.6/api/#operation/PutMePassword

That should allow you to reset the admin user's password.

@AnalogJ
Copy link
Owner

AnalogJ commented Apr 6, 2023

Closing this issue. Instructions for setting the Influxdb admin username/password during first setup are available in the docs

@AnalogJ AnalogJ closed this as completed Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants