Go to file
Vincent Breitmoser 6d0305dede
news: update contact info on about page
2019-06-12 16:04:41 +02:00
contrib Use template systemd service file 2019-02-03 12:43:13 +00:00
database split human-readable interface and hkp 2019-06-11 17:55:39 +02:00
dist news: update contact info on about page 2019-06-12 16:04:41 +02:00
hagridctl Port to Sequoia 0.8pre. 2019-06-11 13:02:57 +02:00
src news: add launch announcement 2019-06-12 16:04:35 +02:00
.gitignore hagridctl: working import command 2019-06-05 18:25:32 +00:00
.gitlab-ci.yml ci: Print backtraces. 2019-03-12 14:28:22 +01:00
CONTRIBUTE.md Add information for potential contributors 2019-05-03 11:12:43 +02:00
COPYING Add license notice and license text 2019-05-03 11:10:34 +02:00
Cargo.lock cargo update 2019-06-11 13:55:42 +02:00
Cargo.toml Port to Sequoia 0.8pre. 2019-06-11 13:02:57 +02:00
README.md remove "usage" from readme (it's outdated anyways) 2019-06-06 16:43:52 +00:00
Rocket.toml.dist rewrite verification mail 2019-06-06 17:45:14 +02:00
build.rs fix warning in build.rs 2019-02-22 16:34:45 +01:00
hagrid-routes.conf nginx: use lua for case transformation 2019-06-11 18:16:34 +02:00
nginx-site.conf split up nginx files 2019-02-27 11:39:38 +01:00
nginx.conf split up nginx files 2019-02-27 11:39:38 +01:00
rustfmt.toml use rustfmt to format source 2019-02-08 12:46:31 +01:00

README.md

Hagrid

Hagrid is a verifying OpenPGP key server. When a new key is uploaded a token is sent to each user ID via email. This token can be used to verify the user ID. Keys can be queried by their verified user IDs (exact match) and their primary keys fingerprint. Keys can be deleted by clicking a link send to all user IDs.

License

Hagrid is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Hagrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Hagrid. If not, see https://www.gnu.org/licenses/.

Quick Start

Building Hagrid required a working Rust nightly toolchain. The key server uses the filesystem to store keys, user IDs and tokens. To run it, supply the absolute path to where you want the database to live and the absolute path to the template directory.

cp Rocket.toml.dist Rocket.toml
cargo run --bin hagrid

This will spawn a web server listening on port 8080.

Hagrid uses sendmail for mailing, so you also need a working local mailer setup.

Usage

You can find instructions and API documentation at the running instance at https://keys.openpgp.org.

Building

Building Hagrid requires a working nightly Rust toolchain. The easiest way to get the toolchain is to download rustup. After rustup is installed, get the nightly compiler and tools:

cd hagrid
rustup override set nightly

The web server can now be built with the cargo command:

cargo build --release

After compilation a binary is placed in target/release/ called hagrid. The binary is linked statically and can be copied everywhere.

cp target/release/hagrid /usr/local/bin

To deploy the key server copy all directories under dist/ to a writable location, and create a suitable configuration file.

mkdir /var/lib/hagrid
cp -R dist/* /var/lib/hagrid
cp Rocket.toml.dist /var/lib/hagrid/Rocket.toml
$EDITOR /var/lib/hagrid/Rocket.toml
/usr/bin/env --chdir=/var/lib/hagrid ROCKET_ENV=production hagrid

This will spawn the server in foreground. The server will put all keys and runtime data under the base folder (/var/lib/hagrid in the above example).

Reverse Proxy

Hagrid is designed to defer lookups to reverse proxy server like Nginx and Apache. The key database is a set of 3 directories with static files in them. The directory structure reflects Hagrids URL scheme. This way, lookups via /vks/v1/by-finingerprint, /vks/v1/by-keyid, and /vks/v1/by-email can be handled by (multiple) simple HTTP server(s). A sample configuration for Nginx is part of the repository (nginx.conf).

Community

We're in ##hagrid on Freenode.