CasaOS – Upgrading Containers

Update: As of the latest iteration CasaOS has an option to “Check and then update.” However, when I ran it against PiHole, which needed an update, it came back claiming current. So… these instructions still stand for the moment.


As of the current iteration of CasaOS, there’s no way to one-click yourself an upgrade on a container. Or, rather, there is, but only sort of. It’s all about how the container installed initially.

To check, pull a config file from the container in question:

  1. Settings > choose Export ComposeFile
  2. Open the file in your text editor of choice and search for the image: line. If it says something like “latest” or “develop” you’re good to go:
  3. In this instance, all you need to do is click Save in CasaOS and the latest image will be pulled down and installed. But wait! Keep reading before you do so! If nothing else, jump down to step 7.
  4. If the image has a hard coded version number, you’re going to need to change it to “latest” and save the YAML (as a different name, or take note of the version number, just in case you find you need to revert):
  5. In the event you’ve had to  update your compose file, now comes the sweaty bit. You need to uninstall the app from CasaOS. If you’ve mapped all your data volumes correctly, this should be fine. Just remember to uncheck Delete userdata when prompted:
  6. Once uninstalled, reinstall the app:
    1. Select App Store, then Custom Install
    2. Select the Import icon on the top right and select your YAML file.
    3. All the settings will be loaded in – confirm them and let ‘er rip.
  7. Now, if you’re making a big upgrade, or an upgrade to a big app, things can get pinchy here for a bit. For instance, I upgraded Navidrome, my music server, and CasaOS barfed a message at me saying something akin to the container being unwell. I run PiHole in the same CasaOS instance, and I noticed that my browsing/DNS resolving had become profoundly slow. CasaOS’s nifty little stats didn’t show anything exciting insofar as resource utilization, but the CasaOS page was also profoundly slow and sluggish. I pulled up the terminal for Navidrome and discovered this:
  8. Now, I have a lot of music. A LOT. So I SSH’ed into my device running CasaOS and navigated to the data directory for Navidrome to discover this:
  9. Navidrome was indeed hard at work upgrading its ridiculously large database – as I refreshed I the timestamp on the db-wal file would continue to iterate.
  10. Eventually the database upgrade finished, Navidrome loaded, and the container was healthy and upgraded.

The moral of the story is, be patient! Don’t freak out if CasaOS delivers some kind of ominous warning – dig deeper before doing  something drastic, like killing a running container in the midst of upgrading a critical database. I suppose you could be double safe by making a backup of your apps data directories before attempting an upgrade. I live on the edge. I recommend going through all your containers and updating all of the ones using hard-coded versions with something like ‘latest.’

Jellyfin – Migrating Users

I’m moving from a Windows based instance of Jellyfin to a containerized instance within CasaOS, and I wanted to preserve user data (including view history). Here’s how I did it:

  • Confirm both your source and destination Jellyfin are the same version
  • Export the UserDatas table from library.db for your source instance. You can use DB Browser for SQLite to achieve this – remember to check “Column names in first line”
  • On your destination server, make a backup of library.db and jellyfin.db
  • Again using DB Browser, open the library.db of your destination server. Drop the UserDatas table and import csv created in the prior step to recreate the table (remember to check that the first line contains the column names)
  • Copy jellyfin.db from your source server and overwrite the db from the destination with it. This is important, as this file contains user history data
  • Fire your new Jellyfin instance up and attempt to log in with an existing user

 

Music

In the late 80s teenage me became enamored with industrial and electronic music – very young genres at the time. I had been listening to punk and metal and, thanks to Fishbone, had discovered funk and soul and ska, but it was my part time job at a record store that sucked me into electronic and industrial. Every week I’d dig through the promo cassettes we’d receive and take home a few, chosen solely for their album covers or titles. This is how I discovered acts like Ministry, Consolidated, Die Warzau, PWEI, Nine Inch Nails and especially Meat Beat Manifesto.

