feature: Adds backup importing support.

This commit is contained in:
Tera << 8 2024-12-25 19:21:22 -05:00
parent ed90f66b2b
commit 217e73d9ec
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
5 changed files with 391 additions and 16 deletions

View file

@ -22,7 +22,7 @@ import (
"gorm.io/gorm"
)
func entrypoint(cCtx *cli.Context) error {
func apiEntrypoint(cCtx *cli.Context) error {
developmentMode := false
if os.Getenv("HERMES_DEVELOPMENT_MODE") != "" {
@ -275,6 +275,22 @@ func main() {
app := &cli.App{
Name: "hermes",
Usage: "port forwarding across boundaries",
Commands: []*cli.Command{
{
Name: "import",
Usage: "imports from legacy NextNet/Hermes source",
Aliases: []string{"i"},
Flags: []cli.Flag{
&cli.StringFlag{
Name: "backup-path",
Aliases: []string{"bp"},
Usage: "path to the backup file",
Required: true,
},
},
Action: backupRestoreEntrypoint,
},
},
Flags: []cli.Flag{
&cli.StringFlag{
Name: "backends-path",
@ -283,7 +299,7 @@ func main() {
Required: true,
},
},
Action: entrypoint,
Action: apiEntrypoint,
}
if err := app.Run(os.Args); err != nil {