Managing FastAPI Projects with Poetry: A Step-by-Step Guide

Image
This guide will walk you through how to use Poetry to manage dependencies and structure your project in FastAPI . It includes detailed explanations of Poetry's core concepts and commands to help prevent issues that can arise during team collaboration and deployment. 1. What is Poetry? Poetry is a dependency management and packaging tool for Python. It goes beyond simply installing libraries by allowing you to clearly declare the dependencies your project needs and ensuring that all developers on the project have the same library versions. Clarity in Dependency Management : Explicitly manage your project's basic information and required libraries through the pyproject.toml file. Reproducible Builds : By locking all dependency versions in the poetry.lock file, it fundamentally prevents "it works on my machine" problems. Integrated Development Environment : It automatically creates and manages isolated virtual environments for each project and handles mo...

From Audio Station to Plex Media Server, A Complete Guide for the Synology DS916+

For nearly ten years, my Synology DS916+ has been a trusty workhorse for file storage. When it came to music, I relied on Synology's own Audio Station. But the experience was never quite right. The UI felt dated, and the constant need to re-enter my OTP password after it expired was a pretty annoyance.

I'd heard great things about Plex, specifically that even the free version was a massive improvement. I decided it was time to make the switch.

In this blog post, I'll walk you through the exact steps I took to install and configure Plex Media Server on my Synology DS916+.

Step 1: Installing the Plex Media Server Package

You have two main options for installing Plex. While using the Synology Package Center is simple, I strongly recommend downloading the package directly from the Plex website to ensure you have the latest features and bug fixes.

Option 1: The Package Center (Easy, but may be outdated)

  • You can find Plex in the Synology DSM Package Center under the "All Packages" section. It's a simple one-click install, but it often lags behind the latest official release.

Option 2: The Official Plex Website (Recommended for the latest version)

  1. Go to the official Plex Media Server downloads page.
  2. Select Plex Media Server, then choose Synology from the platform list.
  3. Choose your architecture: The DS916+ uses an Intel CPU, so select Intel 64-bit (x86_64). Download the latest .spk file to your computer.
  4. In the Synology DSM, open the Package Center and click the Manual Install button in the top-right corner.
  5. Upload the .spk file you just downloaded to complete the installation.
plex media server download

Step 2: Granting Plex Access to Your Media Folders (Crucial Step!)

Before Plex can find your movies and music, you must give it permission to read the folders where they are stored. Do not skip this step, or your library scans will fail.

  1. In the Synology DSM, go to Control Panel > Shared Folder.
  2. Select your media folder (e.g., music) and click the Edit button.
  3. Go to the Permissions tab. In the dropdown menu, change from "Local users" to Internal system user.
  4. Find the Plex Media Server user (the name may vary slightly) in the list and grant it Read/Write access.
  5. Click Save to apply the new permissions. Repeat this process for any other media folders (e.g., movies, tv-shows).
[Key Point] Without these permissions, Plex won't be able to scan your files or save metadata like album art and movie posters.
synology nas plex media server permission setup

Step 3: The Initial Plex Server Setup

With the installation and permissions handled, it's time for the fun part.

1. Launch and Connect to Plex

  1. Open Plex Media Server from the Synology main menu. A new browser tab should open automatically for the setup process. If it doesn't, you can access it manually by going to http://[YOUR_NAS_IP_ADDRESS]:32400/web.
The Most Common Mistake!
My first instinct was to use my DDNS address (e.g., http://mynas.i234.me:32400/web). This will not work for the initial setup. It causes a critical issue where Plex cannot find the local disk drives on the NAS. You must use the local IP address of your NAS (e.g., http://192.168.1.10:32400/web) for the first-time configuration.

2. The Setup Wizard

  • Sign In: Follow the on-screen prompts to sign in with your Plex account or create a new one.
  • Name Your Server: Give your server a friendly name. I recommend keeping the "Allow me to access my media outside my home" box checked for remote streaming.
  • Add Libraries:
    • Click the Add Library button.
    • Select the library type (Music, Movies, TV Shows, etc.) and give it a name.
    • Click Browse For Media Folder and navigate to the folder on your NAS where you granted permissions in Step 2 (e.g., /volume1/music).
    • Click Add Library. Plex will begin scanning your files, downloading metadata, and organizing everything into a beautiful, user-friendly interface.

Step 4: Reverse Proxy Setup (for Custom Domain Access)

Prerequisites:

You must have a DDNS address and a valid SSL certificate for that address configured on your Synology NAS.

1. Fill out the Source and Destination fields as follows:

Move to reverse proxy setup menu: Control Panel > Login Portal > Advanced > Reverse Proxy > Create > General > Source & Destination > Save

Source (How you'll connect from the outside)

  • Protocol: HTTPS
  • Hostname: plex.yourdomain.com (Enter your custom domain here)
  • Port: 443 (The standard port for HTTPS)
  • It's recommended to check the boxes for Enable HSTS and Enable HTTP/2 for better security and performance.
Destination (Your internal Plex server)
  • Protocol: HTTP
  • Hostname: localhost (This refers to the NAS itself)
  • Port: 32400 (The internal port for Plex)
reverse proxy for plex media server


2. (Recommended) Update Plex Network Settings

To ensure Plex's remote access features work seamlessly with your new custom domain, you should tell Plex about it.

  • Open your Plex web app and go to Settings (the wrench icon in the top-right).
  • From the left-hand menu, select Network.
  • Find the field named Custom server access URLs and enter the full address you just set up: https://plex.yourdomain.com
  • Scroll down and click Save Changes.


Comments

Popular posts from this blog

Resolving Key Exchange Failure When Connecting with SecureCRT to OpenSSH

SecureCRT] How to Back Up and Restore SecureCRT Settings on Windows

How to Set Up Vaultwarden (Bitwarden) on Synology NAS (Best Free Alternative to LastPass)