/MM-PNS

Raspberry Pi NAS config that also streams music.

Primary LanguageShell

https://github.com/deloachcd/img/blob/master/MM-PNS-logo.png?raw=true

My Musical P-NAS (MM-PNS)

My Musical P-NAS is my personal solution for hosting a NAS that also streams music on a Raspberry Pi. Setup is largely automated through Ansible, and services are deployed within a set of containers which can be easily spun up and down with docker-compose.

Requirements

  • A raspberry pi with reasonable specs running raspbian
  • A valid SSL cert for the HTTPS reverse proxied services
  • A working SSH connection to the raspberry pi with public key authentication
  • Ansible on the machine the provisioning playbooks will be run from, with the docker module

Feature Roadmap

  • [X] Automated firewall provisioning for public-facing web service, LAN-only samba and SSH services
  • [X] Automated provisioning of containerized Navidrome service
  • [X] Automated provisioning of containerized filebrowser service
  • [X] Automated provisioning of containerized samba service
  • [X] filebrowser and navidrome services behind reverse proxy with nginx
  • [X] convenience script that spins up services inside a tmux session on the server
  • [ ] filebrowser and navidrome services behind HTTPS reverse proxy with nginx

Setup

  • Ensure that you have Ansible installed with the docker module on the machine you’re going to run the automation from, and on your user’s $PATH. For example, for an install via pip:
    # pip installs user packages into ~/.local/bin on Linux, and ~/Library/Python/$version/bin on macOS
    python3 -m pip install --user ansible docker
    # 'which' should return the user-installed package location
    which ansible 
        
  • Create the config file for setting deployment variables with the included script:
    ./script/create-config.sh
        
  • Set the variables for the deployment in the newly created config/PNASfile
  • The SSL cert files need to be put in place for the nginx proxied services. You can place them as live.crt and live.key in nginx/ssl, or place them there as ${pnas_host}.crt and ${pnas_host}.key. (live.crt and live.key will be created as symlinks to these).
  • The services can now be provisioned on the remote server via the wrapper script:
    ./script/deploy.sh