Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jul 3, 2018
2 parents 584c2b8 + bc7de7b commit 01a2033
Show file tree
Hide file tree
Showing 30 changed files with 814 additions and 132 deletions.
8 changes: 4 additions & 4 deletions cmd/config-del.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ var delCmd = &cobra.Command{
Short: "Delete a configuration item",
Long: `Deletes a configuration item. It will be removed both from the pydio.json file and from the database.
SYNTAX
======
### Syntax
Configurations are represented by two parameters that you must pass as arguments :
- serviceName: name of the corresponding service
- configName: name of the parameter you want to delete
EXAMPLES
========
### Examples
Delete the port entry for the micro.web service (rest api)
$ ` + os.Args[0] + ` config delete micro.web port
Expand Down
8 changes: 4 additions & 4 deletions cmd/config-set.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ var updateCmd = &cobra.Command{
Short: "Store a configuration",
Long: `Stores a configuration. Will be stored in both your pydio.json file and in the database.
SYNTAX
======
### Syntax
Configurations are represented by three parameters that you must pass as arguments :
- serviceName: name of the corresponding service
- configName: name of the parameter
- configValue: json-encoded value of the parameter you want to set/change
EXAMPLES
========
### Examples
Change the port of micro.web service (rest api)
$ ` + os.Args[0] + ` config set micro.web port 8083
Expand Down
12 changes: 10 additions & 2 deletions cmd/config-ssl-mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@ import (
// enableCmd represents the enable command
var SslModeCmd = &cobra.Command{
Use: "mode",
Short: "Enable HTTPS on proxy",
Long: `Setup SSL on application main access point`,
Short: "Manage HTTPS support on proxy",
Long: `
This command lets you enable/disabled SSL on application main access point.
Three modes are currently supported :
- TLS mode : provide the paths to certificate and key (as you would on an apache server)
- Self-Signed : a self-signed certificate will be generated at each application start
- Disabled : application will be served on HTTP
`,
Run: func(cmd *cobra.Command, args []string) {

enabled, e := promptSslMode()
Expand Down
2 changes: 1 addition & 1 deletion cmd/config-ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// SslCmd represents the ssl command
var SslCmd = &cobra.Command{
Use: "ssl",
Short: "Enable/Disable SSL support",
Short: "Manage SSL configuration",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
Expand Down
8 changes: 7 additions & 1 deletion cmd/config-versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ var (
var versionsListCmd = &cobra.Command{
Use: "versions",
Short: "List all configurations versions",
Long: `Display the various versions of configuration`,
Long: `
This command allows to manage configurations changes history and eventually
revert to a given version.
A version is created at each call to config.Save() inside the application, along with a log message
and the user originating this call.
`,
Run: func(cmd *cobra.Command, args []string) {

var store file.VersionsStore
Expand Down
35 changes: 11 additions & 24 deletions cmd/ctl/cmd/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
package cmd

import (
"log"

"github.com/pydio/cells/common/utils"
"github.com/spf13/cobra"
// "github.com/spf13/cobra/doc"
)

var docPath string
Expand All @@ -39,29 +41,14 @@ Note: this command is currently broken due to a dependency issue introduced by
github.com/spf13/cobra/doc and the vendor/github.com/cpuguy83/go-md2man/md2man/roff.go
`,
Run: func(cmd *cobra.Command, args []string) {
cmd.Print("This command is currently unavailable.")

// if docPath == "" {
// log.Fatal("Cannot get path flag")
// } else {

// // log.Fatal("Broken command, should be fixed in a next future")

// // Sphinx cross-referencing format
// linkHandler := func(name, ref string) string {
// return fmt.Sprintf(":ref:`%s <%s>`", name, ref)
// }

// filePrepender := func(filename string) string {
// return ""
// }

// err := doc.GenReSTTreeCustom(RootCmd, docPath, filePrepender, linkHandler)
// if err != nil {
// log.Fatal(err)
// }
// }

if docPath == "" {
log.Fatal("Cannot get path flag")
} else {
err := utils.GenMarkdownTree(RootCmd, docPath)
if err != nil {
log.Fatal(err)
}
}
},
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/ctl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var (

// RootCmd represents the base command when called without any subcommands.
var RootCmd = &cobra.Command{
Use: "pydioctl",
Use: "cells-ctl",
Short: "Pydio Cells Client application",
Long: `
Pydio Cells client allows you to interact with the micro services directly.
Expand Down
26 changes: 7 additions & 19 deletions cmd/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,33 @@
package cmd

import (
// "fmt"
"log"

"github.com/spf13/cobra"
// "github.com/spf13/cobra/doc"

"github.com/pydio/cells/common/utils"
)

var docPath string

// versionCmd represents the versioning command
var docCmd = &cobra.Command{
Use: "doc",
Short: "Generate ReST documentation for this command",
Long: `Generate ReStructuredText documentation for this command.
Short: "Generate MD documentation for this command",
Long: `Generate Markdown documentation for this command.
Provide a target folder where to put the generated files.
This command also generates yaml files for pydio.com documentation format.
`,
Run: func(cmd *cobra.Command, args []string) {

log.Fatal("Currently broken because of govendor issues - TODO")

if docPath == "" {
log.Fatal("Cannot get path flag")
log.Fatal("Please provide a path to store output files")
} else {

// Sphinx cross-referencing format
/**
linkHandler := func(name, ref string) string {
return fmt.Sprintf(":ref:`%s <%s>`", name, ref)
}
filePrepender := func(filename string) string {
return ""
}
err := doc.GenReSTTreeCustom(RootCmd, docPath, filePrepender, linkHandler)
err := utils.GenMarkdownTree(RootCmd, docPath)
if err != nil {
log.Fatal(err)
}
*/
}

},
Expand Down
16 changes: 8 additions & 8 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ var RootCmd = &cobra.Command{
Long: `Thank you for using Pydio Cells.
Comprehensive sync & share solution for your collaborators. Open-source software deployed on-premise or in a private cloud.
INSTALL
=======
### Installation
For the very first run, use '` + os.Args[0] + ` install' to load browser-based or command-line based installation wizard. Services
will start at the end of the installation.
RUN
===
### Run
Run '` + os.Args[0] + ` start' to load all services.
LOGS LEVEL
==========
### Logs level
By default, logs are outputted in console format at the Info level. You can set the --log flag or set the PYDIO_LOGS_LEVEL environment
variable to one of the following values:
- debug, info, error : logs are written in console format with the according level
- production : logs are written in json format, for usage with a log aggregator tool.
SERVICES DISCOVERY
==================
### Services Discovery
Micro services need a registry mechanism to discover each other. By default, Pydio Cells ships with Nats.io and Consul.io implementations.
You don't need to install any dependency. By default, Cells uses the NATS implementation. You can switch to consul by using
the flag --registry=consul.
Expand Down
20 changes: 11 additions & 9 deletions cmd/services-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,20 @@ Use this command to list all running services on this machine.
Services fall into main categories (GENERIC, GRPC, REST, API) and are then
organized by tags (broker, data, idm, etc.)
EXAMPLE
=======
### Example
Use the --tags/-t flag to limit display to one specific tag, use lowercase for tags.
$ pydio list -t=broker
pydio.grpc.activity [X]
pydio.grpc.chat [X]
pydio.grpc.mailer [X]
pydio.api.websocket [X]
pydio.rest.activity [X]
pydio.rest.frontlogs [X]
pydio.rest.mailer [X]
- pydio.grpc.activity [X]
- pydio.grpc.chat [X]
- pydio.grpc.mailer [X]
- pydio.api.websocket [X]
- pydio.rest.activity [X]
- pydio.rest.frontlogs [X]
- pydio.rest.mailer [X]
`,
PreRun: func(cmd *cobra.Command, args []string) {
// If we have an error (registry not running) the running list simply is empty
Expand Down
8 changes: 4 additions & 4 deletions cmd/services-start.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ var StartCmd = &cobra.Command{
Short: "Start Cells services",
Long: `Start one or more services on this machine
SYNTAX
======
### Syntax
$ ` + os.Args[0] + ` start [flags] args...
Additional arguments are regexp that can match any of the service names available (see 'list' command).
The -t/--tags flag may limit to only a certain category of services, use lowercase like broker, idm, data, etc...
The -x/--exclude flag may exclude one or more services
Both flags may be used in conjunction with the regexp arguments.
EXAMPLES
========
### Examples
Start only services starting with grpc
$ ` + os.Args[0] + ` start pydio.grpc
Expand Down
Loading

0 comments on commit 01a2033

Please sign in to comment.