Goobi viewer (English)
Documentation homeGoobi viewer Digests
  • Goobi viewer manual
  • Documentation overview
  • What is the Goobi viewer?
  • Configuration
    • 1. Goobi viewer Core
      • 1.1 Local settings
      • 1.2 Translations
      • 1.3 Folder configuration
      • 1.4 URL configuration
      • 1.5 User accounts
        • 1.5.1 Authentication Provider
        • 1.5.2 Sending e-mails
        • 1.5.3 Further settings
      • 1.6 Performance
      • 1.7 Access conditions and images
      • 1.8 Captcha
      • 1.9 PDF download
        • 1.9.1 Variants
        • 1.9.2 Download Links
        • 1.9.3 Individual PDF title page
      • 1.10 ePub download
      • 1.11 Image options
        • 1.11.1 Extended scrolling in the image view
        • 1.11.2 Navigation between structure types
        • 1.11.3 Image view configuration
        • 1.11.4 Maintaining zoom and rotation while browsing in the image view
        • 1.11.5 External images
        • 1.11.6 Restriction of image scaling
        • 1.11.7 Thumbnail settings
        • 1.11.8 Image Footer
      • 1.12 Individual page types
      • 1.13 Opening certain document types in alternative page views
      • 1.14 Full text hints
      • 1.15. Language settings
      • 1.16 Theme
        • 1.16.1 External themes
      • 1.17 Search
        • 1.17.1 Sorting
        • 1.17.2 Faceting
        • 1.17.3 Advanced search
        • 1.17.4 Timeline
        • 1.17.5 Calendar
        • 1.17.6 Save search
        • 1.17.7 Expand query for search sub-results
        • 1.17.8 Aggregated search hit display
        • 1.17.9 Versioning of records
        • 1.17.10 Exporting search results
        • 1.17.11 Search hit metadata
      • 1.18 Digital collections
        • 1.18.1 Collection hierarchy
        • 1.18.2 Sorting of records
        • 1.18.3 Sorting of collections
        • 1.18.4 Blacklist
        • 1.18.5 Collection size
        • 1.18.6 Further settings
        • 1.18.7 Structure element whitelist
      • 1.19 Metadata
        • 1.19.1 Main metadata
        • 1.19.2 Sidebar metadata
        • 1.19.3 Search hit metadata
        • 1.19.4 Archive metadata
        • 1.19.5 Image metadata
        • 1.19.6 Display of authority data
        • 1.19.7 Calendar structure elements
        • 1.19.8 Browsing
        • 1.19.9 Multilingual metadata
        • 1.19.10 Licenses
      • 1.20 Tables of contents
        • 1.20.1 Main table of contents
        • 1.20.2 Sidebar table of contents
        • 1.20.3 Download tables of content as PDF file
      • 1.21 Tag clouds
      • 1.22 Resolver
      • 1.23 Sidebar
      • 1.24 Navigation and display
      • 1.25 RSS feed
      • 1.26 Reading lists
      • 1.27 User comments
      • 1.28 CMS
      • 1.29 Transkribus
      • 1.30 Original content
      • 1.31 Piwik/Matomo
      • 1.32 Sitelinks
      • 1.33 API
        • 1.33.1 JSON
        • 1.33.2 IIIF
        • 1.33.3 Authentication
        • 1.33.4 CORS
      • 1.34 OpenSearch
      • 1.35 Embedding
      • 1.36 Maps
      • 1.37 Translations
      • 1.38 Archive
      • 1.39 Campaigns
      • 1.40 Add content
      • 1.41 Usage figures
      • 1.42 Config Editor
      • 1.43 Proxy
      • 1.44 ActiveMQ
      • 1.45 Developer
      • 1.46 External Ressources
    • 2. Goobi viewer Indexer
      • 2.1 Main configuration
      • 2.2 Directories
      • 2.3 Proxy
      • 2.4 Performance
      • 2.5 Structure types
      • 2.6 Metadata
      • 2.7 Starting and Exiting
      • 2.8 Indexing records
      • 2.9 Updating individual page documents
      • 2.10 Deleting records
      • 2.11 Solr scheme
      • 2.12 Further settings
    • 3. Goobi viewer Connector
      • 3.1 OAI interface
        • 3.1.1 Main Configuration
        • 3.1.2 Dublin Core
        • 3.1.3 Europeana
        • 3.1.4 METS
        • 3.1.5 LIDO
        • 3.1.6 MARCXML
        • 3.1.7 Xepicur
        • 3.1.8 Goobi viewer overview pages
        • 3.1.9 Goobi viewer crowdsourcing
        • 3.1.10 TEI
        • 3.1.11 CMDI
        • 3.1.12 Sets
      • 3.2 SRU interface
  • User interface
    • 1. Frontend
    • 2. Backend
      • 2.1 Dashboard
      • 2.2 Administration
        • 2.2.1 User
        • 2.2.2 Groups
        • 2.2.3 IP-Ranges
        • 2.2.4 Access licenses
        • 2.2.5 Rights
        • 2.2.6 Comments
        • 2.2.7 Terms of use
        • 2.2.8 New record
      • 2.3 Crowdsourcing
        • 2.3.1 Campaigns
        • 2.3.2 Annotations
      • 2.4 CMS
        • 2.4.1 Pages
        • 2.4.2 Categories
        • 2.4.3 Static pages
        • 2.4.4 Media
        • 5.4.5 Menus
        • 5.4.6 Collections
        • 5.4.7 Maps
  • Misc
    • 1. Use cases
      • 1.1 Series and convolutes
      • 1.2 Access restrictions
      • 1.3 Subthemes
      • 1.4 Authority data
      • 1.5 Multilingualism
      • 1.6 Maps
      • 1.7 Sub collections
      • 1.8 Multiple Goobi viewer
      • 1.9 Crowdsourcing module
      • 1.10 Archival documents
      • 1.11 Solr Queries
      • 1.12 Linking from METS file groups
      • 1.13 Add content
      • 1.14 Shibboleth
      • 1.15 Access restricted metadata
    • 2. FAQ
    • 3. Glossary
  • Devs & Ops
    • 1. Core Changelog
    • 2. Theme Changelog
    • 3. Installation guide
      • 3.1 Classical
      • 3.2 Docker
    • 4. Development environment
    • 5. API
    • 6. Explained!
