HTPC-Manager icon indicating copy to clipboard operation
HTPC-Manager copied to clipboard

Synology package and apps with SSL

Open theMadStork opened this issue 9 years ago • 17 comments

Accessing sickbeard or couch potato in htpc manager with SSL cannot connect and fetch data (the test in settings or any fetching of data). The log for sickbeard says Unable to contact sickbeard via https://myip:8899/api/apikey/?cmd=sb.ping but when I explicitly run the URL, the return field is "success".

theMadStork avatar Jun 15 '15 21:06 theMadStork

Your should post a log. No one can help you without one.

Hellowlol avatar Jun 15 '15 22:06 Hellowlol

OK. should I post it here or is there a preferred site for that? If I am running on a synology nas, how can I enable debugging? I've tried logging in as root in WinSCP and running python Htpc.py --debug but it doesn't get far enough to start on the nas. I made sure HTPC manager was not running prior but no luck. Should I use a different SSH or telnet program?

I just saw that your fork has more information in the readme for reporting bugs. Is using --loglevel debug just relevant to your fork? Should I try your fork?

theMadStork avatar Jun 15 '15 22:06 theMadStork

Post it on pastebin. First double check your settings as placeholders can look like values. Wipe the log. Use ssh to cd to htpc manager folder start htpc-manager with --loglevel debug. Enter the modules that don't work then post the log.

Hellowlol avatar Jun 15 '15 22:06 Hellowlol

Well it seems HTPC manager doesn't like starting from the command line in synology. It resets the port to 8085. I noticed on install the port was using 8087 but the settings said 8085. I changed it to 8087 in case it would cause issues but it doesn't seem to matter what I set port to in general settings. In Htpc.py however, if run from the command line, the port resets to 8085. I just manually set it to 8087 in the script and it started barebone. None of my settings were loaded. the debug file is here

http://pastebin.com/VT162jnZ

theMadStork avatar Jun 15 '15 23:06 theMadStork

Sorry its a bit different for nas users. You need to set the -datadir to access your current settings. Yeah, you can test my fork but there are some issue with the install method. Check the wiki in my repo. Ill add some features like download log etc so this isnt so pita on nas.

Hellowlol avatar Jun 16 '15 07:06 Hellowlol

Is it working without ssl? Is Sickbeard and/or couch potato running on the synology or somewhere else? What happens when you wget/curl the https-ping-url from the synology?

styxit avatar Jun 16 '15 07:06 styxit

@styxit Ill make a pr regarding download log to your repo as well, the damn "insert random nas" is just pita..

Hellowlol avatar Jun 16 '15 07:06 Hellowlol

Yes everything works without SSL and HTPC manager, sickbeard, couchpotato work with ssl. It's just when HTPC manager tries to access sickbeard and couchpotato which is the issue.

wget/curl discovered the problem. I am using a self-signed from my nas and therefore the names don't match and that causes the error. My browser has the exception for it which is why it worked. --no-check-certificate worked with wget/curl but it looks like urlopen() as of last year will now validate by default. It looks like I will need to pass an SSL context with urlopen() and manually enter the names or bypass checking all together. I'm not skilled with web programming so I'm not really sure how to do that without reading quite a bit. Is this a quick fix for you? perhaps just a checkbox for self-signed certificate in general settings?

Thanks for your help

theMadStork avatar Jun 16 '15 13:06 theMadStork

Maybe use a valid ssl certificate? https://www.startssl.com offers them for free.

styxit avatar Jun 16 '15 13:06 styxit

understood

theMadStork avatar Jun 16 '15 13:06 theMadStork

I think htpc manager should support self signed cert, it would be trival to replace urllib2 with requests.

Hellowlol avatar Jun 16 '15 13:06 Hellowlol

Could do this as an option/checkbox, not disable the certificate check by default.

styxit avatar Jun 16 '15 14:06 styxit

that would be great!

theMadStork avatar Jun 16 '15 15:06 theMadStork

So I am also on a synology and DO have a valid Purchased SSL cert. I am having the exact same issue. I tried using the external url form my CP install (mydomain.com) and checked SSL and also tried using internal IP (192.xxx.xxx.xxx) with SSL. Both seem to return an error however if I build the url manually similar to how https://github.com/styxit/HTPC-Manager/blob/master/modules/couchpotato.py builds the URL and ping that page in a browser via SSL it responds as expected with a success message as long as key is correct.

dhruvb14 avatar Oct 11 '15 06:10 dhruvb14

I wouldn't say you have the exact same issue (this should have been closed). The op used self signed cert while yours are valid. If you provide a log maybe we can help you out?

Hellowlol avatar Oct 12 '15 04:10 Hellowlol

@Hellowlol yeah but I am having the same issue and have a real certificate. Also I saw that in your branch of HTPC-Manager you have sonarr support. However I'm using the synocommunity package for this and then updated to latest using builtin updater and would love to move to yours for just this one feature. Any advice?

dhruvb14 avatar Oct 13 '15 01:10 dhruvb14

See https://github.com/Hellowlol/HTPC-Manager/wiki/Installing-HTPC-on-Synology-NAS (see the issue that mention there) or wait for https://github.com/SynoCommunity/spksrc/pull/1747

Hellowlol avatar Oct 13 '15 05:10 Hellowlol