Major Refactoring, Client can now be used as a library
Some checks failed
Build (artifact) / build (push) Failing after 1m3s

This commit is contained in:
2026-03-16 21:48:32 +01:00
parent e6a2ba2f8b
commit e0f68788c0
45 changed files with 1359 additions and 1245 deletions

41
cmd/bundle/main.go Normal file
View File

@@ -0,0 +1,41 @@
package main
import (
"fmt"
"os"
"git.nevets.tech/Keys/certman/app/executor"
"git.nevets.tech/Keys/certman/app/shared"
"github.com/spf13/cobra"
)
//TODO create logic for gh vs gt repos
func main() {
rootCmd := &cobra.Command{
Use: "certman",
Short: "CertMan",
Long: "Certificate Manager",
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
}
rootCmd.AddCommand(shared.VersionCmd)
rootCmd.AddCommand(shared.NewKeyCmd)
rootCmd.AddCommand(shared.DevCmd)
rootCmd.AddCommand(shared.NewDomainCmd)
rootCmd.AddCommand(shared.InstallCmd)
rootCmd.AddCommand(shared.CertCmd)
rootCmd.AddCommand(executor.ExecutorCmd)
rootCmd.AddCommand(shared.DaemonCmd)
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}

18
cmd/client/commands.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import (
"git.nevets.tech/Keys/certman/app/client"
"git.nevets.tech/Keys/certman/app/shared"
"github.com/spf13/cobra"
)
func init() {
shared.DaemonCmd.AddCommand(&cobra.Command{
Use: "start",
Short: "Start the daemon",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return shared.RunDaemonCmd(&client.Daemon{})
},
})
}

36
cmd/client/main.go Normal file
View File

@@ -0,0 +1,36 @@
package main
import (
"fmt"
"os"
"git.nevets.tech/Keys/certman/app/shared"
"github.com/spf13/cobra"
)
func main() {
rootCmd := &cobra.Command{
Use: "certman",
Short: "CertMan",
Long: "Certificate Manager",
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
}
rootCmd.AddCommand(shared.VersionCmd)
rootCmd.AddCommand(shared.NewKeyCmd)
rootCmd.AddCommand(shared.DevCmd)
rootCmd.AddCommand(shared.NewDomainCmd)
rootCmd.AddCommand(shared.InstallCmd)
rootCmd.AddCommand(shared.CertCmd)
rootCmd.AddCommand(shared.DaemonCmd)
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}

7
cmd/executor/main.go Normal file
View File

@@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("Hello Executor")
}

18
cmd/server/commands.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import (
"git.nevets.tech/Keys/certman/app/server"
"git.nevets.tech/Keys/certman/app/shared"
"github.com/spf13/cobra"
)
func init() {
shared.DaemonCmd.AddCommand(&cobra.Command{
Use: "start",
Short: "Start the daemon",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return shared.RunDaemonCmd(&server.Daemon{})
},
})
}

7
cmd/server/main.go Normal file
View File

@@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("Hello server")
}