Coder Social home page Coder Social logo

docker-credential-no-nonsense's Introduction

A no-nonsense Docker credential helper

Are you tired of docker-credential-pass or other Docker credential sources doing weird stuff? I was. Then I made this.

docker-credential-no-nonsense is a credential helper that implements the official interface for credential helpers. It has no system-specific or external dependencies (unlike pass requiring a GPG key, etc). Instead, it encrypts your password using AES-256 and stores it in a user-scoped file ready for later use.

Isn't that neat? Easy and quick, no nonsense.

Installation

To install the credential helper, check the release downloads for your platform. Download that, and put it somewhere on your PATH.

Build from source

If you have Go and Make on your system, you can build the binary by cloning the repository and running:

make

The Makefile can also receive DISTS and GOARGS variables in order to build for a different system (or systems). For example, this will be very verbose and build the code for Linux AMD64 and MacOS ARM64:

make DISTS='linux/amd64 darwin/arm64' GOARGS='-x -v'

If you don't have Go, but do have Docker, you can try this instead. Remember to replace the DISTS value with the target platform, since Docker is always Linux no matter what your host is.

docker build -q --target make . | xargs docker run -v "$(pwd):/app" -e DISTS=darwin/arm64

If you don't have Docker, I'm not sure why this project is of interest.

Usage

This package is executed by the official Docker credential helper entrypoint. Thus, its usage is:

Usage: docker-credential-no-nonsense <store|get|erase|list|version>

To make Docker use it, edit your Docker config (~/.docker/config.json) and set "credsStore": "no-nonsense".

The credential helper can be configured via environment variables:

NO_NONSENSE_ENC_KEY (required!). This is the encryption key proper, for encrypting/decrypting the secrets in the JSON storage. It is required and must be supplied via the environment variable. This is because it is the only way that Docker can pass the value through to the point where it internally uses the helper. **You must set this variable before using any docker commands.

You can set it for your current (Unix-ish) shell and subprocesses by using:

export NO_NONSENSE_ENC_KEY=$(read -srp"Key: " && echo $REPLY)

Or for one time usage:

NO_NONSENSE_ENC_KEY=$(read -srp"Key: " && echo $REPLY) docker ...

NO_NONSENSE_CREDFILE. This is the JSON file that the helper uses to store data. If unset, it will use the default, as defined by XDG for your system. You can check what path it is using by providing the --where flag.

$ docker-credential-no-nonsense --where
/home/developer/.local/share/dkr-no-nonsense-credfile.json

docker-credential-no-nonsense's People

Contributors

fsufitch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.