Plex updater / Hackers needed

By 2015-11-24 Buffalo + Plex

IMPORTANT UPDATE: the script had a bug, that was just fixed. If you already downloaded it (on the day when this post was originally released), please download it again.

Hi Hackers,

In the comment section a few people voiced the idea that the Plex Media Server should be updateable without re-flashing the whole firmware. That’s an excellent idea.

Since I’m still travelling I can’t build a full-blown firmware for this (I can’t do any testing without my loyal Linkstation LS-WVL) but I can share the “engine” that’s going to do the heavy-lifting.

If you know how to use SSH on your Linkstation, please try to run this script and report back with the result. If it works, I can try to implement it on the web interface and we could ship it to all users. (As soon as I can get to my device.)

Still no news on LS400/420 support. I know people would like it very much but I just can’t match my time, location and the location of an LS400 yet.

Here’s how you can run the script:

  • Log in to your Linkstation through SSH
  • Run the following commmand (as one line) to download the script:
    • wget --no-check-certificate https://raw.githubusercontent.com/GaryTomato/buffaloplex/master/resources/additions/test/usr/local/sbin/update-plex
  • Run the script:
    • sh update-plex

Check the output. It should download and install the latest public Plex Media Server version onto the Linkstation, using the Synology package. It will ask you to restart the Plex Media Server service. You can do that from the command-line or from the web interface.

If it doesn’t seem to work, please do the following:

  • Copy all output to a text file and send it to me. (In the comment section or e-mail. You can guess my address from “my name at my domain”.)
  • Try to run the last command with a specific version of the Plex Media Server, like this: (as one line)
    • sh update-plex https://downloads.plex.tv/plex-media-server/0.9.12.19.1537-f38ac80/PlexMediaServer-0.9.12.19.1537-f38ac80-arm.spk
  • If that didn’t work either, copy that output too and send it to me.

If it works on first try and you have a PlexPass, now you can upgrade your server to PlexPass versions too. You just need to go to the Plex archive (after logging in) and get the link for the Synology ARM package for the specific version you want to install.

Please send feedback regardless, for everyone’s benefit.

GaryT

