feat: Overseerr to Jellyseerr migration (#2019)

* feat: add Overseerr migration

* refactor: rename to Seerr

* refactor: more rename to Seerr

* feat: update the value of the MediaStatus.DELETED enum

* fix: add more details in migration logs

* fix: replace .update by .save for TypeORM hooks

* fix: add fake migration to skip the duplicated UpdateWebPush migration

* fix: rewrite the AddUserAvatarCacheFields migration for Overseerr merge

* fix: replace jellyseerr migrations with a dedicated one for overseerr

* fix: update overseerr migration

* fix: update overseerr migration

* fix: remove irrelevant changes

* fix: typos

* docs: update jsdoc comment

* docs: update seerr description

* docs: fix the contributing.md link

* fix: remove unwanterd change on postgres dev datasource

* docs: add latest tag to docker image

* fix: migrate old deleted status for 4k media

* fix: update Seerr version check
This commit is contained in:
Gauthier
2025-10-30 19:57:50 +01:00
committed by GitHub
parent 2e6e9ad657
commit 4e9c94c80f
60 changed files with 942 additions and 395 deletions

View File

@@ -0,0 +1,9 @@
{
"label": "Extending Seerr",
"position": 3,
"link": {
"type": "generated-index",
"title": "Extending Seerr",
"description": "Extend Seerr to your liking"
}
}

View File

@@ -0,0 +1,170 @@
---
title: Configuring the Database (Advanced)
description: Configure the database for Seerr
sidebar_position: 2
---
# Configuring the Database
Seerr supports SQLite and PostgreSQL. The database connection can be configured using the following environment variables:
## SQLite Options
If you want to use SQLite, you can simply set the `DB_TYPE` environment variable to `sqlite`. This is the default configuration so even if you don't set any other options, SQLite will be used.
```dotenv
DB_TYPE=sqlite # Which DB engine to use, either sqlite or postgres. The default is sqlite.
CONFIG_DIRECTORY="config" # (optional) The path to the config directory where the db file is stored. The default is "config".
DB_LOG_QUERIES="false" # (optional) Whether to log the DB queries for debugging. The default is "false".
```
## PostgreSQL Options
:::caution
When migrating Postgres from version 17 to 18 in Docker, note that the data mount point has changed. Instead of using `/var/lib/postgresql/data`, the correct mount path is now `/var/lib/postgresql`.
Refer to the [PostgreSQL Docker documentation](https://hub.docker.com/_/postgres/#pgdata) to learn how to migrate or opt out of this change.
:::
### TCP Connection
If your PostgreSQL server is configured to accept TCP connections, you can specify the host and port using the `DB_HOST` and `DB_PORT` environment variables. This is useful for remote connections where the server uses a network host and port.
```dotenv
DB_TYPE=postgres # Which DB engine to use, either sqlite or postgres. The default is sqlite.
DB_HOST="localhost" # (optional) The host (URL) of the database. The default is "localhost".
DB_PORT="5432" # (optional) The port to connect to. The default is "5432".
DB_USER= # (required) Username used to connect to the database.
DB_PASS= # (required) Password of the user used to connect to the database.
DB_NAME="seerr" # (optional) The name of the database to connect to. The default is "seerr".
DB_LOG_QUERIES="false" # (optional) Whether to log the DB queries for debugging. The default is "false".
```
### Unix Socket Connection
If your PostgreSQL server is configured to accept Unix socket connections, you can specify the path to the socket directory using the `DB_SOCKET_PATH` environment variable. This is useful for local connections where the server uses a Unix socket.
```dotenv
DB_TYPE=postgres # Which DB engine to use, either sqlite or postgres. The default is sqlite.
DB_SOCKET_PATH="/var/run/postgresql" # (required) The path to the PostgreSQL Unix socket directory.
DB_USER= # (required) Username used to connect to the database.
DB_PASS= # (optional) Password of the user used to connect to the database, depending on the server's authentication configuration.
DB_NAME="seerr" # (optional) The name of the database to connect to. The default is "seerr".
DB_LOG_QUERIES="false" # (optional) Whether to log the DB queries for debugging. The default is "false".
```
:::info
**Finding Your PostgreSQL Socket Path**
The PostgreSQL socket path varies by operating system and installation method:
- **Ubuntu/Debian**: `/var/run/postgresql`
- **CentOS/RHEL/Fedora**: `/var/run/postgresql`
- **macOS (Homebrew)**: `/tmp` or `/opt/homebrew/var/postgresql`
- **macOS (Postgres.app)**: `/tmp`
- **Windows**: Not applicable (uses TCP connections)
You can find your socket path by running:
```bash
# Find PostgreSQL socket directory
find /tmp /var/run /run -name ".s.PGSQL.*" 2>/dev/null | head -1 | xargs dirname
# Or check PostgreSQL configuration
sudo -u postgres psql -c "SHOW unix_socket_directories;"
```
:::
### SSL configuration
The following options can be used to further configure ssl. Certificates can be provided as a string or a file path, with the string version taking precedence.
```dotenv
DB_USE_SSL="false" # (optional) Whether to enable ssl for database connection. This must be "true" to use the other ssl options. The default is "false".
DB_SSL_REJECT_UNAUTHORIZED="true" # (optional) Whether to reject ssl connections with unverifiable certificates i.e. self-signed certificates without providing the below settings. The default is "true".
DB_SSL_CA= # (optional) The CA certificate to verify the connection, provided as a string. The default is "".
DB_SSL_CA_FILE= # (optional) The path to a CA certificate to verify the connection. The default is "".
DB_SSL_KEY= # (optional) The private key for the connection in PEM format, provided as a string. The default is "".
DB_SSL_KEY_FILE= # (optional) Path to the private key for the connection in PEM format. The default is "".
DB_SSL_CERT= # (optional) Certificate chain in pem format for the private key, provided as a string. The default is "".
DB_SSL_CERT_FILE= # (optional) Path to certificate chain in pem format for the private key. The default is "".
```
---
### Migrating from SQLite to PostgreSQL
1. Set up your PostgreSQL database and configure Seerr to use it
2. Run Seerr to create the tables in the PostgreSQL database
3. Stop Seerr
4. Run the following command to export the data from the SQLite database and import it into the PostgreSQL database:
:::info
Edit the postgres connection string (without the \{\{ and \}\} brackets) to match your setup.
If you don't have or don't want to use docker, you can build the working pgloader version [in this PR](https://github.com/dimitri/pgloader/pull/1531) from source and use the same options as below.
:::
:::caution
The most recent release of pgloader has an issue quoting the table columns. Use the version in the docker container to avoid this issue.
:::
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs>
<TabItem value="docker" label="Using pgloader Container (Recommended)" default>
**Recommended method**: Use the pgloader container even for standalone Seerr installations. This avoids building from source and ensures compatibility.
```bash
# For standalone installations (no Docker network needed)
docker run --rm \
-v /path/to/your/config/db.sqlite3:/db.sqlite3:ro \
ghcr.io/ralgar/pgloader:pr-1531 \
pgloader --with "quote identifiers" --with "data only" \
/db.sqlite3 postgresql://{{DB_USER}}:{{DB_PASS}}@{{DB_HOST}}:{{DB_PORT}}/{{DB_NAME}}
```
**For Docker Compose setups**: Add the network parameter if your PostgreSQL is also in a container:
```bash
docker run --rm \
--network your-seerr-network \
-v /path/to/your/config/db.sqlite3:/db.sqlite3:ro \
ghcr.io/ralgar/pgloader:pr-1531 \
pgloader --with "quote identifiers" --with "data only" \
/db.sqlite3 postgresql://{{DB_USER}}:{{DB_PASS}}@{{DB_HOST}}:{{DB_PORT}}/{{DB_NAME}}
```
</TabItem>
<TabItem value="standalone" label="Building pgloader from Source">
For users who prefer not to use Docker or need a custom build:
```bash
# Clone the repository and checkout the working version
git clone https://github.com/dimitri/pgloader.git
cd pgloader
git fetch origin pull/1531/head:pr-1531
git checkout pr-1531
# Follow the official installation instructions
# See: https://github.com/dimitri/pgloader/blob/master/INSTALL.md
```
:::info
**Building pgloader from source requires following the complete installation process outlined in the [official pgloader INSTALL.md](https://github.com/dimitri/pgloader/blob/master/INSTALL.md).**
Please refer to the official documentation for detailed, up-to-date installation instructions.
:::
Once pgloader is built, run the migration:
```bash
# Run migration (adjust path to your config directory)
./pgloader --with "quote identifiers" --with "data only" \
/path/to/your/config/db.sqlite3 \
postgresql://{{DB_USER}}:{{DB_PASS}}@{{DB_HOST}}:{{DB_PORT}}/{{DB_NAME}}
```
</TabItem>
</Tabs>
5. Start Seerr

View File

@@ -0,0 +1,301 @@
---
title: Reverse Proxy
description: Configure a reverse proxy for Seerr.
sidebar_position: 1
---
# Reverse Proxy
:::warning
Base URLs cannot be configured in Seerr. With this limitation, only subdomain configurations are supported.
A Nginx subfolder workaround configuration is provided below, but it is not officially supported.
:::
## Nginx
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs groupId="nginx-reverse-proxy" queryString>
<TabItem value="subdomain" label="Subdomain">
Add the following configuration to a new file `/etc/nginx/sites-available/seerr.example.com.conf`:
```nginx
server {
listen 80;
server_name seerr.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name seerr.example.com;
ssl_certificate /etc/letsencrypt/live/seerr.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/seerr.example.com/privkey.pem;
proxy_set_header Referer $http_referer;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $remote_port;
proxy_set_header X-Forwarded-Host $host:$remote_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Port $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
location / {
proxy_pass http://127.0.0.1:5055;
}
}
```
Then, create a symlink to `/etc/nginx/sites-enabled`:
```bash
sudo ln -s /etc/nginx/sites-available/seerr.example.com.conf /etc/nginx/sites-enabled/seerr.example.com.conf
```
</TabItem>
<TabItem value="subfolder" label="Subfolder">
:::warning
This Nginx subfolder reverse proxy is an unsupported workaround, and only provided as an example. The filters may stop working when Seerr is updated.
If you encounter any issues with Seerr while using this workaround, we may ask you to try to reproduce the problem without the Nginx proxy.
:::
Add the following location block to your existing `nginx.conf` file.
```nginx
location ^~ /seerr {
set $app 'seerr';
# Remove /seerr path to pass to the app
rewrite ^/seerr/?(.*)$ /$1 break;
proxy_pass http://127.0.0.1:5055; # NO TRAILING SLASH
# Redirect location headers
proxy_redirect ^ /$app;
proxy_redirect /setup /$app/setup;
proxy_redirect /login /$app/login;
# Sub filters to replace hardcoded paths
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types *;
sub_filter 'href="/"' 'href="/$app"';
sub_filter 'href="/login"' 'href="/$app/login"';
sub_filter 'href:"/"' 'href:"/$app"';
sub_filter '\/_next' '\/$app\/_next';
sub_filter '/_next' '/$app/_next';
sub_filter '/api/v1' '/$app/api/v1';
sub_filter '/login/plex/loading' '/$app/login/plex/loading';
sub_filter '/images/' '/$app/images/';
sub_filter '/imageproxy/' '/$app/imageproxy/';
sub_filter '/avatarproxy/' '/$app/avatarproxy/';
sub_filter '/android-' '/$app/android-';
sub_filter '/apple-' '/$app/apple-';
sub_filter '/favicon' '/$app/favicon';
sub_filter '/logo_' '/$app/logo_';
sub_filter '/site.webmanifest' '/$app/site.webmanifest';
}
```
</TabItem>
<TabItem value="swag" label="SWAG">
A sample proxy configuration is included in [SWAG (Secure Web Application Gateway)](https://github.com/linuxserver/docker-swag).
However, this page is still the only source of truth, so the SWAG sample configuration is not guaranteed to be up-to-date. If you find an inconsistency, please [report it to the LinuxServer team](https://github.com/linuxserver/reverse-proxy-confs/issues/new) or [submit a pull request to update it](https://github.com/linuxserver/reverse-proxy-confs/pulls).
To use the bundled configuration file, simply rename `seerr.subdomain.conf.sample` in the `proxy-confs` folder to `seerr.subdomain.conf`.
Alternatively, you can create a new file `seerr.subdomain.conf` in `proxy-confs` with the following configuration:
```nginx
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name seerr.*;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app seerr;
set $upstream_port 5055;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}
```
</TabItem>
<TabItem value="nginx-proxy-manager" label="Nginx Proxy Manager">
Add a new proxy host with the following settings:
### Details
- **Domain Names:** Your desired external Seerr hostname; e.g., `seerr.example.com`
- **Scheme:** `http`
- **Forward Hostname / IP:** Internal Seerr hostname or IP
- **Forward Port:** `5055`
- **Cache Assets:** yes
- **Block Common Exploits:** yes
### SSL
- **SSL Certificate:** Select one of the options; if you are not sure, pick “Request a new SSL Certificate”
- **Force SSL:** yes
- **HTTP/2 Support:** yes
Then, click “Save” and “Apply Changes”.
</TabItem>
</Tabs>
## Caddy (v2)
Create a Caddyfile with the following content:
```caddyfile
seerr.example.com {
reverse_proxy http://127.0.0.1:5055
}
```
Deploy the Caddyfile by running:
```bash
sudo caddy run --config /path/to/Caddyfile
```
Verify by visiting https://seerr.example.com in your browser.
:::note
Caddy will automatically obtain and renew SSL certificates for your domain.
:::
## Traefik (v2)
Add the following labels to the Seerr service in your `compose.yaml` file:
```yaml
labels:
- 'traefik.enable=true'
## HTTP Routers
- 'traefik.http.routers.seerr-rtr.entrypoints=https'
- 'traefik.http.routers.seerr-rtr.rule=Host(`seerr.domain.com`)'
- 'traefik.http.routers.seerr-rtr.tls=true'
## HTTP Services
- 'traefik.http.routers.seerr-rtr.service=seerr-svc'
- 'traefik.http.services.seerr-svc.loadbalancer.server.port=5055'
```
For more information, please refer to the [Traefik documentation](https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/).
## Apache2 HTTP Server
<Tabs groupId="apache2-reverse-proxy" queryString>
<TabItem value="subdomain" label="Subdomain">
Add the following Location block to your existing Server configuration.
```apache
# Seerr
ProxyPreserveHost On
ProxyPass / http://localhost:5055 retry=0 connectiontimeout=5 timeout=30 keepalive=on
ProxyPassReverse http://localhost:5055 /
RequestHeader set Connection ""
```
</TabItem>
<TabItem value="subfolder" label="Subfolder">
:::warning
This Apache2 subfolder reverse proxy is an unsupported workaround, and only provided as an example. The filters may stop working when Seerr is updated.
If you encounter any issues with Seerr while using this workaround, we may ask you to try to reproduce the problem without the Apache2 proxy.
:::
Add the following Location block to your existing Server configuration.
```apache
# Seerr
# We will use "/seerr" as subfolder
# You can replace it with any that you like
<Location /seerr>
ProxyPreserveHost On
ProxyPass http://localhost:5055 retry=0 connectiontimeout=5 timeout=30 keepalive=on
ProxyPassReverse http://localhost:5055
RequestHeader set Connection ""
# Header update, to support subfolder
# Please Replace "FQDN" with your domain
Header edit location ^/login https://FQDN/seerr/login
Header edit location ^/setup https://FQDN/seerr/setup
AddOutputFilterByType INFLATE;SUBSTITUTE text/html application/javascript application/json
SubstituteMaxLineLength 2000K
# This is HTML and JS update
# Please update "/seerr" if needed
Substitute "s|href=\"|href=\"/seerr|inq"
Substitute "s|src=\"|src=\"/seerr|inq"
Substitute "s|/api/|/seerr/api/|inq"
Substitute "s|\"/_next/|\"/seerr/_next/|inq"
# This is JSON update
Substitute "s|\"/avatarproxy/|\"/seerr/avatarproxy/|inq"
</Location>
```
</TabItem>
</Tabs>
## HAProxy (v3)
:::warning
This is a third-party documentation maintained by the community. We can't provide support for this setup and are unable to test it.
:::
Add the following frontend and backend configurations for your seerr instance:
```haproxy
frontend seerr-frontend
bind 0.0.0.0:80
bind 0.0.0.0:443 ssl crt /etc/ssl/private/seerr.example.com.pem
mode http
log global
option httplog
option http-keep-alive
http-request set-header X-Real-IP %[src]
option forwardfor
acl seerr hdr(host) -i seerr.example.com
redirect scheme https code 301 if !{ ssl_fc }
use_backend seerr-backend if seerr
backend seerr-backend
mode http
log global
option httplog
http-response set-header Strict-Transport-Security max-age=15552000
option httpchk GET /api/v1/status
timeout connect 30000
timeout server 30000
retries 3
server seerr 127.0.0.1:5055 check inter 1000
```