From 55db2f72d05a60c16716aa26161c87643a256d5c Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 22 Apr 2020 11:27:42 +0200 Subject: [PATCH] Fixing http server --- pkg/assets/embed.go | 4 ++-- pkg/flagset/flagset.go | 9 ++++++++- pkg/proto/v0/settings.pb.web.go | 8 ++++---- pkg/service/v0/service.go | 1 - reflex.conf | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pkg/assets/embed.go b/pkg/assets/embed.go index 4755c27310..dd258b9b68 100644 --- a/pkg/assets/embed.go +++ b/pkg/assets/embed.go @@ -1,5 +1,5 @@ -// Code generated by fileb0x at "2020-04-22 09:25:46.434104 +0200 CEST m=+0.005074795" from config file "embed.yml" DO NOT EDIT. -// modification hash(39a5e5bc3b3880bb6d929622e4d8ad9d.8058aec596c5fb73022d09bb97af796e) +// Code generated by fileb0x at "2020-04-22 10:33:13.646376 +0200 CEST m=+0.007895650" from config file "embed.yml" DO NOT EDIT. +// modification hash(11bae401e76f7a8a768e1594cbb3ea28.8058aec596c5fb73022d09bb97af796e) package assets diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index b66358b193..508e3ad4aa 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -140,9 +140,16 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { Name: "grpc-addr", Value: "0.0.0.0:9191", Usage: "Address to bind grpc server", - EnvVars: []string{"HELLO_GRPC_ADDR"}, + EnvVars: []string{"SETTINGS_GRPC_ADDR"}, Destination: &cfg.GRPC.Addr, }, + &cli.StringFlag{ + Name: "asset-path", + Value: "", + Usage: "Path to custom assets", + EnvVars: []string{"SETTINGS_ASSET_PATH"}, + Destination: &cfg.Asset.Path, + }, &cli.StringFlag{ Name: "grpc-namespace", Value: "com.owncloud.api", diff --git a/pkg/proto/v0/settings.pb.web.go b/pkg/proto/v0/settings.pb.web.go index 508433d0d7..f5410c2fed 100644 --- a/pkg/proto/v0/settings.pb.web.go +++ b/pkg/proto/v0/settings.pb.web.go @@ -77,10 +77,10 @@ func (h *webBundleServiceHandler) ListSettingsBundles(w http.ResponseWriter, r * resp := &ListSettingsBundlesResponse{} - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } + //if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + // http.Error(w, err.Error(), http.StatusPreconditionFailed) + // return + //} if err := h.h.ListSettingsBundles( context.Background(), diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index f8fa95438d..2ab5fcf6db 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -2,7 +2,6 @@ package svc import ( "context" - "github.com/owncloud/ocis-settings/pkg/settings" store "github.com/owncloud/ocis-settings/pkg/store/filesystem" diff --git a/reflex.conf b/reflex.conf index 074476ee1b..8c87fcf793 100644 --- a/reflex.conf +++ b/reflex.conf @@ -1,5 +1,5 @@ # backend --r '^(cmd|pkg)/.*\.go$' -R '^node_modules/' -s -- sh -c 'make bin/ocis-settings-debug && bin/ocis-settings-debug --log-level debug server --debug-pprof --debug-zpages' +-r '^(cmd|pkg)/.*\.go$' -R '^node_modules/' -s -- sh -c 'make bin/ocis-settings-debug && bin/ocis-settings-debug --log-level debug server --debug-pprof --debug-zpages --asset-path assets/' # frontend -r '^ui/.*\.(vue|js)$' -R '^node_modules/' -- sh -c 'yarn build'