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.

NAVIDROME MOTD

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

Have fun!

  • non_burglar@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 hours ago

    I would have just baked an api call to navidrome in a shell script with an interpreter like js and some bash variable manipulation and called it directly from motd.

    For security, you may want to look at vault for secrets management so you don’t have to expose plaintext secrets in your script.

    • irmadlad@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 hours ago

      For security, you may want to look at vault for secrets management so you don’t have to expose plaintext secrets in your script.

      Yes, you are correct. For what I’ve got surrounding it as far as security wise, I feel fairly secure, not 100%, but more prudence would be much better. Would you have any recommendations maybe in which direction I could go in?

      I would have just baked an api call to navidrome in a shell script with an interpreter like js and some bash variable manipulation and called it directly from motd.

      Oh well, see now you’re just showing off. LOL I may do that at some later date. I actually had a good time doing what seems like a simple thing, and I learned a thing or three, so a good time was had all around.