A roommate and I started cobbling together used equipment (usually purchased on layaway from the dearly departed Galaxy Music on Stone Mountain Hwy) and learning Twelve Tone’s Cakewalk sequencer – first on DOS, and then Windows 3.1. When my roommate and I parted ways, I bought out all this equipment – an ancient PC, a Roland Juno 2, two Ensoniq Mirage’s (one rackmount, one full keyboard), a Yamaha drum machine I mostly repurposed as a sample triggerer, and all the requisite cabling and MIDI garbage to tie it all together. Armed with this stuff, and an old Yamaha bass, Gibson Flying V, and a no-name acoustic, I would stay up late at night after work and create weird, kind of unclassifiable songs. By 1993 I had enough ‘finished’ material to make an album… so I did. I spent forever trying (and mostly failing) to master these tracks and tie them together. I designed an album cover, and burned exactly one CD, which I shared with no one.

I’ve held onto that CD ever since. I dug it out a few years ago to listen to privately and then – with some trepidation – shared it with my son, who was developing his own musical taste and dabbling in trying to create songs. “This is you!? How old is this? How did you do this back then?”

Listening to it over 30 years later… it’s not bad. In fact, it was kind of ahead of its time, or at least in line with what was considered cutting edge in burgeoning electronic music scene at the time I was making it. It sounds dated, but it’s also fascinating to consider that this stuff wasn’t made with a modern DAW – the samples were recorded onto 3.5 inch floppies, painstakingly manipulated and altered, mostly triggered ‘live,’ and sequenced with Cakewalk, which had only MIDI capability at the time. Many of the samples were me playing, either live or converted from an ancient 4-track cassette recorder. Making this stuff now would be easy. Back then it was insanely time consuming and complex. Much of the grit and grime and audio imperfection and degradation comes from this old process, but I kind of think it sounds better because of this. It somehow sounds more organic and lived-in than the sterile electronic music of today.

The 20 year old me was too insecure to share this stuff with anyone. I wonder what could have happened if I hadn’t lacked the confidence to put myself out there all those years ago. But that wasn’t me. I didn’t share. I quit bands as soon as I felt out of my comfort zone. I still have boxes of old 4-track tapes I haven’t listened to in 35 years – many with musical collaborators who are now dead and gone (including the aforementioned roommate) – 3 ring binders filled with art that no one’s ever seen.

But now I’m old, and we’re in a world so flooded with music and media that putting this out there is like dropping a grain of sand on a beach. My kid didn’t recoil upon hearing it so I figured, what the hell.

https://share.amuse.io/album/josefek-josefek

 

CasaOS and LinkDing

Giving LinkDing a whirl. It isn’t featured in any of the stores I’ve found, so I rolled my own. Here’s a sample YAML:

Once it’s up, hit the terminal and create a user with:

From there it will prompt for a password.

Persistent Windows SMB mount in Raspbian via CIFS

I’m using Navidrome in CasaOS on a Pi for music right now and I like it quite a bit. The one thing irking me was that the network storage mounts you can define within CasaOS (Files > Location > Connect network storage) don’t persist. At least they don’t for me – every reboot or update and they’re gone.

I’ve gotten around this by creating a persistent mount within Raspbian utilizing CIFS.

SSH into your Pi, and go ahead and

to avoid having to sudo every line you input. First, make sure cifs-utils are installed (they should be, but still):

Now create a credentials file for your mount to access using nano:

Populate the credfile with the credentials necessary to access your Windows share:

Save it, then set the appropriate permissions to keep it safe from prying eyes:

Create a mount directory on your Pi to link the share to:

Now open fstab:

Add your mount to the bottom of the file, changing the first path to the Windows share and the second to the mount path you created previously:

Finally, reload the daemon:

And mount the share using the details you defined in fstab:

To confirm, cd to the share and confirm you can see the contents.

Leaving YouTube, or What’s Happening to The Intertoobs

Watching the MatPat leaving YouTube video is an interesting thing. The constant repositioning from “I’m going to miss how personal this is and my connection with all of you” to “we’ve achieved penetration in four verticals on YouTube” creates a dissonance that I can’t unsee.

