Fix for droopy and minidlna

Posted by zebul666 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Fix for droopy and minidlna
June 19, 2015 02:31PM
Following my post about minidlna permission issue, I have found out that dropped file via the upload feature of Piratebox (into /opt/piratebox/share/Shared) have by default permission -rw-------.

This make those files unreadable by minidlna, and minidlna can not update, nor provide the newly dropped files.

So minidlna is still broken, even if you have taken care of the permission issue mentionned elsewhere.

Here is the fix for this:
--- /opt/piratebox/bin/droopy	2015-06-19 11:33:20.216375704 +0000
+++ /opt/piratebox/bin/droopy.2	2015-06-19 11:33:30.306281245 +0000
@@ -918,6 +918,7 @@
                 fout = file(localpath, 'wb')
                 shutil.copyfileobj(fileitem.file, fout)
+            os.chmod(localpath, 0644)
             self.log_message("Received: %s", os.path.basename(localpath))
             # -- Reply
This will add one line in droopy to automatically change permission on dropped file to world-readable. That way minidlna will notice the file, read it and update its database, and provides the newly dropped file.

By the way, what have you done to droopy file ? This is an utf-8 encoded file. This is important for the localised string and translation in the file. But you have managed to mess it up and now it's garbage. Instead of getting a nice 'Fichier re├žu' when I drop a file I got a weird character... I don't even talk about korean or chinese where it should be garbage and unreadable...
Re: Fix for droopy and minidlna
June 24, 2015 10:37PM
just to let you know about it.
I added your patch into the current image.

Thank you for your support smileys with beer
Re: Fix for droopy and minidlna
June 25, 2015 04:58PM
thank you for that fix.
I opened a github issue for fixing that. #109.
These changes shouldn't be only on the image itself, it should be in the origin changed, too.

About the utf8 problem, to be honest, no idea what happended. Maybe it would be worth to take the original script and reapply our changes. #110
Re: Fix for droopy and minidlna
June 25, 2015 09:38PM

this version contains a paramerter for chmod, no hardcoded permission required.
github droopy master

I don't know why we have our own version.

Maybe we could adapt to a more current version? grinning smiley

Re: Fix for droopy and minidlna
June 25, 2015 10:25PM
yes, I wanted to do the backport earlier this day and then recognized that.
We should adapt the new version. The only feature, which should be discussed, is the "password protected upload" feature... that is piratebox only. Do we need that?

And a special fix for the environment variable (see on the droopy repository the pull request by terrorbyte).