MCPcopy Create free account
hub / github.com/pydio/cells / cliInstall

Function cliInstall

cmd/install-cli.go:49–145  ·  view source on GitHub ↗
(cmd *cobra.Command, proxyConfig *install.ProxyConfig)

Source from the content-addressed store, hash-verified

47)
48
49func cliInstall(cmd *cobra.Command, proxyConfig *install.ProxyConfig) (*install.InstallConfig, error) {
50
51 cliConfig := lib.GenerateDefaultConfig()
52 cliConfig.ProxyConfig = proxyConfig
53
54 if e := applyAdditionalPrompt(cmd.Context(), "boot", cliConfig); e != nil {
55 return nil, e
56 }
57
58 fmt.Println("\n\033[1m## Database Connection\033[0m")
59 adminRequired, e := promptDB(cmd.Context(), cliConfig)
60 if e != nil {
61 return nil, e
62 }
63
64 if e := applyAdditionalPrompt(cmd.Context(), "post-db", cliConfig); e != nil {
65 return nil, e
66 }
67
68 applyDocumentsDSN := ""
69 if e := promptAdditionalMongoDSN(cmd.Context(), cliConfig, false); e != nil {
70 return nil, e
71 } else if cliConfig.DocumentsDSN != "" {
72 // Copy DSN and apply it later on, or it will trigger configs warning
73 applyDocumentsDSN = cliConfig.DocumentsDSN
74 cliConfig.DocumentsDSN = ""
75 }
76
77 e = lib.Install(cmd.Context(), cliConfig, lib.InstallDb, func(event *lib.InstallProgressEvent) {
78 fmt.Println(p.Styler(p.FGFaint)("... " + event.Message))
79 })
80 if e != nil {
81 return nil, fmt.Errorf("could not perform installation: %s", e.Error())
82 }
83
84 fmt.Println("\n\033[1m## Administrative User Configuration\033[0m")
85 if e := promptFrontendAdmin(cliConfig, adminRequired); e != nil {
86 return nil, e
87 }
88
89 if e := applyAdditionalPrompt(cmd.Context(), "post-admin", cliConfig); e != nil {
90 return nil, e
91 }
92
93 fmt.Println("\n\033[1m## Default storage location\033[0m")
94 if e := promptAdvanced(cmd.Context(), cliConfig); e != nil {
95 return nil, e
96 }
97
98 if e := applyAdditionalPrompt(cmd.Context(), "post-advanced", cliConfig); e != nil {
99 return nil, e
100 }
101
102 fmt.Println("\n\033[1m## Applying configuration\033[0m")
103 e = lib.Install(cmd.Context(), cliConfig, lib.InstallAll, func(event *lib.InstallProgressEvent) {
104 fmt.Println(p.Styler(p.FGFaint)("... " + event.Message))
105 })
106 if e != nil {

Callers 1

configure.goFile · 0.85

Calls 15

GenerateDefaultConfigFunction · 0.92
InstallFunction · 0.92
LoadSitesFunction · 0.92
applyAdditionalPromptFunction · 0.85
promptDBFunction · 0.85
promptAdditionalMongoDSNFunction · 0.85
promptFrontendAdminFunction · 0.85
promptAdvancedFunction · 0.85
checkDefaultBusyFunction · 0.85
PrintlnMethod · 0.80
GetExternalUrlsMethod · 0.80
ContextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…