AI DISCLAIMER: Yes I used AI in addition to a host of website resources to create this. If down voting ‘AI anything’ makes you feel better, then by all means do so.
PURPOSE:
- To display a ‘Song Of The Day’ in MOTD whenever I log in via SSH.
WHY:
- First, I wanted to see if I could actually pull it off. I’ve been tinkering around with basic Python and some bash scripting again, ever since my Weather Data deployment. So learning was a big part of this. Baby steps I’m sure, but progress nonetheless.
- Secondly, I have a pretty large physical collection of music that I have been accumulating for decades and converting out to flac. Sometimes I forget all the cool songs I might miss every once in a while. So, I figured this would be a cool way to remind myself.
POSSIBLE FUTURE UPDATES:
- Perhaps embedding the link to the Song Of The Day in the MOTD. I’m not sure if that is possible at this point.
Among the things I learned is that if your password to Navidrome has special characters such as $, then wrap the password in single quotes:
- NAVIDROME_PASSWORD=“your_password”
- NAVIDROME_PASSWORD=‘$your_pa$$word$’
ETA: Forgot the prerequisites. You must enable these variables in your Docker compose or through Portainer or similar:
- ND_REPORTREALPATH=true
- ND_ENABLESUBSONIC=true
I’m including a pdf for the instructions and script because I can’t seem to get Lemmy formatting to bend to my will. The link will take you to Mega.nz. If you are interested but Mega.nz is not allowed on your network, I can upload anywhere you want. Please scan the pdf before opening.
To the best of my knowledge, this will not cause your server to implode or explode. As with any code you find online, thoroughly examine it before deployment on a production server.

If anyone has a better way or other ideas, I’m willing to be schooled.
Have fun!


Just yanking your chain bro. But back to your admonishment about the vault. I’ve often wondered about it. We keep secrets in .env files etc. Of course, if a nefarious actor gained entrance to the server, at that point, would a vault help? Just spitballing. My security is pretty tight in my estimation. Some even have told me it’s overboard. However it has served me well over the years without incident, but it is something always in my mind. You’re a programmer, what would you recommend?
Hah! By trade, I’m a sysadmin, my daily is security reviews at the planning and governance level.
I spent a good 6 years working in a Dev shop, and I picked up a lot of habits there, learned a ton about rest APIs, etc.
Setting up a vault for secrets (Hashicorp’s vault is a popular one) might be a bit overkill for your needs in a homelab, but it’s a great way to inject some security into python, bash scripts, which I think is useful, because lots of us start with scripting and move from there.
The basic mechanism is you set up the vault, define pools, etc and then use a token request instead of putting the secret in the script itself. There are tons of examples for each language and mode, but i just use a vault command in the script, throw the output in a variable and that’s pretty much it.
Secrets management in Dev and devops work is really interesting, if you ask me. All the way from the IDE to prod, there are many ways to leak passwords, api tokens, paths no one should know, etc.
Edit: I hope you didn’t take the vault comment as an admonishment, I meant it to be an interesting suggestion.
Edit 2: sometimes I wish I could go back to more technical stuff, that’s pretty much my reason for doing homelab stuff.
I took it as a positive.