{"id":58,"date":"2015-05-05T07:53:23","date_gmt":"2015-05-05T07:53:23","guid":{"rendered":"http:\/\/fluentreports.com\/blog\/?p=58"},"modified":"2015-05-05T07:53:23","modified_gmt":"2015-05-05T07:53:23","slug":"dlna-servers-with-passwordable-folders","status":"publish","type":"post","link":"https:\/\/fluentreports.com\/blog\/?p=58","title":{"rendered":"DLNA Servers with Passwordable Folders"},"content":{"rendered":"<p>Over the last couple years I have played around with several DLNA servers and other media servers on my own network. \u00a0 \u00a0 \u00a0I like to eliminate the physical media and make it as simple as possible to listen to my favorite music or watch a video\u00a0from anywhere in my dwelling. \u00a0 Since I have kids and a wife, I need to make it <strong>simple<\/strong> for everyone.<\/p>\n<p>However, based on my research the solutions for protected content have always been <strong>very<\/strong> lacking using straight DLNA. \u00a0 \u00a0The only solution I've seen to date using DLNA is setting up Access Groups based on the device playing the media. \u00a0 However, this solution is very\u00a0lacking in that their is no way to know who is actually using that device. \u00a0 \u00a0 The only other choice I have seen is to not use DLNA, but instead <span style=\"line-height: 1.714285714; font-size: 1rem;\">use a custom front and back end to protect the content. This isn't a horrible\u00a0option if the front end is available for ALL your devices. \u00a0<\/span><\/p>\n<p>Up until now;\u00a0neither option was a good fit for me. \u00a0 So, about a month ago I figured out TWO ways to attack this problem. \u00a0 \u00a0 \u00a0The first option I really liked the best; but unfortunately after doing some research and playing with a couple DLNA clients -- I discovered not all DLNA players support searching. \u00a0 \u00a0 So, my first idea of using the search system to allow input of password was nixed. \u00a0 I needed whatever I was going to do to be fully universal and several of my devices just didn't support searching.<\/p>\n<p>So my\u00a0second \"ingenious\" idea became the actual final working implementation. \u00a0 \u00a0Basically, I add a new \"virtual folder\" (a DLNA Container Object) to the top level folders called \"Password\". \u00a0 \u00a0 The rest of the folders remain the same. \u00a0 \u00a0 \u00a0In the Password folders; I put in 10 folders; labeled 0 through 9. In those folders are another 10 folders (again 0 through 9), until you have the number of digits you need. \u00a0 \u00a0So if you had a password of 1234, you would navigate to \"Password\", \"1\", \"2\", \"3\", \"4\" and then either use the \"Back\" or \"Top\" button to return to the top level. \u00a0 \u00a0 The DLNA server, saw that you hit a 4 digits, and so it then saves this as a entered password. \u00a0 \u00a0 Now any content that is marked with that password now actually shows up in the list of available media. \u00a0Pretty simple and a very ingenious\u00a0method to allow password entries! \u00a0 \u00a0 Their is no reason that I couldn't do 0-9 and a-z; other than it makes navigation a lot larger when you are having to scroll through 36 (or more) different\u00a0options rather than a simple 10 items.<\/p>\n<p>I have release my modified source code to minidlna on my own github.com account <a href=\"http:\/\/github.com\/nathanaela\/minidlna\" target=\"_blank\">http:\/\/github.com\/nathanaela\/minidlna<\/a> -- I will be sending a patch to the author Justin; but their are no guarantees that these changes will be accepted in the mainline as I\u00a0do have a couple potential issues outlined below.<\/p>\n<p>A couple notes:<br \/>\nYou can enter as many passwords as you want; each time you enter a new password it remembers it for your entire session. This way you can actually have multiple passwords for different content. \u00a0 Entering all Zeros for a password will clear all\u00a0passwords you have entered during that session. \u00a0 When a DLNA client disconnects from the server; the server will also forget any passwords that the client has entered for that session. \u00a0 Each client has its own list of passwords; so entering the password on Device 1; does not make the content show up on any other devices.<\/p>\n<p>2. New minidlna.conf configuration option:<br \/>\n- password_length = 1-10 (defaults to 4); this allows you to set how long you want your passwords to be.<\/p>\n<p>3. New file for password configuration<br \/>\nYou need to create a <strong>.password<\/strong>\u00a0file in any directories you want protected. \u00a0This directory and ALL sub-directories under it will be protected then. \u00a0\u00a0\u00a0This is a simple text file. \u00a0 At this point it is NOT encrypted or hashed. \u00a0It is raw text; so \"technically\" this is not very secure.\u00a0 However if I already have access to the folder to read your <strong>.password<\/strong> file; then I can already read the media in the folder -- so you already have a insecure setup. \u00a0 \u00a0 \u00a0I would recommend you change the permissions on this file to only allow the minidlna server to read it for better security. \u00a0 \u00a0Again, the only content in the <strong>.password<\/strong>\u00a0file is the password you want to use. \u00a0(ex: \u00a0<strong>echo 1111&gt;.password<\/strong>\u00a0would create a <strong>.password<\/strong> file with 1111 as the password for accessing this folder and all sub-folders). \u00a0 You can also add another <strong>.password<\/strong> file to a sub-folder of a already password protected folder and then that sub-folder (and any of its sub-folders) would use the new password.<\/p>\n<p>Gotchas:<br \/>\n1. Changing a password in a .password currently requires you to rebuild the database; as minidlna has to do a full scan to pick up the new password.<\/p>\n<p>2. If you attempt to use a password (of a different length ie. like 123 or 12345) and have the password length set to 4; you won't be able to enter either of those as the required length is 4.<\/p>\n<p>Thanks to\u00a0Justin Maggard for all his hard work on minidlna, without it I wouldn't have had a base to implement the password code.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the last couple years I have played around with several DLNA servers and other media servers on my own network. \u00a0 \u00a0 \u00a0I like to eliminate the physical media and make it as simple as possible to listen to my favorite music or watch a video\u00a0from anywhere in my dwelling. \u00a0 Since I have&hellip; <a class=\"more-link\" href=\"https:\/\/fluentreports.com\/blog\/?p=58\">Continue reading <span class=\"screen-reader-text\">DLNA Servers with Passwordable Folders<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[11,13,12,14],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-dlna","tag-media","tag-minidlna","tag-video","entry"],"_links":{"self":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=58"}],"version-history":[{"count":2,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":60,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions\/60"}],"wp:attachment":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}