Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

use open in app request #16

Closed
wants to merge 5 commits into from
Closed
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
28 changes: 12 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,26 @@ require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
contrib.go.opencensus.io/exporter/ocagent v0.7.0
contrib.go.opencensus.io/exporter/zipkin v0.1.2
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887
github.com/cs3org/reva v1.9.0
github.com/asim/go-micro/v3 v3.6.0
github.com/cs3org/go-cs3apis v0.0.0-20210812121411-f18cf19614e8
github.com/cs3org/reva v1.12.0
github.com/go-chi/chi v4.1.2+incompatible
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/go-chi/chi/v5 v5.0.4
github.com/micro/cli/v2 v2.1.2
github.com/oklog/run v1.1.0
github.com/openzipkin/zipkin-go v0.2.5
github.com/owncloud/ocis/ocis-pkg v0.0.0-20210519113029-34a8ed381620
github.com/prometheus/client_golang v1.10.0
github.com/spf13/viper v1.7.1
github.com/owncloud/ocis v1.11.0
github.com/prometheus/client_golang v1.11.0
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/viper v1.8.1
go.opencensus.io v0.23.0
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781
google.golang.org/genproto v0.0.0-20210413151531-c14fb6ef47c3 // indirect
google.golang.org/grpc v1.38.0
golang.org/x/net v0.0.0-20210825183410-e898025ed96a
google.golang.org/grpc v1.40.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
)

replace (
github.com/gomodule/redigo => github.com/gomodule/redigo v1.8.2
github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
github.com/crewjam/saml => github.com/crewjam/saml v0.4.5
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
// latest version compatible with etcd
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)
1,422 changes: 435 additions & 987 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/assets/embed.go

Large diffs are not rendered by default.

18 changes: 7 additions & 11 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,18 @@ type TokenManager struct {
}

type WopiServer struct {
Host string
Insecure bool
RevaGateway string
IOPSecret string
}

// Config combines all available configuration parts.
type Config struct {
File string
Log Log
Debug Debug
HTTP HTTP
Server Server
Tracing Tracing
Asset Asset
TokenManager TokenManager
File string
Log Log
Debug Debug
HTTP HTTP
Server Server
Tracing Tracing
Asset Asset

WopiServer WopiServer

Expand Down
38 changes: 0 additions & 38 deletions pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package flagset

import (
"time"

"github.com/micro/cli/v2"
"github.com/owncloud/ocis-wopiserver/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/flags"
Expand Down Expand Up @@ -164,42 +162,6 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
EnvVars: []string{"WOPISERVER_ASSET_PATH"},
Destination: &cfg.Asset.Path,
},
&cli.StringFlag{
Name: "wopi-server-host",
Value: "http://127.0.0.1:8880",
Usage: "Wopiserver Host",
EnvVars: []string{"WOPISERVER_WOPI_SERVER_HOST"},
Destination: &cfg.WopiServer.Host,
},
&cli.BoolFlag{
Name: "wopi-server-insecure",
Value: false,
Usage: "Wopiserver insecure",
EnvVars: []string{"WOPISERVER_WOPI_SERVER_INSECURE"},
Destination: &cfg.WopiServer.Insecure,
},
&cli.StringFlag{
Name: "wopi-server-iop-secret",
Value: "",
Usage: "shared IOP secret for CS3 WOPI server",
EnvVars: []string{"WOPISERVER_WOPI_SERVER_IOP_SECRET"},
Destination: &cfg.WopiServer.IOPSecret,
},
&cli.DurationFlag{
Name: "wopi-server-token-ttl",
Value: (1 * time.Hour),
Usage: "TTL of issued tokens",
EnvVars: []string{"WOPISERVER_TOKEN_TTL"},
Destination: &cfg.TokenManager.TokenTTL,
},

&cli.StringFlag{
Name: "jwt-secret",
Value: flags.OverrideDefaultString(cfg.TokenManager.JWTSecret, "Pive-Fumkiu4"),
Usage: "Used to create JWT to talk to reva, should equal reva's jwt-secret",
EnvVars: []string{"WOPISERVER_JWT_SECRET", "OCIS_JWT_SECRET"},
Destination: &cfg.TokenManager.JWTSecret,
},
&cli.StringFlag{
Name: "reva-gateway-addr",
Value: flags.OverrideDefaultString(cfg.WopiServer.RevaGateway, "127.0.0.1:9142"),
Expand Down
10 changes: 3 additions & 7 deletions pkg/server/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package http
import (
"github.com/asim/go-micro/v3"
"github.com/cs3org/reva/pkg/rgrpc/todo/pool"
chimiddleware "github.com/go-chi/chi/v5/middleware"
svc "github.com/owncloud/ocis-wopiserver/pkg/service/v0"
"github.com/owncloud/ocis-wopiserver/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/account"
"github.com/owncloud/ocis/ocis-pkg/middleware"
"github.com/owncloud/ocis/ocis-pkg/service/http"
)
Expand Down Expand Up @@ -34,15 +34,11 @@ func Server(opts ...Option) (http.Service, error) {
svc.Logger(options.Logger),
svc.Config(options.Config),
svc.Middleware(
middleware.RealIP,
middleware.RequestID,
chimiddleware.RealIP,
chimiddleware.RequestID,
middleware.NoCache,
middleware.Cors,
middleware.Secure,
middleware.ExtractAccountUUID(
account.Logger(options.Logger),
account.JWTSecret(options.Config.TokenManager.JWTSecret),
),
middleware.Version(
"wopiserver",
version.String,
Expand Down
Loading