Centova Technologies Forum

Centova Cast v3 => Bugs and issues => Topic started by: Roberto Brandolini on October 30, 2012, 07:45:39 am

Title: Symlinks don't work in media library
Post by: Roberto Brandolini on October 30, 2012, 07:45:39 am
Hi Steve,
I see that symlinks doesn't sync in the media library.
I have 2 symlinks folders in the media directory (I usually use them with cc2) but songs in the shared folders don't sync the media library. I try tu lunch the media library update but nothing. I can only see songs uploaded in the media folder but not ones in the shared folders.
Is it a bug?  In the conf file verything about symlinks is "true" so is all enabled.
Title: Re: Symlinks don't work in media library
Post by: Centova - Steve B. on October 30, 2012, 03:32:58 pm
This is intentional behavior -- CCv3 will not follow symlinks for security reasons.  Any symlink-related options remaining in the configuration files are are remnants from v2 and we should remove those to avoid confusion.

You can use bind mounts (described here (http://www.centova.com/doc/cast/internals/files) in the v3 wiki, under "Client Data (Linux)") to achieve the same behavior.  The difference is that bind mounts can only be initially set up by the root user, whereas symlinks can be created by anyone and thus can be a security issue.
Title: Re: Symlinks don't work in media library
Post by: Roberto Brandolini on October 30, 2012, 05:08:34 pm
mmmm  yes but I try without success.

I need to share for example 1 folder (only one) on more different accounts.
I try with mount but after setting the linked folder result empty in the spool/media/  of the account.

Example:   I have a folder like  /var/shared/pop

In this folder I put some mp3 files

So I create an account: test
I need to sync the pop folder to
/usr/local/centovacast/var/vhosts/test/var/spool/media/pop

I try to do like the link you told me:

edit fstab and add:
/usr/local/centovacast/var/vhosts/test/var/spool/media/pop  /var/shared/pop  none  bind

and run:
mount /usr/local/centovacast/var/vhosts/test/var/spool/media/pop

but nothing happen...
in the file manager of test I can't see the folder pop
Where I get wrong?

Thanks for your help
Title: Re: Symlinks don't work in media library
Post by: Roberto Brandolini on October 31, 2012, 04:52:11 am
Ok Steve,
I understand how it work. It was the inverse. I have to mount  /var/shared/pop  and I can see the shared content in the file maneger of the account.
But there's no way to sync...  the behavior is the same than symlinks.  I can see the files in account file manager but not in the media library.

But if it will work...

How I can mount same shared directory to different accounts?  And how to umount only to a specific account in a future without umount other clients?

With symlink was more simple and powerfully. (I think... but I can get wrong)
Title: Re: Symlinks don't work in media library
Post by: Roberto Brandolini on October 31, 2012, 08:15:50 am
Sorry Steve for continusly replay...  but I'm working for testing.

I discovered a thing:

Indeed the mount works fine... the problem is the sync with media library.
I see that media library sync and update only when you add a file with cc3 file manager or FTP.
If you delete a file in the media folder and wait for the sync nothing happen, equally if you force the mediascan cron.
The only way to see changes in the media library is upload at least one file in the media folder. Only after that, any changes done in the media library (including deleted files) are synchronized.

And the the shared folder with mount works fine too...  but only after adding at least one file in the normal media folder the content in shared folders are views and sync with media library.

Is it probably a bug?
Title: Re: Symlinks don't work in media library
Post by: Centova - Steve B. on October 31, 2012, 03:54:09 pm
This is intentional (and documented) behavior.

To update a media library after making external changes (outside of Centova Cast) you can use:
/usr/local/centovacast/bin/ccmanage reindex [username]