From f1fed2de81d112827132c20db30f890e8b2d94fa Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 12 Nov 2020 15:29:13 +0100 Subject: [PATCH] add / edit templates for configuration docs --- accounts/templates/CONFIGURATION.tmpl | 78 +++++++++++++++++++++++ glauth/templates/CONFIGURATION.tmpl | 78 +++++++++++++++++++++++ konnectd/templates/CONFIGURATION.tmpl | 18 +++--- ocis-phoenix/templates/CONFIGURATION.tmpl | 78 +++++++++++++++++++++++ ocis/templates/CONFIGURATION.tmpl | 2 +- ocs/templates/CONFIGURATION.tmpl | 78 +++++++++++++++++++++++ proxy/templates/CONFIGURATION.tmpl | 16 ++--- settings/templates/CONFIGURATION.tmpl | 78 +++++++++++++++++++++++ storage/templates/CONFIGURATION.tmpl | 2 +- store/templates/CONFIGURATION.tmpl | 78 +++++++++++++++++++++++ thumbnails/templates/CONFIGURATION.tmpl | 78 +++++++++++++++++++++++ webdav/templates/CONFIGURATION.tmpl | 2 +- 12 files changed, 566 insertions(+), 20 deletions(-) create mode 100644 accounts/templates/CONFIGURATION.tmpl create mode 100644 glauth/templates/CONFIGURATION.tmpl create mode 100644 ocis-phoenix/templates/CONFIGURATION.tmpl create mode 100644 ocs/templates/CONFIGURATION.tmpl create mode 100644 settings/templates/CONFIGURATION.tmpl create mode 100644 store/templates/CONFIGURATION.tmpl create mode 100644 thumbnails/templates/CONFIGURATION.tmpl diff --git a/accounts/templates/CONFIGURATION.tmpl b/accounts/templates/CONFIGURATION.tmpl new file mode 100644 index 0000000000..459bc2a955 --- /dev/null +++ b/accounts/templates/CONFIGURATION.tmpl @@ -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 -}} \ No newline at end of file diff --git a/glauth/templates/CONFIGURATION.tmpl b/glauth/templates/CONFIGURATION.tmpl new file mode 100644 index 0000000000..12ae3112c4 --- /dev/null +++ b/glauth/templates/CONFIGURATION.tmpl @@ -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/glauth +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_glauth/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-glauth reads `glauth.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 "glauth" -}} +## Root Command + +{{ $c.Usage }} + +Usage: `glauth [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 "glauth" -}} +### glauth {{ $c.Name }} + +{{ $c.Usage }} + +Usage: `glauth {{ $c.Name }} [command options] [arguments...]` +{{ template "options" . }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/konnectd/templates/CONFIGURATION.tmpl b/konnectd/templates/CONFIGURATION.tmpl index ad3eaadfd0..9383405886 100644 --- a/konnectd/templates/CONFIGURATION.tmpl +++ b/konnectd/templates/CONFIGURATION.tmpl @@ -2,8 +2,8 @@ title: "Configuration" date: "{{ date "2006-01-02T15:04:05-0700" now }}" weight: 20 -geekdocRepo: https://github.com/owncloud/ocis-konnectd -geekdocEditPath: edit/master/docs +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/konnectd geekdocFilePath: configuration.md --- {{- define "options"}} @@ -25,7 +25,7 @@ geekdocFilePath: configuration.md 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_proxy/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. +Each extension has its dedicated documentation page (e.g. https://owncloud.github.io/extensions/ocis_konnectd/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 @@ -37,7 +37,7 @@ $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-proxy reads `proxy.json | yaml | toml ...`*. +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-konnectd reads `konnectd.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`. @@ -52,12 +52,12 @@ If you prefer to configure the service with commandline flags you can see the av {{ $options := .Options -}} {{ range $com := .Commands }}{{ with (list $options $com) -}} {{ $c := last . -}} -{{ if eq $c.Name "ocis-konnectd" -}} +{{ if eq $c.Name "konnectd" -}} ## Root Command {{ $c.Usage }} -Usage: `ocis-konnectd [global options] command [command options] [arguments...]` +Usage: `konnectd [global options] command [command options] [arguments...]` {{ template "options" . -}} ## Sub Commands @@ -66,12 +66,12 @@ Usage: `ocis-konnectd [global options] command [command options] [arguments...]` {{ end -}} {{- range $com := .Commands }}{{ with (list $options $com) -}} {{- $c := last . }} -{{- if ne $c.Name "ocis-konnectd" -}} -### ocis-konnectd {{ $c.Name }} +{{- if ne $c.Name "konnectd" -}} +### konnectd {{ $c.Name }} {{ $c.Usage }} -Usage: `ocis-konnectd {{ $c.Name }} [command options] [arguments...]` +Usage: `konnectd {{ $c.Name }} [command options] [arguments...]` {{ template "options" . }} {{- end -}} {{- end -}} diff --git a/ocis-phoenix/templates/CONFIGURATION.tmpl b/ocis-phoenix/templates/CONFIGURATION.tmpl new file mode 100644 index 0000000000..0f2d1f09c9 --- /dev/null +++ b/ocis-phoenix/templates/CONFIGURATION.tmpl @@ -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/phoenix +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_phoenix/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-phoenix reads `phoenix.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 "phoenix" -}} +## Root Command + +{{ $c.Usage }} + +Usage: `phoenix [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 "phoenix" -}} +### phoenix {{ $c.Name }} + +{{ $c.Usage }} + +Usage: `phoenix {{ $c.Name }} [command options] [arguments...]` +{{ template "options" . }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/ocis/templates/CONFIGURATION.tmpl b/ocis/templates/CONFIGURATION.tmpl index db8763b9db..aa13550126 100644 --- a/ocis/templates/CONFIGURATION.tmpl +++ b/ocis/templates/CONFIGURATION.tmpl @@ -25,7 +25,7 @@ geekdocFilePath: configuration.md 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_proxy/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. +Each extension has its dedicated documentation page (e.g. https://owncloud.github.io/extensions/proxy/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 diff --git a/ocs/templates/CONFIGURATION.tmpl b/ocs/templates/CONFIGURATION.tmpl new file mode 100644 index 0000000000..2ac14ab6d4 --- /dev/null +++ b/ocs/templates/CONFIGURATION.tmpl @@ -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/ocs +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_ocs/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-ocs reads `ocs.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 "ocs" -}} +## Root Command + +{{ $c.Usage }} + +Usage: `ocs [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 "ocs" -}} +### ocs {{ $c.Name }} + +{{ $c.Usage }} + +Usage: `ocs {{ $c.Name }} [command options] [arguments...]` +{{ template "options" . }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/proxy/templates/CONFIGURATION.tmpl b/proxy/templates/CONFIGURATION.tmpl index ea35b356b1..ab96f04259 100644 --- a/proxy/templates/CONFIGURATION.tmpl +++ b/proxy/templates/CONFIGURATION.tmpl @@ -2,8 +2,8 @@ title: "Configuration" date: "{{ date "2006-01-02T15:04:05-0700" now }}" weight: 20 -geekdocRepo: https://github.com/owncloud/ocis-proxy -geekdocEditPath: edit/master/docs +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/proxy geekdocFilePath: configuration.md --- {{- define "options"}} @@ -25,7 +25,7 @@ geekdocFilePath: configuration.md 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_proxy/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. +Each extension has its dedicated documentation page (e.g. https://owncloud.github.io/extensions/proxy/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 @@ -52,12 +52,12 @@ If you prefer to configure the service with commandline flags you can see the av {{ $options := .Options -}} {{ range $com := .Commands }}{{ with (list $options $com) -}} {{ $c := last . -}} -{{ if eq $c.Name "ocis-proxy" -}} +{{ if eq $c.Name "proxy" -}} ## Root Command {{ $c.Usage }} -Usage: `ocis-proxy [global options] command [command options] [arguments...]` +Usage: `proxy [global options] command [command options] [arguments...]` {{ template "options" . -}} ## Sub Commands @@ -66,12 +66,12 @@ Usage: `ocis-proxy [global options] command [command options] [arguments...]` {{ end -}} {{- range $com := .Commands }}{{ with (list $options $com) -}} {{- $c := last . }} -{{- if ne $c.Name "ocis-proxy" -}} -### ocis-proxy {{ $c.Name }} +{{- if ne $c.Name "proxy" -}} +### proxy {{ $c.Name }} {{ $c.Usage }} -Usage: `ocis-proxy {{ $c.Name }} [command options] [arguments...]` +Usage: `proxy {{ $c.Name }} [command options] [arguments...]` {{ template "options" . }} {{- end -}} {{- end -}} diff --git a/settings/templates/CONFIGURATION.tmpl b/settings/templates/CONFIGURATION.tmpl new file mode 100644 index 0000000000..4a1dabb936 --- /dev/null +++ b/settings/templates/CONFIGURATION.tmpl @@ -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/settings +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/proxy/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-proxy reads `proxy.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 "settings" -}} +## Root Command + +{{ $c.Usage }} + +Usage: `settings [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 "settings" -}} +### settings {{ $c.Name }} + +{{ $c.Usage }} + +Usage: `settings {{ $c.Name }} [command options] [arguments...]` +{{ template "options" . }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/storage/templates/CONFIGURATION.tmpl b/storage/templates/CONFIGURATION.tmpl index e5863b9061..0d9ae1ab7e 100644 --- a/storage/templates/CONFIGURATION.tmpl +++ b/storage/templates/CONFIGURATION.tmpl @@ -38,7 +38,7 @@ geekdocFilePath: configuration.md 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_proxy/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. +Each extension has its dedicated documentation page (e.g. https://owncloud.github.io/extensions/proxy/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 diff --git a/store/templates/CONFIGURATION.tmpl b/store/templates/CONFIGURATION.tmpl new file mode 100644 index 0000000000..cc01d7a0bc --- /dev/null +++ b/store/templates/CONFIGURATION.tmpl @@ -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/store +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/proxy/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-proxy reads `proxy.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 "store" -}} +## Root Command + +{{ $c.Usage }} + +Usage: `store [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 "store" -}} +### store {{ $c.Name }} + +{{ $c.Usage }} + +Usage: `store {{ $c.Name }} [command options] [arguments...]` +{{ template "options" . }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/thumbnails/templates/CONFIGURATION.tmpl b/thumbnails/templates/CONFIGURATION.tmpl new file mode 100644 index 0000000000..00ad282e2a --- /dev/null +++ b/thumbnails/templates/CONFIGURATION.tmpl @@ -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/thumbnails +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/proxy/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-proxy reads `proxy.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 "thumbnails" -}} +## Root Command + +{{ $c.Usage }} + +Usage: `thumbnails [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 "thumbnails" -}} +### thumbnails {{ $c.Name }} + +{{ $c.Usage }} + +Usage: `thumbnails {{ $c.Name }} [command options] [arguments...]` +{{ template "options" . }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/webdav/templates/CONFIGURATION.tmpl b/webdav/templates/CONFIGURATION.tmpl index 7833ae1962..240abe2022 100644 --- a/webdav/templates/CONFIGURATION.tmpl +++ b/webdav/templates/CONFIGURATION.tmpl @@ -25,7 +25,7 @@ geekdocFilePath: configuration.md 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_proxy/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. +Each extension has its dedicated documentation page (e.g. https://owncloud.github.io/extensions/proxy/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