Powered by GitBook
On this page
  • Introduction
  • Preparation
  • Create directory structure
  • Configuration files
  • config_viewer.xml
  • config_oai.xml
  • XSL files
  • config_indexer.xml
  • Cronjob
  • my.cnf
  • stopwords.txt
  • Variables and aliases
  • Installation
  • Create account
  • Updates
  • General commands

Was this helpful?

  1. Devs & Ops
  2. 3. Installation guide

3.2 Docker

Introduction

The following installation guide for the Goobi viewer refers to Ubuntu Linux 20.04. It is written as a step-by-step guide from top to bottom, meaning that settings and configurations build on each other. If the order is not followed, certain commands may fail.

VIEWER.EXAMPLE.ORG is used as the domain name in this manual, please adapt this to your own DNS name.

For productive use, a virtual machine with at least 4 CPUs and 8GB RAM is recommended.

Preparation

First, log on to the server on which the Goobi viewer is to be installed and obtain root rights:

ssh VIEWER.EXAMPLE.ORG
sudo -i

Then generate a password for the Goobi viewer database and a token and store them as a variable in the session. The DNS name is also stored there:

export VIEWER_HOSTNAME=VIEWER.EXAMPLE.ORG
export PW_SQL_ROOT=SECRETROOTPASSWORD
export PW_SQL_VIEWER=SECRETPASSWORD
export VIEWER_USERNAME=goobi@intranda.com
export VIEWER_USERPASS=SECRETPASSWORD
export VIEWER_IMAGE=intranda/goobi-viewer-theme-reference:develop
export VIEWER_THEME=reference
export TOKEN=$(uuidgen)

