A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
851 B

  1. /*
  2. * Copyright © 2020-2021 Musing Studio LLC.
  3. *
  4. * This file is part of WriteFreely.
  5. *
  6. * WriteFreely is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License, included
  8. * in the LICENSE file in this source code package.
  9. */
  10. package main
  11. import (
  12. "github.com/urfave/cli/v2"
  13. "github.com/writefreely/writefreely"
  14. )
  15. var (
  16. cmdKeys cli.Command = cli.Command{
  17. Name: "keys",
  18. Usage: "key management tools",
  19. Subcommands: []*cli.Command{
  20. &cmdGenerateKeys,
  21. },
  22. }
  23. cmdGenerateKeys cli.Command = cli.Command{
  24. Name: "generate",
  25. Aliases: []string{"gen"},
  26. Usage: "Generate encryption and authentication keys",
  27. Action: genKeysAction,
  28. }
  29. )
  30. func genKeysAction(c *cli.Context) error {
  31. app := writefreely.NewApp(c.String("c"))
  32. return writefreely.GenerateKeyFiles(app)
  33. }