Rebrand pkg
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Package backup contains ocis backup functionality.
|
// Package backup contains OpenCloud backup functionality.
|
||||||
package backup
|
package backup
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
ocisbs "github.com/cs3org/reva/v2/pkg/storage/fs/ocis/blobstore"
|
ocbs "github.com/cs3org/reva/v2/pkg/storage/fs/ocis/blobstore"
|
||||||
s3bs "github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/blobstore"
|
s3bs "github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/blobstore"
|
||||||
"github.com/opencloud-eu/opencloud/opencloud/pkg/backup"
|
"github.com/opencloud-eu/opencloud/opencloud/pkg/backup"
|
||||||
"github.com/opencloud-eu/opencloud/opencloud/pkg/register"
|
"github.com/opencloud-eu/opencloud/opencloud/pkg/register"
|
||||||
@@ -18,7 +18,7 @@ import (
|
|||||||
func BackupCommand(cfg *config.Config) *cli.Command {
|
func BackupCommand(cfg *config.Config) *cli.Command {
|
||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "backup",
|
Name: "backup",
|
||||||
Usage: "ocis backup functionality",
|
Usage: "OpenCloud backup functionality",
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
ConsistencyCommand(cfg),
|
ConsistencyCommand(cfg),
|
||||||
},
|
},
|
||||||
@@ -41,7 +41,7 @@ func ConsistencyCommand(cfg *config.Config) *cli.Command {
|
|||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "basepath",
|
Name: "basepath",
|
||||||
Aliases: []string{"p"},
|
Aliases: []string{"p"},
|
||||||
Usage: "the basepath of the decomposedfs (e.g. /var/tmp/ocis/storage/users)",
|
Usage: "the basepath of the decomposedfs (e.g. /var/tmp/opencloud/storage/users)",
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
@@ -77,7 +77,7 @@ func ConsistencyCommand(cfg *config.Config) *cli.Command {
|
|||||||
s3bs.Options{},
|
s3bs.Options{},
|
||||||
)
|
)
|
||||||
case "ocis":
|
case "ocis":
|
||||||
bs, err = ocisbs.New(basePath)
|
bs, err = ocbs.New(basePath)
|
||||||
case "none":
|
case "none":
|
||||||
bs = nil
|
bs = nil
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ func BenchmarkClientCommand(cfg *config.Config) *cli.Command {
|
|||||||
// other flags
|
// other flags
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "bearer-token-command",
|
Name: "bearer-token-command",
|
||||||
Usage: "Command to execute for a bearer token, e.g. 'oidc-token OCIS'. When set, disables basic auth.",
|
Usage: "Command to execute for a bearer token, e.g. 'oidc-token opencloud'. When set, disables basic auth.",
|
||||||
},
|
},
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "every",
|
Name: "every",
|
||||||
@@ -299,7 +299,7 @@ func BenchmarkSyscallsCommand(cfg *config.Config) *cli.Command {
|
|||||||
|
|
||||||
path := c.String("path")
|
path := c.String("path")
|
||||||
if path == "" {
|
if path == "" {
|
||||||
f, err := os.CreateTemp("", "ocis-bench-temp-")
|
f, err := os.CreateTemp("", "opencloud-bench-temp-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ func checkCmd(cfg *config.Config) *cli.Command {
|
|||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "repair",
|
Name: "repair",
|
||||||
Usage: "Try to repair nodes with incorrect treesize metadata. IMPORTANT: Only use this while ownCloud Infinite Scale is not running.",
|
Usage: "Try to repair nodes with incorrect treesize metadata. IMPORTANT: Only use this while OpenCloud is not running.",
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "force",
|
Name: "force",
|
||||||
@@ -80,7 +80,7 @@ func check(c *cli.Context) error {
|
|||||||
repairFlag := c.Bool("repair")
|
repairFlag := c.Bool("repair")
|
||||||
|
|
||||||
if repairFlag && !c.Bool("force") {
|
if repairFlag && !c.Bool("force") {
|
||||||
answer := strings.ToLower(stringPrompt("IMPORTANT: Only use '--repair' when ownCloud Infinite Scale is not running. Do you want to continue? [yes | no = default]"))
|
answer := strings.ToLower(stringPrompt("IMPORTANT: Only use '--repair' when OpenCloud is not running. Do you want to continue? [yes | no = default]"))
|
||||||
if answer != "yes" && answer != "y" {
|
if answer != "yes" && answer != "y" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ocisinit "github.com/opencloud-eu/opencloud/opencloud/pkg/init"
|
ocinit "github.com/opencloud-eu/opencloud/opencloud/pkg/init"
|
||||||
"github.com/opencloud-eu/opencloud/opencloud/pkg/register"
|
"github.com/opencloud-eu/opencloud/opencloud/pkg/register"
|
||||||
"github.com/opencloud-eu/opencloud/pkg/config"
|
"github.com/opencloud-eu/opencloud/pkg/config"
|
||||||
"github.com/opencloud-eu/opencloud/pkg/config/defaults"
|
"github.com/opencloud-eu/opencloud/pkg/config/defaults"
|
||||||
@@ -18,13 +18,13 @@ import (
|
|||||||
func InitCommand(cfg *config.Config) *cli.Command {
|
func InitCommand(cfg *config.Config) *cli.Command {
|
||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "init",
|
Name: "init",
|
||||||
Usage: "initialise an ocis config",
|
Usage: "initialise an OpenCloud config",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "insecure",
|
Name: "insecure",
|
||||||
EnvVars: []string{"OC_INSECURE"},
|
EnvVars: []string{"OC_INSECURE"},
|
||||||
Value: "ask",
|
Value: "ask",
|
||||||
Usage: "Allow insecure oCIS config",
|
Usage: "Allow insecure OpenCloud config",
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "diff",
|
Name: "diff",
|
||||||
@@ -42,7 +42,7 @@ func InitCommand(cfg *config.Config) *cli.Command {
|
|||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "config-path",
|
Name: "config-path",
|
||||||
Value: defaults.BaseConfigPath(),
|
Value: defaults.BaseConfigPath(),
|
||||||
Usage: "Config path for the ocis runtime",
|
Usage: "Config path for the OpenCloud runtime",
|
||||||
EnvVars: []string{"OC_CONFIG_DIR", "OC_BASE_DATA_PATH"},
|
EnvVars: []string{"OC_CONFIG_DIR", "OC_BASE_DATA_PATH"},
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
@@ -56,14 +56,14 @@ func InitCommand(cfg *config.Config) *cli.Command {
|
|||||||
insecureFlag := c.String("insecure")
|
insecureFlag := c.String("insecure")
|
||||||
insecure := false
|
insecure := false
|
||||||
if insecureFlag == "ask" {
|
if insecureFlag == "ask" {
|
||||||
answer := strings.ToLower(stringPrompt("Do you want to configure Infinite Scale with certificate checking disabled?\n This is not recommended for public instances! [yes | no = default]"))
|
answer := strings.ToLower(stringPrompt("Do you want to configure OpenCloud with certificate checking disabled?\n This is not recommended for public instances! [yes | no = default]"))
|
||||||
if answer == "yes" || answer == "y" {
|
if answer == "yes" || answer == "y" {
|
||||||
insecure = true
|
insecure = true
|
||||||
}
|
}
|
||||||
} else if insecureFlag == strings.ToLower("true") || insecureFlag == strings.ToLower("yes") || insecureFlag == strings.ToLower("y") {
|
} else if insecureFlag == strings.ToLower("true") || insecureFlag == strings.ToLower("yes") || insecureFlag == strings.ToLower("y") {
|
||||||
insecure = true
|
insecure = true
|
||||||
}
|
}
|
||||||
err := ocisinit.CreateConfig(insecure, c.Bool("force-overwrite"), c.Bool("diff"), c.String("config-path"), c.String("admin-password"))
|
err := ocinit.CreateConfig(insecure, c.Bool("force-overwrite"), c.Bool("diff"), c.String("config-path"), c.String("admin-password"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Could not create config: %s", err)
|
log.Fatalf("Could not create config: %s", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
func ListCommand(cfg *config.Config) *cli.Command {
|
func ListCommand(cfg *config.Config) *cli.Command {
|
||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "list",
|
Name: "list",
|
||||||
Usage: "list oCIS services running in the runtime (supervised mode)",
|
Usage: "list OpenCloud services running in the runtime (supervised mode)",
|
||||||
Category: "runtime",
|
Category: "runtime",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||||
ocisbs "github.com/cs3org/reva/v2/pkg/storage/fs/ocis/blobstore"
|
ocbs "github.com/cs3org/reva/v2/pkg/storage/fs/ocis/blobstore"
|
||||||
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup"
|
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup"
|
||||||
s3bs "github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/blobstore"
|
s3bs "github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/blobstore"
|
||||||
"github.com/cs3org/reva/v2/pkg/storagespace"
|
"github.com/cs3org/reva/v2/pkg/storagespace"
|
||||||
@@ -27,7 +27,7 @@ var (
|
|||||||
func RevisionsCommand(cfg *config.Config) *cli.Command {
|
func RevisionsCommand(cfg *config.Config) *cli.Command {
|
||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "revisions",
|
Name: "revisions",
|
||||||
Usage: "ocis revisions functionality",
|
Usage: "OpenCloud revisions functionality",
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
PurgeRevisionsCommand(cfg),
|
PurgeRevisionsCommand(cfg),
|
||||||
},
|
},
|
||||||
@@ -50,7 +50,7 @@ func PurgeRevisionsCommand(cfg *config.Config) *cli.Command {
|
|||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "basepath",
|
Name: "basepath",
|
||||||
Aliases: []string{"p"},
|
Aliases: []string{"p"},
|
||||||
Usage: "the basepath of the decomposedfs (e.g. /var/tmp/ocis/storage/metadata)",
|
Usage: "the basepath of the decomposedfs (e.g. /var/tmp/opencloud/storage/metadata)",
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
@@ -103,7 +103,7 @@ func PurgeRevisionsCommand(cfg *config.Config) *cli.Command {
|
|||||||
s3bs.Options{},
|
s3bs.Options{},
|
||||||
)
|
)
|
||||||
case "ocis":
|
case "ocis":
|
||||||
bs, err = ocisbs.New(basePath)
|
bs, err = ocbs.New(basePath)
|
||||||
case "none":
|
case "none":
|
||||||
bs = nil
|
bs = nil
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Execute is the entry point for the ocis command.
|
// Execute is the entry point for the opencloud command.
|
||||||
func Execute() error {
|
func Execute() error {
|
||||||
cfg := config.DefaultConfig()
|
cfg := config.DefaultConfig()
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
func TrashCommand(cfg *config.Config) *cli.Command {
|
func TrashCommand(cfg *config.Config) *cli.Command {
|
||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "trash",
|
Name: "trash",
|
||||||
Usage: "ocis trash functionality",
|
Usage: "OpenCloud trash functionality",
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
TrashPurgeEmptyDirsCommand(cfg),
|
TrashPurgeEmptyDirsCommand(cfg),
|
||||||
},
|
},
|
||||||
@@ -37,7 +37,7 @@ func TrashPurgeEmptyDirsCommand(cfg *config.Config) *cli.Command {
|
|||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "basepath",
|
Name: "basepath",
|
||||||
Aliases: []string{"p"},
|
Aliases: []string{"p"},
|
||||||
Usage: "the basepath of the decomposedfs (e.g. /var/tmp/ocis/storage/users)",
|
Usage: "the basepath of the decomposedfs (e.g. /var/tmp/opencloud/storage/users)",
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# ownCloud Infinite Scale: Runtime
|
# OpenCloud: Runtime
|
||||||
|
|
||||||
Pman is a slim utility library for supervising long-running processes. It can be [embedded](https://github.com/owncloud/OCIS/blob/ea2a2b328e7261ed72e65adf48359c0a44e14b40/OCIS/pkg/runtime/runtime.go#L84) or used as a cli command.
|
Pman is a slim utility library for supervising long-running processes. It can be embedded or used as a cli command.
|
||||||
|
|
||||||
When used as a CLI command it relays actions to a running runtime.
|
When used as a CLI command it relays actions to a running runtime.
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ Start a runtime
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
import "github.com/owncloud/ocis/ocis/pkg/runtime/service"
|
import "github.com/opencloude-eu/opencloud/opencloud/pkg/runtime/service"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
service.Start()
|
service.Start()
|
||||||
@@ -28,8 +28,8 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/owncloud/ocis/ocis/pkg/runtime/process"
|
"github.com/opencloud-eu/opencloud/opencloud/pkg/runtime/process"
|
||||||
"github.com/owncloud/ocis/ocis/pkg/runtime/service"
|
"github.com/opencloud-eu/opencloud/opencloud/pkg/runtime/service"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@@ -65,4 +65,4 @@ func main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Run the example above with `RUNTIME_KEEP_ALIVE=true` and with no `RUNTIME_KEEP_ALIVE` set to see its behavior. It requires an [oCIS binary](https://github.com/owncloud/ocis/releases) present in your `$PATH` for it to work.
|
Run the example above with `RUNTIME_KEEP_ALIVE=true` and with no `RUNTIME_KEEP_ALIVE` set to see its behavior. It requires an [OpenCloud binary](https://github.com/opencloud-eu/opencloud/releases) present in your `$PATH` for it to work.
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import (
|
|||||||
"github.com/opencloud-eu/opencloud/pkg/config"
|
"github.com/opencloud-eu/opencloud/pkg/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Runtime represents an oCIS runtime environment.
|
// Runtime represents an OpenCloud runtime environment.
|
||||||
type Runtime struct {
|
type Runtime struct {
|
||||||
c *config.Config
|
c *config.Config
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new oCIS + micro runtime
|
// New creates a new OpenCloud + micro runtime
|
||||||
func New(cfg *config.Config) Runtime {
|
func New(cfg *config.Config) Runtime {
|
||||||
return Runtime{
|
return Runtime{
|
||||||
c: cfg,
|
c: cfg,
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ type Service struct {
|
|||||||
// When used as a library, flags are not parsed, and in order to avoid introducing a global state with init functions
|
// When used as a library, flags are not parsed, and in order to avoid introducing a global state with init functions
|
||||||
// calls are done explicitly to loadFromEnv().
|
// calls are done explicitly to loadFromEnv().
|
||||||
// Since this is the public constructor, options need to be added, at the moment only logging options
|
// Since this is the public constructor, options need to be added, at the moment only logging options
|
||||||
// are supported in order to match the running OwnCloud services structured log.
|
// are supported in order to match the running OpenCloud services structured log.
|
||||||
func NewService(ctx context.Context, options ...Option) (*Service, error) {
|
func NewService(ctx context.Context, options ...Option) (*Service, error) {
|
||||||
opts := NewOptions()
|
opts := NewOptions()
|
||||||
|
|
||||||
@@ -349,9 +349,9 @@ func NewService(ctx context.Context, options ...Option) (*Service, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Start a rpc service. By default, the package scope Start will run all default services to provide with a working
|
// Start a rpc service. By default, the package scope Start will run all default services to provide with a working
|
||||||
// oCIS instance.
|
// OpenCloud instance.
|
||||||
func Start(ctx context.Context, o ...Option) error {
|
func Start(ctx context.Context, o ...Option) error {
|
||||||
// Start the runtime. Most likely this was called ONLY by the `ocis server` subcommand, but since we cannot protect
|
// Start the runtime. Most likely this was called ONLY by the `opencloud server` subcommand, but since we cannot protect
|
||||||
// from the caller, the previous statement holds truth.
|
// from the caller, the previous statement holds truth.
|
||||||
|
|
||||||
// prepare a new rpc Service struct.
|
// prepare a new rpc Service struct.
|
||||||
@@ -367,7 +367,7 @@ func Start(ctx context.Context, o ...Option) error {
|
|||||||
tolerance := 5
|
tolerance := 5
|
||||||
totalBackoff := 0
|
totalBackoff := 0
|
||||||
|
|
||||||
// Start creates its own supervisor. Running services under `ocis server` will create its own supervision tree.
|
// Start creates its own supervisor. Running services under `opencloud server` will create its own supervision tree.
|
||||||
s.Supervisor = suture.New("opencloud", suture.Spec{
|
s.Supervisor = suture.New("opencloud", suture.Spec{
|
||||||
EventHook: func(e suture.Event) {
|
EventHook: func(e suture.Event) {
|
||||||
if e.Type() == suture.EventTypeBackoff {
|
if e.Type() == suture.EventTypeBackoff {
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ func DefaultApp(app *cli.App) *cli.App {
|
|||||||
// author info
|
// author info
|
||||||
app.Authors = []*cli.Author{
|
app.Authors = []*cli.Author{
|
||||||
{
|
{
|
||||||
Name: "ownCloud GmbH",
|
Name: "OpenCloud GmbH",
|
||||||
Email: "support@owncloud.com",
|
Email: "support@opencloud.eu",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ nested structs, but it will not allocate new pointers to structs.
|
|||||||
## API
|
## API
|
||||||
|
|
||||||
Full API docs are available on
|
Full API docs are available on
|
||||||
[godoc.org](https://godoc.org/github.com/owncloud/ocis/ocis-pkg/config/envdecode).
|
[godoc.org](https://godoc.org/github.com/opencloud-eu/opencloud/pkg/config/envdecode).
|
||||||
|
|
||||||
Define a struct with `env` struct tags:
|
Define a struct with `env` struct tags:
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ var (
|
|||||||
//Date = time.Now().Format("20060102")
|
//Date = time.Now().Format("20060102")
|
||||||
Date = "dev"
|
Date = "dev"
|
||||||
|
|
||||||
// Legacy defines the old long 4 number ownCloud version needed for some clients
|
// Legacy defines the old long 4 number OpenCloud version needed for some clients
|
||||||
Legacy = "10.11.0.0"
|
Legacy = "10.11.0.0"
|
||||||
|
|
||||||
// LegacyString defines the old ownCloud version needed for some clients
|
// LegacyString defines the old OpenCloud version needed for some clients
|
||||||
LegacyString = "10.11.0"
|
LegacyString = "10.11.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user