Created
August 27, 2015 15:27
-
-
Save erantapaa/eeed10fd7dc1f4218e70 to your computer and use it in GitHub Desktop.
Setting up keys for a new hsackage-server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Script to populate a TUF directory with a new set of private keys. | |
# | |
# Note: Need to install the hackage-repo-tool package from Hackage. | |
REPO_TOOL=hackage-repo-tool | |
KEYS_DIR=/tmp/keys | |
DATA_DIR=./datafiles | |
mkdir $KEYS_DIR | |
$REPO_TOOL create-keys --keys $KEYS_DIR | |
tsfile=$(/bin/ls -1 $KEYS_DIR/timestamp | head -1) | |
cp "$KEYS_DIR/timestamp/$tsfile" $DATA_DIR/TUF/timestamp.private | |
snapfile=$(/bin/ls -1 $KEYS_DIR/snapshot | head -1) | |
cp "$KEYS_DIR/snapshot/$tsfile" "$DATA_DIR/TUF/snapshot.private" | |
$REPO_TOOL create-root --keys $KEYS_DIR -o $DATA_DIR/TUF/root.json | |
$REPO_TOOL create-mirrors --keys $KEYS_DIR -o $DATA_DIR/TUF/mirrors.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment