ispyagentdvr-docker icon indicating copy to clipboard operation
ispyagentdvr-docker copied to clipboard

Network Storage

Open DivanX10 opened this issue 4 years ago • 14 comments
trafficstars

AgentDVR v.3.5.4.0

Tell me, how do I correctly specify the path to the Home Assistant network folder? In the configuration of the samba Home Assistant addon in the settings, I specified a username and password and there are no examples in the instructions of how to specify the address to connect to the seed folder

For example, to connect to samba, you can use this option, but not in the case of AgentDVR smb://user_name:password@server_name

workgroup: WORKGROUP
username: user
password: pass
allow_hosts:
  - 10.0.0.0/8
  - 172.16.0.0/12
  - 192.168.0.0/16
  - fe80::/10
veto_files:
  - ._*
  - .DS_Store
  - Thumbs.db
  - icon?
  - .Trashes
compatibility_mode: false

I tried different options and the files are not saved to this network folder image image

DivanX10 avatar Oct 06 '21 00:10 DivanX10

Hello, you have to remember that docker containers run on a sandbox and only see what you allow them to see. In this case, the container runs on it's own network and is only allowed to talk to other services via the ports allowed, which you have specified on the run command.

With that said, for this to work, you would have to include some sort of plug in or communication channel for the container to reach your samba share. I did a quick search and some things popped up.

Check this thread: https://stackoverflow.com/questions/27989751/mount-smb-cifs-share-within-a-docker-container

If everything else fails, you can try using agent outside of docker, but to be honest I'm not sure if agent supports it out of the box.

@ispysoftware can you elaborate on support for SMB shares?

doitandbedone avatar Oct 06 '21 01:10 doitandbedone

I don't know much about connecting to samba shares from within docker containers but according to microsoft docs: https://social.msdn.microsoft.com/Forums/vstudio/en-US/03bf0cf2-be80-43a4-870c-83727dee1c63/access-a-samba-share-via-c?forum=csharpgeneral it should just be a case of using the path like: \SERVER\media\AgentDVR
and making sure the container has permission to write to that location

maybe it's the addition of the / at the end of the path that's breaking something.

On Wed, Oct 6, 2021 at 9:54 AM doitandbedone @.***> wrote:

Hello, you have to remember that docker containers run on a sandbox and only see what you allow them to see. In this case, the container runs on it's own network and is only allowed to talk to other services via the ports allowed, which you have specified on the run command.

With that said, for this to work, you would have to include some sort of plug in or communication channel for the container to reach your samba share. I did a quick search and some things popped up.

Check this thread:

https://stackoverflow.com/questions/27989751/mount-smb-cifs-share-within-a-docker-container

If everything else fails, you can try using agent outside of docker, but to be honest I'm not sure if agent supports it out of the box.

@ispysoftware https://github.com/ispysoftware can you elaborate on support for SMB shares?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/325#issuecomment-935244220, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXN47GTCDYM4XJ3DBMTUFOT4NANCNFSM5FNAX5JA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ispysoftware avatar Oct 06 '21 02:10 ispysoftware

I then mounted the docker disk to the home assistant, it remains to be done as in the instructions. Only I have already turned off the PC and go to bed. I'll finish it in the afternoon. I just wish the agent DVR could place files on network drives

https://community.home-assistant.io/t/mount-remote-smb-share-on-hassio/116734/28?u=divanx10

DivanX10 avatar Oct 06 '21 02:10 DivanX10

it can if you use windows, you can add network locations.

it looks like you have to use a library to write to samba shares from linux, something like:

https://github.com/ume05rw/EzSmb

unfortunately adding support for that is a *lot *of work

On Wed, Oct 6, 2021 at 10:29 AM DivanX10 @.***> wrote:

I then mounted the docker disk to the home assistant, it remains to be done as in the instructions. Only I have already turned off the PC and go to bed. I'll finish it in the afternoon. I just wish the agent DVR could place files on network drives

https://community.home-assistant.io/t/mount-remote-smb-share-on-hassio/116734/28?u=divanx10

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/325#issuecomment-935284829, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXIV45PRCYN4QXC5KBLUFOX7XANCNFSM5FNAX5JA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ispysoftware avatar Oct 06 '21 02:10 ispysoftware

I went the other way. Implemented by means of Synology. Created the HAOS folder at /agent/media with the mkdir HAOS command image

In Synology, in the Docker network folder, I created the AgentDVR folder where I mounted the Media network folder from the home assistant image image

In the container settings, in the volumes section, I specified where to put the files image.

In the storage settings, I specified the path to the HAOS folder image

The Agent DVR folder will appear in the Home Assistant image

DivanX10 avatar Oct 06 '21 11:10 DivanX10

AgentDVR has an FTP setup. Is it possible to do the same, but for samba? Create a separate setting where there will be a window where we specify the path to the network folder where we need to put the video and login\password

image image

DivanX10 avatar Oct 06 '21 11:10 DivanX10

There must be some other software that does that like copies content from a local directory to a samba share?

On Wed, 6 Oct 2021, 19:36 DivanX10, @.***> wrote:

AgentDVR has an FTP setup. Is it possible to do the same, but for samba? Create a separate setting where there will be a window where we specify the path to the network folder where we need to put the video and login\password

[image: image] https://user-images.githubusercontent.com/64090632/136194873-216df3bf-9f42-4132-bc56-d73915af7560.png [image: image] https://user-images.githubusercontent.com/64090632/136195103-1295a978-16e3-439b-819e-4010aa3be6ea.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/325#issuecomment-936063956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXMT6TICON3MGORHD3DUFQYDJANCNFSM5FNAX5JA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ispysoftware avatar Oct 06 '21 12:10 ispysoftware

You could just put an ftp server on the target computer. Loads of free ones available.

On Wed, 6 Oct 2021, 19:36 DivanX10, @.***> wrote:

AgentDVR has an FTP setup. Is it possible to do the same, but for samba? Create a separate setting where there will be a window where we specify the path to the network folder where we need to put the video and login\password

[image: image] https://user-images.githubusercontent.com/64090632/136194873-216df3bf-9f42-4132-bc56-d73915af7560.png [image: image] https://user-images.githubusercontent.com/64090632/136195103-1295a978-16e3-439b-819e-4010aa3be6ea.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/325#issuecomment-936063956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXMT6TICON3MGORHD3DUFQYDJANCNFSM5FNAX5JA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ispysoftware avatar Oct 06 '21 12:10 ispysoftware

I have FTP on Synology, but we are talking about a home assistant and there I use the samba addon. This is the most convenient way to access network folders. Therefore, it would be more logical to add a samba setting to AgentDVR. I found a way for Synology, but not everyone has Synology and raises AgentDVR on different machines. I also added the Folder Watcher integration, which tracks files in the /media/agent DVD/video/VPIRD folder/ Thanks to this, I can send videos in a telegram

image

DivanX10 avatar Oct 06 '21 13:10 DivanX10

I made a manual how it can be implemented

DivanX10 avatar Oct 06 '21 18:10 DivanX10

If you can add samba to Agent DVR, then don't close this post, if you still can't do it, then it's okay. then close this question.

DivanX10 avatar Oct 06 '21 18:10 DivanX10

Again I would recommend on looking for plugins on how to expose samba shares as volumes for docker. This would be the fatest route for you.

On Wed, Oct 6, 2021, 11:45 AM DivanX10 @.***> wrote:

If you can add samba to Agent DVR, then don't close this post, if you still can't do it, then it's okay. then close this question.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/325#issuecomment-936885955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AORTFNEGCBI2JTAXMFIOCGTUFSKLRANCNFSM5FNAX5JA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

doitandbedone avatar Oct 06 '21 18:10 doitandbedone

That's cool - it seems you know more about home assistant than I do - maybe you could write the addon? it looks quite straightforward..

https://developers.home-assistant.io/docs/add-ons/tutorial/

On Thu, Oct 7, 2021 at 2:43 AM DivanX10 @.***> wrote:

I made a manual https://community.home-assistant.io/t/agentdvr-nas-synology-telegram/344520 how it can be implemented

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/325#issuecomment-936883086, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXLPYCF4DPGPZHSXZUTUFSKFJANCNFSM5FNAX5JA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ispysoftware avatar Oct 06 '21 22:10 ispysoftware

I'm just an experienced user). I can't write programs or add-ons. Although, if you think about it, then you need a plug-in for the Agent DVR itself so that it can mount the Home Assistant network drive and will put the video into the Media folder

DivanX10 avatar Oct 06 '21 23:10 DivanX10