8f860a8ec3
- All DLLs now output to lib\[Configuration]\[TargetFramework]\ at repo root (see Directory.Build.props) - .gitignore updated to exclude /lib/ - On first run, startup.json is auto-generated with OS-appropriate default paths (Windows, Linux, macOS, or portable) - Removes null/example config; generated config is immediately usable and clearly documented - Extensive new documentation: build output, startup.json logic, visual guides, and code proofs - Publish profile now deletes existing files for clean deploys - No breaking changes: existing startup.json files are preserved - Improves first-run UX, deployment, and cross-platform consistency
4.6 KiB
4.6 KiB
Git Commit: OS-Specific startup.json Generation
Summary
Implement automatic generation of OS-specific default paths in startup.json instead of null values.
Files Modified
Jellyfin.Server/Helpers/StartupHelpers.cs
Method: CreateDefaultStartupConfiguration()
Changes:
- Added OS detection using
OperatingSystem.IsWindows(),IsLinux(),IsMacOS() - Generate platform-appropriate default paths
- Removed confusing "Examples" section with null values
- Added clear comments explaining the configuration
- Improved console output to show which OS defaults were used
Implementation Details
Platform Detection Logic
if (OperatingSystem.IsWindows())
{
// Windows: C:/ProgramData/jellyfin
}
else if (OperatingSystem.IsLinux())
{
// Linux: FHS-compliant paths
}
else if (OperatingSystem.IsMacOS())
{
// macOS: User Library paths
}
else
{
// Portable: Relative paths
}
Generated Paths
| Platform | DataDir | ConfigDir | CacheDir | LogDir |
|---|---|---|---|---|
| Windows | C:/ProgramData/jellyfin |
C:/ProgramData/jellyfin |
C:/ProgramData/jellyfin/cache |
C:/ProgramData/jellyfin/log |
| Linux | /var/lib/jellyfin |
/etc/jellyfin |
/var/cache/jellyfin |
/var/log/jellyfin |
| macOS | ~/Library/Application Support/jellyfin |
~/Library/Application Support/jellyfin/config |
~/Library/Caches/jellyfin |
~/Library/Logs/jellyfin |
| Portable | ./data |
./config |
./cache |
./logs |
Benefits
- Immediate Usability - No configuration required for first run
- Platform Standards - Follows OS conventions (FHS for Linux, ProgramData for Windows)
- Better UX - Users don't need to research correct paths
- Clear Documentation - Generated file includes helpful comments
- Still Customizable - Users can edit paths if needed
- Backward Compatible - Existing
startup.jsonfiles are not affected
Testing
Build Status
✅ Solution builds successfully
Test Scenarios
- Fresh Install (Windows) - Creates
startup.jsonwithC:/ProgramData/jellyfinpaths - Fresh Install (Linux) - Creates
startup.jsonwith FHS paths - Existing Config - Does not overwrite existing
startup.json - Custom Paths - User edits are preserved
Related Changes
This builds upon previous work:
STARTUP_CONFIG_UPDATE.md- Updatedstartup.default.jsonwith Linux defaults- Created
startup.linux.jsonandstartup.windows.jsontemplates in Resources/Configuration
Documentation
Created:
OS_SPECIFIC_STARTUP_CONFIG.md- Complete documentation of featureSTARTUP_CONFIG_COMPARISON.md- Before/after comparison
Console Output
Before
Created default startup configuration at: ./startup.json
You can customize this file to set default paths for Jellyfin.
After (Windows Example)
Created default startup configuration at: E:\Jellyfin\startup.json
Using Windows defaults - using C:/ProgramData/jellyfin
You can customize this file to set different paths for Jellyfin.
Commit Message
feat: Generate OS-specific defaults in startup.json
Instead of creating startup.json with null values, automatically populate
with platform-appropriate default paths:
- Windows: C:/ProgramData/jellyfin
- Linux: FHS-compliant paths (/var/lib, /etc, /var/log)
- macOS: User Library paths
- Unknown/Portable: Relative paths
Benefits:
- Immediate usability without manual configuration
- Follows platform conventions and standards
- Improved user experience for first-time setup
- Clear documentation in generated file
- Still fully customizable
Changes:
- Enhanced CreateDefaultStartupConfiguration() in StartupHelpers.cs
- Added OS detection logic
- Improved console output messages
- Added comprehensive documentation
Fixes: User confusion about what values to use
Closes: Issue with null values in startup.json
Git Commands
# Add changes
git add Jellyfin.Server/Helpers/StartupHelpers.cs
git add OS_SPECIFIC_STARTUP_CONFIG.md
git add STARTUP_CONFIG_COMPARISON.md
# Commit
git commit -m "feat: Generate OS-specific defaults in startup.json
Instead of null values, populate with platform-appropriate defaults.
See OS_SPECIFIC_STARTUP_CONFIG.md for details."
# Push
git push origin pgsql_testing_branch
Breaking Changes
None - This is a backward-compatible change. Existing startup.json files are not modified.
Future Work
- Add validation to check if paths are writable
- Add interactive path selection wizard
- Add migration tool for moving data between paths
Status: ✅ Ready to commit
Breaking Changes: None
Documentation: Complete
Testing: Build successful