Back to Shiori

Configuration

docs/Configuration.md

1.8.06.6 KB
Original Source

Configuration

<!-- TOC --> <!-- /TOC -->

Overall Configuration

Most configuration can be set directly using environment variables or flags. The available flags can be found by running shiori --help. The available environment variables are listed below.

Global configuration

Environment variableDefaultRequiredDescription
SHIORI_DEVELOPMENTFalseNoSpecifies if the server is in dev mode

HTTP configuration variables

Environment variableDefaultRequiredDescription
SHIORI_HTTP_ENABLEDTrueNoEnable HTTP service
SHIORI_HTTP_PORT8080NoPort number for the HTTP service
SHIORI_HTTP_ADDRESS:NoAddress for the HTTP service
SHIORI_HTTP_ROOT_PATH/NoRoot path for the HTTP service
SHIORI_HTTP_ACCESS_LOGTrueNoLogging accessibility for HTTP requests
SHIORI_HTTP_SERVE_WEB_UITrueNoServing Web UI via HTTP. Disable serves only the API.
SHIORI_HTTP_SECRET_KEYYesSecret key for HTTP sessions.
SHIORI_HTTP_BODY_LIMIT1024NoLimit for request body size
SHIORI_HTTP_READ_TIMEOUT10sNoMaximum duration for reading the entire request
SHIORI_HTTP_WRITE_TIMEOUT10sNoMaximum duration before timing out writes
SHIORI_HTTP_IDLE_TIMEOUT10sNoMaximum amount of time to wait for the next request
SHIORI_HTTP_DISABLE_KEEP_ALIVEtrueNoDisable HTTP keep-alive connections
SHIORI_HTTP_DISABLE_PARSE_MULTIPART_FORMtrueNoDisable pre-parsing of multipart form
SHIORI_SSO_PROXY_AUTH_ENABLEDfalseNoEnable SSO Auth Proxy Header
SHIORI_SSO_PROXY_AUTH_HEADER_NAMERemote-UserNoList of CIDRs of trusted proxies
SHIORI_SSO_PROXY_AUTH_TRUSTED10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7NoList of CIDRs of trusted proxies

Storage Configuration

The StorageConfig struct contains settings related to storage.

Environment variableDefaultRequiredDescription
SHIORI_DIR(current dir)NoDirectory where Shiori stores its data.

The data Directory

Shiori is designed to work out of the box, but you can change where it stores your bookmarks if you need to.

By default, Shiori saves your bookmarks in one of the following directories:

PlatformDirectory
Linux${XDG_DATA_HOME}/shiori (default: ~/.local/share/shiori)
macOS~/Library/Application Support/shiori
Windows%LOCALAPPDATA%/shiori

If you pass the flag --portable to Shiori, your data will be stored in the shiori-data subdirectory alongside the shiori executable.

To specify a custom path, set the SHIORI_DIR environment variable.

Database Configuration

Environment variableDefaultRequiredDescription
SHIORI_DBMS (deprecated)DBMSNoDeprecated (Use environment variables for DBMS)
SHIORI_DATABASE_URLURLNoURL for the database (required)

SHIORI_DBMS is deprecated and will be removed in a future release. Please use SHIORI_DATABASE_URL instead.

Shiori uses an SQLite3 database stored in the above data directory by default. If you prefer, you can also use MySQL or PostgreSQL database by setting the SHIORI_DATABASE_URL environment variable.

MySQL

MySQL example: SHIORI_DATABASE_URL="mysql://username:password@(hostname:port)/database?charset=utf8mb4"

You can find additional details in go mysql sql driver documentation.

PostgreSQL

PostgreSQL example: SHIORI_DATABASE_URL="postgres://pqgotest:password@hostname/database?sslmode=verify-full"

You can find additional details in go postgres sql driver documentation.

Reverse proxies and the webroot path

If you want to serve Shiori behind a reverse proxy, you can set the SHIORI_HTTP_ROOT_PATH environment variable to the path where Shiori is served, e.g. /shiori/.

Keep in mind this configuration wont make Shiori accessible from /shiori path so you need to setup your reverse proxy accordingly so it can strip the webroot path.

We provide some examples for popular reverse proxies below. Please follow your reverse proxy documentation in order to setup it properly.

Nginx

Fox nginx, you can use the following configuration as a example. The important part is the trailing slash in proxy_pass directive:

nginx
location /shiori/ {
    proxy_pass http://localhost:8080/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
}