Skip to content

Commit

Permalink
docs: fix build and gen:config (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Aug 4, 2021
1 parent e49e16c commit f128732
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/config.js
Expand Up @@ -45,7 +45,7 @@ module.exports = {
})
],
updateConfig: {
src: '.schema/config.schema.json',
dst: './docs/docs/reference/configuration.md'
src: '../.schema/config.schema.json',
dst: 'docs/reference/configuration.md'
}
}
66 changes: 56 additions & 10 deletions docs/docs/reference/configuration.md
Expand Up @@ -18,12 +18,16 @@ Config files can be formatted as JSON, YAML and TOML. Some configuration values
support reloading without server restart. All configuration values can be set
using environment variables, as documented below.

:::warning Disclaimer

This reference configuration documents all keys, also deprecated ones! It is a
reference for all possible configuration values.

If you are looking for an example configuration, it is better to try out the
quickstart.

:::

To find out more about edge cases like setting string array values through
environmental variables head to the
[Configuring ORY services](https://www.ory.sh/docs/ecosystem/configuring)
Expand Down Expand Up @@ -483,31 +487,35 @@ profiling: cpu

## Log ##
#
# Configure logging using the following options. Logging will always be sent to stdout and stderr.
# Configure logging using the following options. Logs will always be sent to stdout and stderr.
#
log:
## Format ##
## Log Format ##
#
# The log format can either be text or JSON.
# The output format of log messages.
#
# Default value: text
#
# One of:
# - text
# - json
# - json_pretty
# - gelf
# - text
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export LOG_FORMAT=<value>
# - Windows Command Line (CMD):
# > set LOG_FORMAT=<value>
#
format: text
format: json

## Leak Sensitive Log Values ##
#
# If set will leak sensitive values (e.g. emails) in the logs.
#
# Default value: false
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export LOG_LEAK_SENSITIVE_VALUES=<value>
Expand All @@ -518,7 +526,7 @@ log:

## Level ##
#
# Debug enables stack traces on errors. Can also be set using environment variable LOG_LEVEL.
# The level of log entries to show. Debug enables stack traces on errors.
#
# Default value: info
#
Expand All @@ -541,27 +549,50 @@ log:

## tracing ##
#
# ORY Hydra supports distributed tracing.
# Configure distributed tracing.
#
tracing:
## service_name ##
#
# Specifies the service name to use on the tracer.
#
# Examples:
# - ORY Hydra
# - Ory Hydra
# - Ory Kratos
# - Ory Keto
# - Ory Oathkeeper
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export TRACING_SERVICE_NAME=<value>
# - Windows Command Line (CMD):
# > set TRACING_SERVICE_NAME=<value>
#
service_name: ORY Hydra
service_name: Ory Hydra

## providers ##
#
providers:
## zipkin ##
#
# Configures the zipkin tracing backend.
#
# Examples:
# - server_url: http://localhost:9411/api/v2/spans
#
zipkin:
## server_url ##
#
# The address of Zipkin server where spans should be sent to.
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export TRACING_PROVIDERS_ZIPKIN_SERVER_URL=<value>
# - Windows Command Line (CMD):
# > set TRACING_PROVIDERS_ZIPKIN_SERVER_URL=<value>
#
server_url: http://localhost:9411/api/v2/spans

## jaeger ##
#
# Configures the jaeger tracing backend.
Expand All @@ -582,6 +613,20 @@ tracing:
#
propagation: jaeger

## max_tag_value_length ##
#
# The value passed to the max tag value length that has been configured.
#
# Minimum value: 0
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export TRACING_PROVIDERS_JAEGER_MAX_TAG_VALUE_LENGTH=<value>
# - Windows Command Line (CMD):
# > set TRACING_PROVIDERS_JAEGER_MAX_TAG_VALUE_LENGTH=<value>
#
max_tag_value_length: 0

## sampling ##
#
# Examples:
Expand Down Expand Up @@ -637,13 +682,14 @@ tracing:

## provider ##
#
# Set this to the tracing backend you wish to use. Currently supports jaeger. If omitted or empty, tracing will be disabled.
# Set this to the tracing backend you wish to use. Supports Jaeger, Zipkin DataDog, Elastic APM and Instana. If omitted or empty, tracing will be disabled. Use environment variables to configure DataDog (see https://docs.datadoghq.com/tracing/setup/go/#configuration).
#
# One of:
# - jaeger
# - zipkin
# - datadog
# - elastic-apm
# - instana
#
# Examples:
# - jaeger
Expand Down
1 change: 1 addition & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions docs/scripts/config.js
Expand Up @@ -7,6 +7,25 @@ const path = require('path')
const fs = require('fs')
const prettier = require('prettier')
const prettierStyles = require('ory-prettier-styles')
const { execSync } = require('child_process')
const fetch = require('node-fetch')

const oryXVersion = execSync(
"cd ..; go list -f '{{.Module.Version}}' -find github.com/ory/x"
)
.toString('utf-8')
.trim()

const refs = {
'ory://tracing-config': `https://raw.githubusercontent.com/ory/x/${oryXVersion}/tracing/config.schema.json`,
'ory://logging-config': `https://raw.githubusercontent.com/ory/x/${oryXVersion}/logrusx/config.schema.json`
}

const oryResolver = {
order: 1,
canRead: /^ory:/i,
read: ({ url }) => fetch(refs[url]).then((res) => res.json())
}

jsf.option({
alwaysFakeOptionals: true,
Expand Down Expand Up @@ -124,6 +143,11 @@ const enhance =
new Promise((resolve, reject) => {
parser.dereference(
require(path.resolve(config.updateConfig.src)),
{
resolve: {
ory: oryResolver
}
},
(err, result) => (err ? reject(err) : resolve(result))
)
})
Expand Down

0 comments on commit f128732

Please sign in to comment.