mirror of
https://github.com/tnb-labs/panel.git
synced 2026-08-29 02:10:58 +08:00
ea22c2f0a7
Replace the samber/do runtime container with explicit constructor dependencies and generated Wire graphs for ace and cli. Keep CLI application loading isolated and verify generated files in CI.
43 lines
993 B
Go
43 lines
993 B
Go
package command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/leonelquinteros/gotext"
|
|
"github.com/urfave/cli/v3"
|
|
|
|
"github.com/acepanel/panel/v3/internal/service"
|
|
)
|
|
|
|
// HttpsCommand 面板 HTTPS 管理命令组
|
|
func HttpsCommand(t *gotext.Locale, cliService *service.CliService) *cli.Command {
|
|
|
|
return &cli.Command{
|
|
Name: "https",
|
|
Usage: t.Get("Operate AcePanel HTTPS"),
|
|
Commands: []*cli.Command{
|
|
{
|
|
Name: "on",
|
|
Usage: t.Get("Enable HTTPS"),
|
|
Action: func(ctx context.Context, cmd *cli.Command) error {
|
|
return cliService.HTTPSOn(ctx, cmd)
|
|
},
|
|
},
|
|
{
|
|
Name: "off",
|
|
Usage: t.Get("Disable HTTPS"),
|
|
Action: func(ctx context.Context, cmd *cli.Command) error {
|
|
return cliService.HTTPSOff(ctx, cmd)
|
|
},
|
|
},
|
|
{
|
|
Name: "generate",
|
|
Usage: t.Get("Obtain a free certificate or generate a self-signed certificate"),
|
|
Action: func(ctx context.Context, cmd *cli.Command) error {
|
|
return cliService.HTTPSGenerate(ctx, cmd)
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|