68kMLA Classic Interface
This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.
| Click here to select a new forum. | | The Official Nubango Thread (Garden iTunes) | Posted by: Floofies on 2026-09-27 08:37:55
The Official Nubango User Support ThreadThis is the official support thread for Nubango / Garden iTunes users.
Technical support requests and other questions posted here will directly notify my email. Please feel free to reach out to me about Nubango!
Hey folks. I meant to post this here back in 2021 but things got wild for me offline. Now I'm back on the MLA, and it's time for some more Mac hacks.
How The Hack?!Back in June of 2021, the Macintosh Garden started hosting their very own iTunes internet radio server. Here's the story of how that happened!
Earlier in 2021, I set up my late father's G4 MDD with Tiger and upgraded the hell out of that thing, making it into one monster of a workstation. The only problem was that I couldn't get iTunes internet radio to work reliably, and eventually I noticed abnormalities beginning to develop in the behavior of the Apple/3Com Kerbango Tuning Service (KTS) API. It looked like something or someone was actively changing things on the server! I noticed that query strings which were fine for decades suddenly started returning valid but empty KTS XML data... and eventually some genres totally disappeared. I figured that it was either a careless developer, or a new cache/fill server which Apple added as part of their newer network infrastructure which failed to work properly with the old server.
I was watching one of the coolest features of old iTunes disappear and then stop functioning entirely. So I searched around to see if anyone had the same issues, or a solution... I came upon this thread on the Macintosh Garden and started a deep-dive investigation into how Apple's iTunes internet radio works. My first efforts involved packet inspection on the API calls to see what iTunes was doing, and then reproducing those calls via a web browser. Doing that was fun, I could probe Apple's KTS server and see first-hand what was going on. There was indeed a lot of data going missing, which was alarming to me, as I would have a harder time recreating the service without the original XML data.
Here's some details about how KTS works which I wrote about in Nubango's contributor guide:
First, we should understand the simple animal that is the original Kerbango Tuning Service (KTS); it was one of the first full-featured internet radio tuning systems available with one of the first internet-based radio appliances. there is no advanced technology inside. According to Wikipedia: "The "Kerbango Internet Radio" was intended to be the first stand-alone product that let users listen to Internet radio without a computer."
Apple acquired the rights to utilize Kerbango via 3Com, and at-present the same exact ancient KTS continues to operate on Apple's server. KTS works by pairing magic numbers with radio station genres. A central XML catalog file represents the mapping between numbers and genres, and the Nubango CGI script contains a similar string-map. The Apple KTS has changed implementation of such magic numbers several times, and different iTunes clients tend to use varying magic numbers, which both result in an empty/bad response from the Apple KTS.
Furthermore, a basic CRAM-MD5 challenge must be passed by iTunes if it communicates with the Apple KTS. The password/salt used in iTunes' MD5 hashing is unknown and there will be no attempt to obtain it, as it isn't necessary to implement Nubango. Nubango instead presents a fake CRAM-MD5 challenge by sending the string foobar as a challenge. By using this well-known exploit around CRAM-MD5 authentication, the end result is that we can trick iTunes into believing that it has initiated a KTS session successfully (and with almost zero effort).
Before I could make a good solution, I had to make some kind of proof of concept. So I gathered up a bunch of the remaining XML data to craft a half-assed, quick, and dirty hack. Using the version of Apache HTTP Server included with OSX 10.4 and a custom RewriteRule allowed me to host static XML files locally, and serve them in a way that didn't upset iTunes. Then, I edited Tiger's hosts file to redirect pri.kts-af.net to localhost. Bam, it worked perfectly! But it's a cruddy solution for a regular user to set up. So I started scripting...
First, I needed a quick easy way to patch iTunes apps instead of forcing users to hack hosts files or DNS servers.
I wrote patcher.sh on that G4 MDD, and this screenshot of the madness wound up being a neat advertisement for the text editor I was using...

Next, I needed to properly create a server backend. These days, some 20-something lizard developer would tell me "Just use NodeJS!" or something. I'm even an expert on NodeJS. But I've also retained a most of my mammalian DNA amidst the techno-idiocracy, and my simple ape-like ass likes keeping it simple. So I chose to use Common Gateway Interface (CGI) scripts, as you can host it on just about any HTTP server out there with minimal configuration.
I named my CGI script streamingRadioStations.sh, which is the exact same name as Apple's CGI script. Oh, you can guess how I know that one! LOL.
To make the server-side proof-of-concept setup easily reproducible, I wound up writing an oddly cringe-inducing script named install.sh, which sets up a Nubango server on the Apache HTTP Server which comes with Mac OS X 10.4. I also documented the details of how to set up your own Nubango server via Linux.
After I got the patcher and CGI scripts working fully, and I had reconstructed the Kerbango Tuning Service API in its entirety, Nubango was almost finished but it was still missing two critical components: The radio stations, and a server to serve them from. Folks were excited to get Nubango by that point, and I was only 1 week into the work! I noticed this thread on the Macintosh Garden which got me thinking about hosting Nubango on there.
Eventually I found an interesting website, iTunes Internet Radio Stations by Steve MacGuire, which seems to have every genre and station listed. All of that HTML could be converted to XML very easily, I thought... So I banged out some unholy JavaScript! It's truly wacky, jsonGenerator.html loads up Steve's HTML page in a web browser and auto-runs a script which converts each genre into individual JSON files, saving them all one-by-one to the hard disk, and then xmlGenerator.js reads each JSON file and parses them via a custom JSON-to-KTS XML converter. Nearly-perfectly formatted XML files are output, with the one caveat being that we couldn't figure out how to make iTunes understand the text encoding of station names and descriptions. I was confused, because Apple's original server allowed all kinds of languages to be transmitted, but we couldn't reproduce that functionality. I settled on using Latin1 / ISO-8859-1 encodings for compatibility purposes, and had to convert or omit a lot of special characters as a result.
With all the iTunes radio stations finally set up, I could then reasonably say that Nubango's server-side and client-side implementations were completed.
I then approached FogWraith, who was the lead system admin of the Macintosh Garden at the time, and he and wound up allocating a VPS to the project! With that and a CDN on top of it, Nubango was live! We hocked it up at pri.kts-af.org, which is nearly identical to the original URL.
On June 26, 2021, the Macintosh Garden's public Nubango server was brought online. Since then, it's seen thousands of concurrent users from all over the planet! ❤️ I've mostly been working on optimizing the CDN and ensuring that the server stays accessible, but there are huge gaps between myself and the users. I'm the primary maintainer and point-of-contact for issues, but it's not exactly straightforward to find this. Therefore, this is now the official support thread for Nubango users. | | 1 |
|