Skip to content

Instantly share code, notes, and snippets.

@sortedcord
Last active February 26, 2024 09:24
Show Gist options
  • Save sortedcord/6dcded2560e8fe264f62c6ddb939e73c to your computer and use it in GitHub Desktop.
Save sortedcord/6dcded2560e8fe264f62c6ddb939e73c to your computer and use it in GitHub Desktop.
Running Swing Music on TRUENAS Scale

Static Badge Static Badge

Setting Up Swing For Truenas Scale

This is a short and simple guide to setting up a Swing Instance on your Truenas (Scale) machine. Since there are no charts specifically for Swing, you would have to create a custom app and straight up the docker image.

1. Pulling the docker image

Be sure to first pull the image and then create a custom app as sometimes the web interface can land you with errors. Use the given docker image in the repo ghcr.io/swing-opensource/swingmusic with the latest channel.

image

2. Installing Custom App

Container Images

Set the docker image to the one that you pulled just before with the same tag and set the pull policy to Only pull image if not present on host

Container Entrypoint

Leave container commands empty and create 2 entries for Container Args:

  1. Port -p: This is the port that swing music will run on inside of the docker container. Note that this is not the same as the port of the webui that you will be accessing later on. This is the port on 0.0.0.0 that will later be binded to another port. Set it as the default -p 1970:1970
  2. Other Arguments: Also use --restart unless-stopped as well.

image

Port Forwarding

Here you would need to forward the port that you previously set for swing (1970). This will then be forwarded to the webui port which will be exposed to the LAN.

  1. Container Port: 1970
  2. Node Port: Set it as the web ui port you want swing to be at. Generally Truenas only allows port numbers greater than 9000.
  3. Protocol: It is recommended to leave this to TCP.

image

Storage

Here we would need to setup 2 Host Path Volumes. Since we didn't mount volumes in the docker arguments, swing would instead use /music and /config for music and configuration files respectively.

  1. /music: Set this to the dataset/location to where your music library is stored. Be sure to use the appropriate permissions. For the current version, you would probably be alright even if you do set this to readonly since swing currently does not have the ability to manipulate or edit your library files.
  2. /config: Be careful while chosing the path for this directory as you need to make sure that the applications group has the ability to write to the specific directory. If you keep running into trouble with ACLs, you can manually set the permisssions to 770 through the root user.

image

Portal Configuration

Since we would be using a web portal for this app we can check the "Enable WebUI portal" so we can directly open the app within the truenas app list, in case the ports have been messed up. In case you are using SSL for your containers, you can change the necessary ports to 443 and make required changes as they are pretty straightforward. Since I am only using HTTP, I would just need to set the port as 9069 as I had done in one of the previous image.

image

That's pretty much it for the setting up. In most cases this should work just fine. But in case you have some other issues you can check the post install section:

Post Installation Issues

Watchdog Error

Usually this error is seen on first run. You can ignore it and continue with the setup on swing app. Once it is done scanning through your library, restart the pod and it should work like normal.

In case, the error is there and you are not able to see any music files then its very likely the specific folder which you had set /music to does not allow reading by the applications group. If you resolve that then this should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment