wirgen / synocodectool-patch

This patch enables transcoding without a valid serial number in DSM 6+
120 stars 24 forks source link

Can VideoStation make a verification similar to synocodectool that breaks plugins? #12

Open ner00 opened 6 months ago

ner00 commented 6 months ago

This is out of the scope of this repository, but I figured I might use the opportunity to ask regardless. I apologize in advance.

Some time ago, VideoStation's plugins like TMDB stopped working, even the installation of non-official plugins stopped working with a similar message of connectivity issue. I've searched around and some of the people who faced this issue had to tinker with their NAS DNS settings, I tried the same but came up with nothing, but again, most of the cases that solved their issue probably had real Synology with a valid S/N and/or Synology account linked.

I have an original Synology NAS and then I have a VM with DSM, same network, same DNS settings, same DSM and VideoStation version on both; the genuine NAS has no connectivity issue as far as VideoStation plugins go, but the same plugins on the virtual NAS won't work regardless of what I try. What's more puzzling is that when looking at the network traffic dump from the virtual NAS, during the plugin connection test, it doesn't even try to contact any external address. The browser's POST request receives a failure reply from the NAS within ~20 milliseconds, and it all happens between the browser and the NAS, no other source or destination involved.

I have also tried running the actual plugin directly in the terminal and it works just fine, and receives all the metadata from the API, so it seems to me that Synology has some verification on the side of VideoStation that prevents it from even initializing the plugin request.

Any idea on the matter? Thanks

image

HTTP POST request

{
  "plugins": "{\"movie\":[{\"id\":\"com.synology.TheMovieDb\",\"default\":true}],\"tvshow\":[{\"id\":\"com.synology.TheMovieDb\",\"default\":true}]}",
  "api": "SYNO.VideoStation2.Plugin",
  "method": "test_plugin",
  "version": "1"
}

HTTP reply

{
  "data": {
    "movie": [
      {
        "id": "com.synology.TheMovieDb",
        "status": "connection_failed"
      }
    ],
    "tvshow": [
      {
        "id": "com.synology.TheMovieDb",
        "status": "connection_failed"
      }
    ]
  },
  "success": true
}

network dump image

running the plugin from the terminal

root@NAS:~# /volume1/@appstore/VideoStation/plugins/syno_themoviedb/loader.sh --type movie --lang enu --input "{\"title\":\"Rocky\", \"season\": null}" --limit 1 --allowguess false --apikey "YOUR_API_KEY"
{
  "success": true,
  "result": [
    {
      "title": "Rocky",
      "tagline": "His whole life was a million-to-one shot.",
      "original_available": "1976-11-21",
      "summary": "An uneducated collector for a Philadelphia loan shark is given a once-in-a-lifetime opportunity to fight against the world heavyweight boxing champion.",
      "certificate": "PG",
      "genre": [
        "Drama"
      ],
      "actor": [
        "Sylvester Stallone",
        "Talia Shire",
        "Burt Young",
        "Carl Weathers",
        "Burgess Meredith",
        "Thayer David",
        "Joe Spinell",
        "Jimmy Gambina",
        "Bill Baldwin",
        "Al Silvani",
        "George Memmoli",
        "Jodi Letizia",
        "Diana Lewis",
        "George O'Hanlon",
        "Larry Carroll",
        "Stan Shaw",
        "Don Sherman",
        "Billy Sands",
        "Pedro Lovell",
        "DeForest Covan",
        "Simmy Bow",
        "Tony Burton",
        "Hank Rolike",
        "Shirley O'Hara",
        "Kathleen Parker",
        "Frank Stallone Jr.",
        "Lloyd Kaufman",
        "Jane Marla Robbins",
        "Jack Hollander",
        "Joe Sorbello",
        "Christopher Avildsen",
        "Frankie Van",
        "Lou Fillipo",
        "Paris Eagle",
        "Frank Stallone Sr.",
        "Robert L. Tangrea",
        "Peter Glassberg",
        "William E. Ring",
        "Joseph C. Giambelluc",
        "Joe Frazier",
        "Michael Dorn",
        "Arnold Johnson",
        "Stu Nahan",
        "Frank Pesce",
        "Lavelle Roby",
        "Arthur Tovey",
        "John Pleshette"
      ],
      "director": [
        "John G. Avildsen",
        "Bonnie Prendergast",
        "Fred T. Gallo",
        "Steve Perry",
        "Charles Ziarko"
      ],
      "writer": [
        "Sylvester Stallone"
      ],
      "extra": {
        "com.synology.TheMovieDb": {
          "reference": {
            "themoviedb": 1366,
            "imdb": "tt0075148"
          },
          "rating": {
            "themoviedb": 7.786
          },
          "poster": [
            "https://image.tmdb.org/t/p/w500/cqxg1CihGR5ge0i1wYXr4Rdeppu.jpg"
          ],
          "backdrop": [
            "https://image.tmdb.org/t/p/original/kK9v1wclQxug6ZUJucD4DTaHgVF.jpg"
          ],
          "collection_id": {
            "themoviedb": 1575
          }
        }
      }
    }
  ]
}
ner00 commented 6 months ago

It might go deeper than I thought...

Serial console

[  143.799058] audit: type=1400 audit(1715530151.021:2): apparmor="DENIED" operation="exec" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15874 comm="bash" requested_mask="x" denied_mask="x" fsuid=228233 ouid=0
[  143.803147] audit: type=1400 audit(1715530151.025:3): apparmor="DENIED" operation="open" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15874 comm="bash" requested_mask="r" denied_mask="r" fsuid=228233 ouid=0
[  143.810459] audit: type=1400 audit(1715530151.032:4): apparmor="DENIED" operation="exec" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15879 comm="bash" requested_mask="x" denied_mask="x" fsuid=228233 ouid=0
[  143.814240] audit: type=1400 audit(1715530151.036:5): apparmor="DENIED" operation="open" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15879 comm="bash" requested_mask="r" denied_mask="r" fsuid=228233 ouid=0
[  143.820832] audit: type=1400 audit(1715530151.043:6): apparmor="DENIED" operation="exec" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15884 comm="bash" requested_mask="x" denied_mask="x" fsuid=228233 ouid=0
[  143.825004] audit: type=1400 audit(1715530151.047:7): apparmor="DENIED" operation="open" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15884 comm="bash" requested_mask="r" denied_mask="r" fsuid=228233 ouid=0
[  143.831772] audit: type=1400 audit(1715530151.054:8): apparmor="DENIED" operation="exec" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15889 comm="bash" requested_mask="x" denied_mask="x" fsuid=228233 ouid=0
[  143.835655] audit: type=1400 audit(1715530151.057:9): apparmor="DENIED" operation="open" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15889 comm="bash" requested_mask="r" denied_mask="r" fsuid=228233 ouid=0
[  143.843663] audit: type=1400 audit(1715530151.065:10): apparmor="DENIED" operation="exec" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15894 comm="bash" requested_mask="x" denied_mask="x" fsuid=228233 ouid=0
[  143.847538] audit: type=1400 audit(1715530151.069:11): apparmor="DENIED" operation="open" profile="videostation_default_plugin" name="/usr/sbin/sed" pid=15894 comm="bash" requested_mask="r" denied_mask="r" fsuid=228233 ouid=0

/var/log/messages

2024-05-12T17:09:11+01:00 VM-NAS plugin_runner[15868]: plugin_runner.cpp:82 Failed to execute plugin runner: /bin/env HOME=/ SHELL=/bin/false /bin/bash -p /var/packages/VideoStation/target/plugins/syno_plugin_tester/loader.sh --type movie --lang enu --input {"original_available":"2001-11-16","title":"Harry Potter"}
 --limit 1 --apikey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --path /var/packages/VideoStation/target/plugins/syno_themoviedb/loader.sh --pluginid com.synology.TheMovieDb
2024-05-12T17:09:11+01:00 VM-NAS plugin_runner[15943]: plugin_runner.cpp:82 Failed to execute plugin runner: /bin/env HOME=/ SHELL=/bin/false /bin/bash -p /var/packages/VideoStation/target/plugins/syno_plugin_tester/loader.sh --type tvshow --lang enu --input {"original_available":"2011-04-17","title":"Game of Thrones"}
 --limit 1 --apikey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --path /var/packages/VideoStation/target/plugins/syno_themoviedb/loader.sh --pluginid com.synology.TheMovieDb