net-misc/iipsrv: new package

Merge request for new net-misc/iipsrv package with user and group accounts (both set to -1) for the server process in acct-user/iipsrv and acct--group/iipsrv. net-misc/iipsrv includes both OpenRC and Systemd files and configuration.

    iipsrv is an image server and transcoder for high resolution and scientific images that supports the IIP, IIIF, Deepzoom and Zoomify APIs (https://iipimage.sourceforge.io)

Signed-off-by: Ruven Pillay <someone@users.sourceforge.net>
This commit is contained in:
Ruven Pillay
2024-03-27 16:20:38 +01:00
parent 5b080de5b2
commit 509dfc7e91
15 changed files with 406 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
--- iipsrv-1.2/Makefile.am 2021-04-09 22:29:51.000000000 +0200
+++ iipsrv-1.2/Makefile.am.new 2023-10-11 00:13:21.665852075 +0200
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = dist-bzip2
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = fcgi src man
+SUBDIRS = src man
-EXTRA_DIST = TODO COPYING.FCGI doc windows
+EXTRA_DIST = doc windows

View File

@@ -0,0 +1,10 @@
--- iipsrv-1.2/src/RawTile.h
+++ iipsrv-1.2/src/RawTile.new.h
@@ -26,6 +26,7 @@
#include <string>
#include <cstdlib>
#include <ctime>
+#include <cstdint>
#if !( (__cplusplus >= 201103L) || ((defined(_MSC_VER) && _MSC_VER >= 1900)) )
#include <stdint.h> // Required for C++98

View File

@@ -0,0 +1,6 @@
<IfDefine PROXY>
ProxyPass "/fcgi-bin/iipsrv.fcgi" "fcgi://0.0.0.0:9000/"
ProxyPass "/iiif" "fcgi://0.0.0.0:9000/"
</IfDefine>

View File

@@ -0,0 +1,84 @@
# OpenRC configuration file
# Parameters to pass to OpenRC init:
# Set which host and port iipsrv should listen
HOST="0.0.0.0"
PORT=9000
# Set user and group under which iipsrv should run
USER=iipsrv
GROUP=iipsrv
# Parameters to pass directly to iipsrv.
# See https://iipimage.sourceforge.io/documentation/server for full details.
# Note that these must be exported:
# File to which iipsrv should log
export LOGFILE="/var/log/iipsrv.log"
# Level of logging (0 is no logging)
export VERBOSITY=1
# Set a mapping from a URL prefix to a supported protocol
export URI_MAP="iiif=>IIIF"
# Max internal cache size for raw tile data in MB
#MAX_IMAGE_CACHE_SIZE=10
# Prefix automatically added to each file path
#FILESYSTEM_PREFIX=
# Suffix automatically added to end of each file path
#FILESYSTEM_SUFFIX
# Default JPEG quality factor
#JPEG_QUALITY=75
# Default PNG deflate compression factor
# PNG_QUALITY=1
# Default WebP quality factor
#WEBP_QUALITY=50
# Maximum output image dimensions in pixels
#MAX_CVT=5000
# Whether image may be upscaled: 0 = no, 1 = yes
#ALLOW_UPSCALING=1
# Maximum number of quality layers to decode in supported formats (-1 for all layers)
# MAX_LAYERS=-1
# TIFF image to use as watermark
#WATERMARK=
# Probability (between 0.0-1.0) that a tile will have watermark applied
#WATERMARK_PROBABILITY=1.0
# Opacity (between 0.0-1.0) applied to watermark image
#WATERMARK_OPACITY=1
#Comma-delimitted list of memcached servers with optional port numbers
#MEMCACHED_SERVERS=
#Time in seconds that cache remains fresh
#MEMCACHED_TIMEOUT=86400
# Interpolation method to use for rescaling when using image export
# 0 = nearest neighbout, 1 = bilinear
#INTERPOLATION=1
# Cross Origin Resource Sharing setting. Disabled by default
#CORS=
# Set a base URL for use in IIIF requests if using web server rewriting
#BASE_URL=
# Set the HTTP Cache-Control header
#CACHE_CONTROL="max-age=86400"
# Pattern following name stem to indicate an image sequence
#FILENAME_PATTERN="_pyr_"

View File

@@ -0,0 +1,32 @@
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
description="IIPImage server"
command="/usr/sbin/iipsrv"
command_args="--bind ${HOST}:${PORT}"
command_user="${USER}:${GROUP}"
command_background=true
extra_started_commands="reload"
description_reload="Empty internal caches"
pidfile="/run/${RC_SVCNAME}.pid"
start_pre()
{
if [ ${LOGFILE} != "syslog" ]; then
# Make sure logfile is writable
checkpath --quiet --file --owner ${command_user} ${LOGFILE}
fi
}
reload()
{
ebegin "Reloading ${RC_SVCNAME}"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}

View File

@@ -0,0 +1,9 @@
server.modules += ("mod_fastcgi")
fastcgi.server = (
"/fcgi-bin/iipsrv.fcgi" => (
("host"=>"0.0.0.0", "port"=>9000, "check-local"=>"disable")
),
"/iiif" => (
("host"=>"0.0.0.0", "port"=>9000, "check-local"=>"disable")
)
)

View File

@@ -0,0 +1,77 @@
# Systemd configuration file for iipsrv
# Paramters passed to systemd.
# Set which host and port iipsrv should listen
HOST="0.0.0.0"
PORT=9000
# Parameters to pass directly to iipsrv.
# See http://iipimage.sourceforge.net/documentation/server for full details.
# File to which iipsrv should log
LOGFILE="/var/log/iipsrv.log"
# Level of logging (0 is no logging)
VERBOSITY=1
# Set a mapping from a URL prefix to a supported protocol
URI_MAP="iiif=>IIIF"
# Max internal cache size for raw tile data in MB
#MAX_IMAGE_CACHE_SIZE=10
# Prefix automatically added to each file path
#FILESYSTEM_PREFIX=
# Suffix automatically added to end of each file path
#FILESYSTEM_SUFFIX
# Default JPEG quality factor
#JPEG_QUALITY=75
# Default PNG deflate compression factor
# PNG_QUALITY=1
# Default WebP quality factor
#WEBP_QUALITY=50
# Maximum output image dimensions in pixels
#MAX_CVT=5000
# Whether image may be upscaled: 0 = no, 1 = yes
#ALLOW_UPSCALING=1
# Maximum number of quality layers to decode in supported formats (-1 for all layers)
# MAX_LAYERS=-1
# TIFF image to use as watermark
#WATERMARK=
# Probability (between 0.0-1.0) that a tile will have watermark applied
#WATERMARK_PROBABILITY=1.0
# Opacity (between 0.0-1.0) applied to watermark image
#WATERMARK_OPACITY=1
#Comma-delimitted list of memcached servers with optional port numbers
#MEMCACHED_SERVERS=
#Time in seconds that cache remains fresh
#MEMCACHED_TIMEOUT=86400
# Interpolation method to use for rescaling when using image export
# 0 = nearest neighbout, 1 = bilinear
#INTERPOLATION=1
# Cross Origin Resource Sharing setting. Disabled by default
#CORS=
# Set a base URL for use in IIIF requests if using web server rewriting
#BASE_URL=
# Set the HTTP Cache-Control header
#CACHE_CONTROL="max-age=86400"
# Pattern following name stem to indicate an image sequence
#FILENAME_PATTERN="_pyr_"

View File

@@ -0,0 +1,21 @@
[Install]
WantedBy=multi-user.target
[Unit]
Description=IIPImage server
After=network.target
Documentation=https://iipimage.sourceforge.io man:iipsrv(8)
[Service]
User=iipsrv
Group=iipsrv
Environment="HOST=0.0.0.0" "PORT=9000" "LOGFILE=/var/log/iipsrv.log"
EnvironmentFile=-/etc/default/iipsrv
# Make sure logfile is writable by our user
ExecStartPre=+/bin/sh -ec "if [[ ${LOGFILE} != syslog ]]; then /usr/bin/touch -a ${LOGFILE} && chown iipsrv:iipsrv ${LOGFILE}; fi"
ExecStart=/usr/sbin/iipsrv --bind ${HOST}:${PORT}
ExecReload=kill -HUP $MAINPID
Restart=on-failure