Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/storage/owncloud #150

Merged
merged 13 commits into from
Aug 26, 2019
Merged

Conversation

butonic
Copy link
Contributor

@butonic butonic commented Jul 18, 2019

add a storage that

  • works on top of an existing owncloud data directory

  • generates a uuid and stores it in the filesystem via extended attributes

  • stores sharing metadata as nfsv4 like acls in a user extended attribute in the filesystem

  • uses redis to cache fileid to path lookups

  • no dbms reuired

  • data migration is tracked in Data Format V2 owncloud/data_exporter#77 (comment)

  • It also adds the versioning endpoint to ocs, which is submitted with this PR because it was tested with the owncloud storage

@butonic butonic requested a review from labkode as a code owner July 18, 2019 14:25
pkg/storage/fs/owncloud/owncloud.go Outdated Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Outdated Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Outdated Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Jul 18, 2019

Codecov Report

Merging #150 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #150   +/-   ##
=======================================
  Coverage   94.65%   94.65%           
=======================================
  Files           6        6           
  Lines         187      187           
=======================================
  Hits          177      177           
  Misses          5        5           
  Partials        5        5
Impacted Files Coverage Δ
pkg/user/manager/json/json.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c3396d...c5d366a. Read the comment docs.

@labkode labkode added the feature New feature label Aug 14, 2019
@labkode labkode changed the title [WIP] Feature/storage/owncloud WIP: Feature/storage/owncloud Aug 14, 2019
cmd/revad/svcs/httpsvcs/ocdavsvc/files.go Outdated Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/webdav.go Outdated Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Outdated Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/dav.go Outdated Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/dav.go Outdated Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/meta.go Outdated Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/versions.go Outdated Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/ocdavsvc.go Outdated Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/ocdavsvc.go Outdated Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/webdav.go Show resolved Hide resolved
cmd/revad/svcs/httpsvcs/ocdavsvc/versions.go Outdated Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Outdated Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Show resolved Hide resolved
pkg/storage/fs/owncloud/owncloud.go Show resolved Hide resolved
@labkode
Copy link
Member

labkode commented Aug 19, 2019

@butonic can you make CI happy?

Copy link
Member

@labkode labkode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor things, happy to approve after, this is a super nice job ! :)

labkode and others added 11 commits August 23, 2019 09:18
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
@butonic
Copy link
Contributor Author

butonic commented Aug 23, 2019

my gateway, goo.toml = gateway oidc owncloud

# This config file will start a reva gateway that:
# - handles incoming HTTP requests
# - forwards GRPC requests to the backend

[core]
log_file = "stderr"
log_mode = "dev"
max_cpus = "100%"
#tracing_enabled = true

[log]
level = "debug"
mode = "console"

# What http services should be started?

[http]
network = "tcp"
address = "0.0.0.0:9998"
enabled_services = [
    "appregistrysvc",
    "ocdavsvc",
    "ocssvc",
    "datasvc",
    "preferencessvc",
    "prometheussvc",
    "oidcprovider",
    "wellknown"
]
enabled_middlewares = ["cors", "auth"]

# HTTP middlewares

[http.middlewares.auth]
priority = 100
# directly talk to the backend for authentication to save a grpc request
gatewaysvc = "0.0.0.0:9999"
credential_strategy = "oidc"
token_strategy = "header"
token_writer = "header"
token_manager = "jwt"
skip_methods = [
    "/status.php",
    "/oauth2",
    "/oauth2/auth", 
    "/oauth2/token", 
    "/oauth2/introspect",
    "/oauth2/userinfo", 
    "/oauth2/sessions", 
    "/.well-known/openid-configuration",
    "/metrics"
]

[http.middlewares.auth.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

[http.middlewares.cors]
priority = 200
allowed_origins = ["*"]
allow_credentials = true
allowed_methods = ["OPTIONS", "GET", "PUT", "POST", "DELETE", "MKCOL", "PROPFIND", "PROPPATCH", "MOVE", "COPY", "REPORT", "SEARCH"]
allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "Authorization", "Ocs-Apirequest", "If-None-Match"]
options_passthrough = true

# HTTP services

[http.services.appregistrysvc]
prefix = "appregistry"
gatewaysvc = "localhost:10000"

[http.services.preferencessvc]
prefix = "preferences"
gatewaysvc = "localhost:10000"

[http.services.iframeuisvc]
prefix = "iframe"

[http.services.webuisvc]
prefix = "ui"

[http.services.ocdavsvc]
prefix = ""
gatewaysvc = "localhost:10000"
chunk_folder = "/var/tmp/owncloud/chunks"

[http.services.ocssvc]
prefix = "ocs"
gatewaysvc = "localhost:10000"
# the list of share recipients is taken fro the user.json file
user_manager = "json"

[http.services.ocssvc.user_managers.json]
users = "/data/users.json"

