Coder Social home page Coder Social logo

podman-authinfo-secrets's Introduction

Podman Authinfo-Secrets

Using the shell secret driver, we can store authentication credentials as Podman secrets in .authinfo.gpg.

Motivation & Benefits

  • A single place to store authentication credentials.
  • Easy to update tokens when necessary.
  • No need for an external tools such as pass.

Installation

First, download the shell script into $HOME/.config/containers, and containers.conf to $HOME/.config/containers/authinfo-secrets.conf.

wget https://raw.githubusercontent.com/arifer612/podman-authinfo-secrets/master/gpg_store.sh -O $HOME/.config/containers/gpg_store.sh
wget https://raw.githubusercontent.com/arifer612/podman-authinfo-secrets/master/containers.conf -O $HOME/.config/containers/authinfo-secrets.conf

Next, configure .authinfo.gpg with your primary GPG encryption recipient. This may be done by adding the GPG key ID of the primary recipient within quotations to the head of the file as

# Recipient key: "0xABCDEFG"
machine ....

or by adding the email of the primary recipient within quotations to the head of the file as

# Recipient email: "[email protected]"
machine ....

or by adding the name of the primary recipient within quotations to the head of the file as

# Recipient name: "John Doe"
machine ....

Otherwise, if you are using Emacs and epa to manage GPG-encrypted files, you should make use of local file variables. For example, adding the GPG key ID of the primary recipient to the head of the file would look like

# -*- epa-file-encrypt-to: ("0xABCDEFG") -*-
machine ....

whereas adding the email of the primary recipient to the head of the file would look like

# -*- epa-file-encrypt-to: ("[email protected]") -*-
machine ....

and adding the name of the primary recipient to the head of the file would look like

# -*- epa-file-encrypt-to: ("John Doe") -*-
machine ....

Usage

Secret-Create

Run podman secret create with the driver flag. The following examples will result in .authinfo.gpg that looks like

machine podman login PODMAN_SECRET_ID password P@s5W0rD

From stdin

CONTAINERS_CONF=$HOME/.config/containers/authinfo-secrets.conf podman secret create [email protected] <(printf P@s5W0rD)

From a file

CONTAINERS_CONF=$HOME/.config/containers/authinfo-secrets.conf podman secret create [email protected] my-docker-io-password.txt

where the contents of my-docker-io-password.txt is

$ cat my-docker-io-password.txt
P@s5W0rD

Secret-Remove

Simply run podman secret rm as normal.
podman secret rm [email protected]

Podman-Login

podman login --username john --secret [email protected] docker.io
podman login --username johnny --secret johnny@fedora registry.fedoraproject.org

podman-authinfo-secrets's People

Contributors

arifer612 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.