Files
Olares/cli/cmd/ctl/os/install.go
dkeven 2df9fd0f9b refactor: choose reverse proxy config during activation if enabled (#1935)
* refactor(cli): get rid of legacy proxy envs in favor of new option

* refactor: update app-service & bfl to ajust for new network settings
2025-10-16 21:44:22 +08:00

39 lines
881 B
Go

package os
import (
"log"
"github.com/beclab/Olares/cli/cmd/ctl/options"
"github.com/beclab/Olares/cli/pkg/pipelines"
"github.com/spf13/cobra"
)
type InstallOsOptions struct {
InstallOptions *options.CliTerminusInstallOptions
}
func NewInstallOsOptions() *InstallOsOptions {
return &InstallOsOptions{
InstallOptions: options.NewCliTerminusInstallOptions(),
}
}
func NewCmdInstallOs() *cobra.Command {
o := NewInstallOsOptions()
cmd := &cobra.Command{
Use: "install",
Short: "Install Olares",
Run: func(cmd *cobra.Command, args []string) {
if !cmd.Flags().Changed("enable-reverse-proxy") {
o.InstallOptions.EnableReverseProxy = nil
}
if err := pipelines.CliInstallTerminusPipeline(o.InstallOptions); err != nil {
log.Fatalf("error: %v", err)
}
},
}
o.InstallOptions.AddFlags(cmd)
cmd.AddCommand(NewCmdInstallStorage())
return cmd
}