Now install the following packages:

apt -y install docker.io docker-compose mariadb-client python3-passlib python3-bcrypt

It is recommended to have a DNS entry for the server set at this time.

Create directory structure

The following commands create the necessary folder structure:

mkdir -p /opt/digiverso/{indexer,logs,viewer/{abbyy,cmdi,db,deleted_mets,dev,hotfolder,media,orig_lido,orig_denkxweb,success,ugc,alto,cms_media,error_mets,indexed_lido,mix,pdf,tei,updated_mets,cache,config/{PDFTitlePage,watermark,docker},fulltext,indexed_mets,oai/token,ptif,themes,wc}}
mkdir -p /opt/digiverso/zookeeper/{data,datalog}/
mkdir -p /opt/digiverso/solr/data/solr
sudo chown -R 8983:8983 /opt/digiverso/solr

Configuration files

Before the containers are started, the directories and configuration files for productive operation must be available in the file system.

config_viewer.xml

Various settings must be stored in the local config_viewer.xmlif necessary, the protocol must be adapted:

sed -e "s|VIEWER.EXAMPLE.ORG|${VIEWER_HOSTNAME}/viewer|g" -e "s|TOKEN|${TOKEN}|g" -e "s|VIEWERTHEME|${VIEWER_THEME}|g" << "EOF" >/opt/digiverso/viewer/config/config_viewer.xml
<?xml version="1.0" encoding="UTF-8" ?>
<config>
        <urls>
                <metadata>
                        <mets>https://VIEWER.EXAMPLE.ORG/oai?verb=GetRecord&amp;metadataPrefix=mets&amp;identifier=</mets>
                        <marc>https://VIEWER.EXAMPLE.ORG/oai?verb=GetRecord&amp;metadataPrefix=marcxml&amp;identifier=</marc>
                        <dc>https://VIEWER.EXAMPLE.ORG/oai?verb=GetRecord&amp;metadataPrefix=oai_dc&amp;identifier=</dc>
                        <ese>https://VIEWER.EXAMPLE.ORG/oai?verb=GetRecord&amp;metadataPrefix=europeana&amp;identifier=</ese>
                </metadata>

                <contentServerWrapper>https://VIEWER.EXAMPLE.ORG/content/</contentServerWrapper>
                <download>https://VIEWER.EXAMPLE.ORG/download/</download>
                <rest>https://VIEWER.EXAMPLE.ORG/api/v1/</rest>
                <connectorVersion>http://viewer:8080/oai/tools?action=getVersion</connectorVersion>
        </urls>

        <viewer>
                <theme mainTheme="VIEWERTHEME" discriminatorField="" />
        </viewer>

        <rss>
                <numberOfItems>50</numberOfItems>
                <title>Goobi viewer RSS Feed</title>
                <description>new items</description>
                <copyright>(c) Goobi viewer using institution </copyright>
        </rss>

        <webapi>        
                <authorization>
                        <token>TOKEN</token>
                </authorization>
        </webapi>
</config>
EOF

config_oai.xml

A local config_oai.xml is also required:

sed -e "s|VIEWER.EXAMPLE.ORG|${VIEWER_HOSTNAME}|g" << "EOF" >/opt/digiverso/viewer/config/config_oai.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
        <identifyTags>
                <baseURL useInRequestElement="true">https://VIEWER.EXAMPLE.ORG/viewer/oai</baseURL>
                <adminEmail>support@intranda.com</adminEmail>
        </identifyTags>
        <urnResolverUrl>https://VIEWER.EXAMPLE.ORG/viewer/resolver?urn=</urnResolverUrl>
        <piResolverUrl>https://VIEWER.EXAMPLE.ORG/viewer/piresolver?id=</piResolverUrl>
</config>
EOF

XSL files

The Goobi viewer OAI interface requires two more files:

