Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
/ gitkv Public archive

gitkv is a server for using git as a key value store for text files

License

Notifications You must be signed in to change notification settings

intenthq/gitkv

Repository files navigation

Gitkv Build Statuscodecov

Gitkv is a server for using git as a key value store for text files

Installation

Binary

Releases of Gitkv are available as pre-compiled static binaries on the corresponding GitHub release. Simply download the appropriate build for your machine and make sure it's in your PATH (or use it directly).

Docker

Gitkv is also distributed as a Docker image that can be pulled from Docker Hub:

docker run intenthq/gitkv

Source

To run Gitkv from source first install Rust.

This is a standard Cargo project — here is a link to the Rust documentation on how to use Cargo, but some common tasks you may wish to use are as follows:

  • cargo build — build the Gitkv binary, but in debug mode (unoptimised).
  • cargo build --release — same as the above, but in release mode (optimised).
  • cargo run — build and run the binary in one step.
  • cargo test — run the tests.

Usage

gitkv is a server for using git as a key value store for text files

USAGE:
    gitkv [OPTIONS]

FLAGS:
        --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -h, --host <HOST>         host to listen to [default: localhost]
    -p, --port <PORT>         port to listen to [default: 7791]
    -r, --repo-root <PATH>    path where the different repositories are located [default: ./]

You can modify the amount of logging with the RUST_LOG parameter:

For basic application info (default): RUST_LOG=gitkv=info ./gitkv
Including incoming HTTP requests: RUST_LOG=info ./gitkv
For more information check env_logger's documentation.

Security

Note that git stores all the content plain so that it's not a good place to store secrets and sensitive information.

There are solutions that offer encrypted git, but we do recommend to store the secrets using a different solution like Vault.

When is it useful?

This server can be used when you need a data store that can easily support:

  • Small to medium text based data
  • Versioning of this data
  • Data follows some kind of hierarchy
  • Access using HTTP + Ability to use the configuration without a central server (just the git repo itself)
  • And you can't use GitHub/GitLab api directly

Why git?

Git is an excellent version control system with lots of tooling around to compare files, have approval mechanisms for the data you store (i.e. pull requests) or to have different flows for editing your files.

Although it's not designed with performance in mind, for some use cases like pulling configuration files with a specific version.

Some people has previously mentioned the idea to use git as a database with some pretty interesting thoughts.

Alternatives/Similar projects

How to contribute

Any contribution will be welcome, please refer to our contributing guidelines for more information.

License

This project is licensed under the MIT license.