The internet, in its infancy, was supposed to set us free. It was supposed to put information at our fingertips, make life easier, make us more efficient, more capable, happier. People started websites, created and joined listservs, got involved in usenet, and eventually posted to YouTube and streamed on various platforms because they had an interest, a passion, and they wanted to share. Personally, I created my own sites on various topics and inherited and hosted a listserv dedicated to an obscure band for many years just because I wanted to engage with other people who shared my interests, and I wanted to contribute something.

But once capitalism got over its initial trepidation of the internet and began to get its arms around it, everything changed. We moved rapidly into the web being one giant shopping mall. From there it evolved into us, the users, being the product, our data collected in a million ways. And I thought that was bad – the digital us being bought and sold and harvested – but the worst was yet to come, because its next evolution was to convince us to cut out the middlemen and become our own pimps. And so we do – hustling ourselves. Hustling for money. Hustling for clout. Hustling for virtue. Hustling for imaginary internet points.

We were no longer posting because we wanted to share or contribute – We were posting strictly for some kind of digital or material gain. Now platforms are filled with fakers. Skaters who fake skating. Singers who fake singing. Mechanics who don’t really repair. Craftsmen who can’t really build anything. Rugged outdoorsfolks who lie about the comfortable home they go to once the cameras are off. Musclebound fitness gurus slap full of tren and lying about it, hawking pills and powders filled with sawdust and broken dreams.

We’re all doing it on some scale. Social media is awash with people constantly signaling goodness and virtue they don’t exhibit with their actions in meatspace. We’ve replaced judging people for their actions with judging them for their proclamations. When someone posts a profound position, no one asks them what they’re actually doing in real life to support that position – they just celebrate the words and reply “Oh, me too! I’m a good person too!” In the meantime everything in Actual Reality gets worse, and no one seems to understand why. They’re all saying the right things, after all. They’re posting the black squares. They’re encircling their profile pictures with the correct slogans. They’re shit-talking all the right people. Perhaps if we all just post a little bit harder…

And The Hustle has now bled into reality. What are YOU doing that can be monetized? Why are you wasting your time doing things you like for free? Have you considered dropshipping, or trying to create viral videos? Don’t write a whole song – you only need about 40 seconds for a TikTok. Why would you spend any time painting a picture you can’t sell, or playing a video game you’re not streaming and providing color commentary over? You know if you don’t hustle you’re going to get left behind right? I can’t believe you haven’t started a SubStack yet. What are you waiting for?

I’m reminded of the time before the last housing crash, when capitalism was all-in on convincing us that the path to happiness was accumulation. Sad? You don’t have enough stuff! You need a McMansion, a couple of gigantic SUVs, a television the size of a mini-theater in every room! Not only will gross accumulation make you happy, it’ll signal to everyone else just how successful you are! Except we know now, in hindsight, after millions of people had to walk away from mortgages and car notes and into bankruptcy, just how big a lie that was. No matter – the folks who pushed it profited, and that’s what mattered.

Those of us who were early adopters of and involved in the development of the internet thought it would help free the world, and though it sounds naive now you can’t blame us for thinking so. For awhile there it was a wild, untamed, magical place. Those days are long gone and now, rather than free us, the internet has introduced new, even heavier chains.

I’m not in MatPat’s head, so I wonder what it’s like. He’s an internet success story. His net worth is currently estimated at $30 million, and he’s not even 40 years old. So why leave YouTube? And why cry about it? Per the parameters of the rest of the folks hustling online, MatPat is a indisputable Winner. He achieved all they desperately strive for and more. But I’m reminded of musicians of old who would make it big and subsequently become miserable. The music made them rich. It made them famous. But they didn’t become musicians to be rich and famous – they became musicians because they had something they wanted to share. Once that passion became a job it was no longer about sharing. It was about numbers, bottom lines, “verticals.” The joy of making music replaced with the drudgery of making product. And this is what the internet is now doing to our lives, all of us. We all spend all of our online time marketing ourselves in one way or another. Empty, shallow, ultimately meaningless marketing. But humans aren’t mere products, and forcing ourselves to be so makes us miserable, even when it’s working.

