Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move/remove code to respective repos #4579

Merged
merged 10 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ tests/ocis/tests/acceptance/work_tmp
toolchain/

logs_test/

tmp/
3 changes: 3 additions & 0 deletions changelog/unreleased/clean-repo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Remove domain-specific code to other repos

https://github.com/cs3org/reva/pull/4579
42 changes: 3 additions & 39 deletions cmd/reva/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"math"
"net/http"
"os"
"path/filepath"
"strconv"

gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
Expand All @@ -40,8 +39,6 @@ import (
"github.com/cs3org/reva/pkg/crypto"
"github.com/cs3org/reva/pkg/errtypes"
"github.com/cs3org/reva/pkg/utils"
"github.com/eventials/go-tus"
"github.com/eventials/go-tus/memorystore"
"github.com/pkg/errors"
"github.com/studio-b12/gowebdav"
)
Expand All @@ -50,11 +47,11 @@ func uploadCommand() *command {
cmd := newCommand("upload")
cmd.Description = func() string { return "upload a local file to the remote server" }
cmd.Usage = func() string { return "Usage: upload [-flags] <file_name> <remote_target>" }
protocolFlag := cmd.String("protocol", "tus", "the protocol to be used for uploads")
xsFlag := cmd.String("xs", "negotiate", "compute checksum")
protocolFlag := cmd.String("protocol", "simple", "protocol for file uploads: simple, negotiate")

cmd.ResetFlags = func() {
*protocolFlag, *xsFlag = "tus", "negotiate"
*protocolFlag, *xsFlag = "simple", "negotiate"
}

cmd.Action = func(w ...io.Writer) error {
Expand Down Expand Up @@ -167,40 +164,7 @@ func uploadCommand() *command {
return errors.New("upload: PUT request returned " + httpRes.Status)
}
} else {
// create the tus client.
c := tus.DefaultConfig()
c.Resume = true
c.HttpClient = client.GetNativeHTTP()
c.Store, err = memorystore.NewMemoryStore()
if err != nil {
return err
}
c.Header.Add(datagateway.TokenTransportHeader, p.Token)
tusc, err := tus.NewClient(dataServerURL, c)
if err != nil {
return err
}

metadata := map[string]string{
"filename": filepath.Base(target),
"dir": filepath.Dir(target),
"checksum": fmt.Sprintf("%s %s", storageprovider.GRPC2PKGXS(xsType).String(), xs),
}

fingerprint := fmt.Sprintf("%s-%d-%s-%s", md.Name(), md.Size(), md.ModTime(), xs)

// create an upload from a file.
upload := tus.NewUpload(fd, md.Size(), metadata, fingerprint)

// create the uploader.
c.Store.Set(upload.Fingerprint, dataServerURL)
uploader := tus.NewUploader(tusc, dataServerURL, upload, 0)

// start the uploading process.
err = uploader.Upload()
if err != nil {
return err
}
return errors.New("protocol not known: " + *protocolFlag)
}

req2 := &provider.StatRequest{
Expand Down
7 changes: 0 additions & 7 deletions cmd/revad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/cs3org/reva/pkg/logger"
"github.com/cs3org/reva/pkg/plugin"
"github.com/cs3org/reva/pkg/sysinfo"
"github.com/cs3org/reva/pkg/utils/maps"
"github.com/google/uuid"
"github.com/pkg/errors"
Expand Down Expand Up @@ -71,12 +70,6 @@ func Main() {

initPlugins()

// initialize the global system information
if err := sysinfo.InitSystemInfo(&sysinfo.RevaVersion{Version: version, BuildDate: buildDate, GitCommit: gitCommit, GoVersion: goVersion}); err != nil {
fmt.Fprintf(os.Stderr, "error initializing system info: %s\n", err.Error())
// This is not really a fatal error, so don't panic
}

handleVersionFlag()
handleSignalFlag()
handlePluginsFlag()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "experimental"
linkTitle: "experimental"
weight: 10
description: >
Configuration for the experimental service
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: "overleaf"
linkTitle: "overleaf"
weight: 10
description: >
Configuration for the overleaf service
---

# _struct: config_

{{% dir name="app_name" type="string" default="" %}}
The App user-friendly name. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/experimental/overleaf/overleaf.go#L58)
{{< highlight toml >}}
[http.services.experimental.overleaf]
app_name = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="archiver_url" type="string" default="" %}}
Internet-facing URL of the archiver service, used to serve the files to Overleaf. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/experimental/overleaf/overleaf.go#L59)
{{< highlight toml >}}
[http.services.experimental.overleaf]
archiver_url = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="app_url" type="string" default="" %}}
The App URL. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/experimental/overleaf/overleaf.go#L60)
{{< highlight toml >}}
[http.services.experimental.overleaf]
app_url = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="insecure" type="bool" default=false %}}
Whether to skip certificate checks when sending requests. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/experimental/overleaf/overleaf.go#L61)
{{< highlight toml >}}
[http.services.experimental.overleaf]
insecure = false
{{< /highlight >}}
{{% /dir %}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "opencloudmesh"
linkTitle: "opencloudmesh"
weight: 10
description: >
Configuration for the opencloudmesh service
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "ocmprovider"
linkTitle: "ocmprovider"
weight: 10
description: >
Configuration for the ocmprovider service
---

# _struct: config_

{{% dir name="ocm_prefix" type="string" default="ocm" %}}
The prefix URL where the OCM API is served. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/opencloudmesh/ocmprovider/ocmprovider.go#L40)
{{< highlight toml >}}
[http.services.opencloudmesh.ocmprovider]
ocm_prefix = "ocm"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="endpoint" type="string" default="This host's full URL. If it's not configured, it is assumed OCM is not available." %}}
[[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/opencloudmesh/ocmprovider/ocmprovider.go#L41)
{{< highlight toml >}}
[http.services.opencloudmesh.ocmprovider]
endpoint = "This host's full URL. If it's not configured, it is assumed OCM is not available."
{{< /highlight >}}
{{% /dir %}}

{{% dir name="provider" type="string" default="reva" %}}
A friendly name that defines this service. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/opencloudmesh/ocmprovider/ocmprovider.go#L42)
{{< highlight toml >}}
[http.services.opencloudmesh.ocmprovider]
provider = "reva"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="webdav_root" type="string" default="/remote.php/dav/ocm" %}}
The root URL of the WebDAV endpoint to serve OCM shares. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/opencloudmesh/ocmprovider/ocmprovider.go#L43)
{{< highlight toml >}}
[http.services.opencloudmesh.ocmprovider]
webdav_root = "/remote.php/dav/ocm"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="webapp_root" type="string" default="/external/sciencemesh" %}}
The root URL to serve Web apps via OCM. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/opencloudmesh/ocmprovider/ocmprovider.go#L44)
{{< highlight toml >}}
[http.services.opencloudmesh.ocmprovider]
webapp_root = "/external/sciencemesh"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="enable_webapp" type="bool" default=false %}}
Whether web apps are enabled in OCM shares. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/opencloudmesh/ocmprovider/ocmprovider.go#L45)
{{< highlight toml >}}
[http.services.opencloudmesh.ocmprovider]
enable_webapp = false
{{< /highlight >}}
{{% /dir %}}

{{% dir name="enable_datatx" type="bool" default=false %}}
Whether data transfers are enabled in OCM shares. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/opencloudmesh/ocmprovider/ocmprovider.go#L46)
{{< highlight toml >}}
[http.services.opencloudmesh.ocmprovider]
enable_datatx = false
{{< /highlight >}}
{{% /dir %}}

Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ insecure = false
{{< /highlight >}}
{{% /dir %}}

{{% dir name="notifications" type="map[string]interface{}" default=Settingsg for the Notification Helper %}}
[[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/owncloud/ocdav/ocdav.go#L123)
{{% dir name="notifications" type="map[string]interface{}" default=nil %}}
settings for the notification helper [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/owncloud/ocdav/ocdav.go#L123)
{{< highlight toml >}}
[http.services.owncloud.ocdav]
notifications = Settingsg for the Notification Helper
notifications = nil
{{< /highlight >}}
{{% /dir %}}

Loading
Loading