Tutorial - Setting up Shiori
Let's setup Shiori, a simple bookmarks manager and clone of Pocket!
Scenario - It's late, you are working on setting up a new service on your server. You keep hitting this little issue. You seem to remember reading something about this before in your research. You go to the blog you had bookmarked and darn, the server is down. You google but can't find what you are looking for. You hit the internet archive and no one has submitted the page. You feel like poop, if only you had a backup of the page you read 3 weeks back. Enter Shiori.
What is Shiori?
Shiori is a simple bookmarks manager written in the Go language. Intended as a simple clone of Pocket. It has a great interface with light/dark modes, command line utilities, optional public sharing and can be run as a single app stack in docker. You can also install from source as it's just a statically linked GO binary.
Features:
Some of the features it includes are:
- Basic bookmarks management i.e. add, edit, delete and search.
- Import and export bookmarks from and to Netscape Bookmark file
- Simple and clean command line interface.
- Portable, thanks to its single binary format.
- Support for sqlite3, PostgreSQL and MySQL as its database.
- Where possible, by default
shiori
will parse the readable content and create an offline archive of the webpage. - [BETA] web extension support for Firefox and Chrome.
Where it fits
There are many different bookmark managing services out there, such as Linkace, Linkding, Linkwarden to name a few. However for today, we will be focusing on Shiori. For me, it seems to have all the features I wanted, without an overly bulky setup with MySQL, Nginx, or PHP-FastCGI applications running. I recently setup Shiori recently and figured I'd outline the steps to setup this amazing application.
Install Shiori using Docker Compose
version: "3"
services:
shiori:
image: ghcr.io/go-shiori/shiori:dev
container_name: shiori
ports:
- "8080:8080"
volumes:
- "/docker/shiori/dev-data:/srv/shiori"
- "/docker/shiori:/src/shiori"
restart: unless-stopped
links:
- "postgres"
environment:
SHIORI_DIR: /srv/shiori
SHIORI_DATABASE_URL: postgres://shiori:shiori@postgres/shiori?sslmode=disable
postgres:
image: postgres:15
environment:
POSTGRES_PASSWORD: shiori
POSTGRES_USER: shiori
ports:
- "5432:5432"
Known Issues
The latest release of Shiori (shiori 1.5.3) has a breaking change that was mentioned in the release notes, but isn't really in the documentation on setting it up. This is why I'm writing this article as I'm sure others will run into the issue.
Once the container is started, you will get an error when logging into Shiori with the default creds: shiori:gopher
. The error states: SQL logic error: no such table: account (1) (500)
. This is because the database doesn't exist yet. The way around this is to run the migration command after the container is started by running the following command: `
Conclusion
The ability to have the bookmarks automatically create a reading and archive screenshot that is hosted on my server is awesome and can't be understated. The fact that it's so light on the server is also something I am in love with. See below for my docker stats. 18MB memory load is amazingly light and would run great on any machine including a Raspberry Pi.