Synology SPK for DVR Record Engine

Downloads & Instructions
demonrik
Posts: 1017
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Postby demonrik » Wed Feb 14, 2018 1:23 pm

- update to the 20180213beta1 engine
20180213beta1
- startup script (from restart or appcenter) logs to /tmp/hdhr_arch_choice to log the arch detected to help debug.
- now modifies newly created directory for recordpath to be accessible by default by http
I may have found a hiccup in the installation of HDHomeRunDVR-0.4.2-20180213.spk. After the installation, HDHomeRunDVR share was no longer accessible. I checked the permissions on /volume1/HDHomeRunDVR/ and they were set to 770 (if I recall correctly). Did a chmod -R 777 "/volume1/HDHomeRunDVR/" (probably overkill) and all was good. Not sure if this is the proper solution to this problem, but it worked for me.
What do you mean by not accessible?
FWIW - my package does not create a share - just a subfolder (i.e. it's not shared out beyond the NAS)

Here is the code in the installation package

Code: Select all

RECORDING_PATH="$SYNOPKG_PKGDEST_VOL/$SYNOPKG_PKGNAME" if [ ! -d $RECORDING_PATH ] ; then mkdir $RECORDING_PATH fi sed -i "s!\(RecordPath\s*=\).*!\1$RECORDING_PATH!" $hdhr_etc_path/$hdhr_conf chown -R http:http $RECORDING_PATH chmod -R u+w $RECORDING_PATH
Basically it will create /volume1/HDHomeRunDVR
this is different from the SD created share /volume1/HDHomeRun

It checks if the path exists - otherwise it creates it.
Then updates the RecordPath in the config file appropriately.
(there is a missing feature to not do this if upgrading)
then sets the owner of the RecordPath to the http user
and then adds write permissions

The fact that you had to change from 770 to 777 indicates that the http user doesn't have write permissions to the folder for some reason?!

TBlankenheim
Posts: 48
Joined: Wed May 27, 2015 9:15 am

Re: Synology SPK for DVR Record Engine

Postby TBlankenheim » Wed Feb 14, 2018 4:16 pm

Basically it will create /volume1/HDHomeRunDVR
this is different from the SD created share /volume1/HDHomeRun

It checks if the path exists - otherwise it creates it.
Then updates the RecordPath in the config file appropriately.
(there is a missing feature to not do this if upgrading)
then sets the owner of the RecordPath to the http user
and then adds write permissions

The fact that you had to change from 770 to 777 indicates that the http user doesn't have write permissions to the folder for some reason?!
I did some troubleshooting and here is what I have learned:

1. Everything works as you described if the path does not exist. Everything works as it should. Directory permissions look like this:

Code: Select all

drwxr-xr-x 1 http http 38 Feb 14 16:00 HDHomeRunDVR
2. If the share /volume1/HDHomeRunDVR exists, prior to package installations, directory permissions are:

Code: Select all

d---------+ 1 root root 12 Feb 14 16:18 HDHomeRunDVR
After package install, directory permissions are:

Code: Select all

drwxrwx--- 1 http http 36 Feb 14 16:22 HDHomeRunDVR
The package install seems to blow away all share permissions, hence I am unable to access the directory via SMB. All package functions seem to work as expected. Once I restored the share permissions via the DSM Shared Folder Control Panel, all seems to function as expected. Not sure if it was necessary, but I made sure the http local group had Read/Write access.

Now that I understand what is happening when the package is installed, I can watch for this and deal with any fallout after the install.

Hope this provides some useful information for future package updates.

Thanks!

signcarver
Expert
Posts: 7878
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 131B34B7 13231F92 1070A18E 1073ED6F

Re: Synology SPK for DVR Record Engine

Postby signcarver » Wed Feb 14, 2018 4:33 pm

Are you mistakenly confusing the folders HDHomeRun and HDHomeRunDVR... the first is a "share" SD wishes to install to... the second is just a folder that the package makes... not a share at all.

demonrik
Posts: 1017
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Postby demonrik » Wed Feb 14, 2018 4:53 pm

The package install seems to blow away all share permissions, hence I am unable to access the directory via SMB. All package functions seem to work as expected. Once I restored the share permissions via the DSM Shared Folder Control Panel, all seems to function as expected. Not sure if it was necessary, but I made sure the http local group had Read/Write access.
Are you mistakenly confusing the folders HDHomeRun and HDHomeRunDVR... the first is a "share" SD wishes to install to... the second is just a folder that the package makes... not a share at all.
I think this is the confusion.
@TBlankenheim when you installed via the SD installer it created a HDHomeRun share
However - when you use the SPK you do not need a share at all.

You only need to create a share if you want to share the DVR files to some other computers - in which case you need to either ensure the group or world permissions are set appropriately.
If this is what you're trying to do then I would recommend adding any users you want to access that share to the http group rather than giving write permission to all.

Rik.

TBlankenheim
Posts: 48
Joined: Wed May 27, 2015 9:15 am

Re: Synology SPK for DVR Record Engine

Postby TBlankenheim » Wed Feb 14, 2018 8:50 pm

Are you mistakenly confusing the folders HDHomeRun and HDHomeRunDVR... the first is a "share" SD wishes to install to... the second is just a folder that the package makes... not a share at all.
You only need to create a share if you want to share the DVR files to some other computers - in which case you need to either ensure the group or world permissions are set appropriately.
If this is what you're trying to do then I would recommend adding any users you want to access that share to the http group rather than giving write permission to all.
No confusion. I want to share HDHomeRunDVR so that I may access the recordings outside the control of the record engine so that I may transcode them to H.264. No need for write access except for the NAS admin account since I will always be deleting the original recordings with the record engine.

Will the package always modify the permissions on install or if http is already the owner etc., will it leave well enough alone?

Tom

demonrik
Posts: 1017
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Postby demonrik » Wed Feb 14, 2018 9:28 pm

Are you mistakenly confusing the folders HDHomeRun and HDHomeRunDVR... the first is a "share" SD wishes to install to... the second is just a folder that the package makes... not a share at all.
You only need to create a share if you want to share the DVR files to some other computers - in which case you need to either ensure the group or world permissions are set appropriately.
If this is what you're trying to do then I would recommend adding any users you want to access that share to the http group rather than giving write permission to all.
No confusion. I want to share HDHomeRunDVR so that I may access the recordings outside the control of the record engine so that I may transcode them to H.264. No need for write access except for the NAS admin account since I will always be deleting the original recordings with the record engine.

Will the package always modify the permissions on install or if http is already the owner etc., will it leave well enough alone?

Tom
I thought that might be it :)
I'll look in to streamlining - for now, you'll just need to monitor.

