6

Ruslan Kuchumov / Trash Can · GitLab

 1 year ago
source link: https://gitlab.com/mildlyparallel/trashcan
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Trash Can

One man's trash is another man's related work.

trashcan -- web based service for indexing scientific papers (or any other documents)

Features:

  • Single lightweight backend service written in C++ using SQLite database.
  • Single page web interface. PDF files can be preview in the same browser window.
  • Documents metadata can be fetched using DOI, ArXiv or ISBN (using Google Books) identifiers.
  • Documents can be categorized using user-defined tags.
  • Full-text search support. Documents contents is extracted with Apache Tika and indexed using SQLite FTS.

Screenshots

Search page:

Edit page:

Mobile version:

img3

Deploying with Docker

Build container:

If you are going to run the service on non-root URL prefix, for example /trash/, you should specify the PREFIX argument:

Start container:

trashcan service would listen on 8000 port (http://localhost:8000/) address and store its files in your $HOME/trashcan/ directory.

Compiling from source

Requirements:

  • meson build system
  • sqlite3
  • libmagic (libmagic-dev or file-devel packages)
  • Apache Tika App
  • nodejs, npm (optional, required only for frontend compilation)

You can download compiled frontend assets archive (frontend.tar.gz) from GitLab Release page and extract it to the project root. Or, instead, you may compile them manually:

Configure backend project:

By default, your files and database would be stored in /var/lib/trashcan/ directory, to change you can use command line arguments later or compile it with the corresponding option:

Compile and install it:

By default, frontend files and content extraction script would be placed in $PREFIX/usr/share and backend executable would be in $PREFIX/bin.

Usage

You'll need to set path to tika-app jar file to TIKA_JAR_PATH environment variable, or you may create a link path to tika-app.jar in the current workdir (check script/extract.sh).

And then you may start backend service:

Run ./build/trashcan -h to see more configuration options.

Systemd service

Make sure TIKA jar files is installed to /usr/share/java/tika-app.jar, or change the path in the service file.

Nginx integration

Nginx can be used as a reverse proxy and for dispatching static content. In the following configuration nginx would serve static files from /trash/ prefix and redirect request coming to /trash/api/ to the backend service.

To change prefixes for static assets and backend API in the frontend, you'd need to specify them in .env.local file and recompile the frontend:

To specify backend API prefix, you would need to compile it with api-prefix option:

Then, in nginx configuration file, you'd need to set /trash/ location as an alias to your static content and /trash/api as a proxy pass to the backend. Make sure to increase request size in order for file uploads to work.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK