From bfed7f22414e25da48ef8b4ee241c2a9684e63e2 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Fri, 16 Oct 2020 16:13:08 +0200 Subject: [PATCH] docs: update sql instructions --- docs/docs/5min-tutorial.mdx | 2 +- docs/docs/dependencies-environment.md | 77 +++------------------------ 2 files changed, 9 insertions(+), 70 deletions(-) diff --git a/docs/docs/5min-tutorial.mdx b/docs/docs/5min-tutorial.mdx index 6b400545362..20c5fd630ac 100644 --- a/docs/docs/5min-tutorial.mdx +++ b/docs/docs/5min-tutorial.mdx @@ -15,7 +15,7 @@ need to have the latest [Docker](https://www.docker.com) and We will use the Docker Compose configuration in the ORY Hydra code base. Getting the Hydra source code is easy: -- if you have Go 1.12+ installed: `go get -d github.com/ory/hydra` +- if you have Go 1.15+ installed: `go get -d github.com/ory/hydra` - if you have Git installed: `git clone https://github.com/ory/hydra.git` - otherwise: download the [Hydra source code](https://github.com/ory-am/hydra/archive/master.zip). and diff --git a/docs/docs/dependencies-environment.md b/docs/docs/dependencies-environment.md index 33be1d9907e..9b616f34bed 100644 --- a/docs/docs/dependencies-environment.md +++ b/docs/docs/dependencies-environment.md @@ -16,15 +16,18 @@ limited to OSX, Linux, Windows, ARM, FreeBSD and more. ORY Hydra has two operational modes: - In-memory: This mode does not work with more than one instance ("cluster") and - any state is lost after restarting the instance. + any state is lost after restarting the instance. ORY Hydra uses SQLite with + in-memory mode to achieve this. - SQL: This mode works with more than one instance and state is not lost after restarts. No further dependencies are required for a production-ready instance. -## SQL +## Database Configuration -The SQL adapter supports two DBMS: PostgreSQL 9.6+ and MySQL 5.7+. Please note +For more information on configuring + +The SQL adapter supports PostgreSQL 9.6+, MySQL 5.7+ and SQLite. Please note that older MySQL versions have issues with ORY Hydra's database schema. For more information [go here](https://github.com/ory/hydra/issues/377). @@ -42,69 +45,5 @@ example to see how we did it! ### Configuration -Both MySQL and PostgreSQL adapters support the following settings. You can -modify these settings by appending query parameters to your DSN -(`postgres://user:pw@host:port/database?setting1=foo&setting2=bar`): - -- `max_conns` sets the maximum number of open connections to the database. - Defaults to the number of CPUs. Example - `postgres://user:pw@host:port/database?max_conns=10`. -- `max_idle_conns` sets the maximum number of connections in the idle connection - pool. Defaults to the number of CPUs. Example - `postgres://user:pw@host:port/database?max_idle_conns=5`. -- `max_conn_lifetime` sets the maximum amount of time (`ms`, `s`, `m`, `h`) a - connection may be reused. Defaults to 0. Example - `postgres://user:pw@host:port/database?max_conn_lifetime=10s`. - -#### MySQL - -> DSN Layout: -> `mysql://user:pw@tcp(host:port)/database?someSetting=value&foo=bar`. - -On top of the settings above, MySQL supports additional settings: - -- `sql_notes`, if set to `false`, ignores MySQL notices. If left empty or set to - `true`, they will be treated as warnings. Example - `mysql://user:pw@tcp(host:port)/database?sql_notes=false`. -- `sql_mode` sets the server-side strict mode. Read more about possible values - [here](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html). - -#### PostgreSQL - -> DSN Layout: `postgres://user:pw@host:port/database?someSetting=value&foo=bar`. - -On top of the settings above, PostgreSQL supports additional settings: - -- `sslmode` sets whether or not to use SSL (default is require, this is not the - default for libpq). Valid values for sslmode are: _ `disable` - No SSL _ - `require` - Always SSL (skip verification) _ `verify-ca` - Always SSL (verify - that the certificate presented by the server was signed by a trusted CA) _ - `verify-full` - Always SSL (verify that the certification presented by the - server was signed by a trusted CA and the server host name matches the one in - the certificate) -- `fallback_application_name` - An application_name to fall back to if one isn't - provided. -- `connect_timeout` - Maximum wait for connection, in seconds. Zero or not - specified means wait indefinitely. -- `sslcert` - Cert file location. The file must contain PEM encoded data. -- `sslkey` - Key file location. The file must contain PEM encoded data. -- `sslrootcert` - The location of the root certificate file. The file must - contain PEM encoded data. - -## Plugin - -It is possible to implement your own DBAL using Go Plugins. - -> We strongly discourage you from implementing your own DBAL. Special knowledge -> is required and internal interfaces will break without notice and migration -> guides. This can lead to serious security issues and vulnerabilities. USE AT -> YOUR OWN RISK. - -Your plugin must implement interface `github.com/ory/hydra/driver.Registry`. You -can load the plugin as follows: - -```yaml -dsn: plugin:///path/to/file.so -``` - -We strongly discourage you from using this feature. +For more information on configuring the DSN (Data-Source-Name), head over +to [Deployment Fundamentals and Requirements](https://www.ory.sh/docs/ecosystem/deployment).