[http.services.ocssvc.config]
version = "1.8"
website = "nexus"
host = "https://localhost:9998"
contact = "admin@localhost"
ssl = "true"
[http.services.ocssvc.capabilities.capabilities.core]
poll_interval = 60
webdav_root = "remote.php/webdav"
[http.services.ocssvc.capabilities.capabilities.core.status]
installed = true
maintenance = false
needsDbUpgrade = false
version = "10.0.9.5"
versionstring = "10.0.9"
edition = "community"
productname = "reva"
hostname = ""
[http.services.ocssvc.capabilities.capabilities.checksums]
supported_types = ["SHA256"]
preferred_upload_type = "SHA256"
[http.services.ocssvc.capabilities.capabilities.files]
private_links = true
bigfilechunking = true
blacklisted_files = ["foo"]
undelete = true
versioning = true
[http.services.ocssvc.capabilities.capabilities.dav]
chunking = "1.0"
[http.services.ocssvc.capabilities.capabilities.files_sharing]
api_enabled = true
resharing = true
group_sharing = true
auto_accept_share = true
share_with_group_members_only = true
share_with_membership_groups_only = true
default_permissions = 22
search_min_length = 3
[http.services.ocssvc.capabilities.capabilities.files_sharing.public]
enabled = true
send_mail = true
social_share = true
upload = true
multiple = true
supports_upload_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.password]
enforced = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.password.enforced_for]
read_only = true
read_write = true
upload_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.expire_date]
enabled = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.user]
send_mail = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.user_enumeration]
enabled = true
group_members_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.federation]
outgoing = true
incoming = true
[http.services.ocssvc.capabilities.capabilities.notifications]
endpoints = ["list", "get", "delete"]
[http.services.ocssvc.capabilities.version]
edition = "nexus"
major = 10
minor = 0
micro = 11
string = "10.0.11"

[http.services.datasvc]
driver = "owncloud"
prefix = "data"
temp_folder = "/var/tmp/"

[http.services.datasvc.drivers.owncloud]
datadirectory = "/data"

[http.services.oidcprovider]
prefix = "oauth2"

[http.services.wellknown]
prefix = ".well-known"

# also start the grpc gateway for other cs3 services so we have one frontend process

[grpc]
network = "tcp"
address = "0.0.0.0:10000"
enabled_services = ["gatewaysvc"]

[grpc.services.gatewaysvc]
storageregistrysvc = "localhost:9999"
authsvc = "localhost:9999"
usershareprovidersvc = "localhost:9999"
appregistrysvc = "localhost:9999"
preferencessvc = "localhost:9999"
commit_share_to_storage_grant = true
commit_share_to_storage_ref = true

The background services roo.toml = reva oidc owncloud

# This config file will start a reva grpc service backend that:
# - stores files in the local storage
# - reads users from users.json
# - uses basic authentication to authenticate requests

[core]
log_file = "stderr"
log_mode = "dev"
max_cpus = "2"
tracing_enabled = true
disable_http = true

[log]
level = "debug"
mode = "console"

# What grpc services  should be started?

[grpc]
network = "tcp"
address = "0.0.0.0:9999"
enabled_services = ["storageprovidersvc", "authsvc", "storageregistrysvc", "appregistrysvc", "appprovidersvc", "preferencessvc", "usershareprovidersvc"]
enabled_interceptors = ["auth"]

# Order and configuration of grpc interceptors 

# GRPC interceptors

[grpc.interceptors.auth]
# keys for grpc metadata are always lowercase, so interceptors headers need to use lowercase.
token_manager = "jwt"
# GenerateAccessToken contains the credentials in the payload. Skip auth, otherwise services cannot obtain a token.
skip_methods = ["/cs3.authv0alpha.AuthService/GenerateAccessToken", "/cs3.authv0alpha.AuthService/WhoAmI"]

[grpc.interceptors.auth.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"


# GRPC services

## The authentication service

[grpc.services.authsvc]
token_manager = "jwt"
# users are authorized by checking their password matches the one in the users.json file
auth_manager = "oidc"
# user info is read from the user.json file
user_manager = "oidc"

[grpc.services.authsvc.auth_managers.oidc]
provider = "http://localhost:9998"
insecure = true
# the client credentials for the token introspection beckchannel
client_id = "phoenix"
client_secret = "foobar"

[grpc.services.authsvc.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

## The storage registry service

[grpc.services.storageregistrysvc]
driver = "static"

[grpc.services.storageregistrysvc.drivers.static.rules]
"/" = "localhost:9999"
"123e4567-e89b-12d3-a456-426655440000" = "localhost:9999"

## The storage provider service

[grpc.services.appregistrysvc]
driver = "static"

[grpc.services.appregistrysvc.static.rules]
".txt" = "localhost:9999"
"text/plain" = "localhost:9999"

[grpc.services.appprovidersvc]
driver = "demo"

[grpc.services.appprovidersvc.demo]
iframe_ui_provider = "http://localhost:9998/iframeuisvc"

[grpc.services.storageprovidersvc]
driver = "owncloud"
mount_path = "/"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://127.0.0.1:9998/data"

[grpc.services.storageprovidersvc.available_checksums]
md5   = 100
unset = 1000


[grpc.services.storageprovidersvc.drivers.owncloud]
datadirectory = "/data"



## The user share provider service

[grpc.services.usershareprovidersvc]
driver = "memory"

@butonic
Copy link
Contributor Author

butonic commented Aug 23, 2019

currently using phoenix commit ca2b13f Update settings.yml
edit: also works with phoenix master

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
@butonic butonic changed the title WIP: Feature/storage/owncloud Feature/storage/owncloud Aug 26, 2019
Copy link
Member

@labkode labkode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome work

@labkode labkode merged commit 4488022 into cs3org:master Aug 26, 2019
@butonic butonic deleted the feature/storage/owncloud branch August 28, 2019 10:47
glpatcern added a commit to glpatcern/reva that referenced this pull request Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants