mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-08 05:09:46 -06:00
Merge branch 'master' into StoreSettingsViaMetadata
This commit is contained in:
@@ -3,5 +3,5 @@ CORE_COMMITID=828075109e7d9b5e55db8b50d311d9a76b89d7e1
|
||||
CORE_BRANCH=master
|
||||
|
||||
# The test runner source for UI tests
|
||||
WEB_COMMITID=94532551d3d89d5d3eeee016e2f0aae9fe919fce
|
||||
WEB_COMMITID=1318eaad950cbeaaf6e30bcbfe998515a932be23
|
||||
WEB_BRANCH=master
|
||||
|
||||
@@ -1260,7 +1260,7 @@ def docs(ctx):
|
||||
{
|
||||
"name": "docs-generate",
|
||||
"image": OC_CI_GOLANG,
|
||||
"commands": ["make -C %s docs-generate" % (module) for module in config["modules"]],
|
||||
"commands": ["make -C docs docs-generate"],
|
||||
},
|
||||
{
|
||||
"name": "prepare",
|
||||
|
||||
@@ -25,45 +25,45 @@ type Config struct {
|
||||
Repo Repo `ocisConfig:"repo"`
|
||||
Index Index `ocisConfig:"index"`
|
||||
ServiceUser ServiceUser `ocisConfig:"service_user"`
|
||||
HashDifficulty int `ocisConfig:"hash_difficulty" env:"ACCOUNTS_HASH_DIFFICULTY"`
|
||||
DemoUsersAndGroups bool `ocisConfig:"demo_users_and_groups" env:"ACCOUNTS_DEMO_USERS_AND_GROUPS"`
|
||||
HashDifficulty int `ocisConfig:"hash_difficulty" env:"ACCOUNTS_HASH_DIFFICULTY" desc:"The hash difficulty makes sure that validating a password takes at least a certain amount of time."`
|
||||
DemoUsersAndGroups bool `ocisConfig:"demo_users_and_groups" env:"ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"If this flag is set the service will setup the demo users and groups."`
|
||||
|
||||
Context context.Context
|
||||
}
|
||||
|
||||
// Asset defines the available asset configuration.
|
||||
type Asset struct {
|
||||
Path string `ocisConfig:"path" env:"ACCOUNTS_ASSET_PATH"`
|
||||
Path string `ocisConfig:"path" env:"ACCOUNTS_ASSET_PATH" desc:"The path to the ui assets."`
|
||||
}
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET"`
|
||||
JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET" desc:"The secret to mint jwt tokens."`
|
||||
}
|
||||
|
||||
// Repo defines which storage implementation is to be used.
|
||||
type Repo struct {
|
||||
Backend string `ocisConfig:"backend" env:"ACCOUNTS_STORAGE_BACKEND"`
|
||||
Backend string `ocisConfig:"backend" env:"ACCOUNTS_STORAGE_BACKEND" desc:"Defines which storage implementation is to be used"`
|
||||
Disk Disk `ocisConfig:"disk"`
|
||||
CS3 CS3 `ocisConfig:"cs3"`
|
||||
}
|
||||
|
||||
// Disk is the local disk implementation of the storage.
|
||||
type Disk struct {
|
||||
Path string `ocisConfig:"path" env:"ACCOUNTS_STORAGE_DISK_PATH"`
|
||||
Path string `ocisConfig:"path" env:"ACCOUNTS_STORAGE_DISK_PATH" desc:"The path where the accounts data is stored."`
|
||||
}
|
||||
|
||||
// CS3 is the cs3 implementation of the storage.
|
||||
type CS3 struct {
|
||||
ProviderAddr string `ocisConfig:"provider_addr" env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR"`
|
||||
ProviderAddr string `ocisConfig:"provider_addr" env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR" desc:"The address to the storage provider."`
|
||||
}
|
||||
|
||||
// ServiceUser defines the user required for EOS.
|
||||
type ServiceUser struct {
|
||||
UUID string `ocisConfig:"uuid" env:"ACCOUNTS_SERVICE_USER_UUID"`
|
||||
Username string `ocisConfig:"username" env:"ACCOUNTS_SERVICE_USER_USERNAME"`
|
||||
UID int64 `ocisConfig:"uid" env:"ACCOUNTS_SERVICE_USER_UID"`
|
||||
GID int64 `ocisConfig:"gid" env:"ACCOUNTS_SERVICE_USER_GID"`
|
||||
UUID string `ocisConfig:"uuid" env:"ACCOUNTS_SERVICE_USER_UUID" desc:"The id of the accounts service user."`
|
||||
Username string `ocisConfig:"username" env:"ACCOUNTS_SERVICE_USER_USERNAME" desc:"The username of the accounts service user."`
|
||||
UID int64 `ocisConfig:"uid" env:"ACCOUNTS_SERVICE_USER_UID" desc:"The uid of the accounts service user."`
|
||||
GID int64 `ocisConfig:"gid" env:"ACCOUNTS_SERVICE_USER_GID" desc:"The gid of the accounts service user."`
|
||||
}
|
||||
|
||||
// Index defines config for indexes.
|
||||
@@ -74,12 +74,12 @@ type Index struct {
|
||||
|
||||
// GIDBound defines a lower and upper bound.
|
||||
type GIDBound struct {
|
||||
Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_GID_INDEX_LOWER_BOUND"`
|
||||
Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_GID_INDEX_UPPER_BOUND"`
|
||||
Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_GID_INDEX_LOWER_BOUND" desc:"The lowest possible gid value for the indexer."`
|
||||
Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_GID_INDEX_UPPER_BOUND" desc:"The highest possible gid value for the indexer."`
|
||||
}
|
||||
|
||||
// UIDBound defines a lower and upper bound.
|
||||
type UIDBound struct {
|
||||
Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_UID_INDEX_LOWER_BOUND"`
|
||||
Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_UID_INDEX_UPPER_BOUND"`
|
||||
Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_UID_INDEX_LOWER_BOUND" desc:"The lowest possible uid value for the indexer."`
|
||||
Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_UID_INDEX_UPPER_BOUND" desc:"The highest possible uid value for the indexer."`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package config
|
||||
|
||||
// GRPC defines the available grpc configuration.
|
||||
type GRPC struct {
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_GRPC_ADDR"`
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_GRPC_ADDR" desc:"The address of the grpc service."`
|
||||
Namespace string
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_HTTP_ADDR"`
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_HTTP_ADDR" desc:"The address of the http service."`
|
||||
Namespace string
|
||||
Root string `ocisConfig:"root" env:"ACCOUNTS_HTTP_ROOT"`
|
||||
CacheTTL int `ocisConfig:"cache_ttl" env:"ACCOUNTS_CACHE_TTL"`
|
||||
CORS CORS `ocisConfig:"cors"`
|
||||
Root string `ocisConfig:"root" env:"ACCOUNTS_HTTP_ROOT" desc:"The root path of the http service."`
|
||||
CacheTTL int `ocisConfig:"cache_ttl" env:"ACCOUNTS_CACHE_TTL" desc:"The cache time for the static assets."`
|
||||
CORS CORS
|
||||
}
|
||||
|
||||
// CORS defines the available cors configuration.
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Log defines the available log configuration.
|
||||
type Log struct {
|
||||
Level string `mapstructure:"level" env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL"`
|
||||
Pretty bool `mapstructure:"pretty" env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY"`
|
||||
Color bool `mapstructure:"color" env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR"`
|
||||
File string `mapstructure:"file" env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE"`
|
||||
Level string `ocisConfig:"level" env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL" desc:"The log level."`
|
||||
Pretty bool `ocisConfig:"pretty" env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY" desc:"Activates pretty log output."`
|
||||
Color bool `ocisConfig:"color" env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR" desc:"Activates colorized log output."`
|
||||
File string `ocisConfig:"file" env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE" desc:"The target log file."`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED"`
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED" desc:"Activates tracing."`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;ACCOUNTS_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -746,7 +746,7 @@ func validateAccountEmail(serviceID string, a *accountsmsg.Account) error {
|
||||
// We want to allow email addresses as usernames so they show up when using them in ACLs on storages that allow integration with our glauth LDAP service
|
||||
// so we are adding a few restrictions from https://stackoverflow.com/questions/6949667/what-are-the-real-rules-for-linux-usernames-on-centos-6-and-rhel-6
|
||||
// names should not start with numbers
|
||||
var usernameRegex = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]*(@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)*$")
|
||||
var usernameRegex = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]*(@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)*$")
|
||||
|
||||
func isValidUsername(e string) bool {
|
||||
if len(e) < 1 && len(e) > 254 {
|
||||
@@ -756,7 +756,7 @@ func isValidUsername(e string) bool {
|
||||
}
|
||||
|
||||
// regex from https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html#valid-e-mail-address
|
||||
var emailRegex = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
|
||||
var emailRegex = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
|
||||
|
||||
func isValidEmail(e string) bool {
|
||||
if len(e) < 3 && len(e) > 254 {
|
||||
|
||||
@@ -2,7 +2,7 @@ const util = require('util')
|
||||
|
||||
module.exports = {
|
||||
url: function () {
|
||||
return this.api.launchUrl + '/#/accounts'
|
||||
return this.api.launchUrl + '/accounts'
|
||||
},
|
||||
|
||||
commands: {
|
||||
|
||||
@@ -8,6 +8,7 @@ help:
|
||||
|
||||
.PHONY: docs-generate
|
||||
docs-generate: ## run docs-generate for all oCIS extensions
|
||||
@pushd helpers && go run configenvextractor.go; popd
|
||||
@$(MAKE) --no-print-directory -C ../ docs-generate
|
||||
|
||||
.PHONY: docs-init
|
||||
|
||||
1
docs/extensions/_includes/.gitignore
vendored
Normal file
1
docs/extensions/_includes/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*_configvars.md
|
||||
3
docs/extensions/_includes/_index.md
Normal file
3
docs/extensions/_includes/_index.md
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
GeekdocHidden: true
|
||||
---
|
||||
1
docs/extensions/accounts/.gitignore
vendored
1
docs/extensions/accounts/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/accounts/configuration.md
Normal file
12
docs/extensions/accounts/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/accounts
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/accounts_configvars.md" >}}
|
||||
1
docs/extensions/glauth/.gitignore
vendored
1
docs/extensions/glauth/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/glauth/configuration.md
Normal file
12
docs/extensions/glauth/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/glauth
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/glauth_configvars.md" >}}
|
||||
1
docs/extensions/graph-explorer/.gitignore
vendored
1
docs/extensions/graph-explorer/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
configuration.md
|
||||
|
||||
12
docs/extensions/graph-explorer/configuration.md
Normal file
12
docs/extensions/graph-explorer/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/graph-explorer
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/graph-explorer_configvars.md" >}}
|
||||
1
docs/extensions/graph/.gitignore
vendored
1
docs/extensions/graph/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
configuration.md
|
||||
|
||||
12
docs/extensions/graph/configuration.md
Normal file
12
docs/extensions/graph/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/graph
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/graph_configvars.md" >}}
|
||||
16
docs/extensions/idm/_index.md
Normal file
16
docs/extensions/idm/_index.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: IDM
|
||||
date: 2022-03-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/idm
|
||||
geekdocFilePath: _index.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
{{< toc-tree >}}
|
||||
12
docs/extensions/idm/configuration.md
Normal file
12
docs/extensions/idm/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/idm
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/idm_configvars.md" >}}
|
||||
1
docs/extensions/idp/.gitignore
vendored
1
docs/extensions/idp/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/idp/configuration.md
Normal file
12
docs/extensions/idp/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/idp
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/idp_configvars.md" >}}
|
||||
16
docs/extensions/nats/_index.md
Normal file
16
docs/extensions/nats/_index.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: NATS
|
||||
date: 2022-03-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/nats
|
||||
geekdocFilePath: _index.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
{{< toc-tree >}}
|
||||
12
docs/extensions/nats/configuration.md
Normal file
12
docs/extensions/nats/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/nats
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/nats_configvars.md" >}}
|
||||
16
docs/extensions/notifications/_index.md
Normal file
16
docs/extensions/notifications/_index.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: Notifications
|
||||
date: 2022-03-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/notifications
|
||||
geekdocFilePath: _index.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
{{< toc-tree >}}
|
||||
12
docs/extensions/notifications/configuration.md
Normal file
12
docs/extensions/notifications/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/notifications
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/notifications_configvars.md" >}}
|
||||
1
docs/extensions/ocs/.gitignore
vendored
1
docs/extensions/ocs/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/ocs/configuration.md
Normal file
12
docs/extensions/ocs/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/ocs
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/ocs_configvars.md" >}}
|
||||
1
docs/extensions/proxy/.gitignore
vendored
1
docs/extensions/proxy/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/proxy/configuration.md
Normal file
12
docs/extensions/proxy/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/proxy
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/proxy_configvars.md" >}}
|
||||
1
docs/extensions/settings/.gitignore
vendored
1
docs/extensions/settings/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/settings/configuration.md
Normal file
12
docs/extensions/settings/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/settings
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/settings_configvars.md" >}}
|
||||
1
docs/extensions/storage/.gitignore
vendored
1
docs/extensions/storage/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
1
docs/extensions/store/.gitignore
vendored
1
docs/extensions/store/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/store/configuration.md
Normal file
12
docs/extensions/store/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/store
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/store_configvars.md" >}}
|
||||
1
docs/extensions/thumbnails/.gitignore
vendored
1
docs/extensions/thumbnails/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/thumbnails/configuration.md
Normal file
12
docs/extensions/thumbnails/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/thumbnails
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/thumbnails_configvars.md" >}}
|
||||
1
docs/extensions/web/.gitignore
vendored
1
docs/extensions/web/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/web/configuration.md
Normal file
12
docs/extensions/web/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/web
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/web_configvars.md" >}}
|
||||
1
docs/extensions/webdav/.gitignore
vendored
1
docs/extensions/webdav/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
configuration.md
|
||||
grpc.md
|
||||
|
||||
12
docs/extensions/webdav/configuration.md
Normal file
12
docs/extensions/webdav/configuration.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/webdav
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/webdav_configvars.md" >}}
|
||||
50
docs/helpers/configenvextractor.go
Normal file
50
docs/helpers/configenvextractor.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("Getting relevant packages")
|
||||
paths, err := filepath.Glob("../../*/pkg/config/defaultconfig.go")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
replacer := strings.NewReplacer(
|
||||
"../../", "github.com/owncloud/ocis/",
|
||||
"/defaultconfig.go", "",
|
||||
)
|
||||
for i := range paths {
|
||||
paths[i] = replacer.Replace(paths[i])
|
||||
}
|
||||
content, err := ioutil.ReadFile("extractor.go.tmpl")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println("Generating intermediate go code")
|
||||
tpl := template.Must(template.New("").Parse(string(content)))
|
||||
os.Mkdir("output", 0700)
|
||||
runner, err := os.Create("output/runner.go")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
tpl.Execute(runner, paths)
|
||||
fmt.Println("Running intermediate go code")
|
||||
os.Chdir("output")
|
||||
os.Setenv("OCIS_BASE_DATA_PATH", "~/.ocis")
|
||||
out, err := exec.Command("go", "run", "runner.go").Output()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println(string(out))
|
||||
fmt.Println("Cleaning up")
|
||||
os.Chdir("../")
|
||||
os.RemoveAll("output")
|
||||
}
|
||||
85
docs/helpers/extractor.go.tmpl
Normal file
85
docs/helpers/extractor.go.tmpl
Normal file
@@ -0,0 +1,85 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
{{- range $key, $value := .}}
|
||||
pkg{{$key}} "{{$value}}"
|
||||
{{- end}})
|
||||
|
||||
type ConfigField struct {
|
||||
Name string
|
||||
DefaultValue string
|
||||
Type string
|
||||
Description string
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("Generating documentation for environment variables:")
|
||||
content, err := ioutil.ReadFile("../../../docs/templates/CONFIGURATION.tmpl")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
replacer := strings.NewReplacer(
|
||||
"github.com/owncloud/ocis/", "",
|
||||
"/pkg/config", "",
|
||||
)
|
||||
var fields []ConfigField
|
||||
var targetFile *os.File
|
||||
tpl := template.Must(template.New("").Parse(string(content)))
|
||||
|
||||
m := map[string]interface{}{
|
||||
{{- range $key, $value := .}}
|
||||
"{{$value}}": *pkg{{$key}}.DefaultConfig(),
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
targetFolder := "../../../docs/extensions/_includes/"
|
||||
for pkg, conf := range m {
|
||||
fields = GetAnnotatedVariables(conf)
|
||||
if len(fields) > 0 {
|
||||
fmt.Printf("... %s\n", pkg)
|
||||
targetFile, err = os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "_configvars.md"))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create target file: %s", err)
|
||||
}
|
||||
defer targetFile.Close()
|
||||
if err := tpl.Execute(targetFile, fields); err != nil {
|
||||
log.Fatalf("Failed to execute template: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("done")
|
||||
}
|
||||
|
||||
func GetAnnotatedVariables(s interface{}) []ConfigField {
|
||||
t := reflect.TypeOf(s)
|
||||
v := reflect.ValueOf(s)
|
||||
|
||||
var fields []ConfigField
|
||||
for i := 0; i < t.NumField(); i++ {
|
||||
field := t.Field(i)
|
||||
value := v.Field(i)
|
||||
|
||||
switch value.Kind() {
|
||||
default:
|
||||
desc := field.Tag.Get("desc")
|
||||
env, ok := field.Tag.Lookup("env")
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
v := fmt.Sprintf("%v", value.Interface())
|
||||
fields = append(fields, ConfigField{Name: env, DefaultValue: v, Description: desc, Type: value.Type().Name()})
|
||||
case reflect.Struct:
|
||||
fields = append(fields, GetAnnotatedVariables(value.Interface())...)
|
||||
}
|
||||
}
|
||||
return fields
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
---
|
||||
title: "16. Storage for Files Metadata"
|
||||
weight: 16
|
||||
date: 2022-03-02T00:00:00+01:00
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/ocis/adr
|
||||
geekdocFilePath: 0016-files-metadata.md
|
||||
---
|
||||
|
||||
* Status: proposed
|
||||
|
||||
7
docs/templates/CONFIGURATION.tmpl
vendored
Normal file
7
docs/templates/CONFIGURATION.tmpl
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
## Environment Variables
|
||||
|
||||
| Name | Type | Default Value | Description |
|
||||
|------|------|---------------|-------------|
|
||||
{{- range .}}
|
||||
| {{.Name}} | {{.Type}} | {{.DefaultValue}} | {{.Description}}|
|
||||
{{- end }}
|
||||
2
go.mod
2
go.mod
@@ -22,7 +22,7 @@ require (
|
||||
github.com/blevesearch/bleve/v2 v2.3.1
|
||||
github.com/coreos/go-oidc/v3 v3.1.0
|
||||
github.com/cs3org/go-cs3apis v0.0.0-20220126114148-64c025ccdd19
|
||||
github.com/cs3org/reva v1.16.1-0.20220301071903-1fd81b097801
|
||||
github.com/cs3org/reva v1.16.1-0.20220301130454-abc01bbfa855
|
||||
github.com/disintegration/imaging v1.6.2
|
||||
github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733
|
||||
github.com/go-chi/chi/v5 v5.0.7
|
||||
|
||||
4
go.sum
4
go.sum
@@ -342,8 +342,6 @@ github.com/crewjam/saml v0.4.5/go.mod h1:qCJQpUtZte9R1ZjUBcW8qtCNlinbO363ooNl02S
|
||||
github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4=
|
||||
github.com/cs3org/go-cs3apis v0.0.0-20220126114148-64c025ccdd19 h1:1jqPH58jCxvbaJ9WLIJ7W2/m622bWS6ChptzljSG6IQ=
|
||||
github.com/cs3org/go-cs3apis v0.0.0-20220126114148-64c025ccdd19/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
|
||||
github.com/cs3org/reva v1.16.1-0.20220228144359-3e80be7f6667 h1:6Cjm0dV/6RcneBhnMAJmUDYgxzeEizumRnDyqiVvDJQ=
|
||||
github.com/cs3org/reva v1.16.1-0.20220228144359-3e80be7f6667/go.mod h1:fdlrnZ0f+UtAdpZfLG+4LM0ZrhT5V8tPEQt6ycYm82c=
|
||||
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
|
||||
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
|
||||
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
|
||||
@@ -912,6 +910,8 @@ github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02
|
||||
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/kljensen/snowball v0.6.0/go.mod h1:27N7E8fVU5H68RlUmnWwZCfxgt4POBJfENGMvNRhldw=
|
||||
github.com/kobergj/reva v1.13.1-0.20220303101200-03258eac912d h1:pEytDpB4JhfL+iieFUHyccJ0yY04pXTogIuypT8yEDI=
|
||||
github.com/kobergj/reva v1.13.1-0.20220303101200-03258eac912d/go.mod h1:fdlrnZ0f+UtAdpZfLG+4LM0ZrhT5V8tPEQt6ycYm82c=
|
||||
github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/owncloud/ocis/graph/pkg/config"
|
||||
"github.com/owncloud/ocis/graph/pkg/identity"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v0"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -66,6 +67,7 @@ type Graph struct {
|
||||
identityBackend identity.Backend
|
||||
gatewayClient GatewayClient
|
||||
httpClient HTTPClient
|
||||
roleService settingssvc.RoleService
|
||||
spacePropertiesCache *ttlcache.Cache
|
||||
}
|
||||
|
||||
|
||||
@@ -116,17 +116,19 @@ func NewService(opts ...Option) Service {
|
||||
svc.httpClient = options.HTTPClient
|
||||
}
|
||||
|
||||
roleService := options.RoleService
|
||||
if roleService == nil {
|
||||
roleService = settingssvc.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient)
|
||||
if options.RoleService == nil {
|
||||
svc.roleService = settingssvc.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient)
|
||||
} else {
|
||||
svc.roleService = options.RoleService
|
||||
}
|
||||
|
||||
roleManager := options.RoleManager
|
||||
if roleManager == nil {
|
||||
m := roles.NewManager(
|
||||
roles.CacheSize(1024),
|
||||
roles.CacheTTL(time.Hour),
|
||||
roles.Logger(options.Logger),
|
||||
roles.RoleService(roleService),
|
||||
roles.RoleService(svc.roleService),
|
||||
)
|
||||
roleManager = &m
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package svc
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
|
||||
revactx "github.com/cs3org/reva/pkg/ctx"
|
||||
"github.com/go-chi/chi/v5"
|
||||
@@ -12,6 +14,8 @@ import (
|
||||
libregraph "github.com/owncloud/libre-graph-api-go"
|
||||
"github.com/owncloud/ocis/graph/pkg/identity"
|
||||
"github.com/owncloud/ocis/graph/pkg/service/v0/errorcode"
|
||||
settings "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v0"
|
||||
settingssvc "github.com/owncloud/ocis/settings/pkg/service/v0"
|
||||
)
|
||||
|
||||
// GetMe implements the Service interface.
|
||||
@@ -56,7 +60,18 @@ func (g Graph) PostUser(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if isNilOrEmpty(u.DisplayName) || isNilOrEmpty(u.OnPremisesSamAccountName) || isNilOrEmpty(u.Mail) {
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, "Missing Required Attribute")
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
if !isValidUsername(*u.OnPremisesSamAccountName) {
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest,
|
||||
fmt.Sprintf("username '%s' must be at least the local part of an email", *u.OnPremisesSamAccountName))
|
||||
return
|
||||
}
|
||||
if !isValidEmail(*u.Mail) {
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest,
|
||||
fmt.Sprintf("'%s' is not a valid email address", *u.Mail))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -73,6 +88,19 @@ func (g Graph) PostUser(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// All users get the user role by default currently.
|
||||
// to all new users for now, as create Account request does not have any role field
|
||||
if g.roleService == nil {
|
||||
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, "could not assign role to account: roleService not configured")
|
||||
return
|
||||
}
|
||||
if _, err = g.roleService.AssignRoleToUser(r.Context(), &settings.AssignRoleToUserRequest{
|
||||
AccountUuid: *u.Id,
|
||||
RoleId: settingssvc.BundleUUIDRoleUser,
|
||||
}); err != nil {
|
||||
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, fmt.Sprintf("could not assign role to account %s", err.Error()))
|
||||
return
|
||||
}
|
||||
render.Status(r, http.StatusOK)
|
||||
render.JSON(w, r, u)
|
||||
}
|
||||
@@ -151,6 +179,13 @@ func (g Graph) PatchUser(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
mail := changes.GetMail()
|
||||
if !isValidEmail(mail) {
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest,
|
||||
fmt.Sprintf("'%s' is not a valid email address", mail))
|
||||
return
|
||||
}
|
||||
|
||||
u, err := g.identityBackend.UpdateUser(r.Context(), nameOrID, *changes)
|
||||
if err != nil {
|
||||
var errcode errorcode.Error
|
||||
@@ -169,3 +204,25 @@ func (g Graph) PatchUser(w http.ResponseWriter, r *http.Request) {
|
||||
func isNilOrEmpty(s *string) bool {
|
||||
return s == nil || *s == ""
|
||||
}
|
||||
|
||||
// We want to allow email addresses as usernames so they show up when using them in ACLs on storages that allow integration with our glauth LDAP service
|
||||
// so we are adding a few restrictions from https://stackoverflow.com/questions/6949667/what-are-the-real-rules-for-linux-usernames-on-centos-6-and-rhel-6
|
||||
// names should not start with numbers
|
||||
var usernameRegex = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]*(@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)*$")
|
||||
|
||||
func isValidUsername(e string) bool {
|
||||
if len(e) < 1 && len(e) > 254 {
|
||||
return false
|
||||
}
|
||||
return usernameRegex.MatchString(e)
|
||||
}
|
||||
|
||||
// regex from https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html#valid-e-mail-address
|
||||
var emailRegex = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
|
||||
|
||||
func isValidEmail(e string) bool {
|
||||
if len(e) < 3 && len(e) > 254 {
|
||||
return false
|
||||
}
|
||||
return emailRegex.MatchString(e)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
const { client } = require('nightwatch-api')
|
||||
const util = require('util')
|
||||
|
||||
module.exports = {
|
||||
url: function () {
|
||||
return this.api.launchUrl + '/#/settings'
|
||||
return this.api.launchUrl + '/settings'
|
||||
},
|
||||
|
||||
commands: {
|
||||
@@ -78,6 +77,6 @@ module.exports = {
|
||||
languageInput: {
|
||||
selector: "//label[.='Language']/..//input",
|
||||
locateStrategy: 'xpath'
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SHELL := bash
|
||||
NAME := web
|
||||
WEB_ASSETS_VERSION = v5.1.0
|
||||
WEB_ASSETS_VERSION = v5.2.0-rc.2
|
||||
|
||||
include ../.make/recursion.mk
|
||||
|
||||
|
||||
Reference in New Issue
Block a user