26 Comments

  • R3DMVN says:

    login as: root
    root@192.168.200.21‘s password:
    root@LinkStation:~# wget –no-check-certificate https://raw.githubusercontent.>;
    –2015-11-24 11:42:52– https://raw.githubusercontent.com/GaryTomato/buffaloplex/master/resources/additions/test/usr/local/sbin/update-plex
    Resolving raw.githubusercontent.com… 23.235.40.133
    Connecting to raw.githubusercontent.com|23.235.40.133|:443… connected.
    WARNING: cannot verify raw.githubusercontent.com’s certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA’:
    Unable to locally verify the issuer’s authority.
    WARNING: certificate common name `www.github.com’ doesn’t match requested host name `raw.githubusercontent.com’.
    HTTP request sent, awaiting response… 200 OK
    Length: 2576 (2.5K) [text/plain]
    Saving to: `update-plex.4′

    100%[======================================>] 2,576 –.-K/s in 0s

    2015-11-24 11:42:53 (143 MB/s) – `update-plex.4′ saved [2576/2576]

    root@LinkStation:~# sh update-plex
    This should only be run on Buffalo Linkstation devices with custom firmware. Visit http://tomatosoft.hu/gadgets for more.
    Trying to find latest Plex Media Server.
    –2015-11-24 11:43:00– https://plex.tv/downloads/1/archive
    Resolving plex.tv… 184.169.150.53, 184.169.183.121, 184.72.57.72, …
    Connecting to plex.tv|184.169.150.53|:443… connected.
    ERROR: cannot verify plex.tv’s certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA’:
    Unable to locally verify the issuer’s authority.
    To connect to plex.tv insecurely, use `–no-check-certificate’.
    Unable to establish SSL connection.
    Download of list of versions from plex.tv failed. Please add a link for manual download.
    <0.9.12.19.1537-f38ac80/PlexMediaServer-0.9.12.19.1537-f38ac80-arm.spk
    This should only be run on Buffalo Linkstation devices with custom firmware. Visit http://tomatosoft.hu/gadgets for more.
    Predefined Plex file detected.
    File to download: https://downloads.plex.tv/plex-media-server/0.9.12.19.1537-f38ac80/PlexMediaServer-0.9.12.19.1537-f38ac80-arm.spk
    Filename: PlexMediaServer-0.9.12.19.1537-f38ac80-arm.spk
    Temporary directory: /mnt/array1/tmpplexupdatetmp
    Downloading PlexMediaServer-0.9.12.19.1537-f38ac80-arm.spk.
    –2015-11-24 11:43:08– https://downloads.plex.tv/plex-media-server/0.9.12.19.1537-f38ac80/PlexMediaServer-0.9.12.19.1537-f38ac80-arm.spk
    Resolving downloads.plex.tv… 104.20.6.9, 104.20.7.9, 2400:cb00:2048:1::6814:609, …
    Connecting to downloads.plex.tv|104.20.6.9|:443… connected.
    ERROR: cannot verify downloads.plex.tv's certificate, issued by `/C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA':
    Unable to locally verify the issuer's authority.
    To connect to downloads.plex.tv insecurely, use `–no-check-certificate'.
    Unable to establish SSL connection.
    Download of Plex Media Server (PlexMediaServer-0.9.12.19.1537-f38ac80-arm.spk) failed.
    root@LinkStation:~# sh update-plex
    This should only be run on Buffalo Linkstation devices with custom firmware. Visit http://tomatosoft.hu/gadgets for more.
    Trying to find latest Plex Media Server.
    –2015-11-24 11:43:10– https://plex.tv/downloads/1/archive
    Resolving plex.tv… 184.169.150.53, 184.169.183.121, 184.72.57.72, …
    Connecting to plex.tv|184.169.150.53|:443… connected.
    ERROR: cannot verify plex.tv's certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA':
    Unable to locally verify the issuer's authority.
    To connect to plex.tv insecurely, use `–no-check-certificate'.
    Unable to establish SSL connection.
    Download of list of versions from plex.tv failed. Please add a link for manual download.
    root@LinkStation:~#

    I did this 4 times don't think its working.

  • Brian says:

    I got the script to work by uninstalling wget and installing wget-ssl. Just an idea for people if they want to get it working.

    • garyt says:

      Thanks Brian. It should work without wget-ssl now. (I guess you ran the first version.) The final script will be a bit more polished.

  • Marc Tanis says:

    Just ran this on a ProStation DUO (LS-WVL960) and it worked flawlessly.

  • Mike says:

    Hi Gary,
    First of all, I wanted to thank you for your work.
    Secondly, I have a LS-CHL and I don’t even know how to enable SSH on it, let alone use that to run the script. I really don’t want to brick my linkstation, so I was wondering if you had any kind of timetable for the updated firmware that contains the plex updater. If it’s a long way out, I may try and figure out how to do it, if not I will wait. Also, if it is a long way out, if anyone has and tips on what I’d need to do, I’d appreciate them.

    Thanks,
    Mike

    • garyt says:

      Hi Mike,

      Unfortunately for a graphical “Plex updater” button, you’ll have to wait until next year. (I have to get back to my device.) I’m planning to release a new version of the firmware this year with updated Plex. There were too many changes on the server side to ignore it…

      Regards,
      GaryT

  • Mike says:

    Actually I see that your firmware enables SSH, (I rolled it back when Plex Server 9.12.13 didn’t work on the new appleTV), so I just need to figure out how to run the script without bricking the linkstation.
    -Mike

    • garyt says:

      Oh, great. Running the script can’t brick the Linkstation. It can brick Plex though if it’s stopped midway through. The good news is that if you restart the script it should fix Plex for you.

      • Mike says:

        Hi Gary,

        Quick question. I have opened Port 22 and Port 2222 on my router and macbook’s firewall and I am still getting a connection refused error on my SSH login.
        Port 2222 was a user defined exception, so I wanted to check on the specific port settings. I did TCP port 2222, is it UDP?
        Connection refused error with all of the following lines
        MacBook-Pro:~ user$ ssh root@localIP -p 2222
        MacBook-Pro:~ user$ ssh root@publicIP -p 2222
        MacBook-Pro:~ user$ ssh root@localIP
        MacBook-Pro:~ user$ ssh root@publicIP
        Also refused when i try to connect via, my admin username with the intention of SUDOing to root user

        Am I missing a setting on the Linkstation? I simply enabled the SSH functionality in the halloween firmware

        Thanks,
        Mike

        • garyt says:

          Hi Mike,

          I think you don’t need to change anything on your Mac to connect to your Linkstation through SSH. The TCP port 2222 needs to be open on the Linkstation device, which is open by default. (There’s no firewall on the Linkstation enabled.) Then on your local network, from your Mac you should be able to run:

          ssh -p 2222 root@ipofthelinkstation

          and log in with the password that you use on the web interface too. Certainly this only works if you enabled SSH for root on the web interface beforehand.

          I advise not allowing SSH pass through on your router. The Linkstation device is still quite insecure after all the Buffalo patches, you don’t know what your letting into your network by allowing SSH through the Internet. Just use SSH on your local network.

          – GaryT

          • Mike says:

            Hi Gary,

            Thanks for taking the time to respond. That is what I tried originally, this is what I get from the terminal
            ssh -p 2222 root@192.168.1.xxx
            => ssh: connect to host 192.168.1.xxx port 2222: Connection refused

            Any thoughts? If not I’ll just have to wait and install your firmware with the never version of plex server
            Thanks,
            Mike

          • Mike says:

            Hi Gary,
            Again I wanted to thank you for your work. As for the SSH server, I found the problem, but no solution. If I run nmap, it says that port 2222 isn’t open.

            Macbook:~ user$ nmap 192.168.1.xxx
            Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-08 17:39 PST
            Nmap scan report for LS-CHL822 (192.168.1.xxx)
            Host is up (0.073s latency).
            Not shown: 990 closed ports
            PORT STATE SERVICE
            80/tcp open http
            139/tcp open netbios-ssn
            443/tcp open https
            445/tcp open microsoft-ds
            515/tcp open printer
            548/tcp open afp
            873/tcp open rsync
            3689/tcp open rendezvous
            8873/tcp open dxspider
            22939/tcp open unknown
            Nmap done: 1 IP address (1 host up) scanned in 2.75 seconds

            But, SSH says that it is enabled under network settings. Any thoughts?
            Thanks again,
            Mike

          • garyt says:

            Hi Mike,

            Thanks for the detailed troubleshooting, you gave me an idea and I double-checked (using the GitHub source since I still don’t have access to my NAS). Here’s the issue:

            My SSH script is based on the original Buffalo code and in that code there’s a check if the hardware supports SFTP. (line 16 in my /etc/init.d/ssh.sh). As it turns out the LS-CHL does not support SFTP out of the box (in the /etc/nas_feature file), hence the check doesn’t enable SSH either. 🙁

            I can remove this check in the next firmware but since my LS-WVL supports SFTP by default, there’s no way for me to properly test if this is going to work on your LS-CHL. When the next version comes out, please check the changelog, it should mention that this check was removed. Then install that firmware and check if SSH magically starts working for you. Since the files are all there, it should, but the LS-CHL has a very slow processor, so your experience may vary.

            Regards,
            GaryT

  • Peter says:

    Hello Guys,
    First of all I really appreciate all your efforts 🙂 Is it possible to post a step by step walkthrough for dummies (like me) who are not so familiar with SSH or hacking how to install the Plex update? Unfortunately Apple TV 4 cannot access the server without it. Or should we wait for an update to be released on your modified Buffalo firmware?
    Thanks in advance!

    • garyt says:

      I’d say wait for the new release. The script in itself is really for hackers. I should have something soon enough.

      – GaryT

  • BrainSop says:

    Hi,
    When I try to use wget with the parameter –no-check-certificate appears the following error:

    wget: unrecognized option `–no-check-certificate’
    Usage: wget [OPTION]… [URL]…

    I run the following command but wget don’t have –no-check-certificate option:

    root@NAS:/mnt/usbdisk1# wget –help | grep ‘cert’
    root@NAS:/mnt/usbdisk1#

    I try to update with ipkg but don’t work:

    root@NAS:/mnt/usbdisk1# ipkg update
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable//Packages
    Updated list of available packages in /opt/lib/ipkg/lists/cs08q1
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable/Packages.gz
    Inflating http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable/Packages.gz
    Updated list of available packages in /opt/lib/ipkg/lists/cross
    Successfully terminated.
    root@NAS:/mnt/usbdisk1# ipkg install wget
    Package wget (1.12-2) installed in root is up to date.
    Nothing to be done
    Successfully terminated.

    I’m using the firmware 1.71-3.66 HALLOWEEN on my LS-WVL NAS
    How can I update the wget command?

    thanks and Regards

    • BrainSop says:

      I found the SSL version of wget with the name wget-ssl on the Halloween firmware on:

      /usr/local/bin/wget-ssl

      I have modified the script to use it and I can update the plex to “Version 0.9.14.6”

      Regard

      • garyt says:

        Awesome, thanks for the feedback. With the new release (coming soon) you won’t have to use the script.

        Regards,
        GaryT

  • I know most ppl can do this but i have redone the script i changed all wget to wget-ssl and it working for me

    i would post it here but i can not 😛

    • garyt says:

      Thanks Chris. The focus is integrating with the Linkstation better (which I’m working on), but if you want to share it, send it to me (it’s easy enough to figure out my e-mail address from my username and the domain of the site) and I can post it.
      Still, I’d rather people wait for the next release and get an all-in-one solution. People with SSH skills have already figured out a solution and people without it should learn linux commands on a test system instead. 🙂

      – GaryT