demonrik
Posts: 1017
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Postby demonrik » Thu Feb 15, 2018 11:00 am

NEW PACKAGE AVAILABLE
- update to the 20180215beta1 engine
20180213beta1

new SPK HDHomeRunDVR-0.4.2-20180215.spk available in the usual locations Google Drive, DropBox, OneDrive

Warning: the wrapper (source code is on github) provided has been compiled both for ARM and x86_64. The script should detect the architecture of your NAS and call the appropriate wrapper. I unfortunately do not have an X86 based Synology to test on - just a bunch of PCs, etc. to try the portable binary. Please let me know if you have issues. In some cases, if the platform is not detected the wrapper is not used and the UI controls will not work. Also please let me know which Synology NAS this happens for

Code is available on github
https://github.com/Silicondust/dvr_install

Known Issues
- diagnostics.sh not updated for new api url
- recordpath for existing in conf file doesn't get adjusted for chmod/chown to http

bunger
Posts: 4
Joined: Fri Feb 16, 2018 11:18 am

Re: Synology SPK for DVR Record Engine

Postby bunger » Fri Feb 16, 2018 11:24 am

Synology DS212, DSM 6.1.5-15254. New install.

I installed Webstation, PHP 5.6, and HDHomerRunDVR-0.4.2-20180214.spk.

Tried to access the web ui: http://<myNAS>/HDHomeRunDVR/
500
There is an error while processing this request.

Saw post about open_basedir, so checked Customize PHP open_basedir box and cleared out text field. Try web ui again - same error.

Tried rebooting NAS, same error.

bunger
Posts: 4
Joined: Fri Feb 16, 2018 11:18 am

Re: Synology SPK for DVR Record Engine

Postby bunger » Fri Feb 16, 2018 2:40 pm

Follow-up: got it working.

after re-reading all posts to this topic, I had to make the following changes:

also installed PHP 7
set PHP 7 as default in Web Station
moved conf file to /var/... dir
changed record directory to HDHomeRunDVR

demonrik
Posts: 1017
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Postby demonrik » Fri Feb 16, 2018 3:17 pm

set PHP 7 as default in Web Station
This is something I'm trying to figure out - should work with 5.6, but I can't get Synology to allow me to specify a PHP* so I can get any version. I changed to 7 to just push it there.
moved conf file to /var/... dir
Can you provide more info - you mean from a previous install
changed record directory to HDHomeRunDVR
You didn't need to do that - just change owner/permissions on the old recordpath

