Direkt zum Hauptinhalt

Environment Configuration

We use Fedora 38 Workstation, but the following steps should be similar on other systems.

We also use a timer to delay the startup of jetty11 at bootup, because it sometimes struggles to perform well at the first start.

vim /lib/systemd/system/jetty11.timer
[Unit]
Description=Timer for jetty11 Startup Delay
 
[Timer]
OnBootSec=1min
 
[Install]
WantedBy=timers.target
vim /lib/systemd/system/jetty11.service
[Unit]
Description=Jetty 11 Web Application Server
Documentation=https://www.eclipse.org/jetty/documentation/current/
After = syslog.target network.target
 
[Service]
# Configuration
Environment="JETTY_HOME=/opt/jetty-home-11.0.15"
Environment="JETTY_BASE=/opt/jetty-home-11.0.15/jetty-base"
Environment="JETTY_USER=jetty"
Environment="JETTY_HOST=127.0.0.1"
Environment="JETTY_ARGS=jetty.port=8080"
Environment="JETTY_STATE=/var/lib/jetty11/jetty.state"
 
Environment="JAVA_OPTS=-Xms1024m -Xmx3584m -Djava.awt.headless=true"
 
#Configure Jetty Service to use database connection instead of H2 local DB
Environment="DATABASE_URL=jdbc:postgresql://127.0.0.1:5432/teedy_db"
Environment="DATABASE_USER=teedy"
Environment="DATABASE_PASSWORD=password"
 
#set base url for password reset
Environment="DOCS_BASE_URL=https://your.domain.tld"
 
#Configure tesseract performance
Environment="OMP_THREAD_LIMIT=1"
 
# Lifecycle
Type=forking
ExecStart = /opt/jetty-home-11.0.15/bin/jetty.sh start
ExecStop = /opt/jetty-home-11.0.15/bin/jetty.sh stop
ExecReload = /opt/jetty-home-11.0.15/bin/jetty.sh restart
 
# Logging
SyslogIdentifier=jetty11
 
# Security
User=jetty
Group=jetty
PrivateTmp=yes
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
WorkingDirectory=/usr/share/jetty11/
LogsDirectory=jetty11
LogsDirectoryMode=750
ProtectSystem=
ReadWritePaths=/var/lib/jetty9/
ReadWritePaths=/mnt/data/sismics/
 
[Install]
WantedBy=multi-user.target

More environment vars can be found at https://github.com/sismics/docs/blob/dd36e08d7d6cd8248f12a9570694b4631be3b04d/README.md#available-environment-variables

systemctl daemon-reload
systemctl enable jetty11.timer #we do not enable jetty11.service too, because that service is just fully controlled by our timer
systemctl start jetty11.service
systemctl status jetty11.service

Information about Teedy file structure


Directory Notes
/var/docs/theme Background image stored here
/var/docs/storage

place for alle the files and their automatically generated thumbnails (*_thumb) and web previews.
Note that alle the files inside this dir are encrypted and got hashed file names.
You can access the file content only inside a running Teedy instance which decrypts the files for you

/var/docs/log log files. Same output which you get from journalctl -u jetty9.service (if you use systemd)
/var/docs/db H2 database files. Empty but existing if PostgreSQL is used
/var/docs Root Directory