odyssey: document routing rules in config
@@ -249,11 +249,13 @@ client_max 100
# incoming client connections.
#
# It is possible to define several Listen sections. Odyssey will listen on
-# every specified server.
+# every specified address.
#
# Odyssey will fail in case it could not bind on any resolved address.
#
+#
listen {
+#
# Bind address.
host "*"
#
@@ -284,14 +286,50 @@ listen {
### ROUTING
###
-storage "local" {
- type "local"
-}
+#
+# Odyssey allows to define client routing rules by specifying
+# 'database', 'user' and 'storage' sections.
+#
+# On client accept appropriate route is assigned by matching 'database' and
+# 'user' sections, all requests then forwarded to a 'storage'
+# (which is referenced from the 'user' section).
+#
+# Database <name> | default.
+#
+# Defines database name requested by client. Each 'database' section structure
+# consist of a 'user' subsections.
+#
+# A special 'database default' is used, in case when no database is matched.
+#
+# User <name> | default.
+#
+# Defines authentication, pooling and storage settings for
+# requested route.
+#
+# A special 'user default' is used, in case when no user is matched.
+#
+# Storage <name>.
+#
+# Defines server used as a data storage or admin console operations.
+#
storage "postgres_server" {
+#
+# Storage type.
+#
+# "remote" - PostgreSQL server
+# "local" - Odyssey (admin console)
+#
type "remote"
+#
+# Remote server address.
host "127.0.0.1"
+#
+# Remote server port.
port 5432
+#
+# Remote server TLS settings.
+#
# tls "disable"
# tls_ca_file ""
# tls_key_file ""
@@ -299,6 +337,10 @@ storage "postgres_server" {
# tls_protocols ""
}
+storage "local" {
+ type "local"
+}
+
database "console" {
user default {
authentication "none"
@@ -309,18 +351,45 @@ database "console" {
database default {
user default {
- # none, block, clear_text, md5
+#
+# Authenication method.
+#
+# "none" - authentication turned off
+# "block" - client is blocked
+# "clear_text" - PostgreSQL clear text authentication
+# "md5" - PostgreSQL MD5 authentication
+#
authentication "none"
+
+#
+# Authentication method password.
+#
+# Depending on selected method, password can be plain text or md5 hash
# password ""
+#
+#
+# Authentication query.
+#
+# Use selected 'auth_query_db' and 'auth_query_user' to match a route.
+# Use this route to authenticate incoming client using 'auth_query'.
+#
# auth_query "select username, pass from auth where username='%u'"
- #auth_query_user ""
# auth_query_db ""
+# auth_query_user ""
+
+# Remote server to use.
+#
+# By default route database and user names are used as connection
+# parameters to remote server. It is possible to override this values
+# by specifying 'storage_db' and 'storage_user'. Remote server password
+# can be set using 'storage_password' field.
+#
storage "postgres_server"
+# storage_db "database"
# storage_user "test"
# storage_password "test"
- #storage_db "database"
pool "transaction"
pool_size 0
