The unobtanium-viewer
takes a summary database and makes it acessible as a search frontend.
It exports an HTTP socket you should put it behind a reverse proxy.
Synopsis
unobtanium-viewer [OPTIONS...]
Options
Accepted options are:
-s
,--summary-db
<file.db>- Path to the summary database.
- Default is
summary.db
-t
,--template-location
<template-directory>- Path to the template directory.
- Default is
/templates
-e
,--extra-config
<extra.toml>- Path to the template configuration file. Its content depends on the template. An example file for the default template can be found in the source, make sure to keep this one updated.
- Default is
extra.toml
inside the template location -l
,--listen-on
<ip:port>- HTTP Socket to listen on.
- Default is
127.0.0.1:3000
(local machine only, tcp port 3000) --request-workers
<n>- How many worker threads to keep available for searching, you should keep this number below the number of available CPU cores. This determines the number of concurrent queries that unobtanium can process.
- Default is
3
--help
- Print help text describing the available options and exit.
HTTP headers
It is recommended to set the following security headers in your reverse proxy:
X-Content-Type-Options "nosniff"
Referrer-Policy "strict-origin"
permissions-policy "interest-cohort=()"
Content-Security-Policy "default-src 'none'; script-src 'self' blob: ; style-src 'self'; img-src 'self'; media-src 'self'; base-uri 'none'; form-action 'self' echoip.slatecave.net ; frame-ancestors 'none'"
Cache-Control "max-age=3600, min-fresh=600, stale-if-error=86400, must-revalidate"
Note: Currently the unobtanium frontend contains no javascript, this may change in the future to enable progresive enhancements or interactive features.
SQLite caching
Unobtanium itself implements no caching mechanisms, keeping a bunch of memory free for the Linux kernel to keep frequently needed parts of the database in RAM is recommended and will greatly improve the query speed.
Plan keeping at least 10% of the summary database size as "usused" RAM so that the kernel can use it for caching.
Serving static files directly
Inside the template directory there is a static
directory which cn be served by your web server directly by overlaying it on top of the reverse proxy functionality.
Note: If you don't do this you're fine too, the unobtanium-viewer will serve them with the same functionality.
Example configuration for the Caddy web server assuming the template directory is /opt/unobtaniun/default-template/
:
your.domain {
[… other configuration …]
# Static file matcher
@isStatic file {
root /opt/unobtaniun/default-template/static/
}
# Static file handler
handle @isStatic {
root * /opt/unobtaniun/default-template/static/
file_server
}
# Reverse proxy
reverse_proxy * localhost:11006 {
header_up Host search.slatecave.net
}
}
Anubis
In case you want to put the Anubis scraper blocker in front of the viewer because you're reciving a high volume of automated queries, the default configuration for anubis works fine.
It should not be necessary though, unobtanium can handle high volumes of requests pretty well.