solokeys / solo1-cli

Solo 1 library and CLI in Python
https://pypi.org/project/solo-python
Apache License 2.0
185 stars 69 forks source link

Running as root in Docker #22

Closed conorpp closed 5 years ago

conorpp commented 5 years ago

When making a bundled firmware in Docker, it runs into this issue.

+ /opt/conda/bin/solo mergehex bootloader-nonverifying-2.3.0.hex firmware-hacker-2.3.0.hex bundle-hacker-2.3.0.hex
THIS COMMAND SHOULD NOT BE RUN AS ROOT!

Please install udev rules and run `solo` as regular user (without sudo).
We suggest using: https://github.com/solokeys/solo/blob/master/udev/70-solokeys-access.rules

For more information, see: https://docs.solokeys.io/solo/udev/

Maybe turn the root message into a warning?

nickray commented 5 years ago

That, or there's an existing mechanism to override the warning: sudo ALLOW_ROOT= /path/to/solo. What do you think about adding this info to the (aborting) warning, and also to the Docker build script?

I'd also be fine with just outputting a warning and continuing.

conorpp commented 5 years ago

I think the warning is easiest. I think the only reason we put the sudo restriction in there was to catch udev issues, and I think a warning would still catch it fine.

nickray commented 5 years ago

Fixed in https://github.com/solokeys/solo-python/releases/tag/0.0.11