wget -O /opt/digiverso/viewer/oai/MARC21slimUtils.xsl.xml https://raw.githubusercontent.com/intranda/goobi-viewer-connector/master/goobi-viewer-connector/src/main/resources/MARC21slimUtils.xsl
wget -O /opt/digiverso/viewer/oai/MODS2MARC21slim.xsl https://raw.githubusercontent.com/intranda/goobi-viewer-connector/master/goobi-viewer-connector/src/main/resources/MODS2MARC21slim.xsl

The XSL file is required for the source file resolver, which filters out the METS fileGrp PRESENTATION and access-restricted metadata:

wget -O /opt/digiverso/viewer/config/METS_filter.xsl https://raw.githubusercontent.com/intranda/goobi-viewer-core-config/refs/heads/master/goobi-viewer-core-config/src/main/resources/install/METS_filter.xsl

config_indexer.xml

Execute the following commands to download the current config.xml and adjust it accordingly:

wget -O /opt/digiverso/indexer/config_indexer.xml https://raw.githubusercontent.com/intranda/goobi-viewer-indexer/master/goobi-viewer-indexer/src/main/resources/config_indexer.xml
sed -e 's|<solrUrl>.*</solrUrl>|<solrUrl>http://solr:8983/solr/collection1</solrUrl>|' -e 's|C:/|/|g' -e "s|<viewerUrl>.*</viewerUrl>|<viewerUrl>https://${VIEWER_HOSTNAME}/viewer/</viewerUrl>|" -i /opt/digiverso/indexer/config_indexer.xml

Cronjob

Cronjobs must be set up for regular tasks:

sed -e "s|VIEWER.EXAMPLE.ORG|${VIEWER_HOSTNAME}|g" -e "s|TOKEN|${TOKEN}|g" << "EOF" >/etc/cron.d/intranda-goobiviewer
PATH=/usr/bin:/bin:/usr/sbin/
MAILTO=admin@intranda.com

#
# Regular cron jobs for the Goobi viewer
#

## These two scripts pull the theme git repository regulary. The @daily part is only 
## a reminder for the 1-minute schedule
#*/1 *       * * *   root    cd /opt/digiverso/viewer/themes/goobi-viewer-theme-reference; git pull | grep -v -e "Already up.to.date." -e "Bereits aktuell."
#@daily              root    echo "Please look at the git checkout interval for the Goobi viewer theme" | mail -s "Reference: Theme repository is checked out every minute" admin@intranda.com 

## Optimize the Solr search index once a month
@monthly            root    curl -s 'http://solr/solr/collection1/update?optimize=true&waitFlush=false'
EOF

ATTENTION: If the installation is not available via HTTPS, then the files just created must be opened at this point and the schema must be adjusted manually.

my.cnf

For easier access to the database later, a my.cnf with the corresponding access data is stored for the root user:

test -e /root/.my.cnf && echo 'WARNING, .my.cnf already exists!' ||
echo -e "[client]\nhost=127.0.0.1\npassword=${PW_SQL_ROOT}" >> /root/.my.cnf
chmod 600 /root/.my.cnf

stopwords.txt

For the Goobi viewer to be able to read the Solr stop words the corresponding language file must be stored, here the German one as an example:

cp /opt/digiverso/viewer/dev/goobi-viewer-docker/solr/goobiviewer/conf/lang/stopwords.txt /opt/digiverso/viewer/config/stopwords.txt

Variables and aliases

Add the following aliases to /root/.bash_aliases:

cat << "EOF" >>/root/.bash_aliases
alias cata='docker-compose -f /opt/digiverso/viewer/config/docker/docker-compose.yml logs -f --tail="500" viewer'
alias ind='docker-compose -f /opt/digiverso/viewer/config/docker/docker-compose.yml logs -f --tail="500" indexer'
EOF

Apply the changes in the current session:

. /root/.bashrc

Installation

For the installation, the Goobi viewer Docker git repository must be cloned:

cd /opt/digiverso/viewer/dev/
git clone https://github.com/intranda/goobi-viewer-docker

If you have your own theme, you must ensure that it can be loaded. If, for example, it is stored in its own Nexus server where access to the container is password-protected, then the access data must first be stored locally, for example:

