docstore/scripts/install_linux.sh
2019-08-29 19:29:53 +02:00

37 lines
819 B
Bash
Executable file

#!/bin/sh
apt install -y poppler-utils tesseract-ocr tesseract-ocr-deu tesseract-ocr-eng
groupadd docstore
useradd -g docstore docstore
mkdir /var/lib/docstore
chown docstore: /var/lib/docstore
mkdir /etc/docstore
cat <<EOF> /etc/docstore/docstore.conf
{
"run_dir": "/var/lib/docstore",
"listen_addr": "0.0.0.0:8080",
"secret": "$(openssl rand -hex 32)",
"langs": ["deu"],
"cmd_timeout": 6000,
"debug": true
}
EOF
cat <<EOF> /etc/systemd/system/docstore.service
[Unit]
Description=DocStore
After=syslog.target
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/bin/docstore server -c /etc/docstore/docstore.conf
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable docstore
cat <<EOF
copy your docstore binary to /usr/local/bin/docstore
then run: systemctl start docstore
EOF