Platform config templates & Postgres migration recovery
- Added Linux/Windows startup config templates and README - Updated default paths to FHS-compliant locations - Improved publish profiles for platform targeting - Enhanced Postgres migration: auto-recover on 42P07 errors - Added RecordMigrationAsAppliedAsync for manual migration history - Improved migration logging and error handling - Added detailed documentation for config and migration fixes
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
# Jellyfin Startup Configuration
|
||||
|
||||
This directory contains startup configuration templates for Jellyfin Server.
|
||||
|
||||
## Configuration Files
|
||||
|
||||
- **`startup.default.json`** - Default configuration (Linux paths)
|
||||
- **`startup.linux.json`** - Linux-specific configuration template
|
||||
- **`startup.windows.json`** - Windows-specific configuration template
|
||||
|
||||
## Usage
|
||||
|
||||
### Linux Systems
|
||||
|
||||
The default configuration uses Linux paths (`/var/lib/jellyfin`). To customize:
|
||||
|
||||
1. Copy `startup.linux.json` to `startup.json` in your Jellyfin installation directory
|
||||
2. Edit the paths as needed
|
||||
3. Restart Jellyfin
|
||||
|
||||
```bash
|
||||
cp startup.linux.json /path/to/jellyfin/startup.json
|
||||
```
|
||||
|
||||
### Windows Systems
|
||||
|
||||
For Windows, use the Windows-specific configuration:
|
||||
|
||||
1. Copy `startup.windows.json` to `startup.json` in your Jellyfin installation directory
|
||||
2. Edit the paths as needed (default: `C:/ProgramData/jellyfin`)
|
||||
3. Restart Jellyfin
|
||||
|
||||
```powershell
|
||||
Copy-Item startup.windows.json C:\Path\To\Jellyfin\startup.json
|
||||
```
|
||||
|
||||
## Configuration Priority
|
||||
|
||||
Jellyfin resolves paths in this order (highest priority first):
|
||||
|
||||
1. **Command-line arguments** (`-d`, `-c`, `-l`, etc.)
|
||||
2. **Environment variables** (`JELLYFIN_DATA_DIR`, `JELLYFIN_CONFIG_DIR`, etc.)
|
||||
3. **`startup.json`** file (user's custom configuration)
|
||||
4. **Built-in defaults** (OS-specific)
|
||||
|
||||
## Path Descriptions
|
||||
|
||||
| Path | Purpose |
|
||||
|------|---------|
|
||||
| `DataDir` | Database files, metadata, and media library information |
|
||||
| `ConfigDir` | User settings, configuration files, and user-specific data |
|
||||
| `CacheDir` | Cached images, thumbnails, and temporary processing files |
|
||||
| `LogDir` | Application log files |
|
||||
| `TempDir` | Temporary files during transcoding and processing |
|
||||
| `WebDir` | Web UI assets (jellyfin-web) |
|
||||
|
||||
## Platform-Specific Defaults
|
||||
|
||||
### Linux (Default)
|
||||
All paths use `/var/lib/jellyfin` for system-wide installation.
|
||||
|
||||
For user-specific installations, consider using:
|
||||
- Data: `~/.local/share/jellyfin`
|
||||
- Config: `~/.config/jellyfin`
|
||||
- Cache: `~/.cache/jellyfin`
|
||||
|
||||
### Windows
|
||||
All paths use `C:/ProgramData/jellyfin` for system-wide installation.
|
||||
|
||||
For user-specific installations, paths will default to:
|
||||
- `%LOCALAPPDATA%\jellyfin`
|
||||
|
||||
### macOS
|
||||
Jellyfin will automatically use appropriate macOS directories:
|
||||
- Data: `~/Library/Application Support/jellyfin`
|
||||
- Config: `~/Library/Application Support/jellyfin/config`
|
||||
- Cache: `~/Library/Caches/jellyfin`
|
||||
|
||||
## Example: Custom Configuration
|
||||
|
||||
Create `startup.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"Paths": {
|
||||
"DataDir": "/mnt/storage/jellyfin/data",
|
||||
"ConfigDir": "/etc/jellyfin",
|
||||
"CacheDir": "/var/cache/jellyfin",
|
||||
"LogDir": "/var/log/jellyfin",
|
||||
"TempDir": "/tmp/jellyfin",
|
||||
"WebDir": "/usr/share/jellyfin/web"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
You can also set paths via environment variables:
|
||||
|
||||
```bash
|
||||
export JELLYFIN_DATA_DIR=/mnt/storage/jellyfin
|
||||
export JELLYFIN_CONFIG_DIR=/etc/jellyfin
|
||||
export JELLYFIN_CACHE_DIR=/var/cache/jellyfin
|
||||
export JELLYFIN_LOG_DIR=/var/log/jellyfin
|
||||
export JELLYFIN_TEMP_DIR=/tmp/jellyfin
|
||||
export JELLYFIN_WEB_DIR=/usr/share/jellyfin/web
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Permissions
|
||||
|
||||
Ensure the Jellyfin user has read/write permissions to all configured paths:
|
||||
|
||||
```bash
|
||||
# Linux
|
||||
sudo chown -R jellyfin:jellyfin /var/lib/jellyfin
|
||||
sudo chmod -R 755 /var/lib/jellyfin
|
||||
```
|
||||
|
||||
```powershell
|
||||
# Windows - Run as Administrator
|
||||
icacls "C:\ProgramData\jellyfin" /grant "NETWORK SERVICE:(OI)(CI)F" /T
|
||||
```
|
||||
|
||||
### Verify Current Configuration
|
||||
|
||||
Check the Jellyfin logs on startup to see which paths are being used. The first few log entries will show the resolved paths.
|
||||
|
||||
## More Information
|
||||
|
||||
- [Jellyfin Documentation](https://jellyfin.org/docs/)
|
||||
- [Installation Guide](https://jellyfin.org/docs/general/installation/)
|
||||
@@ -1,10 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/jellyfin-startup",
|
||||
"// Comment": "Startup configuration defaults for Jellyfin Server",
|
||||
"// Note": "For Linux: Use /var/lib/jellyfin, For Windows: Use C:/ProgramData/jellyfin",
|
||||
"// Documentation": "These values are used when no command-line args or environment variables are set",
|
||||
"Paths": {
|
||||
"DataDir": null,
|
||||
"ConfigDir": null,
|
||||
"CacheDir": null,
|
||||
"LogDir": null,
|
||||
"TempDir": null,
|
||||
"WebDir": null
|
||||
"DataDir": "/var/lib/jellyfin",
|
||||
"ConfigDir": "/var/lib/jellyfin",
|
||||
"CacheDir": "/var/lib/jellyfin",
|
||||
"LogDir": "/var/lib/jellyfin",
|
||||
"TempDir": "/var/lib/jellyfin",
|
||||
"WebDir": "/var/lib/jellyfin"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/jellyfin-startup",
|
||||
"// Comment": "Linux-specific startup configuration for Jellyfin Server",
|
||||
"// Instructions": "Copy this file to 'startup.json' in the Jellyfin directory",
|
||||
"// Documentation": "These paths follow Linux FHS (Filesystem Hierarchy Standard)",
|
||||
"Paths": {
|
||||
"DataDir": "/var/lib/jellyfin",
|
||||
"ConfigDir": "/var/lib/jellyfin",
|
||||
"CacheDir": "/var/lib/jellyfin",
|
||||
"LogDir": "/var/lib/jellyfin",
|
||||
"TempDir": "/var/lib/jellyfin",
|
||||
"WebDir": "/var/lib/jellyfin"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/jellyfin-startup",
|
||||
"// Comment": "Windows-specific startup configuration for Jellyfin Server",
|
||||
"// Instructions": "Copy this file to 'startup.json' in the Jellyfin directory",
|
||||
"// Documentation": "These paths are optimized for Windows installations",
|
||||
"Paths": {
|
||||
"DataDir": "C:/ProgramData/jellyfin",
|
||||
"ConfigDir": "C:/ProgramData/jellyfin",
|
||||
"CacheDir": "C:/ProgramData/jellyfin",
|
||||
"LogDir": "C:/ProgramData/jellyfin",
|
||||
"TempDir": "C:/ProgramData/jellyfin",
|
||||
"WebDir": "C:/ProgramData/jellyfin"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user