this post was submitted on 26 Jun 2026
5 points (61.9% liked)

Selfhosted

60093 readers
553 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam.

  3. Posts here are to be centered around self-hosting. Please ensure it is clear in your post how it relates to self-hosting.

  4. Don't duplicate the full text of your blog or git here. Just post the link for folks to click.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require your active participation in selfhosting or related communities, or the post will be removed. No more than 10% of your posts or comments may be self-promotional, or your post will be removed. F/LOSS Exception: If your post is about a project that is completely open source & can be self-hosted in full without payment, and your account is at least 30 days old, your post is exempt from this rule as long as you continue to engage in comments.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

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!

top 7 comments
sorted by: hot top controversial new old
[–] nfms@lemmy.ml 2 points 7 hours ago (2 children)
[–] irmadlad@lemmy.world 2 points 4 hours ago* (last edited 4 hours ago)

Great question. The MOTD on Linux stands for “Message of the Day.” It’s a system text file that’s displayed when you log in usually over SSH or to a local terminal. It's generated and managed by the distro. It can include server info, warnings, or update notices. The MOTD file is typically / etc / motd or / etc / motd.d /. For instance, my example:

spoiler

There are messages about upgrading, and since I did an update yesterday morning, I need a system restart. The MOTD will tell you about updates, if you have any zombies running around your server all willy-nilly etc. Some people customize their MOTD as such:

spoiler

They can be simple or very involved.

spoiler

I'm sure there are more than likely others here who have custom MOTDs. There used to be a program called neofetch that would assist in this. I haven't played around with neofetch in quite a long time, it's probably been superceeded by something better or updated.

[–] PrinzKasper@feddit.org 1 points 7 hours ago

"Message of the day", basically a dynamic greeting

[–] non_burglar@lemmy.world 4 points 14 hours ago (1 children)

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.world 2 points 14 hours ago (1 children)

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.

[–] non_burglar@lemmy.world 2 points 10 hours ago* (last edited 9 hours ago) (1 children)

Well, it's not super difficult. I sort of mash my way through getting data by api by just using curl and then clumsily filtering the output.

You've already got the mechanism to get the data, I think your solution is fine. My way to do it is just a relic from my time working with a bunch of devs.

[–] irmadlad@lemmy.world 1 points 4 hours ago

Well, it’s not super difficult. I sort of mash my way through getting data by api by just using curl and then clumsily filtering the output.

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?