docker login -u INTRANDACUSTOMER nexus.intranda.com:4443

The setup knows two possible environments. The default is the one for testing. For an installation in productive operation, files must be copied and possibly adapted.

First, copy the .env-production to the local Docker configuration directory, rename it and adjust values in it:

cp /opt/digiverso/viewer/dev/goobi-viewer-docker/.env-production /opt/digiverso/viewer/config/docker/.env
sed -i "s|VIEWER_DOMAIN=VIEWER.EXAMPLE.ORG|VIEWER_DOMAIN=${VIEWER_HOSTNAME}|g" /opt/digiverso/viewer/config/docker/.env
sed -i "s|DB_ROOT_PASSWORD=viewer|DB_ROOT_PASSWORD=${PW_SQL_ROOT}|g" /opt/digiverso/viewer/config/docker/.env
sed -i "s|DB_VIEWER_PASSWORD=viewer|DB_VIEWER_PASSWORD=${PW_SQL_VIEWER}|g" /opt/digiverso/viewer/config/docker/.env
sed -i "s|VIEWER_IMAGE=intranda/goobi-viewer-theme-reference:develop|VIEWER_IMAGE=${VIEWER_IMAGE}|g" /opt/digiverso/viewer/config/docker/.env

Then copy the docker-compose.yml and the solr folder and copy and rename the docker-compose.production.yml:

cp /opt/digiverso/viewer/dev/goobi-viewer-docker/docker-compose.yml /opt/digiverso/viewer/config/docker/docker-compose.yml
cp -a /opt/digiverso/viewer/dev/goobi-viewer-docker/solr /opt/digiverso/viewer/config/docker/
cp /opt/digiverso/viewer/dev/goobi-viewer-docker/docker-compose.production.yml /opt/digiverso/viewer/config/docker/docker-compose.override.yml

Now the containers can be started for the first time with the following commands:

cd /opt/digiverso/viewer/config/docker/
docker-compose up -d viewer-db solr
docker-compose exec solr solr zk upconfig -n goobiviewer -d /opt/goobiviewer
docker-compose exec solr solr create -c collection1 -n goobiviewer
docker-compose up -d

Create account

The Goobi viewer has a backend. The following command adds a test account to the database with the user name goobi@intranda.com and the password set at the beginning:

VIEWER_USERPASS_HASH=$(python3 -c "from passlib.hash import bcrypt; print(bcrypt.using(rounds=10, ident='2a').hash('${VIEWER_USERPASS}'))")
mysql -u viewer -p -D viewer -h 127.0.0.1 -e "INSERT INTO users (active,email,password_hash,score,superuser) VALUES (1,'${VIEWER_USERNAME}','${VIEWER_USERPASS_HASH}',0,1);"

Updates

To apply updates, the goobi-viewer-docker repository must first be pulled:

cd /opt/digiverso/viewer/dev/goobi-viewer-docker
git pull

After that, the differences of the following three files have to be compared and taken over or adjusted accordingly:

diff -u ../../config/docker/.env .env-production  | colordiff
diff -u ../../config/docker/docker-compose.override.yml docker-compose.production.yml  | colordiff
diff -u ../../config/docker/docker-compose.yml docker-compose.yml  | colordiff

At the end, it is still necessary to check if there have been any changes in the Solr directory.

These points are in addition to the existing core and theme changelog.

General commands

Here are some commands documented to get into the containers, etc.

# Start all containers in the background.
# remove -d to run them in the foreground
docker-compose up -d

# Show logfiles of a container
# Possible values are solr, zookeeper, viewer, viewer-db, indexer, connector, proxy
docker-compose logs indexer -f

# Go into a docker container
docker-compose exec viewer /bin/bash

# Restart a docker container
docker-compose restart indexer

# Shutdown
docker-compose down

# Update docker container
docker-compose pull

For example, vim can be installed in a container with the following command:

apt update && apt install vim-nox
Previous3.1 ClassicalNext4. Development environment

Last updated 22 days ago

Was this helpful?