diff --git a/CHANGELOG.md b/CHANGELOG.md index 64497acb19..94c321562e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,35 @@ The following sections list the changes for unreleased. -[unreleased]: https://github.com/owncloud/ocis/compare/v1.12.0...master +[unreleased]: https://github.com/owncloud/ocis/compare/v1.13.0...master + +## Summary + +* Security - Don't expose services by default: [#2612](https://github.com/owncloud/ocis/issues/2612) +* Change - Configurable default quota: [#2621](https://github.com/owncloud/ocis/issues/2621) + +## Details + +* Security - Don't expose services by default: [#2612](https://github.com/owncloud/ocis/issues/2612) + + We've changed the bind behaviour for all non public facing services. Before this PR all + services would listen on all interfaces. After this PR, all services listen on 127.0.0.1 only, + except the proxy which is listening on 0.0.0.0:9200. + + https://github.com/owncloud/ocis/issues/2612 + +* Change - Configurable default quota: [#2621](https://github.com/owncloud/ocis/issues/2621) + + When creating a new space a (configurable) default quota will be used (instead the hardcoded + one) One can set the EnvVar `GRAPH_SPACES_DEFAULT_QUOTA` to configure it + + https://github.com/owncloud/ocis/issues/2621 + https://jira.owncloud.com/browse/OCIS-2070 +# Changelog for [1.13.0] (2021-10-13) + +The following sections list the changes for 1.13.0. + +[1.13.0]: https://github.com/owncloud/ocis/compare/v1.12.0...v1.13.0 ## Summary diff --git a/accounts/pkg/flagset/flagset.go b/accounts/pkg/flagset/flagset.go index dd4db4e61f..3b99a9293a 100644 --- a/accounts/pkg/flagset/flagset.go +++ b/accounts/pkg/flagset/flagset.go @@ -87,7 +87,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9181"), + Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9181"), Usage: "Address to bind http server", EnvVars: []string{"ACCOUNTS_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, @@ -115,7 +115,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "grpc-addr", - Value: flags.OverrideDefaultString(cfg.GRPC.Addr, "0.0.0.0:9180"), + Value: flags.OverrideDefaultString(cfg.GRPC.Addr, "127.0.0.1:9180"), Usage: "Address to bind grpc server", EnvVars: []string{"ACCOUNTS_GRPC_ADDR"}, Destination: &cfg.GRPC.Addr, diff --git a/changelog/unreleased/appregistry-config.md b/changelog/1.13.0_2021-10-13/appregistry-config.md similarity index 100% rename from changelog/unreleased/appregistry-config.md rename to changelog/1.13.0_2021-10-13/appregistry-config.md diff --git a/changelog/unreleased/archiver-capabilities-limits.md b/changelog/1.13.0_2021-10-13/archiver-capabilities-limits.md similarity index 100% rename from changelog/unreleased/archiver-capabilities-limits.md rename to changelog/1.13.0_2021-10-13/archiver-capabilities-limits.md diff --git a/changelog/unreleased/cleanup-source-license.md b/changelog/1.13.0_2021-10-13/cleanup-source-license.md similarity index 100% rename from changelog/unreleased/cleanup-source-license.md rename to changelog/1.13.0_2021-10-13/cleanup-source-license.md diff --git a/changelog/unreleased/configure-users-metadata-storage-separately.md b/changelog/1.13.0_2021-10-13/configure-users-metadata-storage-separately.md similarity index 100% rename from changelog/unreleased/configure-users-metadata-storage-separately.md rename to changelog/1.13.0_2021-10-13/configure-users-metadata-storage-separately.md diff --git a/changelog/unreleased/create-space-response.md b/changelog/1.13.0_2021-10-13/create-space-response.md similarity index 100% rename from changelog/unreleased/create-space-response.md rename to changelog/1.13.0_2021-10-13/create-space-response.md diff --git a/changelog/unreleased/create-spaces-odata.md b/changelog/1.13.0_2021-10-13/create-spaces-odata.md similarity index 100% rename from changelog/unreleased/create-spaces-odata.md rename to changelog/1.13.0_2021-10-13/create-spaces-odata.md diff --git a/changelog/unreleased/expose-reva-archiver.md b/changelog/1.13.0_2021-10-13/expose-reva-archiver.md similarity index 100% rename from changelog/unreleased/expose-reva-archiver.md rename to changelog/1.13.0_2021-10-13/expose-reva-archiver.md diff --git a/changelog/unreleased/favorites-capability.md b/changelog/1.13.0_2021-10-13/favorites-capability.md similarity index 100% rename from changelog/unreleased/favorites-capability.md rename to changelog/1.13.0_2021-10-13/favorites-capability.md diff --git a/changelog/unreleased/fix-account-resolver.md b/changelog/1.13.0_2021-10-13/fix-account-resolver.md similarity index 100% rename from changelog/unreleased/fix-account-resolver.md rename to changelog/1.13.0_2021-10-13/fix-account-resolver.md diff --git a/changelog/unreleased/fix-builtime-version.md b/changelog/1.13.0_2021-10-13/fix-builtime-version.md similarity index 100% rename from changelog/unreleased/fix-builtime-version.md rename to changelog/1.13.0_2021-10-13/fix-builtime-version.md diff --git a/changelog/unreleased/fix-gatewaysvc-everywhere.md b/changelog/1.13.0_2021-10-13/fix-gatewaysvc-everywhere.md similarity index 100% rename from changelog/unreleased/fix-gatewaysvc-everywhere.md rename to changelog/1.13.0_2021-10-13/fix-gatewaysvc-everywhere.md diff --git a/changelog/unreleased/fix-username-encoding.md b/changelog/1.13.0_2021-10-13/fix-username-encoding.md similarity index 100% rename from changelog/unreleased/fix-username-encoding.md rename to changelog/1.13.0_2021-10-13/fix-username-encoding.md diff --git a/changelog/unreleased/go-1-17.md b/changelog/1.13.0_2021-10-13/go-1-17.md similarity index 100% rename from changelog/unreleased/go-1-17.md rename to changelog/1.13.0_2021-10-13/go-1-17.md diff --git a/changelog/unreleased/make-allow-list-mimetypes-configurable.md b/changelog/1.13.0_2021-10-13/make-allow-list-mimetypes-configurable.md similarity index 100% rename from changelog/unreleased/make-allow-list-mimetypes-configurable.md rename to changelog/1.13.0_2021-10-13/make-allow-list-mimetypes-configurable.md diff --git a/changelog/unreleased/mime-type-allow-creation.md b/changelog/1.13.0_2021-10-13/mime-type-allow-creation.md similarity index 100% rename from changelog/unreleased/mime-type-allow-creation.md rename to changelog/1.13.0_2021-10-13/mime-type-allow-creation.md diff --git a/changelog/unreleased/optional-skip-demo-users-creation.md b/changelog/1.13.0_2021-10-13/optional-skip-demo-users-creation.md similarity index 100% rename from changelog/unreleased/optional-skip-demo-users-creation.md rename to changelog/1.13.0_2021-10-13/optional-skip-demo-users-creation.md diff --git a/changelog/unreleased/proxy-policy-claim-precedence.md b/changelog/1.13.0_2021-10-13/proxy-policy-claim-precedence.md similarity index 100% rename from changelog/unreleased/proxy-policy-claim-precedence.md rename to changelog/1.13.0_2021-10-13/proxy-policy-claim-precedence.md diff --git a/changelog/unreleased/redirect-invalid-links-to-oC-web.md b/changelog/1.13.0_2021-10-13/redirect-invalid-links-to-oC-web.md similarity index 100% rename from changelog/unreleased/redirect-invalid-links-to-oC-web.md rename to changelog/1.13.0_2021-10-13/redirect-invalid-links-to-oC-web.md diff --git a/changelog/unreleased/remove-notifications-placeholder.md b/changelog/1.13.0_2021-10-13/remove-notifications-placeholder.md similarity index 100% rename from changelog/unreleased/remove-notifications-placeholder.md rename to changelog/1.13.0_2021-10-13/remove-notifications-placeholder.md diff --git a/changelog/unreleased/remove_proxy_assets.md b/changelog/1.13.0_2021-10-13/remove_proxy_assets.md similarity index 100% rename from changelog/unreleased/remove_proxy_assets.md rename to changelog/1.13.0_2021-10-13/remove_proxy_assets.md diff --git a/changelog/unreleased/reva-auth-tokens.md b/changelog/1.13.0_2021-10-13/reva-auth-tokens.md similarity index 100% rename from changelog/unreleased/reva-auth-tokens.md rename to changelog/1.13.0_2021-10-13/reva-auth-tokens.md diff --git a/changelog/unreleased/reva-gateway-configuration.md b/changelog/1.13.0_2021-10-13/reva-gateway-configuration.md similarity index 100% rename from changelog/unreleased/reva-gateway-configuration.md rename to changelog/1.13.0_2021-10-13/reva-gateway-configuration.md diff --git a/changelog/unreleased/reva-gateway-endpoint-config.md b/changelog/1.13.0_2021-10-13/reva-gateway-endpoint-config.md similarity index 100% rename from changelog/unreleased/reva-gateway-endpoint-config.md rename to changelog/1.13.0_2021-10-13/reva-gateway-endpoint-config.md diff --git a/changelog/unreleased/reva-ldap-tls.md b/changelog/1.13.0_2021-10-13/reva-ldap-tls.md similarity index 100% rename from changelog/unreleased/reva-ldap-tls.md rename to changelog/1.13.0_2021-10-13/reva-ldap-tls.md diff --git a/changelog/unreleased/reva-token-expiration.md b/changelog/1.13.0_2021-10-13/reva-token-expiration.md similarity index 100% rename from changelog/unreleased/reva-token-expiration.md rename to changelog/1.13.0_2021-10-13/reva-token-expiration.md diff --git a/changelog/unreleased/update-reva-to-477bb18843a97c6e392dd316e8735ccbe44f16ed.md b/changelog/1.13.0_2021-10-13/update-reva-to-477bb18843a97c6e392dd316e8735ccbe44f16ed.md similarity index 100% rename from changelog/unreleased/update-reva-to-477bb18843a97c6e392dd316e8735ccbe44f16ed.md rename to changelog/1.13.0_2021-10-13/update-reva-to-477bb18843a97c6e392dd316e8735ccbe44f16ed.md diff --git a/changelog/unreleased/update-web-4.3.0.md b/changelog/1.13.0_2021-10-13/update-web-4.3.0.md similarity index 100% rename from changelog/unreleased/update-web-4.3.0.md rename to changelog/1.13.0_2021-10-13/update-web-4.3.0.md diff --git a/changelog/unreleased/create-space-quota.md b/changelog/unreleased/create-space-quota.md new file mode 100644 index 0000000000..7651cf7460 --- /dev/null +++ b/changelog/unreleased/create-space-quota.md @@ -0,0 +1,7 @@ +Change: Configurable default quota + +When creating a new space a (configurable) default quota will be used (instead the hardcoded one) +One can set the EnvVar `GRAPH_SPACES_DEFAULT_QUOTA` to configure it + +https://github.com/owncloud/ocis/issues/2621 +https://jira.owncloud.com/browse/OCIS-2070 diff --git a/changelog/unreleased/dont-expose-services-by-default.md b/changelog/unreleased/dont-expose-services-by-default.md new file mode 100644 index 0000000000..c2e775c288 --- /dev/null +++ b/changelog/unreleased/dont-expose-services-by-default.md @@ -0,0 +1,7 @@ +Security: Don't expose services by default + +We've changed the bind behaviour for all non public facing services. Before this PR +all services would listen on all interfaces. After this PR, all services listen on +127.0.0.1 only, except the proxy which is listening on 0.0.0.0:9200. + +https://github.com/owncloud/ocis/issues/2612 diff --git a/deployments/examples/ocis_wopi/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index 35253bf402..09b46ff147 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -67,6 +67,7 @@ services: OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} OCIS_TRANSFER_SECRET: ${STORAGE_TRANSFER_SECRET:-replace-me-with-a-transfer-secret} # app registry + STORAGE_GATEWAY_GRPC_ADDR: 0.0.0.0:9142 # make the REVA gateway accessible to the app drivers STORAGE_APP_REGISTRY_MIMETYPES_JSON: /var/tmp/ocis/app-config/mimetypes.json volumes: - ./config/ocis/entrypoint-override.sh:/entrypoint-override.sh @@ -90,6 +91,7 @@ services: command: storage-app-provider server environment: REVA_GATEWAY: ${REVA_GATEWAY:-ocis:9142} + APP_PROVIDER_BASIC_GRPC_ADDR: 0.0.0.0:9164 APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-collabora:9164 OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4} OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} @@ -115,6 +117,7 @@ services: #command: storage-app-provider server environment: REVA_GATEWAY: ${REVA_GATEWAY:-ocis:9142} + APP_PROVIDER_BASIC_GRPC_ADDR: 0.0.0.0:9164 APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-onlyoffice:9164 OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4} OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} @@ -142,6 +145,7 @@ services: #command: storage-app-provider server environment: REVA_GATEWAY: ${REVA_GATEWAY:-ocis:9142} + APP_PROVIDER_BASIC_GRPC_ADDR: 0.0.0.0:9164 APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-codimd:9164 OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4} OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} diff --git a/docs/ocis/release_notes.md b/docs/ocis/release_notes.md index 5aa286470d..a8b8a4a361 100644 --- a/docs/ocis/release_notes.md +++ b/docs/ocis/release_notes.md @@ -7,6 +7,25 @@ geekdocEditPath: edit/master/docs/ocis geekdocFilePath: release_notes.md --- +## ownCloud Infinite Scale 1.13.0 Technology Preview + +Version 1.13.0 brings progress on the backend for the 'Spaces' feature. ownCloud Web and Infinite Scale now provide ZIP/TAR download for multiple files/folders and can integrate external file viewer/editor applications (e.g., Collabora Online, ONLYOFFICE, CodiMD, Microsoft Office Online). + +The most prominent changes in ownCloud Infinite Scale 1.13.0 and ownCloud Web 4.3.0 comprise: + +- Infinite Scale and Web now allow downloading multiple files or folders as archives [ocis#2509](https://github.com/owncloud/ocis/pull/2509) [cs3org/reva#2088](https://github.com/cs3org/reva/pull/2088) +- Infinite Scale and Web can now integrate external applications like file viewers/editors via the [cs3org/wopiserver](https://github.com/cs3org/wopiserver) (e.g., Collabora Online, ONLYOFFICE, CodiMD, Microsoft Office Online). [web#5805](https://github.com/owncloud/web/pull/5805) +- The 'Shared with me' page in ownCloud Web now clearly separates pending, declined and accepted shares. Pending shares are always displayed prominently so that users are aware and can react accordingly. [web#5814](https://github.com/owncloud/web/pull/5814) +- Legacy URLs (e.g., from the address bar, public links) from ownCloud Classic are now properly resolved after migrating to Infinite Scale and Web [cs3org/reva#1089](https://github.com/cs3org/reva/pull/1989) +- A capability for the Favorites feature has been added [ocis#2599](https://github.com/owncloud/ocis/pull/2599) + +You can also read the full [ownCloud Infinite Scale changelog](https://github.com/owncloud/ocis/releases/tag/v1.13.0) and [ownCloud Web changelog](https://github.com/owncloud/web/releases/tag/v4.3.0) for further details on what has changed. + +### Breaking changes +{{< hint warning >}} +We are currently in a Tech Preview state and breaking changes may occur at any time. For more information see our [release roadmap]({{< ref "./release_roadmap" >}}) +{{< /hint >}} + ## ownCloud Infinite Scale 1.12.0 Technology Preview Version 1.12.0 is a maintenance release with the foundations for the 'Spaces' feature and for viewer/editor application integrations. The Infinite Scale backend has been further hardened by fixing known issues, improving error handling and stabilizing existing features. Apart from bugfixing, ownCloud Web 4.2.0 has received a number of usability and design improvements for sharing and the file list. diff --git a/glauth/pkg/flagset/flagset.go b/glauth/pkg/flagset/flagset.go index ba62015419..74b85dd746 100644 --- a/glauth/pkg/flagset/flagset.go +++ b/glauth/pkg/flagset/flagset.go @@ -38,7 +38,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9129"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9129"), Usage: "Address to debug endpoint", EnvVars: []string{"GLAUTH_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -98,7 +98,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9129"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9129"), Usage: "Address to bind debug server", EnvVars: []string{"GLAUTH_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -132,7 +132,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "ldap-addr", - Value: flags.OverrideDefaultString(cfg.Ldap.Addr, "0.0.0.0:9125"), + Value: flags.OverrideDefaultString(cfg.Ldap.Addr, "127.0.0.1:9125"), Usage: "Address to bind ldap server", EnvVars: []string{"GLAUTH_LDAP_ADDR"}, Destination: &cfg.Ldap.Addr, @@ -147,7 +147,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "ldaps-addr", - Value: flags.OverrideDefaultString(cfg.Ldaps.Addr, "0.0.0.0:9126"), + Value: flags.OverrideDefaultString(cfg.Ldaps.Addr, "127.0.0.1:9126"), Usage: "Address to bind ldap server", EnvVars: []string{"GLAUTH_LDAPS_ADDR"}, Destination: &cfg.Ldaps.Addr, diff --git a/graph-explorer/pkg/flagset/flagset.go b/graph-explorer/pkg/flagset/flagset.go index 30dbe0e59b..540780e47f 100644 --- a/graph-explorer/pkg/flagset/flagset.go +++ b/graph-explorer/pkg/flagset/flagset.go @@ -35,7 +35,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9136"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9136"), Usage: "Address to debug endpoint", EnvVars: []string{"GRAPH_EXPLORER_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -88,7 +88,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9136"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9136"), Usage: "Address to bind debug server", EnvVars: []string{"GRAPH_EXPLORER_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -114,7 +114,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9135"), + Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9135"), Usage: "Address to bind http server", EnvVars: []string{"GRAPH_EXPLORER_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, diff --git a/graph/pkg/config/config.go b/graph/pkg/config/config.go index e678250f54..4021472772 100644 --- a/graph/pkg/config/config.go +++ b/graph/pkg/config/config.go @@ -51,7 +51,8 @@ type TokenManager struct { } type Spaces struct { - WebDavBase string + WebDavBase string + DefaultQuota string } // Config combines all available configuration parts. diff --git a/graph/pkg/flagset/flagset.go b/graph/pkg/flagset/flagset.go index 9ac8ca49ea..4357d0ba87 100644 --- a/graph/pkg/flagset/flagset.go +++ b/graph/pkg/flagset/flagset.go @@ -42,7 +42,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9124"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9124"), Usage: "Address to debug endpoint", EnvVars: []string{"GRAPH_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -95,7 +95,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9124"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9124"), Usage: "Address to bind debug server", EnvVars: []string{"GRAPH_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -121,7 +121,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9120"), + Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9120"), Usage: "Address to bind http server", EnvVars: []string{"GRAPH_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, @@ -149,6 +149,14 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Spaces.WebDavBase, }, + &cli.StringFlag{ + Name: "default-space-quota", + Value: flags.OverrideDefaultString(cfg.Spaces.DefaultQuota, "1000000000"), + Usage: "default quota used for all spaces if no custom quota was given", + EnvVars: []string{"GRAPH_SPACES_DEFAULT_QUOTA"}, + Destination: &cfg.Spaces.DefaultQuota, + }, + &cli.StringFlag{ Name: "jwt-secret", Value: flags.OverrideDefaultString(cfg.TokenManager.JWTSecret, "Pive-Fumkiu4"), diff --git a/graph/pkg/service/v0/drives.go b/graph/pkg/service/v0/drives.go index 0ed8202bc2..d401d506cb 100644 --- a/graph/pkg/service/v0/drives.go +++ b/graph/pkg/service/v0/drives.go @@ -8,6 +8,7 @@ import ( "net/http" "net/url" "path" + "strconv" "strings" "time" @@ -56,6 +57,7 @@ func (g Graph) GetDrives(w http.ResponseWriter, r *http.Request) { } g.logger.Error().Err(err).Msg("error sending list storage spaces grpc request") errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, res.Status.Message) + return } wdu, err := url.Parse(g.config.Spaces.WebDavBase) @@ -179,26 +181,18 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) { driveType = *drive.DriveType } switch driveType { - case "": + case "", "project": driveType = "project" - case "share": - errorcode.GeneralException.Render(w, r, http.StatusBadRequest, "drives of type share cannot be created via this api") - } - - var quota uint64 - if drive.Quota != nil && drive.Quota.Total != nil { - quota = uint64(*drive.Quota.Total) - } else { - quota = 65536 // set default quota if no value was sent. + default: + errorcode.GeneralException.Render(w, r, http.StatusBadRequest, fmt.Sprintf("drives of type %s cannot be created via this api", driveType)) + return } csr := provider.CreateStorageSpaceRequest{ Owner: us, Type: driveType, Name: spaceName, - Quota: &provider.Quota{ - QuotaMaxBytes: quota, - }, + Quota: getQuota(drive.Quota, g.config.Spaces.DefaultQuota), } resp, err := client.CreateStorageSpace(r.Context(), &csr) @@ -209,6 +203,7 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) { if resp.GetStatus().GetCode() != v1beta11.Code_CODE_OK { errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, "") + return } wdu, err := url.Parse(g.config.Spaces.WebDavBase) @@ -239,7 +234,8 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) { req, err := godata.ParseRequest(sanitized, r.URL.Query(), true) if err != nil { - panic(err) + errorcode.GeneralException.Render(w, r, http.StatusBadRequest, err.Error()) + return } if req.FirstSegment.Identifier.Get() == "" { @@ -257,6 +253,7 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) { if len(identifierParts) != 2 { errorcode.GeneralException.Render(w, r, http.StatusBadRequest, fmt.Sprintf("invalid resource id: %v", req.FirstSegment.Identifier.Get())) w.WriteHeader(http.StatusInternalServerError) + return } storageID, opaqueID := identifierParts[0], identifierParts[1] @@ -288,10 +285,12 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) { resp, err := client.UpdateStorageSpace(r.Context(), updateSpaceRequest) if err != nil { w.WriteHeader(http.StatusInternalServerError) + return } if resp.GetStatus().GetCode() != v1beta11.Code_CODE_OK { errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, "") + return } w.WriteHeader(http.StatusNoContent) diff --git a/idp/pkg/flagset/flagset.go b/idp/pkg/flagset/flagset.go index 39eb26d648..649e11a996 100644 --- a/idp/pkg/flagset/flagset.go +++ b/idp/pkg/flagset/flagset.go @@ -38,7 +38,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9134"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9134"), Usage: "Address to debug endpoint", EnvVars: []string{"IDP_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -98,7 +98,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9134"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9134"), Usage: "Address to bind debug server", EnvVars: []string{"IDP_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -124,7 +124,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9130"), + Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9130"), Usage: "Address to bind http server", EnvVars: []string{"IDP_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, diff --git a/ocis/pkg/flagset/flagset.go b/ocis/pkg/flagset/flagset.go index 9b296758a1..e97fea4495 100644 --- a/ocis/pkg/flagset/flagset.go +++ b/ocis/pkg/flagset/flagset.go @@ -104,7 +104,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: "0.0.0.0:9010", + Value: "127.0.0.1:9010", Usage: "Address to debug endpoint", EnvVars: []string{"OCIS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -117,7 +117,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: "0.0.0.0:9010", + Value: "127.0.0.1:9010", Usage: "Address to bind debug server", EnvVars: []string{"OCIS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -143,7 +143,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: "0.0.0.0:9000", + Value: "127.0.0.1:9000", Usage: "Address to bind http server", EnvVars: []string{"OCIS_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, @@ -157,7 +157,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "grpc-addr", - Value: "0.0.0.0:9001", + Value: "127.0.0.1:9001", Usage: "Address to bind grpc server", EnvVars: []string{"OCIS_GRPC_ADDR"}, Destination: &cfg.GRPC.Addr, diff --git a/ocis/pkg/runtime/cmd/root.go b/ocis/pkg/runtime/cmd/root.go deleted file mode 100644 index 22127444ec..0000000000 --- a/ocis/pkg/runtime/cmd/root.go +++ /dev/null @@ -1,34 +0,0 @@ -package cmd - -import ( - "github.com/owncloud/ocis/ocis/pkg/runtime/config" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -var ( - rootCmd = &cobra.Command{ - Use: "pman", - Short: "RPC Process Manager", - } -) - -// RootCmd returns a configured root command. -func RootCmd(cfg *config.Config) *cobra.Command { - rootCmd.PersistentFlags().StringVarP(&cfg.Hostname, "hostname", "n", "localhost", "host with a running oCIS runtime.") - rootCmd.PersistentFlags().StringVarP(&cfg.Port, "port", "p", "10666", "port to send messages to the rpc oCIS runtime.") - rootCmd.PersistentFlags().BoolVarP(&cfg.KeepAlive, "keep-alive", "k", false, "restart supervised processes that abruptly die.") - - if err := viper.BindPFlag("hostname", rootCmd.PersistentFlags().Lookup("hostname")); err != nil { - panic(err) - } - if err := viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port")); err != nil { - panic(err) - } - - rootCmd.AddCommand(List(cfg)) - rootCmd.AddCommand(Run(cfg)) - rootCmd.AddCommand(Kill(cfg)) - - return rootCmd -} diff --git a/ocs/pkg/flagset/flagset.go b/ocs/pkg/flagset/flagset.go index 22aac81de8..9420df3161 100644 --- a/ocs/pkg/flagset/flagset.go +++ b/ocs/pkg/flagset/flagset.go @@ -11,7 +11,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9114"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9114"), Usage: "Address to debug endpoint", EnvVars: []string{"OCS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -90,7 +90,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9114"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9114"), Usage: "Address to bind debug server", EnvVars: []string{"OCS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -116,7 +116,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9110"), + Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9110"), Usage: "Address to bind http server", EnvVars: []string{"OCS_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, diff --git a/proxy/pkg/flagset/flagset.go b/proxy/pkg/flagset/flagset.go index b5f0abb514..b330760bd1 100644 --- a/proxy/pkg/flagset/flagset.go +++ b/proxy/pkg/flagset/flagset.go @@ -42,7 +42,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9109"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9109"), Usage: "Address to debug endpoint", EnvVars: []string{"PROXY_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -102,7 +102,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9205"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9205"), Usage: "Address to bind debug server", EnvVars: []string{"PROXY_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, diff --git a/settings/pkg/flagset/flagset.go b/settings/pkg/flagset/flagset.go index 185c5c0a51..39ac38b94e 100644 --- a/settings/pkg/flagset/flagset.go +++ b/settings/pkg/flagset/flagset.go @@ -35,7 +35,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9194"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9194"), Usage: "Address to debug endpoint", EnvVars: []string{"SETTINGS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -89,7 +89,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9194"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9194"), Usage: "Address to bind debug server", EnvVars: []string{"SETTINGS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -115,7 +115,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9190"), + Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9190"), Usage: "Address to bind http server", EnvVars: []string{"SETTINGS_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, @@ -143,7 +143,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "grpc-addr", - Value: flags.OverrideDefaultString(cfg.GRPC.Addr, "0.0.0.0:9191"), + Value: flags.OverrideDefaultString(cfg.GRPC.Addr, "127.0.0.1:9191"), Usage: "Address to bind grpc server", EnvVars: []string{"SETTINGS_GRPC_ADDR"}, Destination: &cfg.GRPC.Addr, diff --git a/storage/pkg/command/groups.go b/storage/pkg/command/groups.go index 152e85e846..c9c35394f4 100644 --- a/storage/pkg/command/groups.go +++ b/storage/pkg/command/groups.go @@ -157,22 +157,22 @@ func groupsConfigFromStruct(c *cli.Context, cfg *config.Config) map[string]inter } } -// GroupProvider allows for the storage-groupprovider command to be embedded and supervised by a suture supervisor tree. -type GroupProvider struct { +// GroupSutureService allows for the storage-groupprovider command to be embedded and supervised by a suture supervisor tree. +type GroupSutureService struct { cfg *config.Config } -// NewGroupProvider creates a new storage.GroupProvider +// NewGroupProviderSutureService creates a new storage.GroupProvider func NewGroupProvider(cfg *ociscfg.Config) suture.Service { if cfg.Mode == 0 { cfg.Storage.Reva.Groups.Supervised = true } - return GroupProvider{ + return GroupSutureService{ cfg: cfg.Storage, } } -func (s GroupProvider) Serve(ctx context.Context) error { +func (s GroupSutureService) Serve(ctx context.Context) error { s.cfg.Reva.Groups.Context = ctx f := &flag.FlagSet{} cmdFlags := Groups(s.cfg).Flags diff --git a/storage/pkg/command/storagemetadata.go b/storage/pkg/command/storagemetadata.go index 66b5198856..dde9a6aa5c 100644 --- a/storage/pkg/command/storagemetadata.go +++ b/storage/pkg/command/storagemetadata.go @@ -159,7 +159,7 @@ func storageMetadataFromStruct(c *cli.Context, cfg *config.Config) map[string]in } // SutureService allows for the storage-metadata command to be embedded and supervised by a suture supervisor tree. -type SutureService struct { +type MetadataSutureService struct { cfg *config.Config } @@ -168,12 +168,12 @@ func NewStorageMetadata(cfg *ociscfg.Config) suture.Service { if cfg.Mode == 0 { cfg.Storage.Reva.StorageMetadata.Supervised = true } - return SutureService{ + return MetadataSutureService{ cfg: cfg.Storage, } } -func (s SutureService) Serve(ctx context.Context) error { +func (s MetadataSutureService) Serve(ctx context.Context) error { s.cfg.Reva.StorageMetadata.Context = ctx f := &flag.FlagSet{} cmdFlags := StorageMetadata(s.cfg).Flags diff --git a/storage/pkg/command/users.go b/storage/pkg/command/users.go index 1acb353b86..d01757ae81 100644 --- a/storage/pkg/command/users.go +++ b/storage/pkg/command/users.go @@ -178,22 +178,22 @@ func usersConfigFromStruct(c *cli.Context, cfg *config.Config) map[string]interf return rcfg } -// UserProvider allows for the storage-userprovider command to be embedded and supervised by a suture supervisor tree. -type UserProvider struct { +// UserProviderSutureService allows for the storage-userprovider command to be embedded and supervised by a suture supervisor tree. +type UserProviderSutureService struct { cfg *config.Config } -// NewUserProvider creates a new storage.UserProvider +// NewUserProviderSutureService creates a new storage.UserProvider func NewUserProvider(cfg *ociscfg.Config) suture.Service { if cfg.Mode == 0 { cfg.Storage.Reva.Users.Supervised = true } - return UserProvider{ + return UserProviderSutureService{ cfg: cfg.Storage, } } -func (s UserProvider) Serve(ctx context.Context) error { +func (s UserProviderSutureService) Serve(ctx context.Context) error { s.cfg.Reva.Users.Context = ctx f := &flag.FlagSet{} cmdFlags := Users(s.cfg).Flags diff --git a/storage/pkg/flagset/appprovider.go b/storage/pkg/flagset/appprovider.go index a8c11e9592..781705586d 100644 --- a/storage/pkg/flagset/appprovider.go +++ b/storage/pkg/flagset/appprovider.go @@ -13,7 +13,7 @@ func AppProviderWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.DebugAddr, "0.0.0.0:9165"), + Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.DebugAddr, "127.0.0.1:9165"), Usage: "Address to bind debug server", EnvVars: []string{"APP_PROVIDER_BASIC_DEBUG_ADDR"}, Destination: &cfg.Reva.AppProvider.DebugAddr, @@ -34,7 +34,7 @@ func AppProviderWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.GRPCAddr, "0.0.0.0:9164"), + Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.GRPCAddr, "127.0.0.1:9164"), Usage: "Address to bind storage service", EnvVars: []string{"APP_PROVIDER_BASIC_GRPC_ADDR"}, Destination: &cfg.Reva.AppProvider.GRPCAddr, diff --git a/storage/pkg/flagset/authbasic.go b/storage/pkg/flagset/authbasic.go index 98d83497cd..bbfcae1ee3 100644 --- a/storage/pkg/flagset/authbasic.go +++ b/storage/pkg/flagset/authbasic.go @@ -13,7 +13,7 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.AuthBasic.DebugAddr, "0.0.0.0:9147"), + Value: flags.OverrideDefaultString(cfg.Reva.AuthBasic.DebugAddr, "127.0.0.1:9147"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_AUTH_BASIC_DEBUG_ADDR"}, Destination: &cfg.Reva.AuthBasic.DebugAddr, @@ -49,7 +49,7 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.AuthBasic.GRPCAddr, "0.0.0.0:9146"), + Value: flags.OverrideDefaultString(cfg.Reva.AuthBasic.GRPCAddr, "127.0.0.1:9146"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_AUTH_BASIC_GRPC_ADDR"}, Destination: &cfg.Reva.AuthBasic.GRPCAddr, diff --git a/storage/pkg/flagset/authbearer.go b/storage/pkg/flagset/authbearer.go index f3a61c9e01..b67b661e51 100644 --- a/storage/pkg/flagset/authbearer.go +++ b/storage/pkg/flagset/authbearer.go @@ -13,7 +13,7 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.AuthBearer.DebugAddr, "0.0.0.0:9149"), + Value: flags.OverrideDefaultString(cfg.Reva.AuthBearer.DebugAddr, "127.0.0.1:9149"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_AUTH_BEARER_DEBUG_ADDR"}, Destination: &cfg.Reva.AuthBearer.DebugAddr, @@ -95,7 +95,7 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.AuthBearer.GRPCAddr, "0.0.0.0:9148"), + Value: flags.OverrideDefaultString(cfg.Reva.AuthBearer.GRPCAddr, "127.0.0.1:9148"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_AUTH_BEARER_GRPC_ADDR"}, Destination: &cfg.Reva.AuthBearer.GRPCAddr, diff --git a/storage/pkg/flagset/frontend.go b/storage/pkg/flagset/frontend.go index 22cf245624..2e84707d19 100644 --- a/storage/pkg/flagset/frontend.go +++ b/storage/pkg/flagset/frontend.go @@ -14,7 +14,7 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.Frontend.DebugAddr, "0.0.0.0:9141"), + Value: flags.OverrideDefaultString(cfg.Reva.Frontend.DebugAddr, "127.0.0.1:9141"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_FRONTEND_DEBUG_ADDR"}, Destination: &cfg.Reva.Frontend.DebugAddr, @@ -88,7 +88,7 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.Frontend.HTTPAddr, "0.0.0.0:9140"), + Value: flags.OverrideDefaultString(cfg.Reva.Frontend.HTTPAddr, "127.0.0.1:9140"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_FRONTEND_HTTP_ADDR"}, Destination: &cfg.Reva.Frontend.HTTPAddr, diff --git a/storage/pkg/flagset/gateway.go b/storage/pkg/flagset/gateway.go index d5ec742685..940368532c 100644 --- a/storage/pkg/flagset/gateway.go +++ b/storage/pkg/flagset/gateway.go @@ -13,7 +13,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.Gateway.DebugAddr, "0.0.0.0:9143"), + Value: flags.OverrideDefaultString(cfg.Reva.Gateway.DebugAddr, "127.0.0.1:9143"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_GATEWAY_DEBUG_ADDR"}, Destination: &cfg.Reva.Gateway.DebugAddr, @@ -48,7 +48,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.Gateway.GRPCAddr, "0.0.0.0:9142"), + Value: flags.OverrideDefaultString(cfg.Reva.Gateway.GRPCAddr, "127.0.0.1:9142"), Usage: "Address to bind REVA service", EnvVars: []string{"STORAGE_GATEWAY_GRPC_ADDR"}, Destination: &cfg.Reva.Gateway.GRPCAddr, diff --git a/storage/pkg/flagset/groups.go b/storage/pkg/flagset/groups.go index b58905d764..50dab10901 100644 --- a/storage/pkg/flagset/groups.go +++ b/storage/pkg/flagset/groups.go @@ -13,7 +13,7 @@ func GroupsWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.Groups.DebugAddr, "0.0.0.0:9161"), + Value: flags.OverrideDefaultString(cfg.Reva.Groups.DebugAddr, "127.0.0.1:9161"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_GROUPPROVIDER_DEBUG_ADDR"}, Destination: &cfg.Reva.Groups.DebugAddr, @@ -42,7 +42,7 @@ func GroupsWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.Groups.GRPCAddr, "0.0.0.0:9160"), + Value: flags.OverrideDefaultString(cfg.Reva.Groups.GRPCAddr, "127.0.0.1:9160"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_GROUPPROVIDER_ADDR"}, Destination: &cfg.Reva.Groups.GRPCAddr, diff --git a/storage/pkg/flagset/health.go b/storage/pkg/flagset/health.go index 60d673c07b..3333622e52 100644 --- a/storage/pkg/flagset/health.go +++ b/storage/pkg/flagset/health.go @@ -11,7 +11,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9109"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9109"), Usage: "Address to debug endpoint", EnvVars: []string{"STORAGE_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, diff --git a/storage/pkg/flagset/sharing.go b/storage/pkg/flagset/sharing.go index 17105d7cc8..c3dde8871c 100644 --- a/storage/pkg/flagset/sharing.go +++ b/storage/pkg/flagset/sharing.go @@ -13,7 +13,7 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.Sharing.DebugAddr, "0.0.0.0:9151"), + Value: flags.OverrideDefaultString(cfg.Reva.Sharing.DebugAddr, "127.0.0.1:9151"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_SHARING_DEBUG_ADDR"}, Destination: &cfg.Reva.Sharing.DebugAddr, @@ -42,7 +42,7 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.Sharing.GRPCAddr, "0.0.0.0:9150"), + Value: flags.OverrideDefaultString(cfg.Reva.Sharing.GRPCAddr, "127.0.0.1:9150"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_SHARING_GRPC_ADDR"}, Destination: &cfg.Reva.Sharing.GRPCAddr, diff --git a/storage/pkg/flagset/storagehome.go b/storage/pkg/flagset/storagehome.go index a23c942340..2efb5d1846 100644 --- a/storage/pkg/flagset/storagehome.go +++ b/storage/pkg/flagset/storagehome.go @@ -14,7 +14,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.DebugAddr, "0.0.0.0:9156"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.DebugAddr, "127.0.0.1:9156"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_HOME_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageHome.DebugAddr, @@ -33,7 +33,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "grpc-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.GRPCAddr, "0.0.0.0:9154"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.GRPCAddr, "127.0.0.1:9154"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_HOME_GRPC_ADDR"}, Destination: &cfg.Reva.StorageHome.GRPCAddr, @@ -47,7 +47,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.HTTPAddr, "0.0.0.0:9155"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageHome.HTTPAddr, "127.0.0.1:9155"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_HOME_HTTP_ADDR"}, Destination: &cfg.Reva.StorageHome.HTTPAddr, diff --git a/storage/pkg/flagset/storagemetadata.go b/storage/pkg/flagset/storagemetadata.go index ce5961c18c..efe2db52ac 100644 --- a/storage/pkg/flagset/storagemetadata.go +++ b/storage/pkg/flagset/storagemetadata.go @@ -12,7 +12,7 @@ func StorageMetadata(cfg *config.Config) []cli.Flag { f := []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.DebugAddr, "0.0.0.0:9217"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.DebugAddr, "127.0.0.1:9217"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_METADATA_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageMetadata.DebugAddr, @@ -26,7 +26,7 @@ func StorageMetadata(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "grpc-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.GRPCAddr, "0.0.0.0:9215"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.GRPCAddr, "127.0.0.1:9215"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_METADATA_GRPC_PROVIDER_ADDR"}, Destination: &cfg.Reva.StorageMetadata.GRPCAddr, @@ -47,7 +47,7 @@ func StorageMetadata(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.HTTPAddr, "0.0.0.0:9216"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageMetadata.HTTPAddr, "127.0.0.1:9216"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_METADATA_HTTP_ADDR"}, Destination: &cfg.Reva.StorageMetadata.HTTPAddr, diff --git a/storage/pkg/flagset/storagepubliclink.go b/storage/pkg/flagset/storagepubliclink.go index 3e05ffa7c1..5d884c79d7 100644 --- a/storage/pkg/flagset/storagepubliclink.go +++ b/storage/pkg/flagset/storagepubliclink.go @@ -12,7 +12,7 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.DebugAddr, "0.0.0.0:9179"), + Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.DebugAddr, "127.0.0.1:9179"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_PUBLIC_LINK_DEBUG_ADDR"}, Destination: &cfg.Reva.StoragePublicLink.DebugAddr, @@ -27,7 +27,7 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.GRPCAddr, "0.0.0.0:9178"), + Value: flags.OverrideDefaultString(cfg.Reva.StoragePublicLink.GRPCAddr, "127.0.0.1:9178"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_PUBLIC_LINK_GRPC_ADDR"}, Destination: &cfg.Reva.StoragePublicLink.GRPCAddr, diff --git a/storage/pkg/flagset/storageusers.go b/storage/pkg/flagset/storageusers.go index ef8b4e0fc3..b61d23f51b 100644 --- a/storage/pkg/flagset/storageusers.go +++ b/storage/pkg/flagset/storageusers.go @@ -14,7 +14,7 @@ func StorageUsersWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.DebugAddr, "0.0.0.0:9159"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.DebugAddr, "127.0.0.1:9159"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_USERS_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageUsers.DebugAddr, @@ -33,7 +33,7 @@ func StorageUsersWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "grpc-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.GRPCAddr, "0.0.0.0:9157"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.GRPCAddr, "127.0.0.1:9157"), Usage: "GRPC Address to bind users storage", EnvVars: []string{"STORAGE_USERS_GRPC_ADDR"}, Destination: &cfg.Reva.StorageUsers.GRPCAddr, @@ -47,7 +47,7 @@ func StorageUsersWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.HTTPAddr, "0.0.0.0:9158"), + Value: flags.OverrideDefaultString(cfg.Reva.StorageUsers.HTTPAddr, "127.0.0.1:9158"), Usage: "HTTP Address to bind users storage", EnvVars: []string{"STORAGE_USERS_HTTP_ADDR"}, Destination: &cfg.Reva.StorageUsers.HTTPAddr, diff --git a/storage/pkg/flagset/users.go b/storage/pkg/flagset/users.go index a050c81df3..182882ecd3 100644 --- a/storage/pkg/flagset/users.go +++ b/storage/pkg/flagset/users.go @@ -13,7 +13,7 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag { // debug ports are the odd ports &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Reva.Users.DebugAddr, "0.0.0.0:9145"), + Value: flags.OverrideDefaultString(cfg.Reva.Users.DebugAddr, "127.0.0.1:9145"), Usage: "Address to bind debug server", EnvVars: []string{"STORAGE_USERPROVIDER_DEBUG_ADDR"}, Destination: &cfg.Reva.Users.DebugAddr, @@ -42,7 +42,7 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: flags.OverrideDefaultString(cfg.Reva.Users.GRPCAddr, "0.0.0.0:9144"), + Value: flags.OverrideDefaultString(cfg.Reva.Users.GRPCAddr, "127.0.0.1:9144"), Usage: "Address to bind storage service", EnvVars: []string{"STORAGE_USERPROVIDER_ADDR"}, Destination: &cfg.Reva.Users.GRPCAddr, diff --git a/store/pkg/flagset/flagset.go b/store/pkg/flagset/flagset.go index 330121fd3f..392c79f6f6 100644 --- a/store/pkg/flagset/flagset.go +++ b/store/pkg/flagset/flagset.go @@ -42,7 +42,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9460"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9464"), Usage: "Address to debug endpoint", EnvVars: []string{"STORE_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -95,7 +95,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9460"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9464"), Usage: "Address to bind debug server", EnvVars: []string{"STORE_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -126,6 +126,13 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"STORE_GRPC_NAMESPACE"}, Destination: &cfg.Service.Namespace, }, + &cli.StringFlag{ + Name: "grpc-addr", + Value: flags.OverrideDefaultString(cfg.GRPC.Addr, "127.0.0.1:9460"), + Usage: "Address to bind grpc server", + EnvVars: []string{"STORE_GRPC_ADDR"}, + Destination: &cfg.GRPC.Addr, + }, &cli.StringFlag{ Name: "name", Value: flags.OverrideDefaultString(cfg.Service.Name, "store"), diff --git a/thumbnails/pkg/flagset/flagset.go b/thumbnails/pkg/flagset/flagset.go index 0658eaa9a1..16dd5a9d98 100644 --- a/thumbnails/pkg/flagset/flagset.go +++ b/thumbnails/pkg/flagset/flagset.go @@ -12,7 +12,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9189"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9189"), Usage: "Address to debug endpoint", EnvVars: []string{"THUMBNAILS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -90,7 +90,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9189"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9189"), Usage: "Address to bind debug server", EnvVars: []string{"THUMBNAILS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -123,7 +123,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "grpc-addr", - Value: flags.OverrideDefaultString(cfg.Server.Address, "0.0.0.0:9185"), + Value: flags.OverrideDefaultString(cfg.Server.Address, "127.0.0.1:9185"), Usage: "Address to bind grpc server", EnvVars: []string{"THUMBNAILS_GRPC_ADDR"}, Destination: &cfg.Server.Address, diff --git a/web/pkg/flagset/flagset.go b/web/pkg/flagset/flagset.go index b72ccd9546..f75ce92138 100644 --- a/web/pkg/flagset/flagset.go +++ b/web/pkg/flagset/flagset.go @@ -35,7 +35,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9104"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9104"), Usage: "Address to debug endpoint", EnvVars: []string{"WEB_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -95,7 +95,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9104"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9104"), Usage: "Address to bind debug server", EnvVars: []string{"WEB_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -121,7 +121,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9100"), + Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9100"), Usage: "Address to bind http server", EnvVars: []string{"WEB_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, diff --git a/webdav/pkg/flagset/flagset.go b/webdav/pkg/flagset/flagset.go index 706e78669a..2441d57bd3 100644 --- a/webdav/pkg/flagset/flagset.go +++ b/webdav/pkg/flagset/flagset.go @@ -11,7 +11,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9119"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9119"), Usage: "Address to debug endpoint", EnvVars: []string{"WEBDAV_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -89,7 +89,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: flags.OverrideDefaultString(cfg.Debug.Addr, "0.0.0.0:9119"), + Value: flags.OverrideDefaultString(cfg.Debug.Addr, "127.0.0.1:9119"), Usage: "Address to bind debug server", EnvVars: []string{"WEBDAV_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -115,7 +115,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9115"), + Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "127.0.0.1:9115"), Usage: "Address to bind http server", EnvVars: []string{"WEBDAV_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr,