Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not auto-generate keys #23

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/Foliage/CmdBuild.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ buildAction
SignOptsSignWithKeys keysPath -> do
ks <- doesDirectoryExist keysPath
unless ks $ do
putWarn $ "You don't seem to have created a set of TUF keys. I will create one in " <> keysPath
liftIO $ createKeys keysPath
putError $ unwords
[ "I cannot find a set of TUF keys in " <> keysPath <> ","
, "Use the create-keys command to create them."
]
fail "Keys not found"
return $ \name -> readKeysAt (keysPath </> name)
SignOptsDon'tSign ->
return $ const $ return []
Expand Down
19 changes: 8 additions & 11 deletions app/Foliage/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,14 @@ buildCommand =
)
where
signOpts =
( SignOptsSignWithKeys
<$> strOption
( long "keys"
<> metavar "KEYS"
<> help "TUF keys location"
<> showDefault
<> value "_keys"
)
)
<|> ( SignOptsDon'tSign
<$ switch (long "no-signatures" <> help "Don't sign the repository")
pure SignOptsDon'tSign
<|> ( SignOptsSignWithKeys
<$> strOption
( long "sign-with-keys"
<> metavar "KEYS"
<> help "TUF keys location"
<> value "_keys"
)
)

createKeysCommand :: Parser Command
Expand Down