I don’t have an answer. I wish I did. My joke about this, as about so many things, is that I really, really need to get to work on that time machine.

Navidrome, Clients and the Compilation MP3 Tag

As I outlined in a previous post, I switched from Jellyfin to Navidrome for my music. While on the whole I’m happy with the change, I discovered that Navidrome handles Various Artists albums such that if the Compilation tag isn’t set, it indexes the album from one into as many as there are artists. And, as outlined in the aforementioned post, this is not a bug, but by design. The intent is to account for different artists with the same album name, and that makes sense.

So I set out to attempt to automate the modification of the Compilation tag – a quest that turned out to be more complicated than I anticipated. The Compilation tag is apparently not a ‘standard’ tag. If you load up an mp3 in taglibsharp and have it vomit out all the tags, the Compilation tag won’t be among them. Here, try it yourself in PowerShell. You’ll have to update the path to your taglibsharp.dll and your test mp3 file.

Here’s an example output:

As you can see, no Compilation tag there. Compilation is technically an iTunes Flag Text Frame, and is set with a Boolean value (1 for Yup, 0 for Nope). It’s defined as TCMP. As of this writing id3.org is down, but here’s the archived page on this tag.

Given all this, I threw together the below. As per usual it’s unrefined, has almost zero error handling, and will be something I improve upon over time. This thing assumes your compilation albums are in directories formatted as “Various – Name of Album.”

Bonus: If you, like me, discovered you have a whole mess of compilation albums in directories with the format “VA – Album Title” instead of “Various – Album Title,” This one liner will help correct that.

Navidrome, Clients and Albums With Varying Artist Tags

I’m using Navidrome as my music server now, having switched from shoehorning Jellyfin into that role, and I quite like it. One thing I discovered, however, is that it – and quite a few clients that support it – rely on the Album Artist tag to help index files. Initially I found this problematic because many of my files didn’t have Album Artist populated. I solved this by writing a PowerShell script to copy the Perfomers tag data (Performers = Artist) to the Album Artist tag. I’ll share that in another post.

But then I discovered a different problem. If an album is a compilation or has variance in the artists from file to file (for example: This Guy feat. That Other Guy), it’d index files into separate albums of the same title. Navidrome’s developers confirmed that this is a feature, not a bug, and it makes sense. The solution for compilation albums is to set the Compilation tag to 1, which I haven’t automated yet but will shortly. The solution for non-comp albums is to make sure the Album Artists tag is consistent.

To accomplish this, I threw together the below script. It’s not optimized, it doesn’t have error handling or confirmation, and it’s apt to be destructive if you’re not careful. Still, it’s something you can build on, just as I inevitably will. As with all my music file related scripts, it requires taglib-sharp.dll. Obtain this file from TagLibSharp. You don’t have to futz with nuget or anything – just download the zipped package, yank the dll out of it, and put it in a subdir you’ll reference in the script.

This script will prompt for the full path to the files you wish to update, and then the name you wish to update the Album Artist tag to.

Calibre Web in a Container, and Credentials

My Calibre Web installed via container in CasaOS decided to lose its admin account creds. To reset, access the container terminal from within CasaOS, navigate to:

and enter:

Where password is your updated passy. If you try to use ‘password’ you’ll probably be kicked back for it not meeting complexity requirements.

Cron for Dynamic DNS Updating

I use my commercial host, Ionos, for websites, including creating subdomains for ones I’m hosting at home. However, I don’t pay for a static ip. I was using a Windows Scheduled Task to curl the necessary URLs to keep the IP updated, but I’m switching everything I can over to Linux, and a Pi.

Start by creating your .sh file and making it executable. I created dnsupdate.sh in my home dir on my Pi, and populated it with my curl calls. I did this via Nano. Then make it executable:

Then I fired up cron by entering:

It’s going to ask you for an editor on first use. I say, stick with Nano.

After this it will present you with a crontab file. Scroll to the bottom and enter:

This will run your sh file every hour at the top of the hour.

Save the file.

If you want to see what’s up with Cron, enter:

If it’s running, it’ll show you the files – your sh file – in use by cron.