From 7d9773c075a42a4742b6d5204d5c7be77f451758 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Thu, 6 Feb 2020 15:39:24 +0100 Subject: [PATCH 01/14] added editorconfig --- .editorconfig | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..7b368379e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,35 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true + +[Makefile] +indent_style = tab +indent_size = 4 + +[*.go] +indent_style = tab +indent_size = 4 + +[*.starlark] +indent_style = space +indent_size = 2 + +[*.{yml,json}] +indent_style = space +indent_size = 2 + +[*.{js,vue}] +indent_style = space +indent_size = 2 + +[*.{css,less}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = true \ No newline at end of file From 1716beaa6250e422f1329ae501cf2364411301a2 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 09:54:43 +0100 Subject: [PATCH 02/14] server command verbose --- pkg/command/server.go | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/pkg/command/server.go b/pkg/command/server.go index 57724a8fe..600d90702 100644 --- a/pkg/command/server.go +++ b/pkg/command/server.go @@ -3,8 +3,6 @@ package command import ( "context" "fmt" - "os" - "path/filepath" "syscall" "github.com/micro/cli/v2" @@ -15,45 +13,50 @@ import ( // Server is the entry point for the server command. func Server(cfg *config.Config) *cli.Command { - baseDir, _ := filepath.Abs(filepath.Dir(os.Args[0])) - return &cli.Command{ - Name: "server", - Usage: "Start accounts service", + Name: "server", + Usage: "Start ocis accounts service", + Description: "an accounts backend manager (driver) needs to be specified. By default the service uses the filesystem as storage", Flags: []cli.Flag{ &cli.StringFlag{ Name: "manager", DefaultText: "filesystem", - Usage: "store controller driver. eg: filesystem", + Usage: "accounts backend manager", Value: "filesystem", EnvVars: []string{"OCIS_ACCOUNTS_MANAGER"}, Destination: &cfg.Manager, }, &cli.StringFlag{ Name: "mount-path", - DefaultText: "binary default running location", - Usage: "where to mount the ocis accounts store", - Value: baseDir, + Usage: "mounting point (necessary when manager=filesystem)", EnvVars: []string{"OCIS_ACCOUNTS_MOUNT_PATH"}, Destination: &cfg.MountPath, }, &cli.StringFlag{ Name: "name", Value: "accounts", - Destination: &cfg.Server.Name, + DefaultText: "accounts", + Usage: "service name", EnvVars: []string{"OCIS_ACCOUNTS_NAME"}, + Destination: &cfg.Server.Name, }, &cli.StringFlag{ Name: "namespace", + Aliases: []string{"ns"}, Value: "com.owncloud", - Destination: &cfg.Server.Namespace, + DefaultText: "com.owncloud", + Usage: "namespace", EnvVars: []string{"OCIS_ACCOUNTS_NAMESPACE"}, + Destination: &cfg.Server.Namespace, }, &cli.StringFlag{ Name: "address", + Aliases: []string{"addr"}, Value: "localhost:9999", - Destination: &cfg.Server.Address, + DefaultText: "localhost:9999", + Usage: "service endpoint", EnvVars: []string{"OCIS_ACCOUNTS_ADDRESS"}, + Destination: &cfg.Server.Address, }, }, Action: func(c *cli.Context) error { From 29677fcf33ae156e5c558224eea145be7d0f26e3 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:03:06 +0100 Subject: [PATCH 03/14] added codacy ignores --- .codacy.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .codacy.yml diff --git a/.codacy.yml b/.codacy.yml new file mode 100644 index 000000000..855b4f298 --- /dev/null +++ b/.codacy.yml @@ -0,0 +1,8 @@ +--- +exclude_paths: + - CHANGELOG.md + - changelog/** + - docs/** + - pkg/proto/** + +... From a6835cd9045ace6ece84c4675f09547d1331af05 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:20:46 +0100 Subject: [PATCH 04/14] added license --- license.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 license.md diff --git a/license.md b/license.md new file mode 100644 index 000000000..268e597fd --- /dev/null +++ b/license.md @@ -0,0 +1,8 @@ +--- +title: "License" +date: 2018-05-02T00:00:00+00:00 +anchor: "license" +weight: 40 +--- + +This project is licensed under the [Apache 2.0](https://github.com/owncloud/ocis-accounts/blob/master/LICENSE) license. For the license of the used libraries you have to check the respective sources. From f6780074d5af2f57e5eb5ab2cc4d8e40a265dbe8 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:21:00 +0100 Subject: [PATCH 05/14] added docs --- docs/.gitignore | 1 + docs/archetypes/default.md | 6 + docs/config.toml | 18 ++ docs/content/about.md | 8 + docs/content/building.md | 24 +++ docs/content/getting-started.md | 63 ++++++ docs/layouts/_default/list.html | 0 docs/layouts/_default/single.html | 0 docs/layouts/index.html | 57 +++++ docs/layouts/partials/style.html | 2 + docs/static/styles.css | 338 ++++++++++++++++++++++++++++++ docs/static/syntax.css | 59 ++++++ 12 files changed, 576 insertions(+) create mode 100644 docs/.gitignore create mode 100644 docs/archetypes/default.md create mode 100644 docs/config.toml create mode 100644 docs/content/about.md create mode 100644 docs/content/building.md create mode 100644 docs/content/getting-started.md create mode 100644 docs/layouts/_default/list.html create mode 100644 docs/layouts/_default/single.html create mode 100644 docs/layouts/index.html create mode 100644 docs/layouts/partials/style.html create mode 100644 docs/static/styles.css create mode 100644 docs/static/syntax.css diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..364fdec1a --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +public/ diff --git a/docs/archetypes/default.md b/docs/archetypes/default.md new file mode 100644 index 000000000..4e777bee1 --- /dev/null +++ b/docs/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +date: {{ .Date }} +anchor: "{{ replace .TranslationBaseName "-" " " | title | urlize }}" +weight: +--- diff --git a/docs/config.toml b/docs/config.toml new file mode 100644 index 000000000..82d4905f1 --- /dev/null +++ b/docs/config.toml @@ -0,0 +1,18 @@ +baseURL = "https://owncloud.github.io/ocis-accounts/" +languageCode = "en-us" +title = "ownCloud Infinite Scale: Accounts" +pygmentsUseClasses = true + +disableKinds = ["taxonomy", "taxonomyTerm", "RSS", "sitemap"] + +[blackfriday] + angledQuotes = true + fractions = false + plainIDAnchors = true + smartlists = true + extensions = ["hardLineBreak"] + +[params] + author = "ownCloud GmbH" + description = "Serve Accounbts API for oCIS" + keywords = "reva, ocis, accounts" diff --git a/docs/content/about.md b/docs/content/about.md new file mode 100644 index 000000000..2f6241567 --- /dev/null +++ b/docs/content/about.md @@ -0,0 +1,8 @@ +--- +title: "About" +date: 2020-02-07T00:00:00+00:00 +anchor: "about" +weight: 10 +--- + +This service provides an inter-operable accounts service that operates on the filesystem by default. diff --git a/docs/content/building.md b/docs/content/building.md new file mode 100644 index 000000000..0cf218652 --- /dev/null +++ b/docs/content/building.md @@ -0,0 +1,24 @@ +--- +title: "Building" +date: 2018-05-02T00:00:00+00:00 +anchor: "building" +weight: 30 +--- + +As this project is built with Go, so you need to install that first. The installation of Go is out of the scope of this document, please follow the official documentation for [Go](https://golang.org/doc/install), to build this project you have to install Go >= v1.13. After the installation of the required tools you need to get the sources: + +{{< highlight txt >}} +git clone https://github.com/owncloud/ocis-accounts.git +cd ocis-accounts +{{< / highlight >}} + +All required tool besides Go itself and make are bundled or getting automatically installed within the `GOPATH`. All commands to build this project are part of our `Makefile`. + +### Backend + +{{< highlight txt >}} +make generate +make build +{{< / highlight >}} + +Finally you should have the binary within the `bin/` folder now, give it a try with `./bin/ocis-accounts -h` to see all available options and subcommands. diff --git a/docs/content/getting-started.md b/docs/content/getting-started.md new file mode 100644 index 000000000..795519fe3 --- /dev/null +++ b/docs/content/getting-started.md @@ -0,0 +1,63 @@ +--- +title: "Getting Started" +date: 2018-05-02T00:00:00+00:00 +anchor: "getting-started" +weight: 20 +--- + +### Installation + +So far we are offering two different variants for the installation. You can choose between [Docker](https://www.docker.com/) or pre-built binaries which are stored on our download mirrors and GitHub releases. Maybe we will also provide system packages for the major distributions later if we see the need for it. + +#### Docker + +TBD + +#### Binaries + +TBD + +### Configuration + +We provide overall three different variants of configuration. The variant based on environment variables and commandline flags are split up into global values and command-specific values. + +#### Envrionment variables + +If you prefer to configure the service with environment variables you can see the available variables below. + +##### Server + +OCIS_ACCOUNTS_MANAGER +: Enable sending traces, defaults to `filesystem` + +OCIS_ACCOUNTS_MOUNT_PATH +: Mounting point for the accounts service when running on the filesystem as manager. + +OCIS_ACCOUNTS_NAME +: Name of the accounts service. It will be part of the namespace. + +OCIS_ACCOUNTS_NAMESPACE +: Namespace of the accounts service. + +OCIS_ACCOUNTS_ADDRESS +: Endpoint for the grpc service endpoint. + +#### Commandline flags + +If you prefer to configure the service with commandline flags you can see the available variables below. + +#### Configuration file + +So far we support the file formats `JSON` and `YAML`, if you want to get a full example configuration just take a look at [our repository](https://github.com/owncloud/ocis-accounts/tree/master/pkg/config), there you can always see the latest configuration format. These example configurations include all available options and the default values. The configuration file will be automatically loaded if it's placed at `/etc/ocis/accounts.yml`, `${HOME}/.ocis/accounts.yml` or `$(pwd)/config/accounts.yml`. + +### Usage + +The program provides a few sub-commands on execution. The available configuration methods have already been mentioned above. Generally you can always see a formated help output if you execute the binary via `ocis-accounts --help`. + +#### Server + +The server command is used to start the grpc server. For further help please execute: + +{{< highlight txt >}} +ocis-accounts server --help +{{< / highlight >}} diff --git a/docs/layouts/_default/list.html b/docs/layouts/_default/list.html new file mode 100644 index 000000000..e69de29bb diff --git a/docs/layouts/_default/single.html b/docs/layouts/_default/single.html new file mode 100644 index 000000000..e69de29bb diff --git a/docs/layouts/index.html b/docs/layouts/index.html new file mode 100644 index 000000000..27db113ac --- /dev/null +++ b/docs/layouts/index.html @@ -0,0 +1,57 @@ + + + + + + + + + {{ .Site.Title }} + + + + + + {{ partial "style.html" . }} + + + + + + {{ range .Data.Pages.ByWeight }} +
+

+ + {{ .Title }} + + + + + Back to Top + + +

+ + {{ .Content | markdownify }} +
+ {{ end }} + + diff --git a/docs/layouts/partials/style.html b/docs/layouts/partials/style.html new file mode 100644 index 000000000..1386c59b0 --- /dev/null +++ b/docs/layouts/partials/style.html @@ -0,0 +1,2 @@ + + diff --git a/docs/static/styles.css b/docs/static/styles.css new file mode 100644 index 000000000..61acc8ddb --- /dev/null +++ b/docs/static/styles.css @@ -0,0 +1,338 @@ +body, +html { + cursor: default; +} + +body, +div, +dl, +dt, +dd, +ul, +ol, +li, +h1, +h2, +h3, +h4, +h5, +h6, +pre, +form, +fieldset, +input, +textarea, +p, +blockquote, +th, +td { + margin: 0; + padding: 0; +} + +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +:before, +:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +img, +object, +embed { + max-width: 100%; + height: auto; +} + +object, +embed { + height: 100%; +} + +img { + margin: 1.25% 0; + -ms-interpolation-mode: bicubic; +} + +html { + background-color: #F0F1F3; + padding: 2%; +} + +body { + font-size: 16px; + line-height: 1.6; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + color: #242424; + max-width: 800px; + margin: 5% auto; +} + +body::after { + clear: both; + content: ""; + display: table; +} + +header { + margin-bottom: 8%; +} + +footer { + text-align: center; +} + +h1, +h2, +h3, +h4, +h5, +h2 a { + color: #263A48; + font-weight: 500; + text-decoration: none; +} + +h1, +h2 { + font-size: 36px; + padding-bottom: 0.3em; + margin-bottom: 0.4em; + border-bottom: 1px solid #eee +} + +h2 { + font-size: 22px; + padding-bottom: 0.6em; + margin-bottom: 0.6em; + margin-top: 2.5em; +} + +h3 { + font-size: 18px; + margin-bottom: 0.3em; +} + +h2 small a { + color: #98999C; + font-size: 15px; + font-weight: normal; + float: right; + position: absolute; + top: 15px; + right: 20px; +} + +section { + background: #fff; + margin-bottom: 1%; + position: relative; + padding: 6% 8%; +} + +blockquote { + border-left: 3px solid #d54e21; + font-size: 16px; + padding: 0 0 0 20px; + color: #d54e21; +} + +blockquote a { + color: #d54e21; + font-weight: 500; +} + +blockquote code { + color: #d54e21; +} + +.highlight pre { + padding: 10px; +} + +.highlight { + margin-bottom: 4%; +} + +a { + color: #1e8cbe; + text-decoration: underline; +} + +a:hover { + color: #d54e21; +} + +ul { + list-style: none; +} + +ol { + list-style: number; +} + +ol li { + color: #98999C; + margin-bottom: 5px; +} + +ol li:last-child { + margin-bottom: 0; +} + +p, +ul, +ol, +blockquote { + margin-bottom: 4%; +} + +ul ul { + padding-top: 0; + margin-bottom: 0; + margin-left: 4%; +} + +ul ul li:before { + content: '-'; + display: inline-block; + padding-right: 2%; +} + +ul.col-2 { + color: #98999C; + -webkit-column-count: 2; + -moz-column-count: 2; + column-count: 2; + -webkit-column-gap: 20px; + -moz-column-gap: 20px; + column-gap: 20px; +} + +dl dt { + font-weight: bold; +} + +dl dd { + padding-left: 10px; +} + +@media screen and (min-width: 500px) { + ul.col-2 { + -webkit-column-count: 3; + -moz-column-count: 3; + column-count: 3; + -webkit-column-gap: 20px; + -moz-column-gap: 20px; + column-gap: 20px; + } +} + +nav { + background: #F0F1F3; + min-width: 215px; + margin-bottom: 5px; + margin-top: 15px; +} + +nav:first-of-type a { + color: #d54e21; + border-radius: 0; +} + +nav:first-of-type a:hover { + color: #d54e21; +} + +nav:first-of-type a:before { + background-color: #d54e21; +} + +nav.affix { + position: fixed; + top: 20px; +} + +nav.affix-bottom { + position: absolute; +} + +nav a { + border-radius: 3px; + font-size: 15px; + display: block; + cursor: pointer; + font-weight: 500; + position: relative; + text-decoration: none; + padding: 10px 12px; + width: 100%; + padding-right: 3px; + border-bottom: 2px solid #fff; +} + +nav a:before { + content: ''; + width: 4px; + display: block; + left: 0; + position: absolute; + height: 100%; + display: none; + background: #1e8cbe; + top: 0; +} + +nav a:hover { + background-color: #E6E8EA; + color: #1e8cbe; + text-decoration: underline; +} + +nav a:hover:before { + display: block; +} + +nav a:last-of-type { + border-bottom: none; +} + +.gist { + margin-top: 5.1%; + margin-bottom: 5%; +} + +@media screen and (max-width: 1050px) { + body { + margin: 0 auto; + } +} + +@media screen and (max-width: 767px) { + header span { + display: none; + } + + h1 { + font-size: 26px; + } + + h2 { + font-size: 20px; + } +} + +@media screen and (max-width: 514px) { + p, + ul, + ol, + blockquote { + margin-bottom: 8%; + } +} diff --git a/docs/static/syntax.css b/docs/static/syntax.css new file mode 100644 index 000000000..681758d06 --- /dev/null +++ b/docs/static/syntax.css @@ -0,0 +1,59 @@ +/* Background */ .chroma { color: #f8f8f2; background-color: #272822 } +/* Error */ .chroma .err { color: #960050; background-color: #1e0010 } +/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } +/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; } +/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc } +/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; } +/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; } +/* Keyword */ .chroma .k { color: #66d9ef } +/* KeywordConstant */ .chroma .kc { color: #66d9ef } +/* KeywordDeclaration */ .chroma .kd { color: #66d9ef } +/* KeywordNamespace */ .chroma .kn { color: #f92672 } +/* KeywordPseudo */ .chroma .kp { color: #66d9ef } +/* KeywordReserved */ .chroma .kr { color: #66d9ef } +/* KeywordType */ .chroma .kt { color: #66d9ef } +/* NameAttribute */ .chroma .na { color: #a6e22e } +/* NameClass */ .chroma .nc { color: #a6e22e } +/* NameConstant */ .chroma .no { color: #66d9ef } +/* NameDecorator */ .chroma .nd { color: #a6e22e } +/* NameException */ .chroma .ne { color: #a6e22e } +/* NameFunction */ .chroma .nf { color: #a6e22e } +/* NameOther */ .chroma .nx { color: #a6e22e } +/* NameTag */ .chroma .nt { color: #f92672 } +/* Literal */ .chroma .l { color: #ae81ff } +/* LiteralDate */ .chroma .ld { color: #e6db74 } +/* LiteralString */ .chroma .s { color: #e6db74 } +/* LiteralStringAffix */ .chroma .sa { color: #e6db74 } +/* LiteralStringBacktick */ .chroma .sb { color: #e6db74 } +/* LiteralStringChar */ .chroma .sc { color: #e6db74 } +/* LiteralStringDelimiter */ .chroma .dl { color: #e6db74 } +/* LiteralStringDoc */ .chroma .sd { color: #e6db74 } +/* LiteralStringDouble */ .chroma .s2 { color: #e6db74 } +/* LiteralStringEscape */ .chroma .se { color: #ae81ff } +/* LiteralStringHeredoc */ .chroma .sh { color: #e6db74 } +/* LiteralStringInterpol */ .chroma .si { color: #e6db74 } +/* LiteralStringOther */ .chroma .sx { color: #e6db74 } +/* LiteralStringRegex */ .chroma .sr { color: #e6db74 } +/* LiteralStringSingle */ .chroma .s1 { color: #e6db74 } +/* LiteralStringSymbol */ .chroma .ss { color: #e6db74 } +/* LiteralNumber */ .chroma .m { color: #ae81ff } +/* LiteralNumberBin */ .chroma .mb { color: #ae81ff } +/* LiteralNumberFloat */ .chroma .mf { color: #ae81ff } +/* LiteralNumberHex */ .chroma .mh { color: #ae81ff } +/* LiteralNumberInteger */ .chroma .mi { color: #ae81ff } +/* LiteralNumberIntegerLong */ .chroma .il { color: #ae81ff } +/* LiteralNumberOct */ .chroma .mo { color: #ae81ff } +/* Operator */ .chroma .o { color: #f92672 } +/* OperatorWord */ .chroma .ow { color: #f92672 } +/* Comment */ .chroma .c { color: #75715e } +/* CommentHashbang */ .chroma .ch { color: #75715e } +/* CommentMultiline */ .chroma .cm { color: #75715e } +/* CommentSingle */ .chroma .c1 { color: #75715e } +/* CommentSpecial */ .chroma .cs { color: #75715e } +/* CommentPreproc */ .chroma .cp { color: #75715e } +/* CommentPreprocFile */ .chroma .cpf { color: #75715e } +/* GenericDeleted */ .chroma .gd { color: #f92672 } +/* GenericEmph */ .chroma .ge { font-style: italic } +/* GenericInserted */ .chroma .gi { color: #a6e22e } +/* GenericStrong */ .chroma .gs { font-weight: bold } +/* GenericSubheading */ .chroma .gu { color: #75715e } From 0916653fc488fc8fd64ee185564b16be1aca7076 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:32:21 +0100 Subject: [PATCH 06/14] added drone.star --- .drone.star | 654 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 654 insertions(+) create mode 100644 .drone.star diff --git a/.drone.star b/.drone.star new file mode 100644 index 000000000..c1bba6419 --- /dev/null +++ b/.drone.star @@ -0,0 +1,654 @@ +def main(ctx): + before = [ + testing(ctx), + ] + + stages = [ + docker(ctx, 'amd64'), + docker(ctx, 'arm64'), + docker(ctx, 'arm'), + binary(ctx, 'linux'), + binary(ctx, 'darwin'), + binary(ctx, 'windows'), + ] + + after = [ + manifest(ctx), + changelog(ctx), + readme(ctx), + badges(ctx), + website(ctx), + ] + + return before + stages + after + +def testing(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'testing', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': [ + { + 'name': 'generate', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make generate', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'vet', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make vet', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'staticcheck', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make staticcheck', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'lint', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make lint', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'build', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make build', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'test', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make test', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'codacy', + 'image': 'plugins/codacy:1', + 'pull': 'always', + 'settings': { + 'token': { + 'from_secret': 'codacy_token', + }, + }, + }, + ], + 'volumes': [ + { + 'name': 'gopath', + 'temp': {}, + }, + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + 'refs/pull/**', + ], + }, + } + +def docker(ctx, arch): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': arch, + 'platform': { + 'os': 'linux', + 'arch': arch, + }, + 'steps': [ + { + 'name': 'generate', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make generate', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'build', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make build', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'dryrun', + 'image': 'plugins/docker:18.09', + 'pull': 'always', + 'settings': { + 'dry_run': True, + 'tags': 'linux-%s' % (arch), + 'dockerfile': 'docker/Dockerfile.linux.%s' % (arch), + 'repo': ctx.repo.slug, + }, + 'when': { + 'ref': { + 'include': [ + 'refs/pull/**', + ], + }, + }, + }, + { + 'name': 'docker', + 'image': 'plugins/docker:18.09', + 'pull': 'always', + 'settings': { + 'username': { + 'from_secret': 'docker_username', + }, + 'password': { + 'from_secret': 'docker_password', + }, + 'auto_tag': True, + 'auto_tag_suffix': 'linux-%s' % (arch), + 'dockerfile': 'docker/Dockerfile.linux.%s' % (arch), + 'repo': ctx.repo.slug, + }, + 'when': { + 'ref': { + 'exclude': [ + 'refs/pull/**', + ], + }, + }, + }, + ], + 'volumes': [ + { + 'name': 'gopath', + 'temp': {}, + }, + ], + 'depends_on': [ + 'testing', + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + 'refs/pull/**', + ], + }, + } + +def binary(ctx, name): + if ctx.build.event == "tag": + settings = { + 'endpoint': { + 'from_secret': 's3_endpoint', + }, + 'access_key': { + 'from_secret': 'aws_access_key_id', + }, + 'secret_key': { + 'from_secret': 'aws_secret_access_key', + }, + 'bucket': { + 'from_secret': 's3_bucket', + }, + 'path_style': True, + 'strip_prefix': 'dist/release/', + 'source': 'dist/release/*', + 'target': '/ocis/%s/%s' % (ctx.repo.name.replace("ocis-", ""), ctx.build.ref.replace("refs/tags/v", "")), + } + else: + settings = { + 'endpoint': { + 'from_secret': 's3_endpoint', + }, + 'access_key': { + 'from_secret': 'aws_access_key_id', + }, + 'secret_key': { + 'from_secret': 'aws_secret_access_key', + }, + 'bucket': { + 'from_secret': 's3_bucket', + }, + 'path_style': True, + 'strip_prefix': 'dist/release/', + 'source': 'dist/release/*', + 'target': '/ocis/%s/testing' % (ctx.repo.name.replace("ocis-", "")), + } + + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': name, + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': [ + { + 'name': 'generate', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make generate', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'build', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make release-%s' % (name), + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'finish', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make release-finish', + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ], + }, + { + 'name': 'upload', + 'image': 'plugins/s3:1', + 'pull': 'always', + 'settings': settings, + 'when': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + ], + }, + }, + { + 'name': 'changelog', + 'image': 'toolhippie/calens:latest', + 'pull': 'always', + 'commands': [ + 'calens --version %s -o dist/CHANGELOG.md' % ctx.build.ref.replace("refs/tags/v", "").split("-")[0], + ], + 'when': { + 'ref': [ + 'refs/tags/**', + ], + }, + }, + { + 'name': 'release', + 'image': 'plugins/github-release:1', + 'pull': 'always', + 'settings': { + 'api_key': { + 'from_secret': 'github_token', + }, + 'files': [ + 'dist/release/*', + ], + 'title': ctx.build.ref.replace("refs/tags/", ""), + 'note': 'dist/CHANGELOG.md', + 'overwrite': True, + }, + 'when': { + 'ref': [ + 'refs/tags/**', + ], + }, + }, + ], + 'volumes': [ + { + 'name': 'gopath', + 'temp': {}, + }, + ], + 'depends_on': [ + 'testing', + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + 'refs/pull/**', + ], + }, + } + +def manifest(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'manifest', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': [ + { + 'name': 'execute', + 'image': 'plugins/manifest:1', + 'pull': 'always', + 'settings': { + 'username': { + 'from_secret': 'docker_username', + }, + 'password': { + 'from_secret': 'docker_password', + }, + 'spec': 'docker/manifest.tmpl', + 'auto_tag': True, + 'ignore_missing': True, + }, + }, + ], + 'depends_on': [ + 'amd64', + 'arm64', + 'arm', + 'linux', + 'darwin', + 'windows', + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + ], + }, + } + +def changelog(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'changelog', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'clone': { + 'disable': True, + }, + 'steps': [ + { + 'name': 'clone', + 'image': 'plugins/git-action:1', + 'pull': 'always', + 'settings': { + 'actions': [ + 'clone', + ], + 'remote': 'https://github.com/%s' % (ctx.repo.slug), + 'branch': ctx.build.branch if ctx.build.event == 'pull_request' else 'master', + 'path': '/drone/src', + 'netrc_machine': 'github.com', + 'netrc_username': { + 'from_secret': 'github_username', + }, + 'netrc_password': { + 'from_secret': 'github_token', + }, + }, + }, + { + 'name': 'generate', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'make changelog', + ], + }, + { + 'name': 'output', + 'image': 'webhippie/golang:1.13', + 'pull': 'always', + 'commands': [ + 'cat CHANGELOG.md', + ], + }, + { + 'name': 'publish', + 'image': 'plugins/git-action:1', + 'pull': 'always', + 'settings': { + 'actions': [ + 'commit', + 'push', + ], + 'message': 'Automated changelog update [skip ci]', + 'branch': 'master', + 'author_email': 'devops@owncloud.com', + 'author_name': 'ownClouders', + 'netrc_machine': 'github.com', + 'netrc_username': { + 'from_secret': 'github_username', + }, + 'netrc_password': { + 'from_secret': 'github_token', + }, + }, + 'when': { + 'ref': { + 'exclude': [ + 'refs/pull/**', + ], + }, + }, + }, + ], + 'depends_on': [ + 'manifest', + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + ], + }, + } + +def readme(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'readme', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': [ + { + 'name': 'execute', + 'image': 'sheogorath/readme-to-dockerhub:latest', + 'pull': 'always', + 'environment': { + 'DOCKERHUB_USERNAME': { + 'from_secret': 'docker_username', + }, + 'DOCKERHUB_PASSWORD': { + 'from_secret': 'docker_password', + }, + 'DOCKERHUB_REPO_PREFIX': ctx.repo.namespace, + 'DOCKERHUB_REPO_NAME': ctx.repo.name, + 'SHORT_DESCRIPTION': 'Docker images for %s' % (ctx.repo.name), + 'README_PATH': 'README.md', + }, + }, + ], + 'depends_on': [ + 'changelog', + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + ], + }, + } + +def badges(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'badges', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': [ + { + 'name': 'execute', + 'image': 'plugins/webhook:1', + 'pull': 'always', + 'settings': { + 'urls': { + 'from_secret': 'microbadger_url', + }, + }, + }, + ], + 'depends_on': [ + 'readme', + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + ], + }, + } + +def website(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'website', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': [ + { + 'name': 'generate', + 'image': 'webhippie/hugo:latest', + 'pull': 'always', + 'commands': [ + 'make docs', + ], + }, + { + 'name': 'publish', + 'image': 'plugins/gh-pages:1', + 'pull': 'always', + 'settings': { + 'username': { + 'from_secret': 'github_username', + }, + 'password': { + 'from_secret': 'github_token', + }, + 'pages_directory': 'docs/public/', + 'temporary_base': 'tmp/', + }, + 'when': { + 'ref': { + 'exclude': [ + 'refs/pull/**', + ], + }, + }, + }, + ], + 'depends_on': [ + 'badges', + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/pull/**', + ], + }, + } From a8cfd5cff4c9d4ad8134b08fe92c8dbaeb4ccdb3 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:33:40 +0100 Subject: [PATCH 07/14] added readme --- Readme.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 000000000..74759169f --- /dev/null +++ b/Readme.md @@ -0,0 +1,45 @@ +# ownCloud Infinite Scale: Accounts + +[![Build Status](https://cloud.drone.io/api/badges/owncloud/ocis-accounts/status.svg)](https://cloud.drone.io/owncloud/ocis-accounts) +[![Gitter chat](https://badges.gitter.im/cs3org/reva.svg)](https://gitter.im/cs3org/reva) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d005a4722c1b463b9b95060479018e99)](https://www.codacy.com/gh/owncloud/ocis-accounts?utm_source=github.com&utm_medium=referral&utm_content=owncloud/ocis-accounts&utm_campaign=Badge_Grade) +[![Go Doc](https://godoc.org/github.com/owncloud/ocis-accounts?status.svg)](http://godoc.org/github.com/owncloud/ocis-accounts) +[![Go Report](http://goreportcard.com/badge/github.com/owncloud/ocis-accounts)](http://goreportcard.com/report/github.com/owncloud/ocis-accounts) +[![](https://images.microbadger.com/badges/image/owncloud/ocis-accounts.svg)](http://microbadger.com/images/owncloud/ocis-accounts "Get your own image badge on microbadger.com") + +**This project is under heavy development, it's not in a working state yet!** + +## Install + +You can download prebuilt binaries from the GitHub releases or from our [download mirrors](http://download.owncloud.com/ocis/accounts/). For instructions how to install this on your platform you should take a look at our [documentation](https://owncloud.github.io/ocis-accounts/) +**** +## Development + +Make sure you have a working Go environment, for further reference or a guide take a look at the [install instructions](http://golang.org/doc/install.html). This project requires Go >= v1.13. + +```console +git clone https://github.com/owncloud/ocis-accounts.git +cd ocis-accounts + +make generate build + +./bin/ocis-accounts -h +``` + +## Security + +If you find a security issue please contact security@owncloud.com first. + +## Contributing + +Fork -> Patch -> Push -> Pull Request + +## License + +Apache-2.0 + +## Copyright + +```console +Copyright (c) 2019 ownCloud GmbH +``` From e29ee67c4348972a5e2a1c4cd2e41c6fb0fd06f1 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:34:13 +0100 Subject: [PATCH 08/14] added dockerignore --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..4ec85b5e4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +* +!bin/ From bc29887f565671276cc053b60bf82c98715eb215 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:35:22 +0100 Subject: [PATCH 09/14] added changelog folder --- changelog/CHANGELOG.tmpl | 28 ++++++++++++++++++++++++++++ changelog/README.md | 6 ++++++ changelog/TEMPLATE | 11 +++++++++++ changelog/unreleased/.keep | 0 4 files changed, 45 insertions(+) create mode 100644 changelog/CHANGELOG.tmpl create mode 100644 changelog/README.md create mode 100644 changelog/TEMPLATE create mode 100644 changelog/unreleased/.keep diff --git a/changelog/CHANGELOG.tmpl b/changelog/CHANGELOG.tmpl new file mode 100644 index 000000000..3fee89481 --- /dev/null +++ b/changelog/CHANGELOG.tmpl @@ -0,0 +1,28 @@ +{{- range $changes := . }}{{ with $changes -}} +# Changelog for {{ .Version }} + +The following sections list the changes for {{ .Version }}. + +## Summary +{{ range $entry := .Entries }}{{ with $entry }} + * {{ .TypeShort }} #{{ .PrimaryID }}: {{ .Title }} +{{- end }}{{ end }} + +## Details +{{ range $entry := .Entries }}{{ with $entry }} + * {{ .Type }} #{{ .PrimaryID }}: {{ .Title }} +{{ range $par := .Paragraphs }} + {{ wrap $par 80 3 }} +{{ end -}} +{{ range $url := .IssueURLs }} + {{ $url -}} +{{ end -}} +{{ range $url := .PRURLs }} + {{ $url -}} +{{ end -}} +{{ range $url := .OtherURLs }} + {{ $url -}} +{{ end }} +{{ end }}{{ end }} + +{{ end }}{{ end -}} diff --git a/changelog/README.md b/changelog/README.md new file mode 100644 index 000000000..0ae5d5b3e --- /dev/null +++ b/changelog/README.md @@ -0,0 +1,6 @@ +# Changelog + +We are using [calens](https://github.com/restic/calens) to properly generate a +changelog before we are tagging a new release. To get an idea how this could +look like would be the +best reference. diff --git a/changelog/TEMPLATE b/changelog/TEMPLATE new file mode 100644 index 000000000..a28466866 --- /dev/null +++ b/changelog/TEMPLATE @@ -0,0 +1,11 @@ +Bugfix: Fix behavior for foobar (in present tense) + +We've fixed the behavior for foobar, a long-standing annoyance for users. The +text should be wrapped at 80 characters length. + +The text in the paragraphs is written in past tense. The last section is a list +of issue URLs, PR URLs and other URLs. The first issue ID (or the first PR ID, +in case there aren't any issue links) is used as the primary ID. + +https://github.com/owncloud/ocis-graph/issues/1234 +https://github.com/owncloud/ocis-graph/pull/55555 diff --git a/changelog/unreleased/.keep b/changelog/unreleased/.keep new file mode 100644 index 000000000..e69de29bb From bf28935fb9eb61e03aa80fa8405422a51610114d Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:36:21 +0100 Subject: [PATCH 10/14] added license --- LICENSE | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++ license.md | 8 --- 2 files changed, 202 insertions(+), 8 deletions(-) create mode 100644 LICENSE delete mode 100644 license.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/license.md b/license.md deleted file mode 100644 index 268e597fd..000000000 --- a/license.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "License" -date: 2018-05-02T00:00:00+00:00 -anchor: "license" -weight: 40 ---- - -This project is licensed under the [Apache 2.0](https://github.com/owncloud/ocis-accounts/blob/master/LICENSE) license. For the license of the used libraries you have to check the respective sources. From 3b877f2ff544e0e0dbcb5a4c4b1704d903848f7b Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:41:45 +0100 Subject: [PATCH 11/14] added github folder --- .github/config.yml | 12 ++++ .github/issue_template.md | 0 .github/pull_request_template.md | 0 .github/settings.yml | 98 ++++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 .github/config.yml create mode 100644 .github/issue_template.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/settings.yml diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 000000000..4bd8b5f18 --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,12 @@ +# Configuration for update-docs - https://github.com/behaviorbot/update-docs + +# Comment to be posted to on PRs that don't update documentation +updateDocsComment: > + Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a [changelog](https://github.com/owncloud/ocis-accounts/blob/master/changelog/README.md) item based on your changes. +updateDocsWhiteList: + - Tests-only + - tests-only + - Tests-Only + +updateDocsTargetFiles: + - changelog/unreleased/ diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 000000000..e69de29bb diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..e69de29bb diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 000000000..bd4fae617 --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,98 @@ +--- +repository: + name: ocis-accounts + description: ':atom_symbol: :busts_in_silhouette: Serve Accounts for oCIS' + homepage: https://owncloud.github.io/ocis-graph/ + topics: reva, ocis + + private: false + has_issues: true + has_projects: false + has_wiki: false + has_downloads: false + + default_branch: master + + allow_squash_merge: true + allow_merge_commit: true + allow_rebase_merge: true + +labels: + - name: bug + color: d73a4a + description: Something isn't working + - name: documentation + color: 0075ca + description: Improvements or additions to documentation + - name: duplicate + color: cfd3d7 + description: This issue or pull request already exists + - name: enhancement + color: a2eeef + description: New feature or request + - name: good first issue + color: 7057ff + description: Good for newcomers + - name: help wanted + color: 008672 + description: Extra attention is needed + - name: invalid + color: e4e669 + description: This doesn't seem right + - name: question + color: d876e3 + description: Further information is requested + - name: wontfix + color: ffffff + description: This will not be worked on + - name: effort/trivial + color: c2e0c6 + description: Required effort to finish task + - name: effort/0.25d + color: c2e0c6 + description: Required effort to finish task + - name: effort/0.5d + color: c2e0c6 + description: Required effort to finish task + - name: effort/1d + color: c2e0c6 + description: Required effort to finish task + - name: effort/2d + color: c2e0c6 + description: Required effort to finish task + - name: effort/4d + color: c2e0c6 + description: Required effort to finish task + - name: effort/5d + color: c2e0c6 + description: Required effort to finish task + - name: effort/10d + color: c2e0c6 + description: Required effort to finish task + +teams: + - name: ci + permission: admin + - name: employees + permission: push + +branches: + - name: master + protection: + required_pull_request_reviews: + required_approving_review_count: 1 + dismiss_stale_reviews: false + require_code_owner_reviews: false + dismissal_restrictions: {} + required_status_checks: + strict: true + contexts: + - continuous-integration/drone/pr + enforce_admins: false + restrictions: + users: [] + teams: + - ci + - employees + +... From bdc473e27a9b5e9d6de695496c37c1badebfcd23 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:45:42 +0100 Subject: [PATCH 12/14] make linter happy --- pkg/store/registry.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/store/registry.go b/pkg/store/registry.go index e4a32c66d..c85ddcedd 100644 --- a/pkg/store/registry.go +++ b/pkg/store/registry.go @@ -1,5 +1,6 @@ package store import ( + // init filesystem store _ "github.com/owncloud/ocis-accounts/pkg/store/filesystem" ) From a3b7d2a97a850c0261b8aac182006db42b675022 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:51:39 +0100 Subject: [PATCH 13/14] added docker folder --- docker/Dockerfile.linux.amd64 | 19 +++++++++++++++++++ docker/Dockerfile.linux.arm | 19 +++++++++++++++++++ docker/Dockerfile.linux.arm64 | 19 +++++++++++++++++++ docker/manifest.tmpl | 22 ++++++++++++++++++++++ go.sum | 1 + 5 files changed, 80 insertions(+) create mode 100644 docker/Dockerfile.linux.amd64 create mode 100644 docker/Dockerfile.linux.arm create mode 100644 docker/Dockerfile.linux.arm64 create mode 100644 docker/manifest.tmpl diff --git a/docker/Dockerfile.linux.amd64 b/docker/Dockerfile.linux.amd64 new file mode 100644 index 000000000..e08533a00 --- /dev/null +++ b/docker/Dockerfile.linux.amd64 @@ -0,0 +1,19 @@ +FROM amd64/alpine:edge + +RUN apk update && \ + apk upgrade && \ + apk add ca-certificates mailcap && \ + rm -rf /var/cache/apk/* && \ + echo 'hosts: files dns' >| /etc/nsswitch.conf + +LABEL maintainer="ownCloud GmbH " \ + org.label-schema.name="oCIS Accounts" \ + org.label-schema.vendor="ownCloud GmbH" \ + org.label-schema.schema-version="1.0" + +EXPOSE 9120 9124 + +ENTRYPOINT ["/usr/bin/ocis-accounts"] +CMD ["server"] + +COPY bin/ocis-accounts /usr/bin/ocis-accounts diff --git a/docker/Dockerfile.linux.arm b/docker/Dockerfile.linux.arm new file mode 100644 index 000000000..b1931d04d --- /dev/null +++ b/docker/Dockerfile.linux.arm @@ -0,0 +1,19 @@ +FROM arm32v6/alpine:edge + +RUN apk update && \ + apk upgrade && \ + apk add ca-certificates mailcap && \ + rm -rf /var/cache/apk/* && \ + echo 'hosts: files dns' >| /etc/nsswitch.conf + +LABEL maintainer="ownCloud GmbH " \ + org.label-schema.name="oCIS Accounts" \ + org.label-schema.vendor="ownCloud GmbH" \ + org.label-schema.schema-version="1.0" + +EXPOSE 9120 9124 + +ENTRYPOINT ["/usr/bin/ocis-accounts"] +CMD ["server"] + +COPY bin/ocis-accounts /usr/bin/ocis-accounts diff --git a/docker/Dockerfile.linux.arm64 b/docker/Dockerfile.linux.arm64 new file mode 100644 index 000000000..acd048457 --- /dev/null +++ b/docker/Dockerfile.linux.arm64 @@ -0,0 +1,19 @@ +FROM arm64v8/alpine:edge + +RUN apk update && \ + apk upgrade && \ + apk add ca-certificates mailcap && \ + rm -rf /var/cache/apk/* && \ + echo 'hosts: files dns' >| /etc/nsswitch.conf + +LABEL maintainer="ownCloud GmbH " \ + org.label-schema.name="oCIS Accounts" \ + org.label-schema.vendor="ownCloud GmbH" \ + org.label-schema.schema-version="1.0" + +EXPOSE 9120 9124 + +ENTRYPOINT ["/usr/bin/ocis-accounts"] +CMD ["server"] + +COPY bin/ocis-accounts /usr/bin/ocis-accounts diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl new file mode 100644 index 000000000..c879450c5 --- /dev/null +++ b/docker/manifest.tmpl @@ -0,0 +1,22 @@ +image: owncloud/ocis-accounts:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - image: owncloud/ocis-accounts:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - image: owncloud/ocis-accounts:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + variant: v8 + os: linux + - image: owncloud/ocis-accounts:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm + platform: + architecture: arm + variant: v6 + os: linux diff --git a/go.sum b/go.sum index 0d49beb03..01097280a 100644 --- a/go.sum +++ b/go.sum @@ -367,6 +367,7 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 h1:FdBGmSkD2QpQzRWup//SGObvWf2nq89zj9+ta9OvI3A= github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5/go.mod h1:0YZ2wQSuwviXXXGUiK6zXzskyBLAbLXhamxzcFHSLoM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= From ce0ca295cd0723c0341676ea865a0bc81b8b4c06 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 7 Feb 2020 10:57:04 +0100 Subject: [PATCH 14/14] reword --- .github/settings.yml | 2 +- changelog/TEMPLATE | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/settings.yml b/.github/settings.yml index bd4fae617..f9cb68b23 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -2,7 +2,7 @@ repository: name: ocis-accounts description: ':atom_symbol: :busts_in_silhouette: Serve Accounts for oCIS' - homepage: https://owncloud.github.io/ocis-graph/ + homepage: https://owncloud.github.io/ocis-accounts/ topics: reva, ocis private: false diff --git a/changelog/TEMPLATE b/changelog/TEMPLATE index a28466866..61f6c06dd 100644 --- a/changelog/TEMPLATE +++ b/changelog/TEMPLATE @@ -7,5 +7,5 @@ The text in the paragraphs is written in past tense. The last section is a list of issue URLs, PR URLs and other URLs. The first issue ID (or the first PR ID, in case there aren't any issue links) is used as the primary ID. -https://github.com/owncloud/ocis-graph/issues/1234 -https://github.com/owncloud/ocis-graph/pull/55555 +https://github.com/owncloud/ocis-accounts/issues/1234 +https://github.com/owncloud/ocis-accounts/pull/55555