Skip to content

CosmicDNA/gitload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gitload

Gitload is a versatile script designed to streamline the process of loading SSH and GPG keys, making it easier for users to manage their encrypted data and automate key-related tasks. This repository contains the source code and packaging information for the Gitload Debian package.

Features

Load SSH and GPG Keys: Automatically load SSH and GPG keys from encrypted files.

Encrypt and Decrypt Data: Easily encrypt and decrypt data files using OpenSSL.

Integration with Funtoo Keychain: Seamlessly integrate with Funtoo Keychain to manage SSH and GPG agents.

Installation

To install the Gitload package, follow these steps:

  1. Clone the Repository:
git clone https://github.com/CosmicDNA/gitload.git
  1. Build the Debian Package:
dpkg-deb --build gitload
  1. Install the Package:
sudo dpkg -i gitload.deb
  1. Source the Script to Your Shell Configuration File:
. /usr/local/gitload/gitload.sh
gitload -i zsh

Tip

Use bash instead of zsh for bash shell, for example: gitload -i bash.

Usage

  1. Set the PASSKEY Environment Variable: Ensure you have a PASSKEY environment variable set for the encryption and decryption processes.

  2. Create the Encrypted SSH Password File. For example:

gitload -e your_ssh_password ssh_password_file
  1. Create the Encrypted Keychain Arguments: Use the gitload -e command to create the encrypted keychain arguments. The keychain_args_file should be a string containing both the SSH file path and the GPG key. For example:
gitload -e "~/.ssh/id_john_doe 3F4A1B2C5D6E7F8G" keychain_args_file
  1. Use the Encrypted Files: Finally, use the encrypted files with the gitload command:
gitload ssh_password_file keychain_args_file
  1. Execute git commands with GPG signing and SSH support:
git commit -m ":tada:"

Now you can commit utilising your ssh but also signing with your loaded gpg key in a breeze.

Switches

After installation and sourcing the script, you can use the gitload command in your shell. The command can be used for:

  • Loading SSH and GPG Keys
  • Encrypting Data to Gitload store
  • Decrypting Data from Gitload store
  • Removing an encrypted file from gitload store
  • Installing source hook to rc file
  • Displaying Help

Caution

For the former 3 cases make sure the PASSKEY environment variable is properly set before running gitload command. This variable is crucial because it is used to encrypt / decrypt information back and forth from gitload store.

Load SSH and GPG Keys

To load SSH and GPG keys from encrypted files, use the following command:

gitload ssh_password_file keychain_args_file

Encrypt Data

To encrypt data to a specified filename, use the -e option:

gitload -e "data to encrypt" filename

Decrypt Data

To decrypt a specified filename, use the -d option:

gitload -d filename

Remove an Encrypted File from Gitload Store

gitload -r filename

Installing Source Hook to Shell's rc File

gitload -i zsh

Tip

Use bash instead of zsh for bash shell, for example: gitload -i bash.

Display Help

To display usage information, use the -h option:

gitload -h

How It Works

Loading Keys

The gitload script automates the process of loading SSH and GPG keys by decrypting the provided encrypted files and using Funtoo Keychain to manage the SSH and GPG agents. This ensures that your keys are securely loaded and available for use.

Encrypting and Decrypting Data

The script provides functionality to encrypt and decrypt data files using OpenSSL. This allows users to securely store and manage sensitive information. The encrypted files are stored at "/var/lib/gitload/keys/$USER".

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages