[med-svn] r18913 - in trunk/packages/orthanc-postgresql/trunk/debian: . configuration
Sebastien Jodogne
jodogne-guest at moszumanska.debian.org
Thu Mar 5 16:06:13 UTC 2015
Author: jodogne-guest
Date: 2015-03-05 16:06:13 +0000 (Thu, 05 Mar 2015)
New Revision: 18913
Added:
trunk/packages/orthanc-postgresql/trunk/debian/orthanc-postgresql.orthanc.init
Removed:
trunk/packages/orthanc-postgresql/trunk/debian/postinst
trunk/packages/orthanc-postgresql/trunk/debian/postrm
Modified:
trunk/packages/orthanc-postgresql/trunk/debian/configuration/orthanc-postgresql.json
trunk/packages/orthanc-postgresql/trunk/debian/control
trunk/packages/orthanc-postgresql/trunk/debian/rules
Log:
orthanc-postgresql is working
Modified: trunk/packages/orthanc-postgresql/trunk/debian/configuration/orthanc-postgresql.json
===================================================================
--- trunk/packages/orthanc-postgresql/trunk/debian/configuration/orthanc-postgresql.json 2015-03-05 16:05:15 UTC (rev 18912)
+++ trunk/packages/orthanc-postgresql/trunk/debian/configuration/orthanc-postgresql.json 2015-03-05 16:06:13 UTC (rev 18913)
@@ -1,30 +1,255 @@
{
+ /**
+ * General configuration of Orthanc
+ **/
+
+ // The logical name of this instance of Orthanc. This one is
+ // displayed in Orthanc Explorer and at the URI "/system".
+ "Name" : "Orthanc",
+
+ // Path to the directory that holds the heavyweight files
+ // (i.e. the raw DICOM instances)
+ "StorageDirectory" : "/var/lib/orthanc/db-v5",
+
+ // Path to the directory that holds the SQLite index (if unset,
+ // the value of StorageDirectory is used). This index could be
+ // stored on a RAM-drive or a SSD device for performance reasons.
+ "IndexDirectory" : "/var/lib/orthanc/db-v5",
+
+ // Enable the transparent compression of the DICOM instances
+ "StorageCompression" : false,
+
+ // Maximum size of the storage in MB (a value of "0" indicates no
+ // limit on the storage size)
+ "MaximumStorageSize" : 0,
+
+ // Maximum number of patients that can be stored at a given time
+ // in the storage (a value of "0" indicates no limit on the number
+ // of patients)
+ "MaximumPatientCount" : 0,
+
+ // List of paths to the custom Lua scripts that are to be loaded
+ // into this instance of Orthanc
+ "LuaScripts" : [
+ ],
+
+ // List of paths to the plugins that are to be loaded into this
+ // instance of Orthanc (e.g. "./libPluginTest.so" for Linux, or
+ // "./PluginTest.dll" for Windows). These paths can refer to
+ // folders, in which case they will be scanned non-recursively to
+ // find shared libraries.
+ "Plugins" : [
+ "/usr/share/orthanc/plugins/"
+ ],
+
+
+ /**
+ * Configuration of the HTTP server
+ **/
+
+ // HTTP port for the REST services and for the GUI
+ "HttpPort" : 8042,
+
+
+
+ /**
+ * Configuration of the DICOM server
+ **/
+
+ // The DICOM Application Entity Title
+ "DicomAet" : "ORTHANC",
+
+ // Check whether the called AET corresponds during a DICOM request
+ "DicomCheckCalledAet" : false,
+
+ // The DICOM port
+ "DicomPort" : 4242,
+
+ // The default encoding that is assumed for DICOM files without
+ // "SpecificCharacterSet" DICOM tag. The allowed values are "Ascii",
+ // "Utf8", "Latin1", "Latin2", "Latin3", "Latin4", "Latin5",
+ // "Cyrillic", "Arabic", "Greek", "Hebrew", "Thai", "Japanese",
+ // and "Chinese".
+ "DefaultEncoding" : "Latin1",
+
+ // The transfer syntaxes that are accepted by Orthanc C-Store SCP
+ "DeflatedTransferSyntaxAccepted" : true,
+ "JpegTransferSyntaxAccepted" : true,
+ "Jpeg2000TransferSyntaxAccepted" : true,
+ "JpegLosslessTransferSyntaxAccepted" : true,
+ "JpipTransferSyntaxAccepted" : true,
+ "Mpeg2TransferSyntaxAccepted" : true,
+ "RleTransferSyntaxAccepted" : true,
+
+
+ /**
+ * Security-related options for the HTTP server
+ **/
+
+ // Whether remote hosts can connect to the HTTP server
+ "RemoteAccessAllowed" : false,
+
+ // Whether or not SSL is enabled
+ "SslEnabled" : false,
+
+ // Path to the SSL certificate (meaningful only if SSL is enabled)
+ "SslCertificate" : "certificate.pem",
+
+ // Whether or not the password protection is enabled
+ "AuthenticationEnabled" : false,
+
+ // The list of the registered users. Because Orthanc uses HTTP
+ // Basic Authentication, the passwords are stored as plain text.
+ "RegisteredUsers" : {
+ // "alice" : "alicePassword"
+ },
+
+
+
+ /**
+ * Network topology
+ **/
+
+ // The list of the known DICOM modalities
+ "DicomModalities" : {
/**
- * The following options must be added to the
- * "/etc/orthanc/orthanc.json" configuration file to control the
- * configuration of the Orthanc PostgreSQL plugins.
+ * Uncommenting the following line would enable Orthanc to
+ * connect to an instance of the "storescp" open-source DICOM
+ * store (shipped in the DCMTK distribution) started by the
+ * command line "storescp 2000".
**/
+ // "sample" : [ "STORESCP", "localhost", 2000 ]
- "PostgreSQL" : {
+ /**
+ * A fourth parameter is available to enable patches for a
+ * specific PACS manufacturer. The allowed values are currently
+ * "Generic" (default value), "StoreScp" (storescp tool from
+ * DCMTK), "ClearCanvas", "MedInria" and "Dcm4Chee". This
+ * parameter is case-sensitive.
+ **/
+ // "clearcanvas" : [ "CLEARCANVAS", "192.168.1.1", 104, "ClearCanvas" ]
+ },
- // Enable the use of PostgreSQL to store the Orthanc index
- "EnableIndex" : true,
+ // The list of the known Orthanc peers
+ "OrthancPeers" : {
+ /**
+ * Each line gives the base URL of an Orthanc peer, possibly
+ * followed by the username/password pair (if the password
+ * protection is enabled on the peer).
+ **/
+ // "peer" : [ "http://localhost:8043/", "alice", "alicePassword" ]
+ // "peer2" : [ "http://localhost:8044/" ]
+ },
- // Enable the use of PostgreSQL to store the DICOM files
- "EnableStorage" : true,
+ // Parameters of the HTTP proxy to be used by Orthanc. If set to the
+ // empty string, no HTTP proxy is used. For instance:
+ // "HttpProxy" : "192.168.0.1:3128"
+ // "HttpProxy" : "proxyUser:proxyPassword at 192.168.0.1:3128"
+ "HttpProxy" : "",
- // Option 1: Specify explicit authentication parameters
- "Host" : "localhost",
- "Port" : 5432,
- "Database" : "orthanc",
- "Username" : "orthanc",
- "Password" : "orthanc",
- // Option 2: Authenticate using PostgreSQL connection URI
- "ConnectionUri" : "postgresql://username:password@localhost:5432/database",
+ /**
+ * Advanced options
+ **/
- // Optional: Disable the locking of the PostgreSQL database
- "Lock" : false
+ // Dictionary of symbolic names for the user-defined metadata. Each
+ // entry must map a number between 1024 and 65535 to an unique
+ // string.
+ "UserMetadata" : {
+ // "Sample" : 1024
+ },
- }
+ // Dictionary of symbolic names for the user-defined types of
+ // attached files. Each entry must map a number between 1024 and
+ // 65535 to an unique string.
+ "UserContentType" : {
+ // "sample" : 1024
+ },
+
+ // Number of seconds without receiving any instance before a
+ // patient, a study or a series is considered as stable.
+ "StableAge" : 60,
+
+ // Enable the HTTP server. If this parameter is set to "false",
+ // Orthanc acts as a pure DICOM server. The REST API and Orthanc
+ // Explorer will not be available.
+ "HttpServerEnabled" : true,
+
+ // Enable the DICOM server. If this parameter is set to "false",
+ // Orthanc acts as a pure REST server. It will not be possible to
+ // receive files or to do query/retrieve through the DICOM protocol.
+ "DicomServerEnabled" : true,
+
+ // By default, Orthanc compares AET (Application Entity Titles) in a
+ // case-insensitive way. Setting this option to "true" will enable
+ // case-sensitive matching.
+ "StrictAetComparison" : false,
+
+ // When the following option is "true", the MD5 of the DICOM files
+ // will be computed and stored in the Orthanc database. This
+ // information can be used to detect disk corruption, at the price
+ // of a small performance overhead.
+ "StoreMD5ForAttachments" : true,
+
+ // The maximum number of results for a single C-FIND request at the
+ // Patient, Study or Series level. Setting this option to "0" means
+ // no limit.
+ "LimitFindResults" : 0,
+
+ // The maximum number of results for a single C-FIND request at the
+ // Instance level. Setting this option to "0" means no limit.
+ "LimitFindInstances" : 0,
+
+ // The maximum number of active jobs in the Orthanc scheduler. When
+ // this limit is reached, the addition of new jobs is blocked until
+ // some job finishes.
+ "LimitJobs" : 10,
+
+ // If this option is set to "false", Orthanc will not log the
+ // resources that are exported to other DICOM modalities of Orthanc
+ // peers in the URI "/exports". This is useful to prevent the index
+ // to grow indefinitely in auto-routing tasks.
+ "LogExportedResources" : true,
+
+ // Enable or disable HTTP Keep-Alive (deprecated). Set this option
+ // to "true" only in the case of high HTTP loads.
+ "KeepAlive" : false,
+
+ // If this option is set to "false", Orthanc will run in index-only
+ // mode. The DICOM files will not be stored on the drive.
+ "StoreDicom" : true,
+
+ // DICOM associations are kept open as long as new DICOM commands
+ // are issued. This option sets the number of seconds of inactivity
+ // to wait before automatically closing a DICOM association. If set
+ // to 0, the connection is closed immediately.
+ "DicomAssociationCloseDelay" : 5,
+
+
+ /**
+ * Configuration of the Orthanc PostgreSQL plugins.
+ **/
+
+ "PostgreSQL" : {
+
+ // Enable the use of PostgreSQL to store the Orthanc index?
+ "EnableIndex" : false,
+
+ // Enable the use of PostgreSQL to store the DICOM files?
+ "EnableStorage" : false,
+
+ // Option 1: Specify explicit authentication parameters
+ "Host" : "localhost",
+ "Port" : 5432,
+ "Database" : "orthanc",
+ "Username" : "orthanc",
+ "Password" : "my_password",
+
+ // Option 2: Authenticate using PostgreSQL connection URI
+ // "ConnectionUri" : "postgresql://username:password@localhost:5432/database",
+
+ // Optional: Disable the locking of the PostgreSQL database
+ "Lock" : false
+
+ }
}
Modified: trunk/packages/orthanc-postgresql/trunk/debian/control
===================================================================
--- trunk/packages/orthanc-postgresql/trunk/debian/control 2015-03-05 16:05:15 UTC (rev 18912)
+++ trunk/packages/orthanc-postgresql/trunk/debian/control 2015-03-05 16:06:13 UTC (rev 18913)
@@ -22,6 +22,7 @@
Package: orthanc-postgresql
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, orthanc (>= 0.8.6)
+Conflicts: orthanc-sqlite
Suggests: postgresql
Description: Plugins to use PostgreSQL as a database back-end to Orthanc
Orthanc PostgreSQL is a set of 2 plugins to Orthanc, a lightweight,
Added: trunk/packages/orthanc-postgresql/trunk/debian/orthanc-postgresql.orthanc.init
===================================================================
--- trunk/packages/orthanc-postgresql/trunk/debian/orthanc-postgresql.orthanc.init (rev 0)
+++ trunk/packages/orthanc-postgresql/trunk/debian/orthanc-postgresql.orthanc.init 2015-03-05 16:06:13 UTC (rev 18913)
@@ -0,0 +1,163 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: orthanc
+# Required-Start: $local_fs $remote_fs $network $syslog
+# Required-Stop: $local_fs $remote_fs $network $syslog
+# Should-Start: postgresql
+# Should-Stop: postgresql
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Orthanc init script
+# Description: Orthanc, a lightweight, RESTful DICOM server
+### END INIT INFO
+
+# Author: Sebastien Jodogne <s.jodogne at gmail.com>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+# You can modify the variables below
+DESC="Orthanc"
+NAME=Orthanc
+
+# Constants
+DAEMON=/usr/sbin/Orthanc
+LOGDIR=/var/log/orthanc
+DAEMON_ARGS="--logdir=${LOGDIR} /etc/orthanc/orthanc-postgresql.json"
+PIDFILE=/run/orthanc.pid
+SCRIPTNAME=/etc/init.d/orthanc
+ORTHANC_USER=orthanc:orthanc
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+ # Prepare a directory to store the Orthanc logs
+ mkdir -p $LOGDIR
+ chown $ORTHANC_USER $LOGDIR
+
+ # Return
+ # 0 if daemon has been started
+ # 1 if daemon was already running
+ # 2 if daemon could not be started
+
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $ORTHANC_USER --background --exec $DAEMON --test > /dev/null \
+ || return 1
+
+ start-stop-daemon --start --quiet --make-pidfile --pidfile $PIDFILE --chuid $ORTHANC_USER --background --exec $DAEMON -- $DAEMON_ARGS \
+ || return 2
+
+ # Add code here, if necessary, that waits for the process to be ready
+ # to handle requests from services started subsequently which depend
+ # on this one. As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+ # Return
+ # 0 if daemon has been stopped
+ # 1 if daemon was already stopped
+ # 2 if daemon could not be stopped
+ # other if a failure occurred
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --chuid $ORTHANC_USER --name $NAME
+ RETVAL="$?"
+ [ "$RETVAL" = 2 ] && return 2
+
+ # Wait for children to finish too if this is a daemon that forks
+ # and if the daemon is only ever run from this initscript.
+ # If the above conditions are not satisfied then add some other code
+ # that waits for the process to drop all resources that could be
+ # needed by services started subsequently. A last resort is to
+ # sleep for some time.
+ start-stop-daemon --stop --quiet --oknodo --retry=0/1/KILL/5 --chuid $ORTHANC_USER --exec $DAEMON
+ [ "$?" = 2 ] && return 2
+ # Many daemons don't delete their pidfiles when they exit.
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+ #
+ # If the daemon can reload its configuration without
+ # restarting (for example, when it is sent a SIGHUP),
+ # then implement that here.
+ #
+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --chuid $ORTHANC_USER --name $NAME
+ return 0
+}
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ status)
+ status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+ ;;
+ #reload|force-reload)
+ #
+ # If do_reload() is not implemented then leave this commented out
+ # and leave 'force-reload' as an alias for 'restart'.
+ #
+ #log_daemon_msg "Reloading $DESC" "$NAME"
+ #do_reload
+ #log_end_msg $?
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented then remove the
+ # 'force-reload' alias
+ #
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ 1) log_end_msg 1 ;; # Old process is still running
+ *) log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ *)
+ #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
+:
Deleted: trunk/packages/orthanc-postgresql/trunk/debian/postinst
===================================================================
--- trunk/packages/orthanc-postgresql/trunk/debian/postinst 2015-03-05 16:05:15 UTC (rev 18912)
+++ trunk/packages/orthanc-postgresql/trunk/debian/postinst 2015-03-05 16:06:13 UTC (rev 18913)
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case $1 in
- configure)
- # Restart the Orthanc service
- # https://www.debian.org/doc/debian-policy/ch-opersys.html#s9.3.3.2
- if which invoke-rc.d >/dev/null 2>&1; then
- invoke-rc.d orthanc restart
- else
- /etc/init.d/orthanc restart
- fi
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-esac
-
-#DEBHELPER#
Deleted: trunk/packages/orthanc-postgresql/trunk/debian/postrm
===================================================================
--- trunk/packages/orthanc-postgresql/trunk/debian/postrm 2015-03-05 16:05:15 UTC (rev 18912)
+++ trunk/packages/orthanc-postgresql/trunk/debian/postrm 2015-03-05 16:06:13 UTC (rev 18913)
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case $1 in
- purge|remove|upgrade)
- # Restart the Orthanc service
- # https://www.debian.org/doc/debian-policy/ch-opersys.html#s9.3.3.2
- if which invoke-rc.d >/dev/null 2>&1; then
- invoke-rc.d orthanc restart
- else
- /etc/init.d/orthanc restart
- fi
- ;;
-
- failed-upgrade|abort-install|abort-upgrade|disappear)
- ;;
-esac
-
-#DEBHELPER#
Modified: trunk/packages/orthanc-postgresql/trunk/debian/rules
===================================================================
--- trunk/packages/orthanc-postgresql/trunk/debian/rules 2015-03-05 16:05:15 UTC (rev 18912)
+++ trunk/packages/orthanc-postgresql/trunk/debian/rules 2015-03-05 16:06:13 UTC (rev 18913)
@@ -32,5 +32,12 @@
override_dh_installchangelogs:
dh_installchangelogs -k NEWS
+override_dh_installinit:
+ # Install "debian/orthanc-postgresql.orthanc.init" as
+ # "/etc/init.d/orthanc.init", but do not start/stop the
+ # "orthanc" service from the orthanc-postgresql package. It is
+ # stopped/started from prerm/postinst in the orthanc package.
+ dh_installinit --name=orthanc --no-start
+
get-orig-source:
uscan --verbose --force-download --repack --compression xz
More information about the debian-med-commit
mailing list