Implement experimental IIPServer support
This commit is contained in:
parent
5d84301361
commit
10b93ddbe8
9 changed files with 51 additions and 4 deletions
|
|
@ -17,6 +17,7 @@ var Provision wisski_distillery.Command = pv{}
|
|||
|
||||
type pv struct {
|
||||
PHPVersion string `short:"p" long:"php" description:"specific php version to use for instance. Should be one of '8.0', '8.1'."`
|
||||
IIPServer bool `short:"i" long:"iip-server" description:"enable iip-server inside this instance"`
|
||||
OPCacheDevelopment bool `short:"o" long:"opcache-devel" description:"Include opcache development configuration"`
|
||||
Flavor string `short:"f" long:"flavor" description:"Use specific flavor. Use '--list-flavors' to list flavors. "`
|
||||
ListFlavors bool `short:"l" long:"list-flavors" description:"List all known flavors"`
|
||||
|
|
@ -65,6 +66,7 @@ func (p pv) Run(context wisski_distillery.Context) error {
|
|||
Flavor: p.Flavor,
|
||||
System: models.System{
|
||||
PHP: p.PHPVersion,
|
||||
IIPServer: p.IIPServer,
|
||||
OpCacheDevelopment: p.OPCacheDevelopment,
|
||||
ContentSecurityPolicy: p.ContentSecurityPolicy,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ type rebuild struct {
|
|||
|
||||
System bool `short:"s" long:"system-update" description:"Update the system configuration according to other flags"`
|
||||
PHPVersion string `short:"p" long:"php" description:"update to specific php version to use for instance. Should be one of '8.0', '8.1'."`
|
||||
IIPServer bool `short:"i" long:"iip-server" description:"enable iip-server inside this instance"`
|
||||
OPCacheDevelopment bool `short:"o" long:"opcache-devel" description:"Include opcache development configuration"`
|
||||
Flavor string `short:"f" long:"flavor" description:"Use specific flavor. Use 'provision --list-flavors' to list flavors. "`
|
||||
ContentSecurityPolicy string `short:"c" long:"content-security-policy" description:"Setup ContentSecurityPolicy"`
|
||||
|
||||
Positionals struct {
|
||||
|
|
@ -75,6 +77,7 @@ func (rb rebuild) Run(context wisski_distillery.Context) (err error) {
|
|||
if rb.System {
|
||||
sys = models.System{
|
||||
PHP: rb.PHPVersion,
|
||||
IIPServer: rb.IIPServer,
|
||||
OpCacheDevelopment: rb.OPCacheDevelopment,
|
||||
ContentSecurityPolicy: rb.ContentSecurityPolicy,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
IIP Image Server
|
||||
IIP Image Server (<em>Experimental</em>)
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ .Instance.System.IIPServer }}</code>
|
||||
|
|
|
|||
|
|
@ -40,10 +40,11 @@
|
|||
<div class="pure-controls">
|
||||
<label for="iipserver" class="pure-checkbox">
|
||||
<input {{ if $rebuild }}{{ if .System.IIPServer }}checked{{end}}{{end}} type="checkbox" id="iipserver" />
|
||||
IIP Image Server
|
||||
IIP Image Server (<em>Experimental</em>)
|
||||
</label>
|
||||
<span class="pure-form-message-inline">
|
||||
Run an <a href="https://iipimage.sourceforge.io/documentation/server" target="_blank" rel="noopener noreferer">IIPImage server</a> inside this instance.
|
||||
This is currently <em>experimental</em>.
|
||||
<br />
|
||||
This can be used for streaming 2D images inside this WissKI, see <a href="https://wiss-ki.eu/documentation/periphal-software/iip-image-server" target="_blank" rel="noopener noreferer">the WissKI Documentation</a> for more details.
|
||||
Please be aware that any installation or configuration steps are performed automatically by the distillery.
|
||||
|
|
|
|||
|
|
@ -52,6 +52,14 @@ func (system System) GetDockerBaseImage() string {
|
|||
return imagePrefix + version + imageSuffix
|
||||
}
|
||||
|
||||
// GetIIPServerEnabled returns if the IIPServer was enabled
|
||||
func (system System) GetIIPServerEnabled() string {
|
||||
if !system.IIPServer {
|
||||
return ""
|
||||
}
|
||||
return "1"
|
||||
}
|
||||
|
||||
const (
|
||||
// Content Security Policy used by the internal server
|
||||
ContentSecurityPolicyNothing = "base-uri 'self'; default-src 'none';"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ FROM $BARREL_BASE_IMAGE
|
|||
WORKDIR /var/www
|
||||
|
||||
# install and enable the various required php extensions and dropbear ssh server
|
||||
ARG IIP_SERVER_ENABLED=
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
curl \
|
||||
openssh-server \
|
||||
|
|
@ -32,6 +33,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|||
unzip \
|
||||
vim \
|
||||
zip \
|
||||
$([ "$IIP_SERVER_ENABLED" = "1" ] && echo iipimage-server) \
|
||||
&& \
|
||||
docker-php-source extract && \
|
||||
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||
|
|
@ -101,11 +103,15 @@ ENV CONTENT_SECURITY_POLICY=${CONTENT_SECURITY_POLICY}
|
|||
RUN rm /etc/apache2/sites-available/*.conf && \
|
||||
rm /etc/apache2/sites-enabled/*.conf
|
||||
|
||||
# Then add the WissKI site
|
||||
# Then add all the configs
|
||||
ADD apache.d/conf/ports.conf /etc/apache2/ports.conf
|
||||
ADD apache.d/sites-available/wisski.conf /etc/apache2/sites-available/wisski.conf
|
||||
|
||||
# And enable it
|
||||
# this file is technically only needed for iipserv is enabled
|
||||
# but we add it in either case, as it's not enabled.
|
||||
ADD apache.d/mods-available/iipsrv.conf /etc/apache2/mods-available/iipsrv.conf
|
||||
|
||||
# enable it
|
||||
RUN a2ensite wisski
|
||||
|
||||
# volumes for composer
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
# Create a directory for the iipsrv binary
|
||||
ScriptAlias /fcgi-bin/ "/usr/lib/iipimage-server/"
|
||||
|
||||
# Set the options on that directory
|
||||
<Location "/fcgi-bin/">
|
||||
AllowOverride None
|
||||
Options None
|
||||
Require all granted
|
||||
|
||||
# Set the module handler
|
||||
AddHandler fcgid-script .fcgi
|
||||
</Location>
|
||||
|
||||
# Set our environment variables for the IIP server
|
||||
FcgidInitialEnv VERBOSITY "1"
|
||||
FcgidInitialEnv LOGFILE "/dev/stderr"
|
||||
FcgidInitialEnv MAX_IMAGE_CACHE_SIZE "10"
|
||||
FcgidInitialEnv JPEG_QUALITY "90"
|
||||
FcgidInitialEnv MAX_CVT "5000"
|
||||
FcgidInitialEnv MEMCACHED_SERVERS "localhost"
|
||||
|
||||
# Define the idle timeout as unlimited and the number of
|
||||
# processes we want
|
||||
FcgidIdleTimeout 0
|
||||
FcgidMaxProcessesPerClass 1
|
||||
|
|
@ -8,6 +8,7 @@ services:
|
|||
BARREL_BASE_IMAGE: ${BARREL_BASE_IMAGE}
|
||||
OPCACHE_MODE: ${OPCACHE_MODE}
|
||||
CONTENT_SECURITY_POLICY: ${CONTENT_SECURITY_POLICY}
|
||||
IIP_SERVER_ENABLED: ${IIP_SERVER_ENABLED}
|
||||
|
||||
logging:
|
||||
driver: none
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ func (barrel *Barrel) Stack() component.StackWithResources {
|
|||
"RUNTIME_DIR": barrel.Malt.Config.Paths.RuntimeDir(),
|
||||
|
||||
"BARREL_BASE_IMAGE": barrel.GetDockerBaseImage(),
|
||||
"IIP_SERVER_ENABLED": barrel.GetIIPServerEnabled(),
|
||||
"OPCACHE_MODE": barrel.OpCacheMode(),
|
||||
"CONTENT_SECURITY_POLICY": barrel.ContentSecurityPolicy,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue