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

Commit

Permalink
Merge pull request #46 from owncloud/refactor-data-model
Browse files Browse the repository at this point in the history
Refactor data model
  • Loading branch information
kulmann authored Aug 19, 2020
2 parents dc8a2f7 + 189a811 commit 5d95974
Show file tree
Hide file tree
Showing 38 changed files with 3,143 additions and 2,795 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,19 @@ $(PROTO_SRC)/settings.pb.go: $(PROTO_SRC)/settings.proto
protoc \
-I=third_party/ \
-I=$(PROTO_SRC)/ \
--go_out=$(PROTO_SRC) settings.proto
--go_out=. settings.proto

$(PROTO_SRC)/settings.pb.micro.go: $(PROTO_SRC)/settings.proto
protoc \
-I=third_party/ \
-I=$(PROTO_SRC)/ \
--micro_out=$(PROTO_SRC) settings.proto
--micro_out=. settings.proto

$(PROTO_SRC)/settings.pb.web.go: $(PROTO_SRC)/settings.proto
protoc \
-I=third_party/ \
-I=$(PROTO_SRC)/ \
--microweb_out=$(PROTO_SRC) settings.proto
--microweb_out=. settings.proto

$(PROTO_SRC)/settings.swagger.json: $(PROTO_SRC)/settings.proto
protoc \
Expand Down
Empty file added changelog/unreleased/.keep
Empty file.
8 changes: 8 additions & 0 deletions changelog/unreleased/refactor-naming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Change: Rename endpoints and message types

We decided to rename endpoints and message types to be less verbose. Specifically, `SettingsBundle` became `Bundle`,
`Setting` (inside a bundle) kept its name and `SettingsValue` became `Value`.

https://github.com/owncloud/ocis-settings/issues/36
https://github.com/owncloud/ocis-settings/issues/32
https://github.com/owncloud/ocis-settings/pull/46
7 changes: 7 additions & 0 deletions changelog/unreleased/switch-to-uuids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Change: Use UUIDs instead of alphanumeric identifiers

`Bundles`, `Settings` and `Values` were identified by a set of alphanumeric identifiers so far. We switched to UUIDs
in order to achieve a flat file hierarchy on disk. Referencing the respective entities by their alphanumeric
identifiers (as used in UI code) is still supported.

https://github.com/owncloud/ocis-settings/pull/46
14 changes: 2 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,32 @@ require (
contrib.go.opencensus.io/exporter/zipkin v0.1.1
github.com/Masterminds/sprig/v3 v3.1.0 // indirect
github.com/UnnoTed/fileb0x v1.1.4
github.com/cespare/reflex v0.2.0 // indirect
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-chi/render v1.0.1
github.com/go-ozzo/ozzo-validation/v4 v4.2.1
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/gofrs/uuid v3.3.0+incompatible
github.com/golang/protobuf v1.4.2
github.com/gomodule/redigo v2.0.0+incompatible // indirect
github.com/grpc-ecosystem/grpc-gateway v1.14.4
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/mholt/certmagic v0.9.3 // indirect
github.com/micro/cli/v2 v2.1.2
github.com/micro/go-micro v1.18.0 // indirect
github.com/micro/go-micro/v2 v2.9.1
github.com/mitchellh/gox v1.0.1
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/ogier/pflag v0.0.1 // indirect
github.com/oklog/run v1.0.0
github.com/openzipkin/zipkin-go v0.2.2
github.com/owncloud/ocis-pkg/v2 v2.2.2-0.20200812103920-db41b5a3d14d
github.com/restic/calens v0.2.0
github.com/spf13/viper v1.6.3
github.com/stretchr/testify v1.6.1
github.com/zenazn/goji v0.9.0 // indirect
go.opencensus.io v0.22.4
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b
golang.org/x/net v0.0.0-20200625001655-4c5254603344
golang.org/x/tools v0.0.0-20200811215021-48a8ffc5b207
golang.org/x/tools v0.0.0-20200811215021-48a8ffc5b207 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20200420144010-e5e8543f8aeb
google.golang.org/grpc v1.31.0
google.golang.org/protobuf v1.23.0
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
gopkg.in/ldap.v2 v2.5.1 // indirect
)

replace google.golang.org/grpc => google.golang.org/grpc v1.26.0
164 changes: 36 additions & 128 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package assets
import (
"net/http"
"os"
"path"
"path/filepath"

"github.com/owncloud/ocis-pkg/v2/log"
"github.com/owncloud/ocis-settings/pkg/config"
Expand All @@ -27,7 +27,7 @@ type assets struct {
func (a assets) Open(original string) (http.File, error) {
if a.config.Asset.Path != "" {
if stat, err := os.Stat(a.config.Asset.Path); err == nil && stat.IsDir() {
custom := path.Join(
custom := filepath.Join(
a.config.Asset.Path,
original,
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/assets/embed.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type Asset struct {

// Storage defines the available storage configuration.
type Storage struct {
RootMountPath string
DataPath string
}

// TokenManager is the config for using the reva token manager
Expand Down
7 changes: 4 additions & 3 deletions pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
Destination: &cfg.GRPC.Namespace,
},
&cli.StringFlag{
Name: "mount-path",
Name: "data-path",
Value: "/var/tmp/ocis-settings",
Usage: "Mount path for the storage",
EnvVars: []string{"SETTINGS_ROOT_MOUNT_PATH"},
Destination: &cfg.Storage.RootMountPath,
EnvVars: []string{"SETTINGS_DATA_PATH"},
Destination: &cfg.Storage.DataPath,
},
&cli.StringFlag{
Name: "jwt-secret",
Expand Down
Loading

0 comments on commit 5d95974

Please sign in to comment.