From 1e088983f6a80b6fd47543d0b4989e9ddb3234d5 Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Fri, 4 Oct 2024 21:59:59 -0400 Subject: add imap stuff --- scripts/hostclass/imap_server/20-tika | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 scripts/hostclass/imap_server/20-tika (limited to 'scripts/hostclass/imap_server/20-tika') diff --git a/scripts/hostclass/imap_server/20-tika b/scripts/hostclass/imap_server/20-tika new file mode 100644 index 0000000..3b4aa47 --- /dev/null +++ b/scripts/hostclass/imap_server/20-tika @@ -0,0 +1,38 @@ +#!/bin/sh + +: ${tika_version:='2.9.2'} +: ${tika_uid:='787'} + +tika_user=tika +tika_conf_dir=/usr/local/etc/tika +tika_install_dir=/usr/local/tika +tika_heap_size=2g +tika_port=9998 +tika_url="https://dlcdn.apache.org/tika/${tika_version}/tika-server-standard-${tika_version}.jar" + +# Add local tika user. +add_user \ + -u "$tika_uid" \ + -c 'Apache Tika' \ + -d /nonexistent \ + -s /usr/sbin/nologin \ + "$tika_user" + +# Create tika install/config directories. +install_directory -m 0755 \ + "$tika_install_dir" \ + "$tika_conf_dir" + +# Download tika jar file. +curl -fL -o "${tika_install_dir}/tika.jar" "$tika_url" + +# Copy tika rc script. +install_file -m 0555 /usr/local/etc/rc.d/tika + +# Copy tika config files. +install_template -m 0644 "${tika_conf_dir}/config.xml" +install_file -m 0644 "${tika_conf_dir}/log4j2.xml" + +# Enable and start tika. +sysrc -v tika_enable=YES +service tika restart -- cgit v1.2.3