Skip to content

Commit

Permalink
Merge pull request #851 from owncloud/cleanup_repository_and_docs
Browse files Browse the repository at this point in the history
cleanup repository and docs
  • Loading branch information
micbar authored Nov 13, 2020
2 parents b470993 + 00835ef commit b09072b
Show file tree
Hide file tree
Showing 36 changed files with 588 additions and 1,253 deletions.
2 changes: 1 addition & 1 deletion accounts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ release-finish: release-copy release-check

.PHONY: config-docs-generate
config-docs-generate:
# go run github.com/owncloud/flaex >| ../docs/extensions/$(NAME)/configuration.md
go run github.com/owncloud/flaex >| ../docs/extensions/$(NAME)/configuration.md

.PHONY: test-acceptance-webui
test-acceptance-webui:
Expand Down
78 changes: 78 additions & 0 deletions accounts/templates/CONFIGURATION.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: "Configuration"
date: "{{ date "2006-01-02T15:04:05-0700" now }}"
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/extensions/accounts
geekdocFilePath: configuration.md
---
{{- define "options"}}
{{ $fnName := (last . ).Flags -}}
{{ range $opt := first . }}{{ with list $fnName $opt -}}
{{ $o := last . -}}
{{ if eq $o.FnName $fnName -}}
--{{ $o.Name }} | ${{ index $o.Env 0 }}
: {{ $o.Usage }}. {{- if $o.Default }} Default: `{{ $o.Default }}`.{{ end }}

{{ end -}}
{{ end -}}
{{ end -}}
{{ end }}

{{`{{< toc >}}`}}

## Configuration

oCIS Single Binary is not responsible for configuring extensions. Instead, each extension could either be configured by environment variables, cli flags or config files.

Each extension has its dedicated documentation page (e.g. https://owncloud.github.io/extensions/ocis_accounts/configuration) which lists all possible configurations. Config files and environment variables are picked up if you use the `./bin/ocis server` command within the oCIS single binary. Command line flags must be set explicitly on the extensions subcommands.

### Configuration using config files

Out of the box extensions will attempt to read configuration details from:

```console
/etc/ocis
$HOME/.ocis
./config
```

For this configuration to be picked up, have a look at your extension `root` command and look for which default config name it has assigned. *i.e: ocis-accounts reads `accounts.json | yaml | toml ...`*.

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/tree/master/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/ocis.yml`, `${HOME}/.ocis/ocis.yml` or `$(pwd)/config/ocis.yml`.

### Envrionment variables

If you prefer to configure the service with environment variables you can see the available variables below.

### Commandline flags

If you prefer to configure the service with commandline flags you can see the available variables below. Command line flags are only working when calling the subcommand directly.

{{ $options := .Options -}}
{{ range $com := .Commands }}{{ with (list $options $com) -}}
{{ $c := last . -}}
{{ if eq $c.Name "accounts" -}}
## Root Command

{{ $c.Usage }}

Usage: `accounts [global options] command [command options] [arguments...]`
{{ template "options" . -}}
## Sub Commands

{{ end -}}
{{ end -}}
{{ end -}}
{{- range $com := .Commands }}{{ with (list $options $com) -}}
{{- $c := last . }}
{{- if ne $c.Name "accounts" -}}
### accounts {{ $c.Name }}

{{ $c.Usage }}

Usage: `accounts {{ $c.Name }} [command options] [arguments...]`
{{ template "options" . }}
{{- end -}}
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions docs/extensions/accounts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.md
84 changes: 0 additions & 84 deletions docs/extensions/accounts/configuration.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/extensions/glauth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.md
1 change: 1 addition & 0 deletions docs/extensions/konnectd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.md
176 changes: 0 additions & 176 deletions docs/extensions/konnectd/configuration.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/extensions/ocis-phoenix/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.md
1 change: 1 addition & 0 deletions docs/extensions/ocs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.md
1 change: 1 addition & 0 deletions docs/extensions/proxy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.md
Loading

0 comments on commit b09072b

Please sign in to comment.