[IDEA] allow sshfs mount remote storage (rights access issue solved for sshfs) - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8) +--- Thread: [IDEA] allow sshfs mount remote storage (rights access issue solved for sshfs) (/showthread.php?tid=5309) |
RE: [IDEA] allow sshfs mount remote storage - TheOldPresbyope - 01-18-2023 Obviously I'm living with moOde not being secure. I'm still concerned about storing credentials for other systems in moOde. Using sshfs looks especially problematic to me because it involves actual ssh credentials. I guess one could always take the caveat emptor approach. Whatever one thinks of the overall Samba security model, the password-less guest access to a share doesn't require local storage of security credentials. Yes, other modes are possible but that's not how I've configured my NAS'es for use with moOde. As for NFS, I'm already on record in previous threads of not being a fan (but you don't need to hear old war stories). I've taken up too much bandwidth; it's time for this old curmudgeon to retreat to his lair. Regards, Kent RE: [IDEA] allow sshfs mount remote storage - Phil35 - 01-18-2023 Hi, I tought it was possible to mount localy the remote directory on /mnt/SDCARD using sshfs as I wrote. I think I am wrong? @Tim Curtis I fully agree with for item 1. 2. and 3. Note for raspberry, now when an image is installed the default pi user don't exist any more A file named 'userconf.txt' must be created with one line: username:encoded_password Phil RE: [IDEA] allow sshfs mount remote storage - TheOldPresbyope - 01-18-2023 (01-18-2023, 07:00 PM)Phil35 Wrote: Hi, What isn't working? I have no difficulty mounting a remote directory either to /mnt/NAS/SSHFS or to /mnt/SDCARD/SSHFS where, in both cases, I first created the /mnt/../SSHFS mountpoint in the moOde filesystem. This makes it much easier to unmount the remote directory after I'm done. Using either mountpoint, moOde (well, MPD actually) happily scans the new files and does all the usual things with them. As an aside, I don't understand why you'd need to use the -p option, which specifies a port. Regards, Kent ETA: Wait, recall what I said back in post #9 "...using sshfs with minimal options to allow others to access the directory besides its owner." What options are you using for permissions? RE: [IDEA] allow sshfs mount remote storage - Tim Curtis - 01-18-2023 We set the default password for user pi in an image builder conf file. https://github.com/moode-player/imgbuild/blob/main/moode-cfg/config A password change request for the user pi could be part of the first-use process in moOde. Something like below. Code: Create a password for the user pi [xxxxxxxxxxxxxxxx]" RE: [IDEA] allow sshfs mount remote storage - Phil35 - 01-19-2023 Hi, Thanks for your patience. @TheOldPresbyope: -p because even internaly default ports are not used in my home network so ssh port number is not 22 but 54321, yes now you know one secret but yes you're right by default the option -p is not needed, because ssh default port number is 22. @Tim Curtis: it works for you not for me ... this is normal isn't it you're the boss, the man who knows. In the directory links are OK (see below). I have done as you ie mkdir /mnt/SDCARD/SSHFS and then mount here. however: - on the web page .. only entries displayed are: NAS Default Playlist Favorites no USB nor SDCARD I tried to restart servers ie moodeutl -r , then moodeutil -t but no USB nor SDCARD are shown on the web page. What do I have done wrong? Code: 20230119 135947 worker: -- Music sources Code: cd /var/lib/mpd/music Code: ls -lalrt mpd/music/SDCARD/ Code: mpd -V Code: moode-player 8.2.4-1moode1 RE: [IDEA] allow sshfs mount remote storage - TheOldPresbyope - 01-19-2023 @Phil35 I have a Music.local directory in my home directory on a Linux host that I use for testing various metadata schemes, file formats, etc. In the following test, I've edited in "me" for my actual username and "host" for the actual hostname. Also, although I prefer placing remote directories under /mnt/NAS, here I'm using /mnt/SDCARD to match your test. I've already created the subdirectory /mnt/SDCARD/SSHFS. So, starting with a stock moOde 8.2.4 player on host m824p4b Code: #mount the remote directory using sshfs I tell the moOdeUI to Update library and see the mpd log rolling as it adds the new files to its database Code: pi@m824p4b:~ $ tail -f /var/log/mpd/log The new tracks show up as appropriate in all moOdeUI views---don't forget to refresh the browser after updating the library--and I'm listening to a track now. Here's the audio info reported Code: SDCARD/SSHFS/Brahms, Johannes-Piano Concerto No 1 & Two Songs for Alto/01.Piano Concerto No 1 in D minor - 1 - Maestoso (Stephen Kovacevich, piano).flac Now let's see what happens if I don't explicitly set any permissions in sshfs. First, reboot moOde just to clear the air and then Code: pi@m824p4b:~ $ sudo sshfs me@host.local:/home/me/Music.local /mnt/SDCARD/SSHFS Clearly, this is useless. At a minimum, sshfs -o allow_other is required. I added default_permissions out of habit but I don't think it's necessary (or may even be redundant). Hope this helps. Regards, Kent RE: [IDEA] allow sshfs mount remote storage - Phil35 - 01-19-2023 Hi, Thank you @TheOldPresbyope Good and bad news ... good Code: I can see the update in mpd log .. bad on the home page of moode, (of course I refresh the browser) If I click on " SD CARD" then only one entry "Stereo Test" SSHFS not displayed Code: root@moode:/home/pi# ls -larlt /mnt/SDCARD/ I tested with using sshfs with user = root group = root and also (another test) user = pi group = pi .. nothing change SSHFS still not displayed I should see all songs twice Code: //192.168.6.237/music 2879621632 2002778124 876843508 70% /mnt/NAS/NAS I'am sorry Phil RE: [IDEA] allow sshfs mount remote storage - TheOldPresbyope - 01-19-2023 I'm away from my system now so just one comment. The Library Folder view will show only the directories in which or below which the mpd scan found music tracks. SSHFS won't show up until the remote directory is mounted properly and the library updated. Regards, Kent RE: [IDEA] allow sshfs mount remote storage - Phil35 - 01-21-2023 Hi Kent, Ok Tested. 1/ remote directory mounted via sshfs on /mnt/SDCARD/SSHFS. Musics are there, files and directories are there ... update library sees nothing more I have click on "clear library tag cache" "regenerate thumbnail" I may read on the webpage "View Status" the scan is running ok in /mnt/SDCARD/SSHFS/........ I may read a correct result with moodeutl -t Code: 20230121 164828 mpdindex: Done: indexed 1 artists, 1 albums, 1 songs However nothing better the webpage still shows only "Stereo Test" 2/ umount /mnt/SDCARD/SSHFS copying some music files localy in /mnt/SDCARD/SSHFS, update library and music is there Good the webpage shows now two entries "SSHFS" and "Stereo Test" , entering SSHFS, music is there and can be played. That's crazy, on this raspberry mpd do not find the files and directories under /mnt/SDCARD/SSHFS when remote directory is mounted there. As I already wrote, this is the same remote than the mounted as NAS Phil fyi: I found a problem but nothing to deal with moode, got these errors messages, problem with around 20 files themselfves Code: 20230121 164413 thumb-gen: Scanning: NAS, SDCARD RE: [IDEA] allow sshfs mount remote storage - TheOldPresbyope - 01-21-2023 (01-21-2023, 03:59 PM)Phil35 Wrote: Hi Kent, If you don't show details, I can only make guesses. What was the exact command you entered to mount the directory and how did you determine things "are there"? My first guess is that you have incorrect permissions on directories and/or files. Quote:update library sees nothing more This snippet of output from moodeutl reinforces my guess since there appears that only one album and track are found in this scan---e.g., the Stereo Test---and that your thumbnail cache already contained 1333 thumbs with no new ones added. Quote:2/ umount /mnt/SDCARD/SSHFS This last tells you that MPD can't find metadata to index in these files (I suppose they are MP3 files). That's a problem for Album and Tag views but these files should still show up in the Folder view, just not nicely tagged. ETA - oops - Obviously this error message relates not to MPD but to the thumbnail generator script which, among other things, checks for coverart which may be embedded in ID3v2 metadata. Still not a problem for the Folder view. You can use mpc from the command line to explore the MPD database and status.
Good luck. Regards, Kent |