comparison Sphinx/source/plugins/postgresql.rst @ 181:c7551e19ae95

sslmode
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Jan 2019 14:15:06 +0100
parents 365427cebb64
children 39609c9a2c41
comparison
equal deleted inserted replaced
180:4b4ede94381e 181:c7551e19ae95
93 "EnableStorage" : true, 93 "EnableStorage" : true,
94 "Host" : "localhost", 94 "Host" : "localhost",
95 "Port" : 5432, 95 "Port" : 5432,
96 "Database" : "orthanc", 96 "Database" : "orthanc",
97 "Username" : "orthanc", 97 "Username" : "orthanc",
98 "Password" : "orthanc" 98 "Password" : "orthanc",
99 "EnableSsl" : false // New in version 3.0
99 }, 100 },
100 "Plugins" : [ 101 "Plugins" : [
101 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", 102 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so",
102 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so" 103 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so"
103 ] 104 ]
105 106
106 **Important:** The ``EnableIndex`` and ``EnableStorage`` options must 107 **Important:** The ``EnableIndex`` and ``EnableStorage`` options must
107 be explicitly set to ``true``, otherwise Orthanc will continue to use 108 be explicitly set to ``true``, otherwise Orthanc will continue to use
108 its default SQLite back-end and the filesystem storage area. 109 its default SQLite back-end and the filesystem storage area.
109 110
110 **Remark:** When using the ``Storage`` PostgreSQL plugin, the DICOM 111 **Remark 1:** When using the ``Storage`` PostgreSQL plugin, the DICOM
111 files are stored as large objects in the database. This might 112 files are stored as large objects in the database. This might
112 actually consume more space than the DICOM file itself. We have 113 actually consume more space than the DICOM file itself. We have
113 observed overhead up to 40%. However, it seems this overhead is 114 observed overhead up to 40%. However, it seems this overhead is
114 temporary and comes from Write-Ahead Logging. Check this `discussion 115 temporary and comes from Write-Ahead Logging. Check this `discussion
115 <https://groups.google.com/d/msg/orthanc-users/pPzHOpb--iw/QkKZ808gIgAJ>`__ 116 <https://groups.google.com/d/msg/orthanc-users/pPzHOpb--iw/QkKZ808gIgAJ>`__
116 on the Orthanc Users group for more info). 117 on the Orthanc Users group for more info).
117 118
118 Note that a typical usage of the PostgreSQL plugin is to enable only 119 **Remark 2:** A typical usage of the PostgreSQL plugin is to enable
119 the ``Index``, and to use the default filesystem storage for DICOM 120 only the ``Index``, and to use the default filesystem storage for
120 files. 121 DICOM files (on a NAS with proper disaster recovery strategies). This
122 setup provides best performance for large-scale databases.
123
124 **Remark 3:** Setting the ``EnableSsl`` to ``true`` forces the use of
125 `SSL connections
126 <https://www.postgresql.org/docs/current/libpq-ssl.html>`__ between
127 Orthanc and the PostgreSQL server. It is a synonym for
128 ``sslmode=require`` in connections URI (see below). Setting
129 ``EnableSsl`` to ``false`` corresponds to ``sslmode=disable``
130 (i.e. SSL is not used, even if it is both available in Orthanc and
131 PostgreSQL). To choose other values for the SSL mode (i.e. ``allow``
132 and ``prefer``), please use connection URIs.
121 133
122 134
123 135
124 .. highlight:: text 136 .. highlight:: text
125 137
150 { 162 {
151 "Name" : "MyOrthanc", 163 "Name" : "MyOrthanc",
152 "PostgreSQL" : { 164 "PostgreSQL" : {
153 "EnableIndex" : true, 165 "EnableIndex" : true,
154 "EnableStorage" : true, 166 "EnableStorage" : true,
155 "ConnectionUri" : "postgresql://username:password@localhost:5432/database" 167 "ConnectionUri" : "postgresql://username:password@localhost:5432/database?sslmode=prefer"
156 }, 168 },
157 "Plugins" : [ 169 "Plugins" : [
158 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", 170 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so",
159 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so" 171 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so"
160 ] 172 ]