Synology SPK for DVR Record Engine

Downloads & Instructions
Post Reply
demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

TBlankenheim wrote: Wed Feb 14, 2018 12:25 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: 101
Joined: Wed May 27, 2015 9:15 am
Device ID: 107BBE13, 10782AED
Location: Madison, WI
x 2

Re: Synology SPK for DVR Record Engine

Post by TBlankenheim »

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: 11079
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10A05954 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 35

Re: Synology SPK for DVR Record Engine

Post by signcarver »

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: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

TBlankenheim wrote: Wed Feb 14, 2018 4:16 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.
signcarver wrote: 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: 101
Joined: Wed May 27, 2015 9:15 am
Device ID: 107BBE13, 10782AED
Location: Madison, WI
x 2

Re: Synology SPK for DVR Record Engine

Post by TBlankenheim »

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: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

TBlankenheim wrote: 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
I thought that might be it :)
I'll look in to streamlining - for now, you'll just need to monitor.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

Removed - see OP for correct version and link
Last edited by demonrik on Fri Oct 01, 2021 4:33 pm, edited 1 time in total.

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

Re: Synology SPK for DVR Record Engine

Post by bunger »

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

Post by bunger »

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: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

bunger wrote: Fri Feb 16, 2018 2:40 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

Post by bunger »

demonrik wrote: Fri Feb 16, 2018 3:17 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: 459
Joined: Thu Jun 27, 2013 5:32 pm
Device ID: 131F6468, 13129237
Location: Central Florida

Re: Synology SPK for DVR Record Engine

Post by Jimmersd »

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

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

Jimmersd wrote: Mon Feb 19, 2018 6:22 am 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: 17
Joined: Sat Oct 10, 2015 11:29 am

Re: Synology SPK for DVR Record Engine

Post by poorman »

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

karlh
Posts: 4
Joined: Fri Feb 24, 2017 2:14 pm
x 1

Re: Synology SPK for DVR Record Engine

Post by karlh »

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


Post Reply