Glad you're up and running though.
I'll try and update some of the first post to make it more obvious.

bunger
Posts: 4
Joined: Fri Feb 16, 2018 11:18 am

Re: Synology SPK for DVR Record Engine

Postby bunger » Fri Feb 16, 2018 3:59 pm

moved conf file to /var/... dir
Can you provide more info - you mean from a previous install
Yep... had a previous install

Jimmersd
Posts: 250
Joined: Thu Jun 27, 2013 5:32 pm

Re: Synology SPK for DVR Record Engine

Postby Jimmersd » Mon Feb 19, 2018 6:22 am

Hi Rik, Thanks for building this. Can you add a scrollbar to the log page?

demonrik
Posts: 1017
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Postby demonrik » Mon Feb 19, 2018 9:52 pm

Hi Rik, Thanks for building this. Can you add a scrollbar to the log page?
short answer... no

longer answer... you can do his yourself by modifying the css file.
look for webkit-scrollbar and remove entry(ies) in main.less

poorman
Posts: 12
Joined: Sat Oct 10, 2015 11:29 am

Re: Synology SPK for DVR Record Engine

Postby poorman » Fri Mar 02, 2018 5:07 pm

Thanks Rik!
Great update. I like how it updated the record engine too.

karlh
Posts: 3
Joined: Fri Feb 24, 2017 2:14 pm

Re: Synology SPK for DVR Record Engine

Postby karlh » Sat Mar 03, 2018 4:09 pm

Hi,
I just installed this yesterday, and the DVR is working with the repeating recording of shows previously set up using the "HDHomeRun set up install" and new recordings set up through the App.

I have 2 issues, the first, I can not find a way to setup new recordings. The second, is selecting the "Recordings" tab, I see all of my recorded shows, and can play and delete them, however a screen pops up showing some errors (see below)

Thanks for this, and any help you can give me

Code: Select all

Notice: Undefined property: DVRUI_Recordings::$recording_EpisodesURL in /volume1/web/HDHomeRunDVR/includes/dvrui_recordings.php on line 38 Call Stack: 0.0001 355184 1. {main}() /volume1/web/HDHomeRunDVR/index.php:0 0.0445 386008 2. TinyAjax->process() /volume1/web/HDHomeRunDVR/index.php:42 0.0446 386864 3. openRecordingsPage() /volume1/web/HDHomeRunDVR/TinyAjax.php:233 0.2143 406192 4. DVRUI_Recordings->DVRUI_Recordings() /volume1/web/HDHomeRunDVR/recordings.php:15 Notice: Undefined variable: j in /volume1/web/HDHomeRunDVR/includes/dvrui_recordings.php on line 38 Call Stack: 0.0001 355184 1. {main}() /volume1/web/HDHomeRunDVR/index.php:0 0.0445 386008 2. TinyAjax->process() /volume1/web/HDHomeRunDVR/index.php:42 0.0446 386864 3. openRecordingsPage() /volume1/web/HDHomeRunDVR/TinyAjax.php:233 0.2143 406192 4. DVRUI_Recordings->DVRUI_Recordings() /volume1/web/HDHomeRunDVR/recordings.php:15 Notice: Undefined index: in /volume1/web/HDHomeRunDVR/includes/dvrui_recordings.php on line 38 Call Stack: 0.0001 355184 1. {main}() /volume1/web/HDHomeRunDVR/index.php:0 0.0445 386008 2. TinyAjax->process() /volume1/web/HDHomeRunDVR/index.php:42 0.0446 386864 3. openRecordingsPage() /volume1/web/HDHomeRunDVR/TinyAjax.php:233 0.2143 406192 4. DVRUI_Recordings->DVRUI_Recordings() /volume1/web/HDHomeRunDVR/recordings.php:15 Warning: array_key_exists() expects parameter 2 to be array, null given in /volume1/web/HDHomeRunDVR/includes/dvrui_recordings.php on line 38 Call Stack: 0.0001 355184 1. {main}() /volume1/web/HDHomeRunDVR/index.php:0 0.0445 386008 2. TinyAjax->process() /volume1/web/HDHomeRunDVR/index.php:42 0.0446 386864 3. openRecordingsPage() /volume1/web/HDHomeRunDVR/TinyAjax.php:233 0.2143 406192 4. DVRUI_Recordings->DVRUI_Recordings() /volume1/web/HDHomeRunDVR/recordings.php:15 0.2829 788272 5. array_key_exists() /volume1/web/HDHomeRunDVR/includes/dvrui_recordings.php:38


Return to “Downloads & Instructions”

Who is online

Users browsing this forum: No registered users and 1 guest