Compare commits

...
190 Commits
Author SHA1 Message Date
Michael Barz 1ca18f4cd2 prepare release 1.3.0
Signed-off-by: Michael Barz <mbarz@owncloud.com>
2021-03-09 16:27:44 +01:00
Pascal Wengerter 98709a8dfc Automated changelog update [skip ci] 2021-03-09 15:17:29 +00:00
Pascal Wengerter ebd863e73e Merge pull request #1776 from owncloud/update-web-2.0.2
Update web version to 2.0.2
2021-03-09 15:17:00 +00:00
Pascal Wengerter 255b872b30 Update web release docs && re-run CI 2021-03-09 13:55:10 +00:00
Pascal Wengerter dc5496e16c Update web version to 2.0.2 2021-03-09 13:54:38 +00:00
Phil Davis e0eff6ee41 Merge pull request #1760 from owncloud/bumpCommitId
[Tests-only] bump web and core commit id
2021-03-09 19:02:27 +05:45
Swikriti Tripathi c939d6042b bump web and core commit id and adjust expected to fail file 2021-03-09 18:02:11 +05:45
Phil Davis 253e180355 Merge pull request #1781 from owncloud/fix_ci_docs
[docs-only] fix ci docs
2021-03-09 17:42:53 +05:45
Willy Kloucek 84888ebce1 fix ci docs 2021-03-09 11:27:21 +01:00
David Christofas 0eda3b882b Merge pull request #1763 from owncloud/accounts-update-npm-deps
update npm dependencies
2021-03-05 14:33:43 +01:00
David Christofas fb6b83a8cc Merge pull request #1765 from owncloud/idp-update-npm-deps
update npm dependencies
2021-03-05 14:33:36 +01:00
David Christofas 9da10fc14e Merge pull request #1764 from owncloud/onlyoffice-update-npm-dependencies
update npm dependencies
2021-03-05 08:56:25 +01:00
David Christofas 9c6fbedfd5 update npm dependencies 2021-03-04 21:20:56 +01:00
David Christofas 400cd5e3e5 update npm dependencies 2021-03-04 20:49:13 +01:00
David Christofas 5a434d6deb update npm dependencies 2021-03-04 20:42:44 +01:00
Jörn Friedrich Dreyer f9de747ef3 Merge pull request #1759 from owncloud/update-ocis-index-docs
[docs-only] update ocis index
2021-03-04 11:38:17 +01:00
Jörn Friedrich Dreyer 90e7c53187 Merge pull request #1757 from owncloud/update-development-getting-started
[docs-only] Update development getting-started.md
2021-03-04 11:37:14 +01:00
Jörn Friedrich Dreyer 0bbee16e88 add ldap / glauth, add review
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-03-04 10:34:19 +00:00
Jörn Friedrich Dreyer 6df001524e Update development getting-started.md
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-03-04 09:48:14 +00:00
David Christofas ee4073256f Merge pull request #1756 from owncloud/settings-update-npm-dependencies
update npm dependencies
2021-03-03 16:51:58 +01:00
Jörn Friedrich Dreyer bdbeb967c6 update ocis index
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-03-03 15:34:03 +00:00
David Christofas d007164a53 Automated changelog update [skip ci] 2021-03-03 15:30:53 +00:00
David Christofas 57b337546d Merge pull request #1758 from owncloud/remove-log-secrets
remove JWT from logs
2021-03-03 16:28:45 +01:00
David Christofas c532073dd1 remove JWT from logs
secrets should not be exposed in the logs
2021-03-03 15:30:11 +01:00
David Christofas 12e6eb1395 update npm dependencies 2021-03-03 12:08:39 +01:00
Phil Davis 0719d18586 Merge pull request #1746 from owncloud/bumpCommitIdAPI
[tests-only] Bump commit id for API tests
2021-03-02 14:15:49 +03:00
David Christofas 4943fed2fe Merge pull request #1742 from owncloud/dependabot/go_modules/ocis/go.opencensus.io-0.23.0
Bump go.opencensus.io from 0.22.6 to 0.23.0 in /ocis
2021-03-02 11:46:52 +01:00
dependabot[bot] 0f40e3896b Bump go.opencensus.io from 0.22.6 to 0.23.0 in /ocis
Bumps [go.opencensus.io](https://github.com/census-instrumentation/opencensus-go) from 0.22.6 to 0.23.0.
- [Release notes](https://github.com/census-instrumentation/opencensus-go/releases)
- [Commits](https://github.com/census-instrumentation/opencensus-go/compare/v0.22.6...v0.23.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-02 07:33:18 +00:00
Willy Kloucek 6e17117800 Merge pull request #1714 from owncloud/bingo_and_rework_makefiles
introduce bingo and golangci-lint and rework makefiles
2021-03-02 07:15:56 +01:00
Swikriti Tripathi b841cd7874 Bump API tests commit id 2021-03-02 10:23:32 +05:45
Phil Davis 80e6600275 Merge pull request #1669 from owncloud/bump-web-commit-id-20210217
[tests-only] Bump web commit id
2021-03-01 23:02:30 +03:00
Willy Kloucek 92145eeab9 fix readme 2021-03-01 17:21:25 +01:00
Parajuli Kiran 271d27592f Added ldapjs as dev dependency 2021-03-01 20:33:54 +05:45
Parajuli Kiran e2d8b90ecc Fixed expected failures md 2021-03-01 20:33:53 +05:45
Phil Davis f3d3ef1c3d Bump web commit id 2021-03-01 20:33:51 +05:45
Willy Kloucek 58c3acb525 run "make go-mod-tidy" and "make generate" 2021-03-01 15:33:14 +01:00
Willy Kloucek 1aac5a09d2 cleanup 2021-03-01 15:23:47 +01:00
Willy Kloucek 82f75a2164 switch to golangci-lint 2021-03-01 15:06:11 +01:00
Willy Kloucek 083b39ef17 introduce hot reload for docs 2021-03-01 15:06:00 +01:00
Willy Kloucek 387b2f3272 introduce bingo and rework makefiles 2021-03-01 15:05:48 +01:00
Phil Davis 2cec8d757d Merge pull request #1732 from owncloud/bump-commit-id-20210226
[tests-only] Bump commit id for API tests
2021-02-27 00:16:43 +03:00
Phil Davis 53e64d4b4a Adjust expected-failures 2021-02-27 01:48:19 +05:45
Phil Davis 305b7d7acc Bump API tests commit id for fix to run.sh 2021-02-27 01:48:19 +05:45
Phil Davis 4bc6d1759f Bump commit id for API tests 2021-02-27 01:48:19 +05:45
Artur Neumann 1469afb432 Automated changelog update [skip ci] 2021-02-26 16:53:31 +00:00
Artur Neumann 3c0730c170 Merge pull request #1734 from owncloud/delay-accounts-execution
Delay accounts service startup
2021-02-26 22:37:27 +05:45
Jörn Friedrich Dreyer a2e1e9f28e Merge pull request #1735 from owncloud/proxy-resolve-linter
resolve linter issues
2021-02-26 16:38:38 +01:00
David Christofas cfcd4b5992 resolve linter issues 2021-02-26 14:24:25 +01:00
Phil Davis 4ec4dd5f77 Merge pull request #1722 from owncloud/onlyoffice-resolve-linter
resolve linter issues
2021-02-26 12:57:54 +03:00
A.Unger c71fbf297a add changelog 2021-02-26 10:29:59 +01:00
A.Unger d6b2973697 delay accounts service startup 2021-02-26 10:25:18 +01:00
David Christofas 1f5f99996b resolve linter issues 2021-02-26 09:20:28 +01:00
Phil Davis 690399008d Merge pull request #1723 from owncloud/ocs-resolve-linter
resolve linter issues
2021-02-26 07:37:32 +03:00
Phil Davis 75116a3f12 Merge pull request #1720 from owncloud/storage-resolve-linter
resolve linter issues
2021-02-26 07:37:14 +03:00
David Christofas dfbc6759da resolve linter issues 2021-02-26 09:14:27 +05:45
David Christofas bb9c3db982 resolve linter issues 2021-02-26 09:13:50 +05:45
Jörn Friedrich Dreyer 17711526e5 Merge pull request #1727 from owncloud/ocis-resolve-linter
resolve linter issues
2021-02-25 23:30:18 +01:00
Jörn Friedrich Dreyer ab2fb958a3 Merge pull request #1724 from owncloud/ocis-pkg-resolve-linter
resolve linter issues
2021-02-25 22:17:03 +01:00
Jörn Friedrich Dreyer d33ff007fd Merge pull request #1719 from owncloud/thumbnails-resolve-linter
resolve linter issues
2021-02-25 22:00:34 +01:00
Jörn Friedrich Dreyer 696fdecf42 Merge pull request #1721 from owncloud/proxy-resolve-linter
resolve linter issues
2021-02-25 21:59:56 +01:00
Jörn Friedrich Dreyer 071cb6a78a Merge pull request #1717 from owncloud/webdav-resolve-linter
resolve linter issues
2021-02-25 21:59:36 +01:00
Jörn Friedrich Dreyer 0c7874630b Automated changelog update [skip ci] 2021-02-25 19:52:31 +00:00
Jörn Friedrich Dreyer 00659b6323 Merge pull request #1716 from owncloud/add-missing-gatewaysvc-config
add missing gatewaysvc config
2021-02-25 20:50:50 +01:00
Jörn Friedrich Dreyer a7b2f4df2a Merge pull request #1726 from owncloud/graph-linter
Graph linter
2021-02-25 17:55:37 +01:00
Jörn Friedrich Dreyer b01a549579 Merge pull request #1718 from owncloud/web-resolve-linter
resolve linter issues
2021-02-25 17:19:35 +01:00
Jörn Friedrich Dreyer a8660e27ed Merge pull request #1725 from owncloud/idp-resolve-linter
resolve linter issues
2021-02-25 17:18:30 +01:00
David Christofas ad4da605d7 Merge pull request #1681 from owncloud/onlyoffice-update-npm-dependencies
update npm dependencies
2021-02-25 16:30:20 +01:00
David Christofas 3f30ea134b resolve linter issues 2021-02-25 15:53:46 +01:00
David Christofas 902977cb60 resolve linter issues 2021-02-25 14:53:56 +01:00
David Christofas ee161b2359 resolve linter issues 2021-02-25 14:45:19 +01:00
David Christofas eda3997211 resolve linter issues 2021-02-25 14:37:05 +01:00
David Christofas 0802e8aac3 Merge pull request #1711 from owncloud/accounts-linter
resolve linter issues
2021-02-25 14:00:44 +01:00
David Christofas 0fd7580301 resolve linter issues 2021-02-25 10:48:40 +01:00
David Christofas c861d27aae resolve linter issues 2021-02-25 10:30:28 +01:00
Jörn Friedrich Dreyer 52f13fe778 Merge pull request #1712 from owncloud/glauth-linter
resolve linter issues
2021-02-25 09:43:40 +01:00
Jörn Friedrich Dreyer 9bb88c848e Merge pull request #1713 from owncloud/graph-explorer-linter
resolve linter issues
2021-02-25 09:42:48 +01:00
Jörn Friedrich Dreyer 059bec1a7a add missing gatewaysvc config
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-25 08:41:19 +00:00
David Christofas a22b7d6844 resolve linter issues 2021-02-24 16:24:36 +01:00
David Christofas 20dbf299d0 resolve linter issues 2021-02-24 16:06:24 +01:00
David Christofas c8fa6af54b update npm dependencies 2021-02-24 15:04:01 +01:00
David Christofas cc417c6ee8 resolve linter issues 2021-02-24 14:48:22 +01:00
Alex Unger b8ac8f1ddd Automated changelog update [skip ci] 2021-02-24 13:16:27 +00:00
Alex Unger 71ec5b2106 Merge pull request #1696 from owncloud/initialization-responsibility 2021-02-24 14:10:57 +01:00
David Christofas 878e465c52 resolve linter issues 2021-02-24 14:04:05 +01:00
David Christofas 226ffbb3f3 resolve linter issues 2021-02-24 11:35:09 +01:00
A.Unger 7b4ed397b3 add circuit breakers to the changelog 2021-02-24 09:56:45 +01:00
David Christofas 3328f9acb7 Merge pull request #1707 from owncloud/dependabot/go_modules/ocis/github.com/olekukonko/tablewriter-0.0.5
Bump github.com/olekukonko/tablewriter from 0.0.4 to 0.0.5 in /ocis
2021-02-24 09:36:26 +01:00
Phil Davis 4a107673ad Merge pull request #1709 from owncloud/docsRefactor
[docs-only] Expected-failures files changed to .md from .txt in documentation
2021-02-24 11:07:34 +03:00
Swikriti Tripathi 1ecf95b896 expected-failures files changed to .md from .txt in documentation 2021-02-24 13:34:01 +05:45
A.Unger 9cb417bf6c Merge branch 'master' into initialization-responsibility 2021-02-23 16:52:36 +01:00
dependabot[bot] 80214cb2c7 Bump github.com/olekukonko/tablewriter from 0.0.4 to 0.0.5 in /ocis
Bumps [github.com/olekukonko/tablewriter](https://github.com/olekukonko/tablewriter) from 0.0.4 to 0.0.5.
- [Release notes](https://github.com/olekukonko/tablewriter/releases)
- [Commits](https://github.com/olekukonko/tablewriter/compare/v0.0.4...v0.0.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-23 15:52:22 +00:00
David Christofas 9d5c82f61f Merge pull request #1706 from owncloud/dependabot/go_modules/ocis/github.com/spf13/cobra-1.1.3
Bump github.com/spf13/cobra from 1.0.0 to 1.1.3 in /ocis
2021-02-23 16:40:51 +01:00
A.Unger 8596afcfee bring back dependants 2021-02-23 15:50:29 +01:00
dependabot[bot] 262632e0ae Bump github.com/spf13/cobra from 1.0.0 to 1.1.3 in /ocis
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.0.0 to 1.1.3.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spf13/cobra/compare/v1.0.0...v1.1.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-23 14:29:18 +00:00
A.Unger 71d63a69e6 update dependencies 2021-02-23 14:58:09 +01:00
A.Unger 89fc088239 Merge branch 'master' into initialization-responsibility 2021-02-23 14:56:36 +01:00
Willy Kloucek b6dac5e36c Merge pull request #1704 from owncloud/native_hugo_serve
[docs-only] Native hugo serve
2021-02-23 14:42:20 +01:00
Jörn Friedrich Dreyer f3468e1070 Merge pull request #1701 from owncloud/missing-dependencies
fix missing registry dependencies
2021-02-23 14:29:38 +01:00
David Christofas deb7417145 Automated changelog update [skip ci] 2021-02-23 13:27:19 +00:00
David Christofas 1ed27939cc Merge pull request #1684 from owncloud/update-reva
update reva to v1.6.1-0.20210218130854-a954e7242e7a
2021-02-23 14:26:42 +01:00
A.Unger 9342b5abbd go around circuit breaker 2021-02-23 14:25:16 +01:00
A.Unger 9a507a4450 add readme 2021-02-23 13:41:51 +01:00
A.Unger 78eabd2437 rework settings tests 2021-02-23 13:35:57 +01:00
A.Unger a361c12e2a defensive code around accounts init 2021-02-23 12:45:21 +01:00
Willy Kloucek 6d397c79f5 only generate config 2021-02-23 12:38:18 +01:00
Willy Kloucek 19cfa326fd add native hugo serve target 2021-02-23 12:28:03 +01:00
A.Unger 7609b11dc1 fix empty branch 2021-02-23 12:04:44 +01:00
A.Unger 97271d51bc add circuit breakers 2021-02-23 11:56:03 +01:00
David Christofas 3a46bd2f94 update reva to v1.6.1-0.20210223065028-53f39499762e
Update reva and also set a replace for github.com/oleiade/reflections.
The replace should resolve the dependabot issue. See oleiade/reflections#14. Once https://github.com/ory/fosite has updated to reflections 1.0.1 or higher we can remove the replace.
2021-02-23 11:36:07 +01:00
A.Unger f280e98897 no race condition 2021-02-23 11:16:55 +01:00
A.Unger 5d98dbac4a Merge branch 'master' into initialization-responsibility 2021-02-23 10:40:22 +01:00
Jörn Friedrich Dreyer 368d32becb run make go-mod-tidy
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-23 09:16:58 +00:00
Jörn Friedrich Dreyer 52ebb7c611 Merge pull request #1700 from owncloud/preallocate-slices
pre allocate slices
2021-02-23 09:55:52 +01:00
Florian Schade 377eecc66e add missing dependencies 2021-02-23 03:43:17 +01:00
Jörn Friedrich Dreyer cf531154fb Automated changelog update [skip ci] 2021-02-22 19:37:04 +00:00
Jörn Friedrich Dreyer 4fffec0749 Merge pull request #1699 from owncloud/fix-token-ttl
fix token cache TTL
2021-02-22 20:36:05 +01:00
Jörn Friedrich Dreyer bbb94c40da Merge pull request #1697 from owncloud/use-registry-interface
Use registry interface value
2021-02-22 20:35:23 +01:00
David Christofas 1088faf95d pre allocate slices
Pre allocating slices with a target size reduces the number of allocations because we already know how big the slice will be and therefore need to allocate only once
2021-02-22 19:41:48 +01:00
David Christofas 7ad38d7757 fix token cache TTL
The TTL was supplied to the middleware as a duration and then in that middleware multiplied by `time.Second` again. Durations should not be multiplied because they result in unintended values.
```go
	time.Second * 1 = 1s
	time.Second * time.Second = 277777h46m40s
```
2021-02-22 18:40:15 +01:00
David Christofas 24cb9dcf70 Merge pull request #1698 from owncloud/settings-fix-dependencies
downgrade rollup-plugin-vue to 5.1.9
2021-02-22 18:22:19 +01:00
Jörn Friedrich Dreyer e535975718 Merge pull request #1693 from owncloud/fix_keycloak_example_sharing
[docs-only] fix sharing in Keycloak deployment example
2021-02-22 17:40:36 +01:00
David Christofas 22ed643be8 downgrade rollup-plugin-vue to 5.1.9
The rollup-plugin-vue in version 6.0.0 was breaking the build of the settings ui.
2021-02-22 17:13:08 +01:00
Artur Neumann b4713a4b49 Merge pull request #1695 from owncloud/updateIssueLinks
[tests-only] update issue links in gRPC tests
2021-02-22 21:41:51 +05:45
Jörn Friedrich Dreyer deb20ffa90 add changelog
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-22 15:26:36 +00:00
Jörn Friedrich Dreyer fd703ec740 add initial nats and kubernetes registry support
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-22 15:20:22 +00:00
Jörn Friedrich Dreyer 8a8aa2dc52 use micre v3 registry interface
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-22 15:08:50 +00:00
Jörn Friedrich Dreyer f89128a2d9 use registry interface
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-22 13:42:00 +00:00
A.Unger 2004942a3a shift role initialization from accounts to settings 2021-02-22 12:19:50 +01:00
Artur Neumann 26d7842cfe update issue links in gRPC tests 2021-02-22 16:58:28 +05:45
Willy Kloucek cae068fe73 fix sharing in keycloak deployment example 2021-02-22 11:30:20 +01:00
Jörn Friedrich Dreyer f15c40d52e Automated changelog update [skip ci] 2021-02-22 09:21:48 +00:00
Jörn Friedrich Dreyer aea505805c Merge pull request #1670 from owncloud/update-go-micro-v3
Update go micro v3
2021-02-22 10:20:34 +01:00
Artur Neumann 64dd0baa02 Merge pull request #1689 from owncloud/bump-core-commit-id-20210221
[tests-only] Bump core commit for tests
2021-02-22 09:21:27 +05:45
Phil Davis f75d2c1b32 Bump core commit for tests 2021-02-22 04:05:52 +05:45
Phil Davis 14fdbb9788 Merge pull request #1687 from owncloud/dirkstascheit-patch-1
[docs-only] Update getting-started.md
2021-02-19 15:47:02 +03:00
Dirk Stascheit 2575c29051 Update getting-started.md
updated the tech preview version from 1.1 to 1.2
2021-02-19 18:28:54 +05:45
Phil Davis d9894560d7 Merge pull request #1682 from owncloud/bump-core-commit-id-20210219
[tests-only] Bump core commit id for tests
2021-02-19 15:24:56 +03:00
Phil Davis c9515ecb35 Bump core commit id for tests 2021-02-19 17:01:42 +05:45
Benedikt Kulmann 6fad231246 Automated changelog update [skip ci] 2021-02-19 10:51:49 +00:00
Benedikt Kulmann 3bb76bfad6 Merge pull request #1683 from owncloud/update-web-2.0.1
Update web to 2.0.1
2021-02-19 11:51:14 +01:00
Benedikt Kulmann 6374fb4568 Update web to 2.0.1 2021-02-19 09:57:56 +01:00
Phil Davis 1762458e4d Merge pull request #1642 from EParzefall/patch-1
[docs-only] Update _index.md
2021-02-19 06:02:25 +03:00
EParzefall 0bc9f71353 Update _index.md
Just some minor punctuation and language fixes.
2021-02-19 08:42:06 +05:45
Jörn Friedrich Dreyer 89b06defa5 use ocis grpc client for thumbnails
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 21:26:36 +00:00
Jörn Friedrich Dreyer ec882bc22e Merge pull request #1680 from ishank011/separate-user-group-schema
Separate LDAP schemas for users and groups
2021-02-18 21:23:21 +01:00
Jörn Friedrich Dreyer d4585933ac reuse the default client
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 13:07:04 +00:00
A.Unger 7736d26e0c update readme 2021-02-18 12:51:31 +01:00
Ishank Arora f11d8a2718 Separate LDAP schemas for users and groups 2021-02-18 12:46:30 +01:00
A.Unger 1daad022c3 set MICRO_LOG_LEVEL to error if not defined 2021-02-18 12:45:44 +01:00
Phil Davis 74c883b85b Merge pull request #1679 from owncloud/add_breaking_changes_changelog
[docs-only] add breaking changes and migration
2021-02-18 14:35:37 +03:00
Jörn Friedrich Dreyer d9f4a4c524 always pass in a client
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 10:58:56 +00:00
Willy Kloucek 977f590954 add breaking changes and migration 2021-02-18 11:07:23 +01:00
Jörn Friedrich Dreyer 11ed5e49d8 same order of options in grpc and http service
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 10:00:16 +00:00
Jörn Friedrich Dreyer 13f6defb7a use upstream prometheus logger
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 09:10:00 +00:00
Jörn Friedrich Dreyer 8d3562dc62 add missing files
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:59:35 +00:00
David Christofas ebc51c6dff Merge pull request #1674 from owncloud/settings-update-npm-dependencies
update npm dependencies
2021-02-18 09:56:25 +01:00
Patrick Maier 14feb0f4a6 Merge pull request #1676 from owncloud/rn_correction
[docs-only] Correct WCAG version in 1.2.0 release notes
2021-02-18 09:44:04 +01:00
Patrick Maier cb45a4bb37 [docs-only] Correct WCAG version in 1.2.0 release notes 2021-02-18 09:40:41 +01:00
Jörn Friedrich Dreyer 2ece67fd0b changelog
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:28:21 +00:00
Jörn Friedrich Dreyer c2939551e5 rebase and tidy
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:17:57 +00:00
Jörn Friedrich Dreyer 34a9fb2dc8 remove unneeded getTranstport
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:03:22 +00:00
Jörn Friedrich Dreyer 63416c3cac update proto-gen-micro, regenerate protobuf, mod tidy all
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:03:22 +00:00
Jörn Friedrich Dreyer 57aec02410 tidy everything
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:03:22 +00:00
Jörn Friedrich Dreyer 588ac4a2a6 get rid of http server option.Hander
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:01:53 +00:00
Jörn Friedrich Dreyer 603dad3533 bring back etcd registry
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:01:53 +00:00
A.Unger b89deea796 remove redundant transport 2021-02-18 08:01:53 +00:00
A.Unger 448bdde79c use http replace 2021-02-18 08:01:53 +00:00
A.Unger 072d0704df wip 2021-02-18 08:01:53 +00:00
A.Unger 7e505fbd9f remove any micro v2 occurences from the project 2021-02-18 08:01:53 +00:00
A.Unger 54c4331479 update web to use go-micro v3 2021-02-18 08:01:53 +00:00
A.Unger 6644f5b679 update thumbnails to use go-micro v3 2021-02-18 08:01:53 +00:00
A.Unger d19cc340ea update settings to use go-micro v3 2021-02-18 08:01:53 +00:00
A.Unger b4115bbee4 update settings to use go-micro v3 2021-02-18 08:01:53 +00:00
A.Unger a1d5e34f41 update proxy to use go-micro v3 2021-02-18 08:01:53 +00:00
A.Unger 75c3b7d81b update store to use go-micro v3 2021-02-18 08:01:53 +00:00
A.Unger b167dc8b21 update ocs + store to use go-micro v3 2021-02-18 08:01:53 +00:00
A.Unger f851b91489 update idp to use go-micro v3 2021-02-18 08:01:52 +00:00
A.Unger 656d034dd3 update graph-explorer to use go-micro v3 2021-02-18 08:01:52 +00:00
A.Unger 9b9f4703af update graph to use go-micro v3 2021-02-18 08:01:52 +00:00
A.Unger af33d62a9a update glauth to use go-micro v3 2021-02-18 08:00:02 +00:00
A.Unger 005f47d436 update accounts, settings, storage-metadata and ocis-pkg to use asim go-micro v3 2021-02-18 08:00:02 +00:00
Jörn Friedrich Dreyer 83851ca2bb return micro.Service()
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-02-18 08:00:02 +00:00
A.Unger 88f670b45c initial commit 2021-02-18 08:00:02 +00:00
Phil Davis 530ee622db Merge pull request #1673 from owncloud/graph-update-reva
update reva
2021-02-18 03:03:33 +03:00
David Christofas 8560368f47 update npm dependencies 2021-02-17 23:35:43 +01:00
Michael Barz 4e130ac406 Automated changelog update [skip ci] 2021-02-17 21:47:45 +00:00
Michael Barz 8b1571aa26 Merge pull request #1672 from owncloud/release-1.2.0
Merge back 1.2.0 Release
2021-02-17 22:43:19 +01:00
David Christofas 5e76dfdecd update reva 2021-02-17 22:31:41 +01:00
Michael Barz d7fedc7046 Merge pull request #1671 from owncloud/1.2.0_release_notes
[docs-only] 1.2.0 Release Notes
2021-02-17 18:38:57 +01:00
Patrick Maier a5e55ef5e6 [docs-only] 1.2.0 Release Notes 2021-02-17 18:27:48 +01:00
271 changed files with 13380 additions and 11800 deletions

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
# Ignore everything
*
# But not these files:
!.gitignore
!*.mod
!README.md
!Variables.mk
!variables.env
*tmp.mod
+14
View File
@@ -0,0 +1,14 @@
# Project Development Dependencies.
This directory stores Go modules with pinned buildable packages that are used within this repository, managed by https://github.com/bwplotka/bingo.
* Run `bingo get` to install all tools having each own module file in this directory.
* Run `bingo get <tool>` to install <tool> that have own module file in this directory.
* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod.
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool.
* For go: Import `.bingo/variables.go` to for variable names.
* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies.
## Requirements
* Go 1.14+
+114
View File
@@ -0,0 +1,114 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.3.1. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
GO ?= $(shell which go)
# Bellow generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.
# For example for bingo variable:
#
# In your main Makefile (for non array binaries):
#
#include .bingo/Variables.mk # Assuming -dir was set to .bingo .
#
#command: $(BINGO)
# @echo "Running bingo"
# @$(BINGO) <flags/args..>
#
BINGO := $(GOBIN)/bingo-v0.3.1
$(BINGO): $(BINGO_DIR)/bingo.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/bingo-v0.3.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.3.1 "github.com/bwplotka/bingo"
BUF := $(GOBIN)/buf-v0.37.1
$(BUF): $(BINGO_DIR)/buf.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/buf-v0.37.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=buf.mod -o=$(GOBIN)/buf-v0.37.1 "github.com/bufbuild/buf/cmd/buf"
CALENS := $(GOBIN)/calens-v0.2.0
$(CALENS): $(BINGO_DIR)/calens.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/calens-v0.2.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=calens.mod -o=$(GOBIN)/calens-v0.2.0 "github.com/restic/calens"
FILEB0X := $(GOBIN)/fileb0x-v1.1.4
$(FILEB0X): $(BINGO_DIR)/fileb0x.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/fileb0x-v1.1.4"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=fileb0x.mod -o=$(GOBIN)/fileb0x-v1.1.4 "github.com/UnnoTed/fileb0x"
FLAEX := $(GOBIN)/flaex-v0.2.0
$(FLAEX): $(BINGO_DIR)/flaex.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/flaex-v0.2.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=flaex.mod -o=$(GOBIN)/flaex-v0.2.0 "github.com/owncloud/flaex"
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.37.1
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v1.37.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.37.1 "github.com/golangci/golangci-lint/cmd/golangci-lint"
GOVERAGE := $(GOBIN)/goverage-v0.0.0-20180129164344-eec3514a20b5
$(GOVERAGE): $(BINGO_DIR)/goverage.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/goverage-v0.0.0-20180129164344-eec3514a20b5"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=goverage.mod -o=$(GOBIN)/goverage-v0.0.0-20180129164344-eec3514a20b5 "github.com/haya14busa/goverage"
GOX := $(GOBIN)/gox-v1.0.1
$(GOX): $(BINGO_DIR)/gox.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/gox-v1.0.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=gox.mod -o=$(GOBIN)/gox-v1.0.1 "github.com/mitchellh/gox"
HUGO := $(GOBIN)/hugo-v0.80.0
$(HUGO): $(BINGO_DIR)/hugo.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/hugo-v0.80.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=hugo.mod -o=$(GOBIN)/hugo-v0.80.0 "github.com/gohugoio/hugo"
MUTAGEN := $(GOBIN)/mutagen-v0.11.8
$(MUTAGEN): $(BINGO_DIR)/mutagen.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/mutagen-v0.11.8"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=mutagen.mod -o=$(GOBIN)/mutagen-v0.11.8 "github.com/mutagen-io/mutagen/cmd/mutagen"
PROTOC_GEN_DOC := $(GOBIN)/protoc-gen-doc-v1.4.1
$(PROTOC_GEN_DOC): $(BINGO_DIR)/protoc-gen-doc.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-doc-v1.4.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-doc.mod -o=$(GOBIN)/protoc-gen-doc-v1.4.1 "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
PROTOC_GEN_GO := $(GOBIN)/protoc-gen-go-v1.25.0
$(PROTOC_GEN_GO): $(BINGO_DIR)/protoc-gen-go.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-go-v1.25.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-go.mod -o=$(GOBIN)/protoc-gen-go-v1.25.0 "google.golang.org/protobuf/cmd/protoc-gen-go"
PROTOC_GEN_MICRO := $(GOBIN)/protoc-gen-micro-v3.0.0-20210217182006-0f0ace1a44a9
$(PROTOC_GEN_MICRO): $(BINGO_DIR)/protoc-gen-micro.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-micro-v3.0.0-20210217182006-0f0ace1a44a9"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-micro.mod -o=$(GOBIN)/protoc-gen-micro-v3.0.0-20210217182006-0f0ace1a44a9 "github.com/asim/go-micro/cmd/protoc-gen-micro/v3"
PROTOC_GEN_MICROWEB := $(GOBIN)/protoc-gen-microweb-v0.0.0-20210224131655-d9b1137a84d4
$(PROTOC_GEN_MICROWEB): $(BINGO_DIR)/protoc-gen-microweb.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-microweb-v0.0.0-20210224131655-d9b1137a84d4"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-microweb.mod -o=$(GOBIN)/protoc-gen-microweb-v0.0.0-20210224131655-d9b1137a84d4 "github.com/owncloud/protoc-gen-microweb"
PROTOC_GEN_OPENAPIV2 := $(GOBIN)/protoc-gen-openapiv2-v2.2.0
$(PROTOC_GEN_OPENAPIV2): $(BINGO_DIR)/protoc-gen-openapiv2.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-openapiv2-v2.2.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-openapiv2.mod -o=$(GOBIN)/protoc-gen-openapiv2-v2.2.0 "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
REFLEX := $(GOBIN)/reflex-v0.3.0
$(REFLEX): $(BINGO_DIR)/reflex.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/reflex-v0.3.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=reflex.mod -o=$(GOBIN)/reflex-v0.3.0 "github.com/cespare/reflex"
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/bwplotka/bingo v0.3.1
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/bufbuild/buf v0.37.1 // cmd/buf
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/restic/calens v0.2.0
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/UnnoTed/fileb0x v1.1.4
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/owncloud/flaex v0.2.0
Executable
+1
View File
@@ -0,0 +1 @@
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files.
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/golangci/golangci-lint v1.37.1 // cmd/golangci-lint
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/mitchellh/gox v1.0.1
+7
View File
@@ -0,0 +1,7 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
replace github.com/markbates/inflect => github.com/markbates/inflect v0.0.0-20171215194931-a12c3aec81a6
require github.com/gohugoio/hugo v0.80.0
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/mutagen-io/mutagen v0.11.8 // cmd/mutagen
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/pseudomuto/protoc-gen-doc v1.4.1 // cmd/protoc-gen-doc
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require google.golang.org/protobuf v1.25.0 // cmd/protoc-gen-go
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/asim/go-micro/cmd/protoc-gen-micro/v3 v3.0.0-20210217182006-0f0ace1a44a9
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/owncloud/protoc-gen-microweb v0.0.0-20210224131655-d9b1137a84d4
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/grpc-ecosystem/grpc-gateway/v2 v2.2.0 // protoc-gen-openapiv2
+5
View File
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/cespare/reflex v0.3.0
+41
View File
@@ -0,0 +1,41 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.3.1. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
GOBIN=${GOBIN:=$(go env GOBIN)}
if [ -z "$GOBIN" ]; then
GOBIN="$(go env GOPATH)/bin"
fi
BINGO="${GOBIN}/bingo-v0.3.1"
BUF="${GOBIN}/buf-v0.37.1"
CALENS="${GOBIN}/calens-v0.2.0"
FILEB0X="${GOBIN}/fileb0x-v1.1.4"
FLAEX="${GOBIN}/flaex-v0.2.0"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.37.1"
GOVERAGE="${GOBIN}/goverage-v0.0.0-20180129164344-eec3514a20b5"
GOX="${GOBIN}/gox-v1.0.1"
HUGO="${GOBIN}/hugo-v0.80.0"
MUTAGEN="${GOBIN}/mutagen-v0.11.8"
PROTOC_GEN_DOC="${GOBIN}/protoc-gen-doc-v1.4.1"
PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.25.0"
PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v3.0.0-20210217182006-0f0ace1a44a9"
PROTOC_GEN_MICROWEB="${GOBIN}/protoc-gen-microweb-v0.0.0-20210224131655-d9b1137a84d4"
PROTOC_GEN_OPENAPIV2="${GOBIN}/protoc-gen-openapiv2-v2.2.0"
REFLEX="${GOBIN}/reflex-v0.3.0"
+2 -2
View File
@@ -1,7 +1,7 @@
# The test runner source for API tests
CORE_COMMITID=2056240d53091ea69336d25ad57e3f4afc0c37d3
CORE_COMMITID=90edbb40800b36fadc4aba6216a3fd16b559f1e3
CORE_BRANCH=master
# The test runner source for UI tests
WEB_COMMITID=f1c70eb67fbe86f6f32f851ec6199f0b25bb5393
WEB_COMMITID=da869f4cb36ea0a28ead87e57a61d7bbb639aab0
WEB_BRANCH=master
+52 -52
View File
@@ -1,5 +1,6 @@
config = {
'modules': [
# if you add a module here please also add it to the root level Makefile
'accounts',
'glauth',
'graph-explorer',
@@ -239,10 +240,10 @@ def testOcisModules(ctx):
for module in config['modules']:
pipelines.append(testOcisModule(ctx, module))
coverage_upload = uploadCoverage(ctx)
coverage_upload['depends_on'] = getPipelineNames(pipelines)
scan_result_upload = uploadScanResults(ctx)
scan_result_upload['depends_on'] = getPipelineNames(pipelines)
return pipelines + [coverage_upload]
return pipelines + [scan_result_upload]
def testPipelines(ctx):
pipelines = [
@@ -263,29 +264,13 @@ def testPipelines(ctx):
def testOcisModule(ctx, module):
steps = makeGenerate(module) + [
{
'name': 'vet',
'name': 'golangci-lint',
'image': 'webhippie/golang:1.15',
'pull': 'always',
'commands': [
'make -C %s vet' % (module),
],
'volumes': [stepVolumeGoWebhippie,],
},
{
'name': 'staticcheck',
'image': 'webhippie/golang:1.15',
'pull': 'always',
'commands': [
'make -C %s staticcheck' % (module),
],
'volumes': [stepVolumeGoWebhippie,],
},
{
'name': 'lint',
'image': 'webhippie/golang:1.15',
'pull': 'always',
'commands': [
'make -C %s lint' % (module),
'mkdir -p cache/checkstyle',
'make -C %s ci-golangci-lint' % (module),
'mv %s/checkstyle.xml cache/checkstyle/%s_checkstyle.xml' % (module, module),
],
'volumes': [stepVolumeGoWebhippie,],
},
@@ -294,21 +279,22 @@ def testOcisModule(ctx, module):
'image': 'webhippie/golang:1.15',
'pull': 'always',
'commands': [
'mkdir -p cache/coverage',
'make -C %s test' % (module),
'mv %s/coverage.out %s_coverage.out' % (module, module),
'mv %s/coverage.out cache/coverage/%s_coverage.out' % (module, module),
],
'volumes': [stepVolumeGoWebhippie,],
},
{
'name': 'coverage-cache',
'image': 'plugins/s3',
'name': 'scan-result-cache',
'image': 'plugins/s3:1',
'settings': {
'endpoint': {
'from_secret': 'cache_s3_endpoint'
},
'bucket': 'cache',
'source': '%s_coverage.out' % (module),
'target': '%s/%s/coverage' % (ctx.repo.slug, ctx.build.commit + '-${DRONE_BUILD_NUMBER}'),
'source': 'cache/**/*',
'target': '%s/%s' % (ctx.repo.slug, ctx.build.commit + '-${DRONE_BUILD_NUMBER}'),
'path_style': True,
'access_key': {
'from_secret': 'cache_s3_access_key'
@@ -363,7 +349,7 @@ def buildOcisBinaryForTesting(ctx):
'volumes': [pipelineVolumeGoWebhippie],
}
def uploadCoverage(ctx):
def uploadScanResults(ctx):
sonar_env = {
'SONAR_TOKEN': {
'from_secret': 'sonar_token',
@@ -376,26 +362,39 @@ def uploadCoverage(ctx):
'SONAR_PULL_REQUEST_KEY': '%s' % (ctx.build.ref.replace("refs/pull/", "").split("/")[0]),
})
repo_slug = ctx.build.source_repo if ctx.build.source_repo else ctx.repo.slug
return {
'kind': 'pipeline',
'type': 'docker',
'name': 'upload-coverage',
'name': 'upload-scan-results',
'platform': {
'os': 'linux',
'arch': 'amd64',
},
'clone': {
'disable': True, # Sonarcloud does not apply issues on already merged branch
},
'steps': [
{
'name': 'clone',
'image': 'alpine/git',
'commands': [
'git clone https://github.com/%s.git .' % (repo_slug),
'git checkout $DRONE_COMMIT',
],
},
{
'name': 'sync-from-cache',
'image': 'minio/mc:RELEASE.2020-12-10T01-26-17Z',
'image': 'minio/mc:RELEASE.2021-02-19T05-34-40Z',
'environment': {
'MC_HOST_cache': {
'MC_HOST_cachebucket': {
'from_secret': 'cache_s3_connection_url'
}
},
'commands': [
'mkdir -p coverage',
'mc mirror cache/cache/%s/%s/coverage coverage/' % (ctx.repo.slug, ctx.build.commit + '-${DRONE_BUILD_NUMBER}'),
'mkdir -p cache',
'mc mirror cachebucket/cache/%s/%s/cache cache/' % (ctx.repo.slug, ctx.build.commit + '-${DRONE_BUILD_NUMBER}'),
]
},
{
@@ -418,12 +417,12 @@ def uploadCoverage(ctx):
'name': 'purge-cache',
'image': 'minio/mc:RELEASE.2020-12-10T01-26-17Z',
'environment': {
'MC_HOST_cache': {
'MC_HOST_cachebucket': {
'from_secret': 'cache_s3_connection_url'
}
},
'commands': [
'mc rm --recursive --force cache/cache/%s/%s/coverage' % (ctx.repo.slug, ctx.build.commit + '-${DRONE_BUILD_NUMBER}'),
'mc rm --recursive --force cachebucket/cache/%s/%s/cache' % (ctx.repo.slug, ctx.build.commit + '-${DRONE_BUILD_NUMBER}'),
]
},
],
@@ -580,7 +579,8 @@ def uiTestPipeline(ctx, suiteName, storage = 'owncloud', accounts_hash_difficult
'cd /srv/app/web',
'git checkout $WEB_COMMITID',
'cp -r tests/acceptance/filesForUpload/* /uploads',
'yarn install-all',
'yarn install --all',
'yarn build',
'./tests/acceptance/run.sh'
],
'volumes':
@@ -646,7 +646,8 @@ def accountsUITests(ctx, storage = 'owncloud', accounts_hash_difficulty = 4):
'cd /srv/app/web',
'git checkout $WEB_COMMITID',
'cp -r tests/acceptance/filesForUpload/* /uploads',
'yarn install-all',
'yarn install --all',
'yarn build',
'cd /drone/src/accounts',
'yarn install --all',
'make test-acceptance-webui'
@@ -712,7 +713,7 @@ def dockerRelease(ctx, arch):
build() + [
{
'name': 'dryrun',
'image': 'plugins/docker:18.09',
'image': 'plugins/docker:latest',
'pull': 'always',
'settings': {
'dry_run': True,
@@ -732,7 +733,7 @@ def dockerRelease(ctx, arch):
},
{
'name': 'docker',
'image': 'plugins/docker:18.09',
'image': 'plugins/docker:latest',
'pull': 'always',
'settings': {
'username': {
@@ -782,7 +783,7 @@ def dockerEos(ctx):
build() + [
{
'name': 'dryrun-eos-ocis',
'image': 'plugins/docker:18.09',
'image': 'plugins/docker:latest',
'pull': 'always',
'settings': {
'dry_run': True,
@@ -801,7 +802,7 @@ def dockerEos(ctx):
},
{
'name': 'docker-eos-ocis',
'image': 'plugins/docker:18.09',
'image': 'plugins/docker:latest',
'pull': 'always',
'settings': {
'username': {
@@ -914,10 +915,10 @@ def binaryRelease(ctx, name):
},
{
'name': 'changelog',
'image': 'toolhippie/calens:latest',
'image': 'webhippie/golang:1.15',
'pull': 'always',
'commands': [
'calens --version %s -o ocis/dist/CHANGELOG.md' % ctx.build.ref.replace("refs/tags/v", "").split("-")[0],
'make changelog CHANGELOG_VERSION=%s' % ctx.build.ref.replace("refs/tags/v", "").split("-")[0],
],
'when': {
'ref': [
@@ -1194,17 +1195,16 @@ def docs(ctx):
},
{
'name': 'prepare',
'image': 'owncloudci/alpine:latest',
'image': 'webhippie/golang:1.15',
'commands': [
'make -C docs docs-copy'
],
},
{
'name': 'test',
'image': 'owncloudci/hugo:0.71.0',
'image': 'webhippie/golang:1.15',
'commands': [
'cd docs/hugo',
'hugo',
'make -C docs test'
],
},
{
@@ -1233,13 +1233,13 @@ def docs(ctx):
'name': 'list and remove temporary files',
'image': 'owncloudci/alpine:latest',
'commands': [
'tree hugo/public',
'tree docs/hugo/public',
'rm -rf docs/hugo',
],
},
{
'name': 'downstream',
'image': 'plugins/downstream',
'image': 'plugins/downstream:latest',
'settings': {
'server': 'https://drone.owncloud.com/',
'token': {
@@ -1479,7 +1479,7 @@ def deploy(ctx, config, rebuild):
'steps': [
{
'name': 'clone continuous deployment playbook',
'image': 'alpine/git',
'image': 'alpine/git:latest',
'commands': [
'cd deployments/continuous-deployment-config',
'git clone https://github.com/owncloud-devops/continuous-deployment.git',
@@ -1487,7 +1487,7 @@ def deploy(ctx, config, rebuild):
},
{
'name': 'deploy',
'image': 'owncloudci/drone-ansible',
'image': 'owncloudci/drone-ansible:latest',
'failure': 'ignore',
'environment': {
'CONTINUOUS_DEPLOY_SERVERS_CONFIG': '../%s' % (config),
+1
View File
@@ -1,4 +1,5 @@
*/coverage.out
*/checkstyle.xml
ocis/config/identifier-registration.yaml
*/bin
+7
View File
@@ -0,0 +1,7 @@
.PHONY: config-docs-generate
config-docs-generate: $(FLAEX)
@echo "$(NAME): generating config docs"
@$(FLAEX) >| ../docs/extensions/$(NAME)/configuration.md
.PHONY: grpc-docs-generate
grpc-docs-generate: ../docs/extensions/${NAME}/grpc.md
+6
View File
@@ -0,0 +1,6 @@
.PHONY: generate
generate: ci-node-generate ci-go-generate
.PHONY: embed.yml
embed.yml: $(FILEB0X)
@cd pkg/assets/ && echo -n "$(NAME): embed.go - " && $(FILEB0X) embed.yml
+108
View File
@@ -0,0 +1,108 @@
IMPORT := github.com/owncloud/ocis/$(NAME)
BIN := bin
DIST := dist
ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
UNAME := Windows
else
EXECUTABLE := $(NAME)
UNAME := $(shell uname -s)
endif
ifeq ($(UNAME), Darwin)
GOBUILD ?= go build -i
else
GOBUILD ?= go build
endif
PACKAGES ?= $(shell go list ./...)
SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
GENERATE ?= $(PACKAGES)
TAGS ?=
ifndef OUTPUT
ifneq ($(DRONE_TAG),)
OUTPUT ?= $(subst v,,$(DRONE_TAG))
else
OUTPUT ?= testing
endif
endif
ifndef VERSION
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
VERSION ?= $(shell git rev-parse --short HEAD)
endif
endif
ifndef DATE
DATE := $(shell date -u '+%Y%m%d')
endif
LDFLAGS += -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
DEBUG_LDFLAGS += -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
GCFLAGS += all=-N -l
.PHONY: all
all: build
.PHONY: sync
sync:
go mod download
.PHONY: clean
clean:
@echo "$(NAME): clean"
go clean -i ./...
rm -rf $(BIN) $(DIST)
.PHONY: go-mod-tidy
go-mod-tidy:
@echo "$(NAME): go-mod-tidy"
@go mod tidy
.PHONY: fmt
fmt:
gofmt -s -w $(SOURCES)
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E golint -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME)
.PHONY: ci-golangci-lint
ci-golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E golint -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME) --timeout 10m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
.PHONY: test
test: $(GOVERAGE)
@echo
@echo
@echo "$(NAME): test"
@echo
@$(GOVERAGE) -v -coverprofile coverage.out $(PACKAGES)
.PHONY: go-coverage
go-coverage:
@echo "$(NAME): go-coverage"
@if [ ! -f coverage.out ]; then $(MAKE) test &>/dev/null; fi;
@go tool cover -func coverage.out | tail -1 | grep -Eo "[0-9]+\.[0-9]+"
.PHONY: install
install: $(SOURCES)
go install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' ./cmd/$(NAME)
.PHONY: build
build: $(BIN)/$(EXECUTABLE) $(BIN)/$(EXECUTABLE)-debug
$(BIN)/$(EXECUTABLE): $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ ./cmd/$(NAME)
$(BIN)/$(EXECUTABLE)-debug: $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(DEBUG_LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)
.PHONY: watch
watch: $(REFLEX)
$(REFLEX) -c reflex.conf
+60
View File
@@ -0,0 +1,60 @@
.PHONY: protoc-gen-openapiv2
protoc-gen-openapiv2:
GO111MODULE=off go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2
.PHONY: $(PROTO_SRC)/${NAME}.pb.go
$(PROTO_SRC)/${NAME}.pb.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_GO)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-go=$(PROTOC_GEN_GO) \
--go_out=. \
$(PROTO_SRC)/${NAME}.proto
.PHONY: $(PROTO_SRC)/${NAME}.pb.micro.go
$(PROTO_SRC)/${NAME}.pb.micro.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_MICRO)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.micro.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-micro=$(PROTOC_GEN_MICRO) \
--micro_out=. \
$(PROTO_SRC)/${NAME}.proto
.PHONY: $(PROTO_SRC)/${NAME}.pb.web.go
$(PROTO_SRC)/${NAME}.pb.web.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_MICROWEB)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.web.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-microweb=$(PROTOC_GEN_MICROWEB) \
--microweb_out=. \
$(PROTO_SRC)/${NAME}.proto
.PHONY: $(PROTO_SRC)/${NAME}.swagger.json
$(PROTO_SRC)/${NAME}.swagger.json: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_OPENAPIV2)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.swagger.json"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-openapiv2=$(PROTOC_GEN_OPENAPIV2) \
--openapiv2_out=$(PROTO_SRC)/ \
$(PROTO_SRC)/${NAME}.proto
.PHONY: ../docs/extensions/${NAME}/grpc.md
../docs/extensions/${NAME}/grpc.md: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_DOC)
@echo "$(NAME): generating ../docs/extensions/${NAME}/grpc.md"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-doc=$(PROTOC_GEN_DOC) \
--doc_opt=./templates/GRPC.tmpl,grpc.md \
--doc_out=../docs/extensions/${NAME} \
$(PROTO_SRC)/${NAME}.proto
+33
View File
@@ -0,0 +1,33 @@
.PHONY: changelog
changelog: $(CALENS) ## generate changelog
$(CALENS) -i ../changelog -t ../changelog/CHANGELOG.tmpl >| ../CHANGELOG.md
.PHONY: release
release: release-dirs release-linux release-windows release-darwin release-copy release-check
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release
.PHONY: release-linux
release-linux: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-windows
release-windows: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-darwin
release-darwin: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-copy
release-copy:
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
.PHONY: release-check
release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
.PHONY: release-finish
release-finish: release-copy release-check
+122 -1
View File
@@ -2,7 +2,128 @@
The following sections list the changes for unreleased.
[unreleased]: https://github.com/owncloud/ocis/compare/v1.1.0...master
[unreleased]: https://github.com/owncloud/ocis/compare/v1.2.0...master
## Summary
* Bugfix - Purposely delay accounts service startup: [#1734](https://github.com/owncloud/ocis/pull/1734)
* Bugfix - Add missing gateway config: [#1716](https://github.com/owncloud/ocis/pull/1716)
* Bugfix - Fix accounts initialization: [#1696](https://github.com/owncloud/ocis/pull/1696)
* Bugfix - Fix the ttl of the authentication middleware cache: [#1699](https://github.com/owncloud/ocis/pull/1699)
* Change - Update ownCloud Web to v2.0.1: [#1683](https://github.com/owncloud/ocis/pull/1683)
* Change - Update ownCloud Web to v2.0.2: [#1776](https://github.com/owncloud/ocis/pull/1776)
* Enhancement - Remove the JWT from the log: [#1758](https://github.com/owncloud/ocis/pull/1758)
* Enhancement - Update go-micro to v3.5.1-0.20210217182006-0f0ace1a44a9: [#1670](https://github.com/owncloud/ocis/pull/1670)
* Enhancement - Update reva to v1.6.1-0.20210223065028-53f39499762e: [#1683](https://github.com/owncloud/ocis/pull/1683)
* Enhancement - Add initial nats and kubernetes registry support: [#1697](https://github.com/owncloud/ocis/pull/1697)
## Details
* Bugfix - Purposely delay accounts service startup: [#1734](https://github.com/owncloud/ocis/pull/1734)
As it turns out the race condition between `accounts <-> storage-metadata` still remains.
This PR is a hotfix, and it should be followed up with a proper fix. Either:
- block the accounts' initialization until the storage metadata is ready (using the registry)
or - allow the accounts service to initialize and use a message broker to signal the accounts the
metadata storage is ready to receive requests.
https://github.com/owncloud/ocis/pull/1734
* Bugfix - Add missing gateway config: [#1716](https://github.com/owncloud/ocis/pull/1716)
The auth provider `ldap` and `oidc` drivers now need to be able talk to the reva gateway. We added
the `gatewayscv` to the config that is passed to reva.
https://github.com/owncloud/ocis/pull/1716
* Bugfix - Fix accounts initialization: [#1696](https://github.com/owncloud/ocis/pull/1696)
Originally the accounts service relies on both the `settings` and `storage-metadata` to be up
and running at the moment it starts. This is an antipattern as it will cause the entire service to
panic if the dependants are not present.
We inverted this dependency and moved the default initialization data (i.e: creating roles,
permissions, settings bundles) and instead of notifying the settings service that the
account has to provide with such options, the settings is instead initialized with the options
the accounts rely on. Essentially saving bandwith as there is no longer a gRPC call to the
settings service.
For the `storage-metadata` a retry mechanism was added that retries by default 20 times to
fetch the `com.owncloud.storage.metadata` from the service registry every `500`
miliseconds. If this retry expires the accounts panics, as its dependency on the
`storage-metadata` service cannot be resolved.
We also introduced a client wrapper that acts as middleware between a client and a server. For
more information on how it works further read [here](https://github.com/sony/gobreaker)
https://github.com/owncloud/ocis/pull/1696
* Bugfix - Fix the ttl of the authentication middleware cache: [#1699](https://github.com/owncloud/ocis/pull/1699)
The authentication cache ttl was multiplied with `time.Second` multiple times. This
resulted in a ttl that was not intended.
https://github.com/owncloud/ocis/pull/1699
* Change - Update ownCloud Web to v2.0.1: [#1683](https://github.com/owncloud/ocis/pull/1683)
Tags: web
We updated ownCloud Web to v2.0.1. Please refer to the changelog (linked) for details on the web
release.
https://github.com/owncloud/ocis/pull/1683
https://github.com/owncloud/web/releases/tag/v2.0.1
* Change - Update ownCloud Web to v2.0.2: [#1776](https://github.com/owncloud/ocis/pull/1776)
Tags: web
We updated ownCloud Web to v2.0.2. Please refer to the changelog (linked) for details on the web
release.
https://github.com/owncloud/ocis/pull/1776
https://github.com/owncloud/web/releases/tag/v2.0.2
* Enhancement - Remove the JWT from the log: [#1758](https://github.com/owncloud/ocis/pull/1758)
We were logging the JWT in some places. Secrets should not be exposed in logs so it got removed.
https://github.com/owncloud/ocis/pull/1758
* Enhancement - Update go-micro to v3.5.1-0.20210217182006-0f0ace1a44a9: [#1670](https://github.com/owncloud/ocis/pull/1670)
- We updated from go micro v2 (v2.9.1) go-micro v3 (v3.5.1 edge). - oCIS runtime is now aware of
`MICRO_LOG_LEVEL` and is set to `error` by default. This decision was made because ownCloud,
as framework builders, want to log everything oCIS related and hide everything unrelated by
default. It can be re-enabled by setting it to a log level other than `error`. i.e:
`MICRO_LOG_LEVEL=info`. - Updated `protoc-gen-micro` to the [latest
version](https://github.com/asim/go-micro/tree/master/cmd/protoc-gen-micro). -
We're using Prometheus wrappers from go-micro.
https://github.com/owncloud/ocis/pull/1670
https://github.com/asim/go-micro/pull/2126
* Enhancement - Update reva to v1.6.1-0.20210223065028-53f39499762e: [#1683](https://github.com/owncloud/ocis/pull/1683)
* quota querying and tree accounting [cs3org/reva#1405](https://github.com/cs3org/reva/pull/1405)
https://github.com/owncloud/ocis/pull/1683
https://github.com/cs3org/reva/pull/1405
* Enhancement - Add initial nats and kubernetes registry support: [#1697](https://github.com/owncloud/ocis/pull/1697)
We added initial support to use nats and kubernetes as a service registry using
`MICRO_REGISTRY=nats` and `MICRO_REGISTRY=kubernetes` respectively. Multiple nodes can
be given with `MICRO_REGISTRY_ADDRESS=1.2.3.4,5.6.7.8,9.10.11.12`.
https://github.com/owncloud/ocis/pull/1697
# Changelog for [1.2.0] (2021-02-17)
The following sections list the changes for 1.2.0.
[1.2.0]: https://github.com/owncloud/ocis/compare/v1.1.0...v1.2.0
## Summary
+16
View File
@@ -12,6 +12,7 @@ WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
# if you add a module here please also add it to the .drone.star file
OCIS_MODULES = \
accounts \
glauth \
@@ -30,6 +31,8 @@ OCIS_MODULES = \
web \
webdav
include .bingo/Variables.mk
.PHONY: help
help:
@echo "Please use 'make <target>' where <target> is one of the following:"
@@ -135,3 +138,16 @@ go-coverage:
@for mod in $(OCIS_MODULES); do \
echo -n "% coverage $$mod: "; $(MAKE) --no-print-directory -C $$mod go-coverage; \
done
.PHONY: bingo-update
bingo-update: $(BINGO)
$(BINGO) get -u
CHANGELOG_VERSION =
.PHONY: changelog
changelog: $(CALENS)
ifndef CHANGELOG_VERSION
$(error CHANGELOG_VERSION is undefined)
endif
$(CALENS) --version $(CHANGELOG_VERSION) -o ocis/dist/CHANGELOG.md
+15 -211
View File
@@ -1,178 +1,33 @@
SHELL := bash
NAME := accounts
IMPORT := github.com/owncloud/ocis/$(NAME)
BIN := bin
DIST := dist
HUGO := hugo
PROTO_VERSION := v0
PROTO_SRC := pkg/proto/$(PROTO_VERSION)
ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
UNAME := Windows
else
EXECUTABLE := $(NAME)
UNAME := $(shell uname -s)
endif
ifeq ($(UNAME), Darwin)
GOBUILD ?= go build -i
else
GOBUILD ?= go build
endif
PACKAGES ?= $(shell go list ./...)
SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
GENERATE ?= $(IMPORT)/pkg/assets
FEATURE_PATH ?= "ui/tests/acceptance/features"
TAGS ?=
ifndef GOPATH
export GOPATH := $(shell go env GOPATH)
endif
export PATH := $(PATH):$(GOPATH)/bin
ifndef OUTPUT
ifneq ($(DRONE_TAG),)
OUTPUT ?= $(subst v,,$(DRONE_TAG))
else
OUTPUT ?= testing
endif
endif
ifndef VERSION
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
VERSION ?= $(shell git rev-parse --short HEAD)
endif
endif
ifndef DATE
DATE := $(shell date -u '+%Y%m%d')
endif
LDFLAGS += -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
GCFLAGS += all=-N -l
.PHONY: all
all: build
.PHONY: sync
sync:
go mod download
.PHONY: clean
clean:
go clean -i ./...
rm -rf $(BIN) $(DIST) $(HUGO)
.PHONY: go-mod-tidy
go-mod-tidy:
@go mod tidy
.PHONY: fmt
fmt:
gofmt -s -w $(SOURCES)
.PHONY: vet
vet:
go vet $(PACKAGES)
.PHONY: staticcheck
staticcheck:
go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES)
.PHONY: lint
lint:
for PKG in $(PACKAGES); do go run golang.org/x/lint/golint -set_exit_status $$PKG || exit 1; done;
.PHONY: changelog
changelog:
go run github.com/restic/calens >| CHANGELOG.md
.PHONY: test
test:
go run github.com/haya14busa/goverage -v -coverprofile coverage.out $(PACKAGES)
.PHONY: go-coverage
go-coverage:
@if [ ! -f coverage.out ]; then $(MAKE) test &>/dev/null; fi;
@go tool cover -func coverage.out | tail -1 | grep -Eo "[0-9]+\.[0-9]+"
.PHONY: install
install: $(SOURCES)
go install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' ./cmd/$(NAME)
.PHONY: build
build: $(BIN)/$(EXECUTABLE) $(BIN)/$(EXECUTABLE)-debug
$(BIN)/$(EXECUTABLE): $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ ./cmd/$(NAME)
$(BIN)/$(EXECUTABLE)-debug: $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)
.PHONY: release
release: release-dirs release-linux release-windows release-darwin release-copy release-check
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release
.PHONY: release-linux
release-linux: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-windows
release-windows: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-darwin
release-darwin: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-copy
release-copy:
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
.PHONY: release-check
release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
.PHONY: release-finish
release-finish: release-copy release-check
.PHONY: test-acceptance-webui
test-acceptance-webui:
./ui/tests/run-acceptance-test.sh $(FEATURE_PATH)
.PHONY: watch
watch:
go run github.com/cespare/reflex -c reflex.conf
############ tooling ############
include ../.bingo/Variables.mk
############ go tooling ############
include ../.make/go.mk
############ release ############
include ../.make/release.mk
############ docs generate ############
include ../.make/docs.mk
.PHONY: docs-generate
docs-generate: config-docs-generate \
grpc-docs-generate
.PHONY: config-docs-generate
config-docs-generate:
go run github.com/owncloud/flaex >| ../docs/extensions/$(NAME)/configuration.md
.PHONY: grpc-docs-generate
grpc-docs-generate: ../docs/extensions/${NAME}/grpc.md
############ generate ############
.PHONY: generate
generate: ci-node-generate ci-go-generate
include ../.make/generate.mk
.PHONY: ci-go-generate
ci-go-generate: protobuf # CI runs ci-node-generate automatically before this target
go generate $(GENERATE)
@go generate $(GENERATE)
.PHONY: ci-node-generate
ci-node-generate: yarn-build
@@ -188,61 +43,10 @@ node_modules:
yarn install --frozen-lockfile
############ protobuf ############
$(GOPATH)/bin/protoc-gen-go:
go get -v google.golang.org/protobuf/cmd/protoc-gen-go@v1.25.0
include ../.make/protobuf.mk
$(GOPATH)/bin/protoc-gen-micro:
GO111MODULE=on go get -v github.com/micro/protoc-gen-micro/v2
$(GOPATH)/bin/protoc-gen-microweb:
GO111MODULE=off go get -v github.com/owncloud/protoc-gen-microweb
$(GOPATH)/bin/protoc-gen-openapiv2:
GO111MODULE=off go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2
$(GOPATH)/bin/protoc-gen-doc:
GO111MODULE=off go get -v github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
.PHONY: $(PROTO_SRC)/${NAME}.pb.go
$(PROTO_SRC)/${NAME}.pb.go: $(GOPATH)/bin/protoc-gen-openapiv2 $(GOPATH)/bin/protoc-gen-go
protoc \
-I=../third_party/ \
-I=$(PROTO_SRC)/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/ \
--go_out=. ${NAME}.proto
.PHONY: $(PROTO_SRC)/${NAME}.pb.micro.go
$(PROTO_SRC)/${NAME}.pb.micro.go: $(GOPATH)/bin/protoc-gen-openapiv2 $(GOPATH)/bin/protoc-gen-micro
protoc \
-I=../third_party/ \
-I=$(PROTO_SRC)/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/ \
--micro_out=. ${NAME}.proto
.PHONY: $(PROTO_SRC)/${NAME}.pb.web.go
$(PROTO_SRC)/${NAME}.pb.web.go: $(GOPATH)/bin/protoc-gen-openapiv2 $(GOPATH)/bin/protoc-gen-microweb
protoc \
-I=../third_party/ \
-I=$(PROTO_SRC)/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/ \
--microweb_out=. ${NAME}.proto
.PHONY: $(PROTO_SRC)/${NAME}.swagger.json
$(PROTO_SRC)/${NAME}.swagger.json: $(GOPATH)/bin/protoc-gen-openapiv2
protoc \
-I=../third_party/ \
-I=$(PROTO_SRC)/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/ \
--openapiv2_out=$(PROTO_SRC)/ ${NAME}.proto
.PHONY: ../docs/extensions/${NAME}/grpc.md
../docs/extensions/${NAME}/grpc.md: $(GOPATH)/bin/protoc-gen-openapiv2 $(GOPATH)/bin/protoc-gen-doc
protoc \
-I=../third_party/ \
-I=$(PROTO_SRC)/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/ \
--doc_opt=./templates/GRPC.tmpl,grpc.md \
--doc_out=../docs/extensions/${NAME} $(PROTO_SRC)/${NAME}.proto
PROTO_VERSION := v0
PROTO_SRC := pkg/proto/$(PROTO_VERSION)
.PHONY: protobuf
protobuf: $(PROTO_SRC)/${NAME}.pb.go \
+10 -12
View File
@@ -6,46 +6,44 @@ require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
contrib.go.opencensus.io/exporter/ocagent v0.6.0
contrib.go.opencensus.io/exporter/zipkin v0.1.1
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/asim/go-micro/plugins/client/grpc/v3 v3.0.0-20210217182006-0f0ace1a44a9
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/cs3org/go-cs3apis v0.0.0-20210209082852-35ace33082f5
github.com/cs3org/reva v1.6.0
github.com/cs3org/reva v1.6.1-0.20210223065028-53f39499762e
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-chi/render v1.0.1
github.com/gofrs/uuid v3.3.0+incompatible
github.com/golang/protobuf v1.4.3
github.com/huandu/xstrings v1.3.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.2.0
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/mennanov/fieldmask-utils v0.3.3
github.com/micro/cli/v2 v2.1.2
github.com/micro/go-micro/v2 v2.9.1
github.com/micro/protoc-gen-micro/v2 v2.1.1 // indirect
github.com/mitchellh/copystructure v1.1.1 // indirect
github.com/oklog/run v1.1.0
github.com/olekukonko/tablewriter v0.0.4
github.com/openzipkin/zipkin-go v0.2.2
github.com/owncloud/ocis/ocis-pkg v0.0.0-20210216094451-dc73176dc62d
github.com/owncloud/ocis/settings v0.0.0-20210216094451-dc73176dc62d
github.com/prometheus/client_golang v1.7.1
github.com/restic/calens v0.2.0
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rs/zerolog v1.20.0
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.7.0
go.opencensus.io v0.22.6
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/mod v0.4.1 // indirect
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
golang.org/x/text v0.3.5 // indirect
google.golang.org/genproto v0.0.0-20200624020401-64a14ca9d1ad
google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea
google.golang.org/grpc v1.35.0
google.golang.org/protobuf v1.25.0
gopkg.in/yaml.v2 v2.4.0 // indirect
honnef.co/go/tools v0.1.1 // indirect
)
replace (
github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg
github.com/owncloud/ocis/settings => ../settings
google.golang.org/grpc => google.golang.org/grpc v1.26.0
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
// latest version compatible with etcd
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)
+230 -153
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -21,7 +21,7 @@
},
"devDependencies": {
"@babel/core": "^7.7.7",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-export-default-from": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.7",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
@@ -33,7 +33,7 @@
"@rollup/plugin-commonjs": "^11.0.1",
"@rollup/plugin-json": "^4.0.1",
"@rollup/plugin-replace": "^2.3.0",
"archiver": "^4.0.1",
"archiver": "^5.2.0",
"axios": "^0.21.1",
"core-js": "3",
"cross-env": "^7.0.3",
@@ -50,7 +50,7 @@
"eslint-plugin-vue": "^7.6.0",
"fs-extra": "^9.0.1",
"join-path": "^1.1.1",
"ldap": "^0.7.1",
"ldapjs": "^2.2.3",
"nightwatch": "^1.3.6",
"nightwatch-api": "^3.0.1",
"nightwatch-vrt": "^0.2.10",
+1 -1
View File
@@ -15,7 +15,7 @@ import (
_ "golang.org/x/net/webdav"
)
//go:generate go run github.com/UnnoTed/fileb0x embed.yml
//go:generate make -C ../.. embed.yml
// assets gets initialized by New and provides the handler.
type assets struct {
+3 -3
View File
@@ -1,5 +1,5 @@
// Code generated by fileb0x at "2021-02-17 10:35:52.837501 +0100 CET m=+0.010639355" from config file "embed.yml" DO NOT EDIT.
// modification hash(c9d4111ae741bf537598ab0856324f72.8058aec596c5fb73022d09bb97af796e)
// Code generated by fileb0x at "2021-03-04 20:39:03.472300386 +0100 CET m=+0.014524045" from config file "embed.yml" DO NOT EDIT.
// modification hash(2da0b5efdd6831d3c6c6fe0c3348f8e9.8058aec596c5fb73022d09bb97af796e)
package assets
@@ -36,7 +36,7 @@ type HTTPFS struct {
}
// FileAccountsJs is "accounts.js"
var FileAccountsJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\xe9\x76\xdb\x38\xb7\x28\xf8\xbb\xcf\x53\x48\x3c\xf5\xf1\x00\xa5\x6d\x45\x4a\x6a\xa4\x82\xd2\xe7\x24\xce\x50\x99\x5c\xb6\x93\x4a\x95\x4a\xc7\x8b\xa6\x20\x1b\x89\x04\xa8\x40\xc8\x43\x24\xf6\xfb\xf4\x6b\xf4\x93\xf5\xc2\x44\x82\x14\x95\xaa\xef\xdc\x73\x7b\xdd\x5e\x7d\xd7\xf2\xb2\x48\x10\xe3\xc6\xc6\x9e\xb0\xb1\x31\xa3\x73\xc6\x29\x42\xf3\x35\xcf\x14\x13\x1c\xe1\x4d\xb4\xce\x69\x27\x57\x92\x65\x2a\x1a\x5d\xa7\xb2\xa3\x48\xb4\xe6\x36\xe3\x2c\xea\x12\x75\xb7\xa2\x62\xde\xb9\x5c\x88\x8b\x74\x71\x76\xc5\xf2\x71\xf5\x98\xb4\xe5\xbc\x61\x7c\x26\x6e\xc6\xf6\xa7\x35\x87\xad\xc0\xd5\xd3\x9a\x23\xa7\x8b\xf9\x58\xff\x4b\x36\xc5\xc8\x77\xb6\x43\x91\x02\x8a\x37\x92\xaa\xb5\xe4\x1d\x85\x28\xd9\xd0\xdb\x95\x90\x2a\x4f\x36\x45\x01\xb4\xef\xde\x70\xf5\x58\xe8\x11\x71\x12\x0e\x59\xe1\x8d\x4e\xa4\x64\x37\xe5\xed\xc5\x47\x9a\xa9\xfe\x4a\x0a\x25\x74\x4f\x80\x13\xda\xbf\x4a\xf3\xb7\x37\xfc\x58\x8a\x15\x95\xea\x0e\x24\x89\x7c\xc1\x88\xf8\xfe\x9e\xde\x2d\x2f\xc4\x62\x6c\x7f\x92\x4d\x01\x82\xc8\x3e\x53\x54\xa6\x4a\xc8\xed\x36\xfa\xe7\x3f\xfd\x4b\x04\x8c\xc8\x7e\x9a\xdf\xf1\xec\x45\xf8\xbd\x96\x12\x41\x4a\x64\x5f\x89\x53\x25\x19\xbf\x3c\x4b\x2f\x4d\x96\xe0\x3d\xaa\x80\x92\x69\xa0\x00\x2f\xc1\xe2\xc6\x60\x41\xea\x7b\x6d\xf2\x6c\xae\xd3\xc5\x9a\x26\x1c\x28\x5f\x2f\xa9\x4c\x2f\x16\x34\xe9\x0e\x20\x13\x7c\xce\x2e\xd7\xe5\xfb\x8d\x64\xca\x3d\x17\x18\xd4\x84\x4e\x0b\x25\xef\x36\x19\xda\x14\x10\x45\xb8\xc8\x52\x95\x5d\x69\x98\x65\x01\x04\x6b\x5d\xd0\x65\x08\x2f\x8a\xb2\x8f\xb9\xcd\x00\xd2\x02\x5a\x10\x1a\xc7\xb4\x02\x73\x87\xf1\x5c\xa5\x3c\xd3\x90\x9c\x8f\x69\x32\x07\xe6\xa7\x22\x93\x34\x55\x14\x89\x2a\x33\x86\x94\x70\x7a\xd3\x39\x42\x72\xbb\x9d\x4c\xf1\xc8\x35\xca\xfa\xe7\x8c\x5f\x8b\x4f\x74\xa7\x57\xba\x49\x49\xa2\x7c\x9d\xaf\x28\x9f\xd1\xd9\xa9\x4a\xa5\x8a\x7c\xb9\x32\xb7\x00\x86\x37\x6c\x8e\x22\x7a\x4b\xb3\xb5\x62\xfc\x32\x22\x84\x48\xac\xae\xa4\xb8\xe9\x98\x26\xa5\x14\x12\x45\xcf\x28\xb7\xd3\xd4\x61\x79\x27\x5d\x48\x9a\xce\xee\x3a\x72\xcd\xb9\x2e\x82\x47\xba\x8a\x4c\x2c\x57\x0b\xaa\xe8\xcc\x56\x61\xaa\x35\xf5\xe8\x77\xe1\xaa\x64\xbe\x0b\xa7\x08\x17\x73\x21\x11\xef\x2f\xa9\xba\x12\x33\x22\x80\xf7\x53\x79\x49\xd8\x68\x64\xbb\x9f\x12\xde\x9f\xd1\x05\xbd\x4c\x15\xd5\x0d\xa4\x36\x39\x23\x37\x28\x05\x6e\xda\xcc\x4c\x2b\x19\x21\x64\x81\x33\xc1\x15\xe3\x6b\xea\x1b\xc8\x8a\x42\xf7\x80\xd3\x5b\xa5\x3b\xe0\xdb\xc1\xbc\x9f\x53\xae\x08\xef\x9f\xbb\xdf\x54\x5e\x8e\xe8\x22\xa7\x9d\x5a\x87\xcb\xfc\x66\x1c\x0d\x38\x06\x30\x92\x24\x18\xb8\x1d\xc2\x88\xf7\x67\x2c\x5f\x69\x94\x39\xba\xcd\xe8\xca\x40\xda\x7c\xc1\x85\x6e\x28\xb2\x3d\x0c\x5b\x89\x63\xde\x4f\x2f\xe4\x7a\xa5\x90\xff\x6a\xeb\xc2\x23\x49\x82\xc9\x31\xc4\x2a\x27\x6b\x37\xcd\x06\xee\x5c\xc8\x65\xba\xd0\xb5\xe5\x7d\x83\x2c\xba\xc7\x52\x03\x4f\x70\x3a\x0e\x7a\x97\x54\xc3\xf8\x8d\xd1\xc5\x2c\x82\xdc\x40\xbc\x05\x7a\x6e\xd9\x98\xef\xa0\xeb\x49\x6c\x75\x45\x51\x41\xc8\xb6\x16\xc7\xa8\x09\x02\x37\xa1\x2e\xa7\x9b\xd6\xdc\x8e\xbf\x28\x90\x02\x0e\x29\x06\x56\x2d\x15\x3f\x9c\x8d\x5e\x73\xae\x03\xba\xee\xc4\x8f\x0d\x52\x79\x99\xa8\x7e\x96\x2e\x16\x48\x67\x2c\xaa\x05\x59\xcb\xee\x5a\x34\xb9\x8b\xa2\x50\xfd\x1b\x99\xae\x48\x6e\xa0\xb6\x20\x21\x59\x9d\x23\xbc\xa9\x3a\x30\xab\xbd\xad\xf4\x9b\x2e\x72\xa5\x8b\x5c\x4d\xc4\x94\x04\xbc\xc3\xaf\xf7\x2b\x96\x17\xa6\xe2\xa5\x5f\xb7\x97\x54\x1d\xfb\x15\xfb\x76\x0e\xd7\x64\x19\xc7\x4b\xb4\x44\x6f\xd1\x64\x8a\x31\x1e\x5d\xc7\xf1\x75\x97\x68\x3a\xc0\xed\x50\xae\x41\xe0\x38\x46\x57\xe4\x1a\x9b\x9a\x2e\xc9\xaa\x5a\xf3\x64\x1e\x3c\xd7\x29\xc3\x15\xae\x06\x72\xa7\x81\x30\xb1\x68\x0e\x1e\x00\x1e\x87\xa6\xfd\xb9\x90\x47\x69\x76\x15\xb0\x02\x8a\x37\x96\x7c\xd6\xb8\x43\x30\x2a\x4f\x53\x10\x05\x85\x0b\x6c\xfe\xca\xe6\x2e\x2c\x3b\x32\xe4\x65\x14\xe6\x26\x75\x9a\x52\x16\x48\x2b\x90\x69\x72\x12\x32\x25\x09\x29\xde\x74\xcb\x9c\x52\x97\x84\x14\x32\x5b\xbd\xc1\xf2\x89\x98\x82\x02\x66\x11\xdd\x0e\xae\x5b\xe1\xb9\x9d\x56\x8b\xa4\x73\xb2\xe8\x1b\xa4\x2d\x69\x5c\x1c\x47\xc2\x80\xad\x62\x59\xf3\x12\xf4\x73\x88\xce\xcf\xd3\x9b\x94\xa9\x08\x8f\x69\x5f\xd2\x5c\x2c\xae\x29\x9a\xf7\x5d\x2a\xee\xab\x2b\xca\xeb\x1c\x54\x3a\x6a\x02\xca\xf4\xb2\xc0\xd0\xfc\xec\xc0\xef\xbf\xe3\x24\xa8\xb9\xad\x46\xd7\x65\xa2\x20\x45\x8b\xdd\x0a\xed\x40\x5a\xea\x2d\x32\xe4\xd6\x93\x81\x99\x06\xa4\x4e\xf5\x05\x88\x1c\x4b\xdb\x5a\x0a\x29\x4e\x52\x84\x03\xbe\x74\x53\xcd\x20\x27\xaa\x64\xd8\x13\xea\xd6\xed\x54\xc3\xfa\x5a\xb0\x59\x67\xa0\x09\x94\xa1\x26\xb4\x24\xc4\x84\xaf\x17\x0b\xa8\x88\x00\x0d\xc9\x64\x55\x5b\xdf\x76\x25\x8e\x11\x2d\xc9\x81\xa7\x6b\xd4\xd0\x03\xdb\x02\xd8\xde\xb4\x55\x88\xdd\x68\x16\x23\xda\xa4\x28\xb6\x06\x8d\x4e\x67\x77\x2b\xea\x38\xd4\xd9\x15\xed\xf8\xe6\x3b\x33\x41\xf3\x0e\x17\xaa\xb3\x92\xe2\x9a\xcd\x68\x27\xed\xfc\x87\x29\xfc\x1f\x1d\x5b\x57\x54\x42\x6b\x51\x58\x5e\xb9\x46\x1c\xaa\x01\xd8\x36\x42\xbc\xd3\x34\xdf\xe2\x9d\x2b\xb8\xa7\x5b\xd2\xa0\x63\x13\x62\x8b\x91\x15\x02\xcc\x57\x8f\xa2\x62\x2c\x2c\x91\x46\x74\xa2\x34\xa6\xac\x17\xea\x4d\xba\xa4\x53\x22\x2c\x62\x00\xed\x6b\x8c\x23\xca\xfc\xbc\x12\x59\xb9\xb2\xbb\x15\xa4\x6a\xLine truncated
var FileAccountsJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\xfd\xe9\x92\x1b\xb7\xf6\x20\x88\x7f\xfe\xf7\x53\x90\x79\xed\xfc\x01\xe6\x29\x16\x59\x5a\x6c\x27\x05\xf1\x6a\x97\x6c\x6d\xd6\x62\x5b\xa6\x78\x2b\xb2\x92\x20\x2b\x25\x12\xa0\x91\x60\x2d\x26\xb3\x23\xfe\xfd\x36\xf3\x71\x3e\xcc\x0b\xcc\x13\x74\xbf\xd1\x04\x0e\x80\xdc\x98\x94\x7c\xbb\x7f\x3d\x11\x13\x52\x14\x33\x91\x58\x0f\x80\xb3\xe3\x60\xc6\xe7\xa9\xe0\x84\xcc\x37\x22\xd1\xa9\x14\x84\x6e\x83\x4d\xc6\x3b\x99\x56\x69\xa2\x83\xd1\x45\xac\x3a\x9a\x05\x1b\x61\x33\xce\x82\x2e\xd3\xd7\x6b\x2e\xe7\x9d\xc5\x52\x9e\xc5\xcb\x77\xe7\x69\x36\x2e\x1f\xa3\xb6\x9c\x97\xa9\x98\xc9\xcb\xb1\xfd\x69\xcd\x61\x2b\x70\xf5\xb4\xe6\xc8\xf8\x72\x3e\x36\x7f\xa2\x6d\x3e\xf2\x9d\xed\x70\xa2\x81\xd3\xad\xe2\x7a\xa3\x44\x47\x13\xce\xb6\xfc\x6a\x2d\x95\xce\xa2\x6d\x9e\x03\xef\xbb\x37\x5a\x3e\xe6\xd5\xc1\x6a\xba\x35\x03\xe4\x6c\x3f\xe5\xd5\xd9\x27\x9e\xe8\xfe\x5a\x49\x2d\x4d\x1f\x40\x30\xde\x3f\x8f\xb3\x57\x97\xe2\xb5\x92\x6b\xae\xf4\x35\x28\x16\xf8\x82\x01\xf3\x3d\x7d\x7b\xbd\x3a\x93\xcb\xb1\xfd\x89\xb6\x39\x48\xa6\xfa\xa9\xe6\x2a\xd6\x52\xed\x76\xc1\x3f\xff\xe9\x5f\x02\x48\x99\xea\xc7\xd9\xb5\x48\x9e\x55\xbf\xd7\x52\x02\x88\x99\xea\x6b\xf9\x56\xab\x54\x2c\xde\xc5\x0b\xcc\x52\x79\x0f\x4a\x70\x64\x06\x1c\x20\x0a\x80\xb8\x31\x58\x60\xfa\x5e\x63\x9e\xed\x45\xbc\xdc\xf0\x48\x00\x17\x9b\x15\x57\xf1\xd9\x92\x47\xdd\x01\x24\x52\xcc\xd3\xc5\xa6\x78\xbf\x54\xa9\x76\xcf\x39\x05\x3d\xe1\xd3\x5c\xab\xeb\x6d\x46\xb6\x39\x04\x01\xcd\x93\x58\x27\xe7\x06\x66\x59\x05\x82\xb5\x2e\x98\x32\x4c\xe4\x79\xd1\xc7\xc4\x66\x00\x65\x01\x2d\x19\x0f\x43\x5e\x82\xb9\x93\x8a\x4c\xc7\x22\x31\x90\x9c\x8f\x79\x34\x87\xd4\x4f\x45\xa2\x78\xac\x39\x91\x65\x66\x0a\x31\x13\xfc\xb2\x73\x45\xd4\x6e\x37\x99\xd2\x91\x6b\x34\xed\x9f\xa6\xe2\x42\x7e\xe6\x7b\xbd\x32\x4d\x2a\x16\x64\x9b\x6c\xcd\xc5\x8c\xcf\xde\xea\x58\xe9\xc0\x97\x2b\x72\x4b\x48\xe9\x36\x9d\x93\x80\x5f\xf1\x64\xa3\x53\xb1\x08\x18\x63\x8a\xea\x73\x25\x2f\x3b\xa6\xc9\x47\x4a\x49\x45\x82\x27\x5c\xd8\x69\xea\xa4\x59\x27\x5e\x2a\x1e\xcf\xae\x3b\x6a\x23\x84\x29\x42\x47\xa6\x8a\x44\xae\xd6\x4b\xae\xf9\xcc\x56\x81\xd5\x62\x3d\xe6\x5d\xba\x2a\x53\xdf\x85\x53\x42\xf3\xb9\x54\x44\xf4\x57\x5c\x9f\xcb\x19\x93\x20\xfa\xb1\x5a\xb0\x74\x34\xb2\xdd\x8f\x99\xe8\xcf\xf8\x92\x2f\x62\xcd\x4d\x03\xb1\x4d\xce\xd8\x25\x89\x41\x60\x9b\x19\xb6\x92\x31\xc6\x96\x34\x91\x42\xa7\x62\xc3\x7d\x03\x59\x9e\x9b\x1e\x08\x7e\xa5\x4d\x07\x7c\x3b\x54\xf4\x33\x2e\x34\x13\xfd\x53\xf7\x1b\xab\xc5\x88\x2f\x33\xde\xa9\x75\xb8\xc8\x8f\xe3\x68\xc0\xb1\x02\x23\xc5\x2a\x03\xb7\x43\x18\x89\xfe\x2c\xcd\xd6\x66\xc9\x3c\xba\x4a\xf8\x1a\x21\x8d\x5f\x68\x6e\x1a\x0a\x6c\x0f\xab\xad\x84\xa1\xe8\xc7\x67\x6a\xb3\xd6\xc4\x7f\xb5\x75\xd1\x91\x62\x95\xc9\x41\x34\x95\xb0\x8d\x9b\x66\x84\xbb\x90\x6a\x15\x2f\x4d\x6d\x49\x1f\x17\x8b\xe9\xb1\x32\xc0\x93\x82\x8f\x2b\xbd\x8b\xca\x61\x7c\x48\xf9\x72\x16\x40\x82\x10\x6f\x81\x9e\xdb\x36\xf8\x1d\x4c\x3d\x91\xad\x2e\xcf\x4b\x08\xd9\xd6\xc2\x90\x34\x41\xe0\x26\xd4\xe5\x74\xd3\x9a\xd8\xf1\xe7\x39\xd1\x20\x20\xa6\x90\x96\x5b\xc5\x0f\x67\x6b\xf6\x9c\xeb\x80\xa9\x3b\xf2\x63\x83\x58\x2d\x22\xdd\x4f\xe2\xe5\x92\x98\x8c\x79\xb9\x21\x6b\xd9\x5d\x8b\x98\x3b\xcf\x73\xdd\xbf\x54\xf1\x9a\x25\x08\xb5\x25\xab\x22\xd4\x39\xa1\xdb\xb2\x03\xb3\xda\xdb\xda\xbc\x99\x22\xe7\xa6\xc8\xf9\x44\x4e\x59\x85\x6a\xf8\xfd\x7e\x9e\x66\x39\x56\xbc\xf2\xfb\x76\xc1\xf5\x6b\xbf\x63\x5f\xcd\x61\xc1\x56\x61\xb8\x22\x2b\xf2\x8a\x4c\xa6\x94\xd2\xd1\x22\x0c\x17\x5d\x66\xf0\x80\xb0\x43\x59\x80\xa4\x61\x48\xce\xd9\x82\x62\x4d\xd7\x6c\x5d\xee\x79\x36\xaf\x3c\xd7\x31\xc3\x39\x2d\x07\x72\x61\x80\x30\xb1\xcb\x1c\x3c\x00\xfc\x1a\x9a\xf6\xe7\x52\x3d\x8a\x93\xf3\x0a\x29\xe0\x74\x6b\xd1\x67\x8d\x3a\x54\x46\xe5\x71\x0a\xe1\xa0\x69\x4e\xf1\x7f\xd1\xdc\x99\x25\x44\x88\x5e\x46\xd5\xdc\xac\x8e\x53\x8a\x02\x71\x09\x32\x83\x4e\xaa\x44\x49\x41\x4c\xb7\xdd\x22\xa7\x32\x25\x21\x86\xcc\x56\x8f\xab\x7c\x22\xa7\xa0\x21\xb5\x0b\xdd\x0e\xae\x5b\xae\x73\x3b\xad\x76\x91\xce\xd9\xb2\x8f\x8b\xb6\xc0\x71\x61\x18\x48\x04\x5b\x49\xb2\xe6\x05\xe8\xe7\x10\x9c\x9e\xc6\x97\x71\xaa\x03\x3a\xe6\x7d\xc5\x33\xb9\xbc\xe0\x64\xde\x77\xa9\xb4\xaf\xcf\xb9\xa8\x53\x50\xe5\xb0\x09\x68\xec\x65\x4e\xa1\xf9\xd9\x81\xdf\x7f\xa7\x51\xa5\xe6\xb6\x1a\x5d\x97\x99\x86\x98\x2c\xf7\x2b\xb4\x03\x69\xa9\x37\xcf\x88\xdb\x4f\x08\x33\x03\x48\x93\xea\x0b\x30\x35\x56\xb6\xb5\x18\x62\x1a\xc5\x84\x56\xe8\xd2\x65\x39\x83\x82\xe9\x82\x60\x4f\xb8\xdb\xb7\x53\x03\xeb\x0b\x99\xce\x3a\x03\x83\xa0\x10\x9b\xf0\x02\x11\x33\xb1\x59\x2e\xa1\x44\x02\xbc\x8a\x26\xcb\xda\xfa\xb6\x2b\x61\x48\x78\x81\x0e\x3c\x5e\xe3\x88\x0f\x6c\x0b\x60\x7b\xd3\x56\x21\x75\xa3\x59\x8e\x78\x13\xa3\xd8\x1a\xcc\x72\x7a\x77\xbd\xe6\x8e\x42\xbd\x3b\xe7\x1d\xdf\x7c\x67\x26\x79\xd6\x11\x52\x77\xd6\x4a\x5e\xa4\x33\xde\x89\x3b\xff\x81\x85\xff\xa3\x63\xeb\x0a\x0a\x68\x2d\x73\x4b\x2b\x37\x44\x40\x39\x00\xdb\x46\x75\xdd\x19\x9c\x6f\xd7\x9d\x2b\x78\xa0\x5b\x0a\x97\x63\x13\x62\xcb\x91\x65\x02\xf0\xab\x5f\xa2\x72\x2c\x2d\x92\x26\x7c\xa2\xcd\x4a\xd9\x2c\xf5\xcb\x78\xc5\xa7\x4c\xda\x85\x01\xbc\x6f\x56\x1c\xd3\xf8\xf3\x5c\xLine truncated
func init() {
err := CTX.Err()
+1 -1
View File
@@ -3,8 +3,8 @@ package command
import (
"fmt"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
+4 -3
View File
@@ -2,14 +2,15 @@ package command
import (
"fmt"
"os"
"strconv"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
tw "github.com/olekukonko/tablewriter"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"os"
"strconv"
)
// InspectAccount command shows detailed information about a specific account.
+4 -3
View File
@@ -2,14 +2,15 @@ package command
import (
"fmt"
"os"
"strconv"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
tw "github.com/olekukonko/tablewriter"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"os"
"strconv"
)
// ListAccounts command lists all accounts
+2 -2
View File
@@ -4,9 +4,9 @@ import (
"context"
"fmt"
"github.com/asim/go-micro/plugins/client/grpc/v3"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/owncloud/ocis/accounts/pkg/config"
index "github.com/owncloud/ocis/accounts/pkg/proto/v0"
)
+3 -2
View File
@@ -2,12 +2,13 @@ package command
import (
"fmt"
"os"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"os"
)
// RemoveAccount command deletes an existing account.
-3
View File
@@ -160,9 +160,6 @@ func Server(cfg *config.Config) *cli.Command {
)
gr.Add(func() error {
logger.Info().Str("service", server.Name()).Msg("Reporting settings bundles to settings service")
svc.RegisterSettingsBundles(&logger)
svc.RegisterPermissions(&logger)
return server.Run()
}, func(_ error) {
logger.Info().
+2 -1
View File
@@ -3,8 +3,9 @@ package command
import (
"errors"
"fmt"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
+1 -1
View File
@@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command {
Usage: "Print the versions of the running instances",
Flags: flagset.ListAccountsWithConfig(cfg),
Action: func(c *cli.Context) error {
reg := *registry.GetRegistry()
reg := registry.GetRegistry()
services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Server.Name)
if err != nil {
fmt.Println(fmt.Errorf("could not get accounts services from the registry: %v", err))
+1 -1
View File
@@ -3,8 +3,8 @@ package proto
import (
context "context"
client "github.com/asim/go-micro/v3/client"
empty "github.com/golang/protobuf/ptypes/empty"
client "github.com/micro/go-micro/v2/client"
)
// MockAccountsService can be used to write tests
+3 -3
View File
@@ -16,9 +16,9 @@ import (
import (
context "context"
api "github.com/micro/go-micro/v2/api"
client "github.com/micro/go-micro/v2/client"
server "github.com/micro/go-micro/v2/server"
api "github.com/asim/go-micro/v3/api"
client "github.com/asim/go-micro/v3/client"
server "github.com/asim/go-micro/v3/server"
)
// Reference imports to suppress errors if they are not otherwise used.
+86 -58
View File
@@ -10,9 +10,11 @@ import (
"path/filepath"
"testing"
mgrpcc "github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/asim/go-micro/v3/client"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/golang/protobuf/ptypes/empty"
"github.com/micro/go-micro/v2/client"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/owncloud/ocis/accounts/pkg/command"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
@@ -24,7 +26,7 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"
)
var service = grpc.Service{}
var service = grpc.NewService()
var dataPath = createTmpDir()
@@ -302,18 +304,18 @@ func assertGroupsSame(t *testing.T, grp1, grp2 *proto.Group) {
}
}
func assertGroupHasMember(t *testing.T, grp *proto.Group, memberId string) {
func assertGroupHasMember(t *testing.T, grp *proto.Group, memberID string) {
for _, m := range grp.Members {
if m.Id == memberId {
if m.Id == memberID {
return
}
}
t.Fatalf("Member with id %s expected to be in group '%s', but not found", memberId, grp.DisplayName)
t.Fatalf("Member with id %s expected to be in group '%s', but not found", memberID, grp.DisplayName)
}
func createAccount(t *testing.T, user string) (*proto.Account, error) {
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewAccountsService("com.owncloud.api.accounts", client)
account := getAccount(user)
@@ -326,7 +328,7 @@ func createAccount(t *testing.T, user string) (*proto.Account, error) {
}
func createGroup(t *testing.T, group *proto.Group) (*proto.Group, error) {
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
request := &proto.CreateGroupRequest{Group: group}
@@ -338,7 +340,7 @@ func createGroup(t *testing.T, group *proto.Group) (*proto.Group, error) {
}
func updateAccount(t *testing.T, account *proto.Account, updateArray []string) (*proto.Account, error) {
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewAccountsService("com.owncloud.api.accounts", client)
updateMask := &field_mask.FieldMask{
@@ -352,7 +354,7 @@ func updateAccount(t *testing.T, account *proto.Account, updateArray []string) (
func listAccounts(t *testing.T) (*proto.ListAccountsResponse, error) {
request := &proto.ListAccountsRequest{}
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewAccountsService("com.owncloud.api.accounts", client)
response, err := cl.ListAccounts(context.Background(), request)
@@ -361,7 +363,7 @@ func listAccounts(t *testing.T) (*proto.ListAccountsResponse, error) {
func listGroups(t *testing.T) *proto.ListGroupsResponse {
request := &proto.ListGroupsRequest{}
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
response, err := cl.ListGroups(context.Background(), request)
@@ -370,7 +372,7 @@ func listGroups(t *testing.T) *proto.ListGroupsResponse {
}
func deleteAccount(t *testing.T, id string) (*empty.Empty, error) {
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewAccountsService("com.owncloud.api.accounts", client)
req := &proto.DeleteAccountRequest{Id: id}
@@ -379,7 +381,7 @@ func deleteAccount(t *testing.T, id string) (*empty.Empty, error) {
}
func deleteGroup(t *testing.T, id string) (*empty.Empty, error) {
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
req := &proto.DeleteGroupRequest{Id: id}
@@ -554,7 +556,8 @@ func TestUpdateAccount(t *testing.T) {
}
func TestUpdateNonUpdatableFieldsInAccount(t *testing.T) {
_, _ = createAccount(t, "user1")
_, err := createAccount(t, "user1")
assert.NoError(t, err)
tests := []struct {
name string
@@ -622,8 +625,10 @@ func TestUpdateNonUpdatableFieldsInAccount(t *testing.T) {
}
func TestListAccounts(t *testing.T) {
createAccount(t, "user1")
createAccount(t, "user2")
_, err := createAccount(t, "user1")
assert.NoError(t, err)
_, err = createAccount(t, "user2")
assert.NoError(t, err)
resp, err := listAccounts(t)
assert.NoError(t, err)
@@ -744,7 +749,8 @@ func TestListAccountsWithFilterQuery(t *testing.T) {
}
func TestGetAccount(t *testing.T) {
createAccount(t, "user1")
_, err := createAccount(t, "user1")
assert.NoError(t, err)
req := &proto.GetAccountRequest{Id: getAccount("user1").Id}
@@ -762,12 +768,14 @@ func TestGetAccount(t *testing.T) {
//TODO: This segfaults! WIP
func TestDeleteAccount(t *testing.T) {
createAccount(t, "user1")
createAccount(t, "user2")
_, err := createAccount(t, "user1")
assert.NoError(t, err)
_, err = createAccount(t, "user2")
assert.NoError(t, err)
req := &proto.DeleteAccountRequest{Id: getAccount("user1").Id}
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewAccountsService("com.owncloud.api.accounts", client)
resp, err := cl.DeleteAccount(context.Background(), req)
@@ -785,7 +793,7 @@ func TestDeleteAccount(t *testing.T) {
func TestListGroups(t *testing.T) {
req := &proto.ListGroupsRequest{}
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
resp, err := cl.ListGroups(context.Background(), req)
@@ -812,7 +820,7 @@ func TestListGroups(t *testing.T) {
}
func TestGetGroups(t *testing.T) {
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
groups := []string{
@@ -860,7 +868,7 @@ func TestCreateGroup(t *testing.T) {
}
func TestGetGroupInvalidID(t *testing.T) {
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
req := &proto.GetGroupRequest{Id: "42"}
@@ -876,11 +884,14 @@ func TestDeleteGroup(t *testing.T) {
grp1 := getTestGroups("grp1")
grp2 := getTestGroups("grp2")
grp3 := getTestGroups("grp3")
createGroup(t, grp1)
createGroup(t, grp2)
createGroup(t, grp3)
_, err := createGroup(t, grp1)
assert.NoError(t, err)
_, err = createGroup(t, grp2)
assert.NoError(t, err)
_, err = createGroup(t, grp3)
assert.NoError(t, err)
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
req := &proto.DeleteGroupRequest{Id: grp1.Id}
@@ -909,7 +920,7 @@ func TestDeleteGroupNotExisting(t *testing.T) {
" ",
}
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
for _, id := range invalidIds {
@@ -932,7 +943,7 @@ func TestDeleteGroupInvalidId(t *testing.T) {
"": ".",
}
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
for id := range invalidIds {
@@ -947,9 +958,10 @@ func TestDeleteGroupInvalidId(t *testing.T) {
func TestUpdateGroup(t *testing.T) {
grp1 := getTestGroups("grp1")
createGroup(t, grp1)
_, err := createGroup(t, grp1)
assert.NoError(t, err)
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
updateGrp := &proto.Group{
@@ -975,10 +987,12 @@ func TestAddMember(t *testing.T) {
updatedGroup := grp1
updatedGroup.Members = append(updatedGroup.Members, &proto.Account{Id: account.Id})
createGroup(t, grp1)
createAccount(t, account.PreferredName)
_, err := createGroup(t, grp1)
assert.NoError(t, err)
_, err = createAccount(t, account.PreferredName)
assert.NoError(t, err)
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
req := &proto.AddMemberRequest{GroupId: grp1.Id, AccountId: account.Id}
@@ -1005,12 +1019,15 @@ func TestAddMemberAlreadyInGroup(t *testing.T) {
updatedGroup := grp1
updatedGroup.Members = append(updatedGroup.Members, &proto.Account{Id: account.Id})
createGroup(t, grp1)
createAccount(t, account.PreferredName)
_, err := createGroup(t, grp1)
assert.NoError(t, err)
_, err = createAccount(t, account.PreferredName)
assert.NoError(t, err)
addMemberToGroup(t, grp1.Id, account.Id)
_, err = addMemberToGroup(t, grp1.Id, account.Id)
assert.NoError(t, err)
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
req := &proto.AddMemberRequest{GroupId: grp1.Id, AccountId: account.Id}
@@ -1033,9 +1050,10 @@ func TestAddMemberAlreadyInGroup(t *testing.T) {
func TestAddMemberNonExisting(t *testing.T) {
grp1 := getTestGroups("grp1")
createGroup(t, grp1)
_, err := createGroup(t, grp1)
assert.NoError(t, err)
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
invalidIds := []string{
@@ -1062,11 +1080,11 @@ func TestAddMemberNonExisting(t *testing.T) {
cleanUp(t)
}
func addMemberToGroup(t *testing.T, groupId, memberId string) (*proto.Group, error) {
client := service.Client()
func addMemberToGroup(t *testing.T, groupID, memberID string) (*proto.Group, error) {
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
req := &proto.AddMemberRequest{GroupId: groupId, AccountId: memberId}
req := &proto.AddMemberRequest{GroupId: groupID, AccountId: memberID}
res, err := cl.AddMember(context.Background(), req)
@@ -1078,12 +1096,15 @@ func TestRemoveMember(t *testing.T) {
grp1 := getTestGroups("grp1")
account := getAccount("user1")
createGroup(t, grp1)
createAccount(t, account.PreferredName)
_, err := createGroup(t, grp1)
assert.NoError(t, err)
_, err = createAccount(t, account.PreferredName)
assert.NoError(t, err)
addMemberToGroup(t, grp1.Id, account.Id)
_, err = addMemberToGroup(t, grp1.Id, account.Id)
assert.NoError(t, err)
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
req := &proto.RemoveMemberRequest{GroupId: grp1.Id, AccountId: account.Id}
@@ -1104,9 +1125,10 @@ func TestRemoveMember(t *testing.T) {
func TestRemoveMemberNonExistingUser(t *testing.T) {
grp1 := getTestGroups("grp1")
createGroup(t, grp1)
_, err := createGroup(t, grp1)
assert.NoError(t, err)
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
invalidIds := []string{
@@ -1137,10 +1159,12 @@ func TestRemoveMemberNotInGroup(t *testing.T) {
grp1 := getTestGroups("grp1")
account := getAccount("user1")
createGroup(t, grp1)
createAccount(t, account.PreferredName)
_, err := createGroup(t, grp1)
assert.NoError(t, err)
_, err = createAccount(t, account.PreferredName)
assert.NoError(t, err)
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
req := &proto.RemoveMemberRequest{GroupId: grp1.Id, AccountId: account.Id}
@@ -1177,7 +1201,7 @@ func TestListMembers(t *testing.T) {
"physics-lovers",
}
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
for _, group := range groups {
@@ -1209,7 +1233,7 @@ func TestListMembers(t *testing.T) {
func TestListMembersEmptyGroup(t *testing.T) {
group := &proto.Group{Id: "5d58e5ec-842e-498b-8800-61f2ec6f911c", GidNumber: 60000, OnPremisesSamAccountName: "quantum-group", DisplayName: "Quantum Group", Members: []*proto.Account{}}
client := service.Client()
client := mgrpcc.NewClient()
cl := proto.NewGroupsService("com.owncloud.api.accounts", client)
request := &proto.CreateGroupRequest{Group: group}
@@ -1229,9 +1253,11 @@ func TestListMembersEmptyGroup(t *testing.T) {
}
func TestAccountUpdateMask(t *testing.T) {
createAccount(t, "user1")
_, err := createAccount(t, "user1")
assert.NoError(t, err)
user1 := getAccount("user1")
client := service.Client()
client := mgrpcc.NewClient()
req := &proto.UpdateAccountRequest{
// We only want to update the display-name, rest should be ignored
UpdateMask: &field_mask.FieldMask{Paths: []string{"DisplayName"}},
@@ -1252,9 +1278,11 @@ func TestAccountUpdateMask(t *testing.T) {
}
func TestAccountUpdateReadOnlyField(t *testing.T) {
createAccount(t, "user1")
_, err := createAccount(t, "user1")
assert.NoError(t, err)
user1 := getAccount("user1")
client := service.Client()
client := mgrpcc.NewClient()
req := &proto.UpdateAccountRequest{
// We only want to update the display-name, rest should be ignored
UpdateMask: &field_mask.FieldMask{Paths: []string{"CreatedDateTime"}},
@@ -13,6 +13,17 @@
"url": "https://github.com/owncloud/ocis/blob/master/LICENSE"
}
},
"tags": [
{
"name": "AccountsService"
},
{
"name": "GroupsService"
},
{
"name": "IndexService"
}
],
"schemes": [
"http",
"https"
+6 -7
View File
@@ -1,6 +1,7 @@
package http
import (
"github.com/asim/go-micro/v3"
"github.com/go-chi/chi"
"github.com/owncloud/ocis/accounts/pkg/assets"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
@@ -60,13 +61,11 @@ func Server(opts ...Option) http.Service {
proto.RegisterGroupsServiceWeb(r, handler)
})
service.Handle(
"/",
mux,
)
if err := service.Init(); err != nil {
panic(err)
err := micro.RegisterHandler(service.Server(), mux)
if err != nil {
options.Logger.Fatal().Err(err).Msg("failed to register the handler")
}
service.Init()
return service
}
+15 -7
View File
@@ -6,21 +6,22 @@ import (
"crypto/sha256"
"encoding/hex"
"fmt"
"github.com/owncloud/ocis/ocis-pkg/sync"
"golang.org/x/crypto/bcrypt"
"io"
"path"
"regexp"
"strconv"
"time"
"github.com/owncloud/ocis/ocis-pkg/sync"
"golang.org/x/crypto/bcrypt"
"github.com/owncloud/ocis/ocis-pkg/log"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/asim/go-micro/v3/metadata"
"github.com/gofrs/uuid"
p "github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/empty"
fieldmask_utils "github.com/mennanov/fieldmask-utils"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/micro/go-micro/v2/metadata"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/accounts/pkg/storage"
"github.com/owncloud/ocis/ocis-pkg/middleware"
@@ -29,6 +30,7 @@ import (
settings_svc "github.com/owncloud/ocis/settings/pkg/service/v0"
"github.com/rs/zerolog"
"google.golang.org/genproto/protobuf/field_mask"
p "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -171,11 +173,11 @@ func (s Service) ListAccounts(ctx context.Context, in *proto.ListAccountsRequest
var suspicious bool
kh := sha256.New()
kh.Write([]byte(a.Id))
mustWrite(kh, []byte(a.Id))
k := hex.EncodeToString(kh.Sum([]byte(a.PasswordProfile.LastPasswordChangeDateTime.String())))
vh := sha256.New()
vh.Write([]byte(a.PasswordProfile.Password))
mustWrite(vh, []byte(a.PasswordProfile.Password))
v := vh.Sum([]byte(password))
e := passwordValidCache.Load(k)
@@ -837,3 +839,9 @@ func isPasswordValid(logger log.Logger, hash string, pwd string) (ok bool) {
return bcrypt.CompareHashAndPassword([]byte(hash), []byte(pwd)) == nil
}
func mustWrite(w io.Writer, val []byte) {
if _, err := w.Write(val); err != nil {
panic(err)
}
}
@@ -9,10 +9,10 @@ import (
"testing"
"time"
"github.com/asim/go-micro/v3/client"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/asim/go-micro/v3/metadata"
"github.com/golang/protobuf/ptypes/empty"
"github.com/micro/go-micro/v2/client"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/micro/go-micro/v2/metadata"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
olog "github.com/owncloud/ocis/ocis-pkg/log"
+2 -2
View File
@@ -5,12 +5,12 @@ import (
"path"
"strconv"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/gofrs/uuid"
p "github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/empty"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/accounts/pkg/storage"
p "google.golang.org/protobuf/proto"
)
func (s Service) expandMembers(g *proto.Group) {
+27 -33
View File
@@ -19,9 +19,9 @@ import (
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/ocis-pkg/log"
oreg "github.com/owncloud/ocis/ocis-pkg/registry"
"github.com/owncloud/ocis/ocis-pkg/roles"
settings "github.com/owncloud/ocis/settings/pkg/proto/v0"
settings_svc "github.com/owncloud/ocis/settings/pkg/service/v0"
)
// userDefaultGID is the default integer representing the "users" group.
@@ -57,6 +57,31 @@ func New(opts ...Option) (s *Service, err error) {
repo: createMetadataStorage(cfg, logger),
}
retries := 20
var current int
r := oreg.GetRegistry()
if cfg.Repo.Disk.Path == "" {
for {
if current >= retries {
panic("metadata service failed to start.")
}
s, err := r.GetService("com.owncloud.storage.metadata")
if err != nil {
logger.Error().Err(err).Msg("error getting metadata service from service registry")
}
if len(s) > 0 {
break
}
logger.Info().Msg("accounts blocked waiting for metadata service to be up and running...")
time.Sleep(2 * time.Second)
current++
}
}
// we want to wait anyway. If it depends on a reva service it could be the case that the entry on the registry
// happens prior to the reva service being up and running
time.Sleep(500 * time.Millisecond)
if s.index, err = s.buildIndex(); err != nil {
return nil, err
}
@@ -68,7 +93,6 @@ func New(opts ...Option) (s *Service, err error) {
if err = s.createDefaultGroups(); err != nil {
return nil, err
}
// TODO watch folders for new records
return
}
@@ -267,6 +291,7 @@ func (s Service) createDefaultAccounts() (err error) {
},
},
}
// this only deals with the metadata service.
for i := range accounts {
a := &proto.Account{}
err := s.repo.LoadAccount(context.Background(), accounts[i].Id, a)
@@ -287,7 +312,6 @@ func (s Service) createDefaultAccounts() (err error) {
}
}
// TODO: can be removed again as soon as we respect the predefined UIDs and GIDs from the account. Then no autoincrement is happening, therefore we don't need to update accounts.
changed := false
for _, r := range results {
if r.Field == "UidNumber" || r.Field == "GidNumber" {
@@ -309,24 +333,6 @@ func (s Service) createDefaultAccounts() (err error) {
}
}
}
// set role for admin users and regular users
assignRoleToUser("058bff95-6708-4fe5-91e4-9ea3d377588b", settings_svc.BundleUUIDRoleAdmin, s.RoleService, s.log)
for _, accountID := range []string{
"058bff95-6708-4fe5-91e4-9ea3d377588b", //moss
"ddc2004c-0977-11eb-9d3f-a793888cd0f8", //admin
"820ba2a1-3f54-4538-80a4-2d73007e30bf", //idp
"bc596f3c-c955-4328-80a0-60d018b4ad57", //reva
} {
assignRoleToUser(accountID, settings_svc.BundleUUIDRoleAdmin, s.RoleService, s.log)
}
for _, accountID := range []string{
"4c510ada-c86b-4815-8820-42cdf82c3d51", //einstein
"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c", //marie
"932b4540-8d16-481e-8ef4-588e4b6b151c", //richard
} {
assignRoleToUser(accountID, settings_svc.BundleUUIDRoleUser, s.RoleService, s.log)
}
return nil
}
@@ -403,18 +409,6 @@ func (s Service) createDefaultGroups() (err error) {
return nil
}
func assignRoleToUser(accountID, roleID string, rs settings.RoleService, logger log.Logger) (ok bool) {
_, err := rs.AssignRoleToUser(context.Background(), &settings.AssignRoleToUserRequest{
AccountUuid: accountID,
RoleId: roleID,
})
if err != nil {
logger.Error().Err(err).Str("accountID", accountID).Str("roleID", roleID).Msg("could not set role for account")
return false
}
return true
}
func createMetadataStorage(cfg *config.Config, logger log.Logger) storage.Repo {
// for now we detect the used storage implementation based on which storage is configured
// the config with defaults needs to be checked last
-194
View File
@@ -1,194 +0,0 @@
package service
import (
"context"
olog "github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/ocis-pkg/service/grpc"
settings "github.com/owncloud/ocis/settings/pkg/proto/v0"
ssvc "github.com/owncloud/ocis/settings/pkg/service/v0"
)
const (
settingUUIDProfileLanguage = "aa8cfbe5-95d4-4f7e-a032-c3c01f5f062f"
)
// RegisterSettingsBundles pushes the settings bundle definitions for this extension to the ocis-settings service.
func RegisterSettingsBundles(l *olog.Logger) {
service := settings.NewBundleService("com.owncloud.api.settings", grpc.DefaultClient)
bundleRequests := []settings.SaveBundleRequest{
generateBundleProfileRequest(),
}
for i := range bundleRequests {
res, err := service.SaveBundle(context.Background(), &bundleRequests[i])
if err != nil {
l.Err(err).Str("bundle", bundleRequests[i].Bundle.Id).Msg("Error registering bundle")
} else {
l.Info().Str("bundle", res.Bundle.Id).Msg("Successfully registered bundle")
}
}
permissionRequests := generateProfilePermissionsRequests()
for i := range permissionRequests {
res, err := service.AddSettingToBundle(context.Background(), &permissionRequests[i])
bundleID := permissionRequests[i].BundleId
if err != nil {
l.Err(err).Str("bundle", bundleID).Str("setting", permissionRequests[i].Setting.Id).Msg("Error adding setting to bundle")
} else {
l.Info().Str("bundle", bundleID).Str("setting", res.Setting.Id).Msg("Successfully added setting to bundle")
}
}
}
var languageSetting = settings.Setting_SingleChoiceValue{
SingleChoiceValue: &settings.SingleChoiceList{
Options: []*settings.ListOption{
{
Value: &settings.ListOptionValue{
Option: &settings.ListOptionValue_StringValue{
StringValue: "cs",
},
},
DisplayValue: "Czech",
},
{
Value: &settings.ListOptionValue{
Option: &settings.ListOptionValue_StringValue{
StringValue: "de",
},
},
DisplayValue: "Deutsch",
},
{
Value: &settings.ListOptionValue{
Option: &settings.ListOptionValue_StringValue{
StringValue: "en",
},
},
DisplayValue: "English",
},
{
Value: &settings.ListOptionValue{
Option: &settings.ListOptionValue_StringValue{
StringValue: "es",
},
},
DisplayValue: "Español",
},
{
Value: &settings.ListOptionValue{
Option: &settings.ListOptionValue_StringValue{
StringValue: "fr",
},
},
DisplayValue: "Français",
},
{
Value: &settings.ListOptionValue{
Option: &settings.ListOptionValue_StringValue{
StringValue: "gl",
},
},
DisplayValue: "Galego",
},
{
Value: &settings.ListOptionValue{
Option: &settings.ListOptionValue_StringValue{
StringValue: "it",
},
},
DisplayValue: "Italiano",
},
},
},
}
func generateBundleProfileRequest() settings.SaveBundleRequest {
return settings.SaveBundleRequest{
Bundle: &settings.Bundle{
Id: "2a506de7-99bd-4f0d-994e-c38e72c28fd9",
Name: "profile",
Extension: "ocis-accounts",
Type: settings.Bundle_TYPE_DEFAULT,
Resource: &settings.Resource{
Type: settings.Resource_TYPE_SYSTEM,
},
DisplayName: "Profile",
Settings: []*settings.Setting{
{
Id: settingUUIDProfileLanguage,
Name: "language",
DisplayName: "Language",
Description: "User language",
Resource: &settings.Resource{
Type: settings.Resource_TYPE_USER,
},
Value: &languageSetting,
},
},
},
}
}
func generateProfilePermissionsRequests() []settings.AddSettingToBundleRequest {
// TODO: we don't want to set up permissions for settings manually in the future. Instead each setting should come with
// a set of default permissions for the default roles (guest, user, admin).
return []settings.AddSettingToBundleRequest{
{
BundleId: ssvc.BundleUUIDRoleAdmin,
Setting: &settings.Setting{
Id: "7d81f103-0488-4853-bce5-98dcce36d649",
Name: "language-readwrite",
DisplayName: "Permission to read and set the language (anyone)",
Resource: &settings.Resource{
Type: settings.Resource_TYPE_SETTING,
Id: settingUUIDProfileLanguage,
},
Value: &settings.Setting_PermissionValue{
PermissionValue: &settings.Permission{
Operation: settings.Permission_OPERATION_READWRITE,
Constraint: settings.Permission_CONSTRAINT_ALL,
},
},
},
},
{
BundleId: ssvc.BundleUUIDRoleUser,
Setting: &settings.Setting{
Id: "640e00d2-4df8-41bd-b1c2-9f30a01e0e99",
Name: "language-readwrite",
DisplayName: "Permission to read and set the language (self)",
Resource: &settings.Resource{
Type: settings.Resource_TYPE_SETTING,
Id: settingUUIDProfileLanguage,
},
Value: &settings.Setting_PermissionValue{
PermissionValue: &settings.Permission{
Operation: settings.Permission_OPERATION_READWRITE,
Constraint: settings.Permission_CONSTRAINT_OWN,
},
},
},
},
{
BundleId: ssvc.BundleUUIDRoleGuest,
Setting: &settings.Setting{
Id: "ca878636-8b1a-4fae-8282-8617a4c13597",
Name: "language-readwrite",
DisplayName: "Permission to read and set the language (self)",
Resource: &settings.Resource{
Type: settings.Resource_TYPE_SETTING,
Id: settingUUIDProfileLanguage,
},
Value: &settings.Setting_PermissionValue{
PermissionValue: &settings.Permission{
Operation: settings.Permission_OPERATION_READWRITE,
Constraint: settings.Permission_CONSTRAINT_OWN,
},
},
},
},
}
}
-7
View File
@@ -1,7 +0,0 @@
// +build tools
package main
import (
_ "github.com/restic/calens"
)
+1118 -1116
View File
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,8 @@
Bugfix: Purposely delay accounts service startup
As it turns out the race condition between `accounts <-> storage-metadata` still remains. This PR is a hotfix, and it should be followed up with a proper fix. Either:
- block the accounts' initialization until the storage metadata is ready (using the registry) or
- allow the accounts service to initialize and use a message broker to signal the accounts the metadata storage is ready to receive requests.
https://github.com/owncloud/ocis/pull/1734
@@ -0,0 +1,5 @@
Bugfix: Add missing gateway config
The auth provider `ldap` and `oidc` drivers now need to be able talk to the reva gateway. We added the `gatewayscv` to the config that is passed to reva.
https://github.com/owncloud/ocis/pull/1716
@@ -0,0 +1,11 @@
Bugfix: Fix accounts initialization
Originally the accounts service relies on both the `settings` and `storage-metadata` to be up and running at the moment it starts. This is an antipattern as it will cause the entire service to panic if the dependants are not present.
We inverted this dependency and moved the default initialization data (i.e: creating roles, permissions, settings bundles) and instead of notifying the settings service that the account has to provide with such options, the settings is instead initialized with the options the accounts rely on. Essentially saving bandwith as there is no longer a gRPC call to the settings service.
For the `storage-metadata` a retry mechanism was added that retries by default 20 times to fetch the `com.owncloud.storage.metadata` from the service registry every `500` miliseconds. If this retry expires the accounts panics, as its dependency on the `storage-metadata` service cannot be resolved.
We also introduced a client wrapper that acts as middleware between a client and a server. For more information on how it works further read [here](https://github.com/sony/gobreaker)
https://github.com/owncloud/ocis/pull/1696
@@ -0,0 +1,5 @@
Bugfix: Fix the ttl of the authentication middleware cache
The authentication cache ttl was multiplied with `time.Second` multiple times. This resulted in a ttl that was not intended.
https://github.com/owncloud/ocis/pull/1699
@@ -0,0 +1,5 @@
Enhancement: Remove the JWT from the log
We were logging the JWT in some places. Secrets should not be exposed in logs so it got removed.
https://github.com/owncloud/ocis/pull/1758
@@ -0,0 +1,9 @@
Enhancement: Update go-micro to v3.5.1-0.20210217182006-0f0ace1a44a9
- We updated from go micro v2 (v2.9.1) go-micro v3 (v3.5.1 edge).
- oCIS runtime is now aware of `MICRO_LOG_LEVEL` and is set to `error` by default. This decision was made because ownCloud, as framework builders, want to log everything oCIS related and hide everything unrelated by default. It can be re-enabled by setting it to a log level other than `error`. i.e: `MICRO_LOG_LEVEL=info`.
- Updated `protoc-gen-micro` to the [latest version](https://github.com/asim/go-micro/tree/master/cmd/protoc-gen-micro).
- We're using Prometheus wrappers from go-micro.
https://github.com/owncloud/ocis/pull/1670
https://github.com/asim/go-micro/pull/2126
@@ -0,0 +1,6 @@
Enhancement: Update reva to v1.6.1-0.20210223065028-53f39499762e
* quota querying and tree accounting [cs3org/reva#1405](https://github.com/cs3org/reva/pull/1405)
https://github.com/owncloud/ocis/pull/1683
https://github.com/cs3org/reva/pull/1405
@@ -0,0 +1,8 @@
Change: Update ownCloud Web to v2.0.1
Tags: web
We updated ownCloud Web to v2.0.1. Please refer to the changelog (linked) for details on the web release.
https://github.com/owncloud/ocis/pull/1683
https://github.com/owncloud/web/releases/tag/v2.0.1
@@ -0,0 +1,8 @@
Change: Update ownCloud Web to v2.0.2
Tags: web
We updated ownCloud Web to v2.0.2. Please refer to the changelog (linked) for details on the web release.
https://github.com/owncloud/ocis/pull/1776
https://github.com/owncloud/web/releases/tag/v2.0.2
@@ -0,0 +1,6 @@
Enhancement: Add initial nats and kubernetes registry support
We added initial support to use nats and kubernetes as a service registry using `MICRO_REGISTRY=nats` and `MICRO_REGISTRY=kubernetes` respectively.
Multiple nodes can be given with `MICRO_REGISTRY_ADDRESS=1.2.3.4,5.6.7.8,9.10.11.12`.
https://github.com/owncloud/ocis/pull/1697
@@ -58,7 +58,7 @@ services:
WEB_OIDC_CLIENT_ID: ${OCIS_OIDC_CLIENT_ID:-web}
WEB_OIDC_METADATA_URL: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-oCIS}/.well-known/openid-configuration
STORAGE_OIDC_ISSUER: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}
STORAGE_LDAP_IDP: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}
STORAGE_LDAP_IDP: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-oCIS}
# general config
OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose
+2 -1
View File
@@ -1 +1,2 @@
hugo/
hugo/
mutagen.yml.lock
+37 -14
View File
@@ -1,28 +1,51 @@
SHELL := bash
include ../.bingo/Variables.mk
.PHONY: help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: docs-generate
docs-generate: ## run config-docs-generate for all oCIS extensions
docs-generate: ## run docs-generate for all oCIS extensions
@$(MAKE) --no-print-directory -C ../ docs-generate
.PHONY: docs-copy
docs-copy: ## copy docs to hugo
.PHONY: docs-init
docs-init:
@mkdir -p hugo/content/
@cd hugo; \
git init; \
git config advice.detachedHead false; \
git remote rm origin; \
git remote add origin https://github.com/owncloud/owncloud.github.io; \
git fetch --depth=1; \
git checkout origin/source -f; \
rsync -ax --delete --exclude hugo/ --exclude Makefile --exclude .gitignore --exclude README.md ../. content/; \
@cd hugo && git init
@cd hugo && git config advice.detachedHead false
@cd hugo && git remote rm origin || true
@cd hugo && git remote add origin https://github.com/owncloud/owncloud.github.io
@cd hugo && git fetch --depth=1
@cd hugo && git checkout origin/source -f
.PHONY: docs-serve
docs-serve: docs-generate docs-copy ## serve docs with hugo
@docker run --rm --network host -v $(shell pwd)/hugo:/src owncloudci/hugo:0 server
docs-serve: docs-init docs-generate docs-copy ## serve docs with hugo
@bash -c "trap 'trap - SIGINT SIGTERM ERR; $(MAKE) --no-print-directory docs-sync-stop; exit 0' SIGINT SIGTERM ERR; $(MAKE) --no-print-directory docs-sync-start && $(MAKE) --no-print-directory hugo-serve"
.PHONY: test
test: $(HUGO)
@cd hugo && $(HUGO)
.PHONY: hugo-serve
hugo-serve: $(HUGO)
@cd hugo && $(HUGO) server
.PHONY: docs-copy
docs-copy: docs-init docs-sync-start docs-sync-stop
.PHONY: docs-sync-start
docs-sync-start: $(MUTAGEN)
@$(MUTAGEN) project terminate || true
@$(MUTAGEN) daemon stop || true
@$(MUTAGEN) project start
@$(MUTAGEN) project flush
.PHONY: docs-sync-stop
docs-sync-stop: $(MUTAGEN)
@$(MUTAGEN) project terminate
@$(MUTAGEN) daemon stop
.PHONY: clean
clean: ## clean up docs build artifacts
+2 -2
View File
@@ -10,7 +10,7 @@ Welcome to our developer documentation. Here you can find developer documentatio
- [oCIS](https://owncloud.github.io/ocis/) server
- oCIS extensions
- Clients, like:
- Clients like:
- [ownCloud Web](https://github.com/owncloud/web) - the new web frontend for oCIS and ownCloud
- [ownCloud Android app](https://github.com/owncloud/android)
- [ownCloud iOS app](https://github.com/owncloud/ios-app)
@@ -28,7 +28,7 @@ You can also find all client sources on GitHub.
The oCIS server repository on GitHub is a good entry point for you to join the project. But we also develop clients for iOS, Android, Desktop and Web.
For communication on development you can join our public chat [talk.owncloud.com](https://talk.owncloud.com)
For communication on development, join our public chat [talk.owncloud.com](https://talk.owncloud.com)
If you want to help and improve ownCloud or oCIS, start coding or open issues on GitHub in the related repository.
+9 -13
View File
@@ -28,16 +28,12 @@ and take note of its release tag name.
#### Updating ocis-web
1. Create a branch `release-$version`. in <https://github.com/owncloud/ocis>
2. Create a Folder in `changelog` for the release version and date `mkdir $major.$minor.$patchVersion_YYYY-MM-DD`.
3. Move all changelog items from the `changelog/unreleased/` folder to the `$major.$minor.$patchVersion_YYYY-MM-DD` folder.
4. Update the go module `ocis-pkg` to the latest version <https://blog.golang.org/using-go-modules> .
5. Update the ownCloud Web asset by adjusting the value of `WEB_ASSETS_VERSION` at the top of the Makefile and specify the tag name of the latest [ownCloud Web release](https://github.com/owncloud/web/tags).
6. Run `make clean generate`.
7. Create a changelog item for the update in the `changelog/$major.$minor.$patchVersion_YYYY-MM-DD` folder.
8. Commit your changes.
9. After merging, wait for the CI to run on the merge commit.
10. Go to "Releases" in GH click "Draft a new Release".
11. Use `v$major.$minor.$patch` as a tag (the `v` prefix is important) and publish it.
12. The tag and the Release artifacts will be created automatically.
1. Create a branch `update-web-$version` in the [ocis repository](https://github.com/owncloud/ocis)
2. Change into web package folder via `cd web`
3. Inside `web/`, update the `Makefile` so that the WEB_ASSETS_VERSION variable references the currently released version of https://github.com/owncloud/web
4. Inside `web/`, replace the current assets with newly released ones by running `make pull-assets`
5. Inside `web/`, run `make generate`. The output should look something like this: `web: embed.go - YYY/MM/DD ... to write [./embed.go] from config file ...`
6. Move to the changelog (`cd ../changelog/`) and add a changelog file to the `unreleased/` folder (You can copy an old web release changelog item as a template)
7. Move to the repo root (`cd ..`)and update the WEB_COMMITID in the `/.drone.env` file to the commit id from the released version (unless the existing commit id is already newer)
8. **Optional:** Test the changes locally by running `cd ocis && go run cmd/ocis/main.go server`, visiting [https://localhost:9200](https://localhost:9200) and confirming everything renders correctly
9. Commit your changes, push them and [create a PR](https://github.com/owncloud/ocis/pulls)
+14
View File
@@ -0,0 +1,14 @@
sync:
docs:
mode: one-way-replica
alpha: .
beta: ./hugo/content
flushOnCreate: true
ignore:
paths:
- .gitignore
- mutagen.yml
- mutagen.yml.lock
- hugo
- README.md
- Makefile
+25 -4
View File
@@ -13,13 +13,34 @@ geekdocFilePath: _index.md
Welcome to oCIS, the modern file-sync and share platform, which is based on our knowledge and experience with the PHP based [ownCloud server](https://owncloud.com/#server).
### oCIS server
### oCIS microservice runtime
The oCIS server implementation follows [Go](https://golang.org/) best practices and is based on the [go-micro](https://go-micro.dev/) framework and [REVA](https://reva.link/). We love and stick to [12 Factor](https://12factor.net/).
oCIS is a micro-service based server, which allows scale-out of individual services to meet your specific performance requirements.
We run a huge [test suite](https://github.com/owncloud/core/tree/master/tests), which originated in ownCloud 10 and continues to grow.
The oCIS runtime allows us to dynamically manage services running in a single process. We use [suture](https://github.com/thejerf/suture) to create a supervisor tree that starts each service in a dedicated goroutine. Be default oCIS will start all built in oCIS extensions in a single process. Individual services can be moved to other nodes to scale-out and meet specific performance requirements. A [go-micro](https://github.com/asim/go-micro/blob/master/registry/registry.go) based registry allows services in multiple nodes to form a distributed microservice architecture.
### oCIS extensions
Every oCIS extension uses [ocis-pkg](https://github.com/owncloud/ocis/ocis-pkg), which implements the [go-micro](https://go-micro.dev/) interfaces for [servers](https://github.com/asim/go-micro/blob/v3.5.0/server/server.go#L17-L37) to register and [clients](https://github.com/asim/go-micro/blob/v3.5.0/client/client.go#L11-L23) to lookup nodes with a service [registry](https://github.com/asim/go-micro/blob/v3.5.0/registry/registry.go).
We are following the [12 Factor](https://12factor.net/)methodology with oCIS. The uniformity of services also allows us to use the same command, logging and configuration mechanism. Configurations are forwarded from the
oCIS runtime to the individual extensions.
### go-micro
While the [go-micro](https://go-micro.dev/) framework provides abstractions as well as implementations for the different components in a microservice architecture it uses a more developer focused runtime philosophy: it is used to download a services from a repo, compile them on the fly and start them as individual processes. For oCIS we decided to use a more admin friendly runtime: you can download a single binary and start the contained oCIS extensions with a single `bin/ocis server`. This also makes packaging easier.
We use[ocis-pkg](https://github.com/owncloud/ocis/ocis-pkg) to configure the default implementations for the go-micro [grpc server](https://github.com/asim/go-micro/tree/v3.5.0/plugins/server/grpc), [client](https://github.com/asim/go-micro/tree/v3.5.0/plugins/client/grpc) and [mdns registry](https://github.com/asim/go-micro/blob/v3.5.0/registry/mdns_registry.go), swapping them out as needed, eg. to use the [kubernetes registry plugin](https://github.com/asim/go-micro/tree/v3.5.0/plugins/registry/kubernetes).
### REVA
A lot of embedded services in oCIS are built upon the [REVA](https://reva.link/) runtime. We decided to bundle some of the [CS3 services](https://github.com/cs3org/cs3apis) to logically group them. A [home storage provider](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/storagehome.go#L93-L108), which is dealing with [metadata](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ProviderAPI), and the corresponding [data provider](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/storagehome.go#L109-L123), which is dealing with [up and download](https://cs3org.github.io/cs3apis/#cs3.gateway.v1beta1.FileUploadProtocol), are one example. The [frontend](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/frontend.go) with the [oc flavoured webdav](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/frontend.go#L132-L138), [ocs handlers](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/frontend.go#L139-L148) and a [datagateway](https://github.com/owncloud/ocis/blob/v1.2.0/storage/pkg/command/frontend.go#L126-L131) are another.
### Protocol driven development
Interacting with oCIS involves a multitude af APIs. The server and all clients rely on [OpenID Connect](https://openid.net/connect/) for authentication. The [embedded konnectd](https://github.com/owncloud/ocis/tree/master/idp) can be replaced with any other OpenID Connect Identity Provider. Clients use the [WebDAV](http://webdav.org/) based [oc sync protocol](https://github.com/cernbox/smashbox/blob/master/protocol/protocol.md) to manage files and folders, [ocs to manage shares](https://doc.owncloud.com/server/developer_manual/core/apis/ocs-share-api.html) and [TUS](https://tus.io/protocols/resumable-upload.html) to upload files in a resumable way. On the server side [REVA](https://reva.link/) is the reference implementation of the [CS3 apis](https://github.com/cs3org/cs3apis) which is defined using [protobuf](https://developers.google.com/protocol-buffers/). By embedding [glauth](https://github.com/glauth/glauth/), oCIS provides a read only [LDAP](https://tools.ietf.org/html/rfc2849) interface to make accounts, including guests available to firewalls and other systems. In the future, we are looking into [the Microsoft Graph API](https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0), which is based on [odata](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html) as a well defined REST/JSON dialect for the existing endpoints.
### Acceptance test suite
We run a huge [test suite](https://github.com/owncloud/core/tree/master/tests), which originated in ownCloud 10 and continues to grow. A detailed description can be found in the developer docs for [testing]({{< relref "development/testing.md" >}}).
### Architecture Overview
Running `bin/ocis server` will start the below services, all of which can be scaled and deployed on a single node or in a cloud native environment, as needed.
{{< svg src="ocis/static/architecture-overview.drawio.svg" >}}
+5 -1
View File
@@ -11,7 +11,11 @@ geekdocFilePath: build-docs.md
## Build the documentation
Just run `make -C docs docs-serve` from within the root level of the oCIS git repository.
{{< hint info >}}
For building the documentation you need to have Make and Go 1.14 or higher installed.
{{< /hint >}}
Just run `make -C docs docs-serve` from within the root level of the oCIS git repository. This will make documentation available on [localhost:1313](http://localhost:1313) and also do a hot reload if you change something in the (non autogenerated) documentation files.
## Add changes to the documentation
@@ -37,8 +37,6 @@ You may add flags to your commit message or PR title in order to speed up pipeli
- `[tests-only]`: please add this flag, if you only changed tests or test-related tooling. You do not need to add a changelog for tests-only changes.
- `[with-benchmarks]`: please add this flag, if you want benchmarks to be run in CI.
### Knowledge base
- My pipeline fails because some CI related files or commands are missing.
@@ -54,7 +52,7 @@ You may add flags to your commit message or PR title in order to speed up pipeli
```
{{< hint info >}}
If you experience a `"build" struct has no .title attribute` error you need a patched drone-cli binary.
You need to build it yourself from this [source code](https://github.com/micbar/drone-cli/tree/add-more-flags).
(There is also an open [PR](https://github.com/drone/drone-cli/pull/175) for that on drone-cli)
If you experience a `"build" struct has no .title attribute` you need a newer version of drone-cli.
You currently need to build it yourself from this [source code](https://github.com/drone/drone-cli). If you are not using master as source, please ensure that this [PR](https://github.com/drone/drone-cli/pull/175) is included.
{{< /hint >}}
+4 -6
View File
@@ -16,7 +16,7 @@ So we are trying to reflect this in the tooling. It should be kept simple and qu
Besides standard development tools like git and a text editor, you need the following software for development:
- Go >= v1.13 ([install instructions](https://golang.org/doc/install))
- Go >= v1.15 ([install instructions](https://golang.org/doc/install))
- Yarn ([install instructions](https://classic.yarnpkg.com/en/docs/install))
- docker ([install instructions](https://docs.docker.com/get-docker/))
- docker-compose ([install instructions](https://docs.docker.com/compose/install/))
@@ -25,17 +25,15 @@ If you find tools needed besides the mentioned above, please feel free to open a
## Repository structure
This repository follows the [golang-standard project-layout](https://github.com/golang-standards/project-layout).
oCIS consists of multiple micro services, also called extensions. We started by having standalone repositories for each of them but quickly noticed, that this adds a time consuming overhead for developers. So we ended up with a monorepo housing all the extensions in one repository.
Each of the extensions live in a subfolder (eg. `accounts` or `settings`) in this repository, technically creating independent Go modules.
Each extension lives in a subfolder (eg. `accounts` or `settings`) in this respository as an independent Go module, following the [golang-standard project-layout](https://github.com/golang-standards/project-layout). They have common Makefile targets and can be used to change, build and run individual extensions.
The `ocis` folder does also contain a Go module but is no extension at all. Instead this module is used to import all extensions and furthermore implement commands to start the extensions. With the resulting oCIS binary you can start single extensions or even all extensions at the same time.
The `ocis` folder contains our [go-micro](https://github.com/asim/go-micro/) and [suture](https://github.com/thejerf/suture) based runtime. It is used to import all extensions and implements commands to manage them, similar to a small orchestrator. With the resulting oCIS binary you can start single extensions or even all extensions at the same time.
The `docs` folder contains the source for the [oCIS documentation](https://owncloud.github.io/ocis/).
The `deployments` folder contains documented deployment configurations and templates.
The `deployments` folder contains documented deployment configurations and templates. On a single node, running a single ocis runtime is a resource efficient way to deploy ocis. For multiple nodes docker compose or helm charts for kubernetes examples can be found here.
The `scripts` folder contains scripts to perform various build, install, analysis, etc operations.
+3 -3
View File
@@ -131,12 +131,12 @@ To run a single test add `BEHAT_FEATURE=<feature file>`
### use existing tests for BDD
As a lot of scenarios are written for oC10, we can use those tests for Behaviour driven development in ocis.
Every scenario that does not work in oCIS with "owncloud" storage, is listed in `tests/acceptance/expected-failures-on-OWNCLOUD-storage.txt` with a link to the related issue.
Every scenario that does not work in oCIS with "ocis" storage, is listed in `tests/acceptance/expected-failures-on-OCIS-storage.txt` with a link to the related issue.
Every scenario that does not work in oCIS with "owncloud" storage, is listed in `tests/acceptance/expected-failures-on-OWNCLOUD-storage.md` with a link to the related issue.
Every scenario that does not work in oCIS with "ocis" storage, is listed in `tests/acceptance/expected-failures-on-OCIS-storage.md` with a link to the related issue.
Those scenarios are run in the ordinary acceptance test pipeline in CI. The scenarios that fail are checked against the
expected failures. If there are any differences then the CI pipeline fails.
Similarly, scenarios that do not work in oCIS with EOS storage are listed in `tests/acceptance/expected-failures-on-EOS-storage.txt`.
Similarly, scenarios that do not work in oCIS with EOS storage are listed in `tests/acceptance/expected-failures-on-EOS-storage.md`.
Additionally, some issues have scenarios that demonstrate the current buggy behaviour in ocis(reva).
Those scenarios are in this ocis repository in `tests/acceptance/features/apiBugDemonstration`.
Have a look into the [documentation](https://doc.owncloud.com/server/developer_manual/testing/acceptance-tests.html#writing-scenarios-for-bugs) to understand why we are writing those tests.
+2 -2
View File
@@ -20,11 +20,11 @@ You can find the latest official release of ocis at [our download mirror](https:
The latest build from the master branch can be found at [our download mirrors testing section](https://download.owncloud.com/ocis/ocis/testing/).
To run oCIS as binary you need to download it first and then run the following commands.
For this example, assuming version 1.1.0 of oCIS running on a Linux AMD64 host:
For this example, assuming version 1.2.0 of oCIS running on a Linux AMD64 host:
```console
# download
curl https://download.owncloud.com/ocis/ocis/1.1.0/ocis-1.1.0-linux-amd64 --output ocis
curl https://download.owncloud.com/ocis/ocis/1.2.0/ocis-1.2.0-linux-amd64 --output ocis
# make binary executable
chmod +x ocis
+54
View File
@@ -7,6 +7,60 @@ geekdocEditPath: edit/master/docs/ocis
geekdocFilePath: release_notes.md
---
## ownCloud Infinite Scale 1.2.0 Technology Preview
Version 1.2.0 brings more functionality and stability to ownCloud Infinite Scale. ownCloud Web now loads a lot faster and is prepared for the introduction of accessibility features. An initial implementation for S3 storage support is available and file integrity checking has been introduced.
The most prominent changes in version 1.2.0 comprise:
- The initial loading time for ownCloud Web has been reduced by handling dependencies more efficiently (the bundle size of ownCloud Web has been drastically reduced) https://github.com/owncloud/web/pull/4584
- Preparations for accessibility features have been implemented to work towards WCAG 2.1 compliance https://github.com/owncloud/web/pull/4594
- Initial S3 storage support is available https://github.com/cs3org/reva/issues/1429
- File integrity checking has been introduced: When uploading files, Infinite Scale now makes sure that the file integrity is protected between server and clients by comparing checksums https://github.com/cs3org/reva/issues/1400
- Public link passwords are now stored as hashes to improve security https://github.com/cs3org/reva/issues/1462
You can also read the full [ownCloud Infinite Scale changelog](https://github.com/owncloud/ocis/blob/master/CHANGELOG.md) and [ownCloud Web changelog](https://github.com/owncloud/web/blob/master/CHANGELOG.md#changelog-for-owncloud-web-200-2021-02-16) 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.md" >}})
{{< /hint >}}
#### Fix IDP service user
Related: [#1390](https://github.com/owncloud/ocis/pull/1390), [#1569](https://github.com/owncloud/ocis/issues/1569)
After upgrading oCIS from a previous version to oCIS 1.2.0 you will not be able to login in ownCloud Web
Implications:
- manual action required
Migration steps:
- Stop oCIS
- Open following file `/var/tmp/ocis/storage/metadata/nodes/root/accounts/820ba2a1-3f54-4538-80a4-2d73007e30bf`
- Change password to `$2y$12$ywfGLDPsSlBTVZU0g.2GZOPO8Wap3rVOpm8e3192VlytNdGWH7x72`
- Change onPremisesSamAccountName to `idp`
- Change preferredName to `idp`
- Save the changed file
- Start oCIS
- You now are able to lock back in again.
Please have a look at [how to secure an oCIS instance]({{< ref "./deployment#secure-an-ocis-instance" >}}) since you seem to run it with default secrets.
#### Reset shares
Related: [#1626](https://github.com/owncloud/ocis/pull/1626)
After upgrading oCIS from a previous version to oCIS 1.2.0 you will will not be able to use previous shares or create new shares.
Implications:
- manual action required
- loss of shares (manual resharing is needed, files will not be lost)
Migration steps:
- Stop oCIS
- Delete following file `/var/tmp/ocis/storage/shares.json`
- Start oCIS
- Recreate shares manually
## ownCloud Infinite Scale 1.1.0 Technology Preview
Version 1.1.0 is a hardening and patch release. It ships with the latest version of ownCloud Web and brings a couple of minor improvements. The minor version increase is needed due to non-backwards compatible changes in configuration. The documentation has been updated to reflect the changes. Please note that this version is still a Technology Preview and not suited for production use.
+9 -142
View File
@@ -1,160 +1,27 @@
SHELL := bash
NAME := glauth
IMPORT := github.com/owncloud/ocis/$(NAME)
BIN := bin
DIST := dist
ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
UNAME := Windows
else
EXECUTABLE := $(NAME)
UNAME := $(shell uname -s)
endif
############ tooling ############
include ../.bingo/Variables.mk
ifeq ($(UNAME), Darwin)
GOBUILD ?= go build -i
else
GOBUILD ?= go build
endif
############ go tooling ############
include ../.make/go.mk
PACKAGES ?= $(shell go list ./...)
SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
GENERATE ?= $(PACKAGES)
TAGS ?=
ifndef OUTPUT
ifneq ($(DRONE_TAG),)
OUTPUT ?= $(subst v,,$(DRONE_TAG))
else
OUTPUT ?= testing
endif
endif
ifndef VERSION
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
VERSION ?= $(shell git rev-parse --short HEAD)
endif
endif
ifndef DATE
DATE := $(shell date -u '+%Y%m%d')
endif
LDFLAGS += -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
GCFLAGS += all=-N -l
.PHONY: all
all: build
.PHONY: sync
sync:
go mod download
.PHONY: clean
clean:
go clean -i ./...
rm -rf $(BIN) $(DIST)
.PHONY: go-mod-tidy
go-mod-tidy:
@go mod tidy
.PHONY: fmt
fmt:
gofmt -s -w $(SOURCES)
.PHONY: vet
vet:
go vet $(PACKAGES)
.PHONY: staticcheck
staticcheck:
go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES)
.PHONY: lint
lint:
for PKG in $(PACKAGES); do go run golang.org/x/lint/golint -set_exit_status $$PKG || exit 1; done;
.PHONY: changelog
changelog:
go run github.com/restic/calens >| CHANGELOG.md
.PHONY: test
test:
go run github.com/haya14busa/goverage -v -coverprofile coverage.out $(PACKAGES)
.PHONY: go-coverage
go-coverage:
@if [ ! -f coverage.out ]; then $(MAKE) test &>/dev/null; fi;
@go tool cover -func coverage.out | tail -1 | grep -Eo "[0-9]+\.[0-9]+"
.PHONY: install
install: $(SOURCES)
go install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' ./cmd/$(NAME)
.PHONY: build
build: $(BIN)/$(EXECUTABLE) $(BIN)/$(EXECUTABLE)-debug
$(BIN)/$(EXECUTABLE): $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ ./cmd/$(NAME)
$(BIN)/$(EXECUTABLE)-debug: $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)
.PHONY: release
release: release-dirs release-linux release-windows release-darwin release-copy release-check
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release
.PHONY: release-linux
release-linux: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-windows
release-windows: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-darwin
release-darwin: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-copy
release-copy:
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
.PHONY: release-check
release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
.PHONY: release-finish
release-finish: release-copy release-check
.PHONY: watch
watch:
go run github.com/cespare/reflex -c reflex.conf
############ release ############
include ../.make/release.mk
############ docs generate ############
include ../.make/docs.mk
.PHONY: docs-generate
docs-generate: config-docs-generate
.PHONY: config-docs-generate
config-docs-generate:
go run github.com/owncloud/flaex >| ../docs/extensions/$(NAME)/configuration.md
############ generate ############
.PHONY: generate
generate: ci-node-generate ci-go-generate
include ../.make/generate.mk
.PHONY: ci-go-generate
ci-go-generate: # CI runs ci-node-generate automatically before this target
go generate $(GENERATE)
@go generate $(GENERATE)
.PHONY: ci-node-generate
ci-node-generate:
+6 -4
View File
@@ -7,11 +7,10 @@ require (
contrib.go.opencensus.io/exporter/ocagent v0.7.0
contrib.go.opencensus.io/exporter/zipkin v0.1.2
github.com/GeertJohan/yubigo v0.0.0-20190917122436-175bc097e60e
github.com/UnnoTed/fileb0x v1.1.4
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/glauth/glauth v1.1.3-0.20201110124627-fd3ac7e4bbdc
github.com/go-logr/logr v0.1.0
github.com/micro/cli/v2 v2.1.2
github.com/micro/go-micro/v2 v2.9.1
github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484
github.com/nmcclain/ldap v0.0.0-20191021200707-3b3b69a7e9e3
github.com/oklog/run v1.1.0
@@ -19,7 +18,6 @@ require (
github.com/owncloud/ocis/accounts v0.5.3-0.20210216094451-dc73176dc62d
github.com/owncloud/ocis/ocis-pkg v0.0.0-20210216094451-dc73176dc62d
github.com/prometheus/client_golang v1.7.1
github.com/restic/calens v0.2.0
github.com/rs/zerolog v1.20.0
github.com/spf13/viper v1.7.1
go.opencensus.io v0.22.6
@@ -28,5 +26,9 @@ require (
replace (
github.com/owncloud/ocis/accounts => ../accounts
github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg
google.golang.org/grpc => google.golang.org/grpc v1.26.0
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
// latest version compatible with etcd
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)
+235 -263
View File
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -117,17 +117,17 @@ func (l logger) V(verbosity int) logr.InfoLogger {
// uses '/' characters to separate name elements. Callers should not pass '/'
// in the provided name string, but this library does not actually enforce that.
func (l logger) WithName(name string) logr.Logger {
new := l.clone()
nl := l.clone()
if len(l.prefix) > 0 {
new.prefix = l.prefix + "/"
nl.prefix = l.prefix + "/"
}
new.prefix += name
return new
nl.prefix += name
return nl
}
func (l logger) WithValues(kvList ...interface{}) logr.Logger {
new := l.clone()
new.values = append(new.values, kvList...)
return new
nl := l.clone()
nl.values = append(nl.values, kvList...)
return nl
}
var _ logr.Logger = logger{}
+10 -2
View File
@@ -34,7 +34,11 @@ func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
// TODO(tboerger): check if services are up and running
io.WriteString(w, http.StatusText(http.StatusOK))
_, err := io.WriteString(w, http.StatusText(http.StatusOK))
// io.WriteString should not fail but if it does we want to know.
if err != nil {
panic(err)
}
}
}
@@ -46,6 +50,10 @@ func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
// TODO(tboerger): check if services are up and running
io.WriteString(w, http.StatusText(http.StatusOK))
_, err := io.WriteString(w, http.StatusText(http.StatusOK))
// io.WriteString should not fail but if it does we want to know.
if err != nil {
panic(err)
}
}
}
+3 -3
View File
@@ -8,9 +8,9 @@ import (
"strconv"
"strings"
"github.com/asim/go-micro/v3/metadata"
"github.com/glauth/glauth/pkg/handler"
"github.com/glauth/glauth/pkg/stats"
"github.com/micro/go-micro/v2/metadata"
ber "github.com/nmcclain/asn1-ber"
"github.com/nmcclain/ldap"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
@@ -275,7 +275,7 @@ func attribute(name string, values ...string) *ldap.EntryAttribute {
}
func (h ocisHandler) mapAccounts(accounts []*accounts.Account) []*ldap.Entry {
var entries []*ldap.Entry
entries := make([]*ldap.Entry, 0, len(accounts))
for i := range accounts {
attrs := []*ldap.EntryAttribute{
attribute("objectClass", "posixAccount", "inetOrgPerson", "organizationalPerson", "Person", "top"),
@@ -314,7 +314,7 @@ func (h ocisHandler) mapAccounts(accounts []*accounts.Account) []*ldap.Entry {
}
func (h ocisHandler) mapGroups(groups []*accounts.Group) []*ldap.Entry {
var entries []*ldap.Entry
entries := make([]*ldap.Entry, 0, len(groups))
for i := range groups {
attrs := []*ldap.EntryAttribute{
attribute("objectClass", "posixGroup", "groupOfNames", "top"),
-8
View File
@@ -1,8 +0,0 @@
// +build tools
package main
import (
_ "github.com/UnnoTed/fileb0x"
_ "github.com/restic/calens"
)
+11 -144
View File
@@ -1,165 +1,32 @@
SHELL := bash
NAME := graph-explorer
IMPORT := github.com/owncloud/ocis/$(NAME)
BIN := bin
DIST := dist
ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
UNAME := Windows
else
EXECUTABLE := $(NAME)
UNAME := $(shell uname -s)
endif
############ tooling ############
include ../.bingo/Variables.mk
ifeq ($(UNAME), Darwin)
GOBUILD ?= go build -i
else
GOBUILD ?= go build
endif
############ go tooling ############
include ../.make/go.mk
PACKAGES ?= $(shell go list ./...)
SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
GENERATE ?= $(PACKAGES)
TAGS ?=
ifndef OUTPUT
ifneq ($(DRONE_TAG),)
OUTPUT ?= $(subst v,,$(DRONE_TAG))
else
OUTPUT ?= testing
endif
endif
ifndef VERSION
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
VERSION ?= $(shell git rev-parse --short HEAD)
endif
endif
ifndef DATE
DATE := $(shell date -u '+%Y%m%d')
endif
LDFLAGS += -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
DEBUG_LDFLAGS += -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
GCFLAGS += all=-N -l
.PHONY: all
all: build
.PHONY: sync
sync:
go mod download
.PHONY: clean
clean:
go clean -i ./...
rm -rf $(BIN) $(DIST) assets
.PHONY: go-mod-tidy
go-mod-tidy:
@go mod tidy
.PHONY: fmt
fmt:
gofmt -s -w $(SOURCES)
.PHONY: vet
vet:
go vet $(PACKAGES)
.PHONY: staticcheck
staticcheck:
go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES)
.PHONY: lint
lint:
for PKG in $(PACKAGES); do go run golang.org/x/lint/golint -set_exit_status $$PKG || exit 1; done;
.PHONY: changelog
changelog:
go run github.com/restic/calens >| CHANGELOG.md
.PHONY: test
test:
go run github.com/haya14busa/goverage -v -coverprofile coverage.out $(PACKAGES)
.PHONY: go-coverage
go-coverage:
@if [ ! -f coverage.out ]; then $(MAKE) test &>/dev/null; fi;
@go tool cover -func coverage.out | tail -1 | grep -Eo "[0-9]+\.[0-9]+"
.PHONY: install
install: $(SOURCES)
go install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' ./cmd/$(NAME)
.PHONY: build
build: $(BIN)/$(EXECUTABLE) $(BIN)/$(EXECUTABLE)-debug
$(BIN)/$(EXECUTABLE): $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ ./cmd/$(NAME)
$(BIN)/$(EXECUTABLE)-debug: $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(DEBUG_LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)
.PHONY: release
release: release-dirs release-linux release-windows release-darwin release-copy release-check
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release
.PHONY: release-linux
release-linux: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-windows
release-windows: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-darwin
release-darwin: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-copy
release-copy:
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
.PHONY: release-check
release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
.PHONY: release-finish
release-finish: release-copy release-check
.PHONY: watch
watch:
go run github.com/cespare/reflex -c reflex.conf
############ release ############
include ../.make/release.mk
############ docs generate ############
include ../.make/docs.mk
.PHONY: docs-generate
docs-generate: config-docs-generate
.PHONY: config-docs-generate
config-docs-generate:
go run github.com/owncloud/flaex >| ../docs/extensions/$(NAME)/configuration.md
############ generate ############
.PHONY: generate
generate: ci-node-generate ci-go-generate
include ../.make/generate.mk
.PHONY: ci-go-generate
ci-go-generate: pull-assets # CI runs ci-node-generate automatically before this target
go generate $(GENERATE)
@go generate $(GENERATE)
.PHONY: ci-node-generate
ci-node-generate:
.PHONY: pull-assets
pull-assets:
rm -Rf assets && mkdir assets/ && curl -slL -o- https://github.com/owncloud/graph-explorer/releases/download/v1.7.10.3/release.tar.gz | tar xvzf - -C assets/
@rm -Rf assets && mkdir assets/ && curl -slL -o- https://github.com/owncloud/graph-explorer/releases/download/v1.7.10.3/release.tar.gz | tar xvzf - -C assets/
+8 -9
View File
@@ -6,12 +6,10 @@ require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
contrib.go.opencensus.io/exporter/ocagent v0.6.0
contrib.go.opencensus.io/exporter/zipkin v0.1.1
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/go-chi/chi v4.1.2+incompatible
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/micro/cli/v2 v2.1.2
github.com/mitchellh/copystructure v1.1.1 // indirect
github.com/oklog/run v1.1.0
github.com/openzipkin/zipkin-go v0.2.2
github.com/owncloud/ocis/ocis-pkg v0.0.0-20210216094451-dc73176dc62d
@@ -19,13 +17,14 @@ require (
go.opencensus.io v0.22.6
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
golang.org/x/mod v0.4.1 // indirect
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
google.golang.org/grpc/examples v0.0.0-20210212222430-425d405f3928 // indirect
honnef.co/go/tools v0.1.1 // indirect
golang.org/x/net v0.0.0-20201224014010-6772e930b67b
)
replace (
github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg
google.golang.org/grpc => google.golang.org/grpc v1.26.0
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
// latest version compatible with etcd
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)
+217 -289
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/owncloud/ocis/ocis-pkg/log"
)
//go:generate go run github.com/UnnoTed/fileb0x embed.yml
//go:generate make -C ../.. embed.yml
// assets gets initialized by New and provides the handler.
type assets struct {
+6 -2
View File
@@ -34,7 +34,9 @@ func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
// TODO(tboerger): check if services are up and running
io.WriteString(w, http.StatusText(http.StatusOK))
if _, err := io.WriteString(w, http.StatusText(http.StatusOK)); err != nil {
panic(err)
}
}
}
@@ -46,6 +48,8 @@ func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
// TODO(tboerger): check if services are up and running
io.WriteString(w, http.StatusText(http.StatusOK))
if _, err := io.WriteString(w, http.StatusText(http.StatusOK)); err != nil {
panic(err)
}
}
}
+4 -4
View File
@@ -1,6 +1,7 @@
package http
import (
"github.com/asim/go-micro/v3"
svc "github.com/owncloud/ocis/graph-explorer/pkg/service/v0"
"github.com/owncloud/ocis/graph-explorer/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/middleware"
@@ -46,10 +47,9 @@ func Server(opts ...Option) (http.Service, error) {
handle = svc.NewTracing(handle)
}
service.Handle(
"/",
handle,
)
if err := micro.RegisterHandler(service.Server(), handle); err != nil {
return http.Service{}, err
}
service.Init()
return service, nil
+9 -3
View File
@@ -55,9 +55,15 @@ func (p GraphExplorer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (p GraphExplorer) ConfigJs(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/javascript")
w.WriteHeader(http.StatusOK)
io.WriteString(w, fmt.Sprintf("window.ClientId = \"%v\";", p.config.GraphExplorer.ClientID))
io.WriteString(w, fmt.Sprintf("window.Iss = \"%v\";", p.config.GraphExplorer.Issuer))
io.WriteString(w, fmt.Sprintf("window.GraphUrl = \"%v\";", p.config.GraphExplorer.GraphURL))
if _, err := io.WriteString(w, fmt.Sprintf("window.ClientId = \"%v\";", p.config.GraphExplorer.ClientID)); err != nil {
p.logger.Error().Err(err).Msg("Could not write to response writer")
}
if _, err := io.WriteString(w, fmt.Sprintf("window.Iss = \"%v\";", p.config.GraphExplorer.Issuer)); err != nil {
p.logger.Error().Err(err).Msg("Could not write to response writer")
}
if _, err := io.WriteString(w, fmt.Sprintf("window.GraphUrl = \"%v\";", p.config.GraphExplorer.GraphURL)); err != nil {
p.logger.Error().Err(err).Msg("Could not write to response writer")
}
}
// Static simply serves all static files.
+9 -143
View File
@@ -1,161 +1,27 @@
SHELL := bash
NAME := graph
IMPORT := github.com/owncloud/ocis/$(NAME)
BIN := bin
DIST := dist
ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
UNAME := Windows
else
EXECUTABLE := $(NAME)
UNAME := $(shell uname -s)
endif
############ tooling ############
include ../.bingo/Variables.mk
ifeq ($(UNAME), Darwin)
GOBUILD ?= go build -i
else
GOBUILD ?= go build
endif
############ go tooling ############
include ../.make/go.mk
PACKAGES ?= $(shell go list ./...)
SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
GENERATE ?= $(PACKAGES)
TAGS ?=
ifndef OUTPUT
ifneq ($(DRONE_TAG),)
OUTPUT ?= $(subst v,,$(DRONE_TAG))
else
OUTPUT ?= testing
endif
endif
ifndef VERSION
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
VERSION ?= $(shell git rev-parse --short HEAD)
endif
endif
ifndef DATE
DATE := $(shell date -u '+%Y%m%d')
endif
LDFLAGS += -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
DEBUG_LDFLAGS += -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
GCFLAGS += all=-N -l
.PHONY: all
all: build
.PHONY: sync
sync:
go mod download
.PHONY: clean
clean:
go clean -i ./...
rm -rf $(BIN) $(DIST)
.PHONY: go-mod-tidy
go-mod-tidy:
@go mod tidy
.PHONY: fmt
fmt:
gofmt -s -w $(SOURCES)
.PHONY: vet
vet:
go vet $(PACKAGES)
.PHONY: staticcheck
staticcheck:
go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES)
.PHONY: lint
lint:
for PKG in $(PACKAGES); do go run golang.org/x/lint/golint -set_exit_status $$PKG || exit 1; done;
.PHONY: changelog
changelog:
go run github.com/restic/calens >| CHANGELOG.md
.PHONY: test
test:
go run github.com/haya14busa/goverage -v -coverprofile coverage.out $(PACKAGES)
.PHONY: go-coverage
go-coverage:
@if [ ! -f coverage.out ]; then $(MAKE) test &>/dev/null; fi;
@go tool cover -func coverage.out | tail -1 | grep -Eo "[0-9]+\.[0-9]+"
.PHONY: install
install: $(SOURCES)
go install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' ./cmd/$(NAME)
.PHONY: build
build: $(BIN)/$(EXECUTABLE) $(BIN)/$(EXECUTABLE)-debug
$(BIN)/$(EXECUTABLE): $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ ./cmd/$(NAME)
$(BIN)/$(EXECUTABLE)-debug: $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(DEBUG_LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)
.PHONY: release
release: release-dirs release-linux release-windows release-darwin release-copy release-check
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release
.PHONY: release-linux
release-linux: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-windows
release-windows: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-darwin
release-darwin: release-dirs
go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-copy
release-copy:
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
.PHONY: release-check
release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
.PHONY: release-finish
release-finish: release-copy release-check
.PHONY: watch
watch:
go run github.com/cespare/reflex -c reflex.conf
############ release ############
include ../.make/release.mk
############ docs generate ############
include ../.make/docs.mk
.PHONY: docs-generate
docs-generate: config-docs-generate
.PHONY: config-docs-generate
config-docs-generate:
go run github.com/owncloud/flaex >| ../docs/extensions/$(NAME)/configuration.md
############ generate ############
.PHONY: generate
generate: ci-node-generate ci-go-generate
include ../.make/generate.mk
.PHONY: ci-go-generate
ci-go-generate: # CI runs ci-node-generate automatically before this target
go generate $(GENERATE)
@go generate $(GENERATE)
.PHONY: ci-node-generate
ci-node-generate:
+8 -6
View File
@@ -6,12 +6,12 @@ require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
contrib.go.opencensus.io/exporter/ocagent v0.7.0
contrib.go.opencensus.io/exporter/zipkin v0.1.2
github.com/cs3org/go-cs3apis v0.0.0-20210104105209-0d3ecb3453dc
github.com/cs3org/reva v1.5.2-0.20210212085611-d8aa2eb3ec9c
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/cs3org/go-cs3apis v0.0.0-20210209082852-35ace33082f5
github.com/cs3org/reva v1.6.1-0.20210223065028-53f39499762e
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-chi/render v1.0.1
github.com/go-ldap/ldap/v3 v3.2.4
github.com/gogo/protobuf v1.3.1 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/micro/cli/v2 v2.1.2
github.com/oklog/run v1.1.0
@@ -23,12 +23,14 @@ require (
go.opencensus.io v0.22.6
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
golang.org/x/mod v0.4.1 // indirect
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
google.golang.org/grpc v1.35.0
honnef.co/go/tools v0.1.1 // indirect
)
replace (
github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg
google.golang.org/grpc => google.golang.org/grpc v1.26.0
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
// latest version compatible with etcd
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)
+221 -167
View File
File diff suppressed because it is too large. Load diff
+6 -2
View File
@@ -34,7 +34,9 @@ func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
// TODO(tboerger): check if services are up and running
io.WriteString(w, http.StatusText(http.StatusOK))
if _, err := io.WriteString(w, http.StatusText(http.StatusOK)); err != nil {
panic(err)
}
}
}
@@ -46,6 +48,8 @@ func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
// TODO(tboerger): check if services are up and running
io.WriteString(w, http.StatusText(http.StatusOK))
if _, err := io.WriteString(w, http.StatusText(http.StatusOK)); err != nil {
panic(err)
}
}
}
+4 -4
View File
@@ -1,6 +1,7 @@
package http
import (
"github.com/asim/go-micro/v3"
svc "github.com/owncloud/ocis/graph/pkg/service/v0"
"github.com/owncloud/ocis/graph/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/middleware"
@@ -53,10 +54,9 @@ func Server(opts ...Option) (http.Service, error) {
handle = svc.NewTracing(handle)
}
service.Handle(
"/",
handle,
)
if err := micro.RegisterHandler(service.Server(), handle); err != nil {
return http.Service{}, err
}
service.Init()
return service, nil
+1 -1
View File
@@ -53,7 +53,7 @@ func (g Graph) GetGroups(w http.ResponseWriter, r *http.Request) {
return
}
var groups []*msgraph.Group
groups := make([]*msgraph.Group, 0, len(result.Entries))
for _, group := range result.Entries {
groups = append(
Loaded 100 of 271 files, more files were not shown because too many files have changed in this diff. Show more