TechPerplexed / Gooby

Gooby: The ultimate infinite Plex media server using a VPS and Cloud service
https://bit.ly/Tech_Perplexed
GNU General Public License v3.0
286 stars 43 forks source link

Decoupling Google Drive from Gooby (switching to SMB) #221

Closed bifa2 closed 8 months ago

bifa2 commented 1 year ago

Hi,

Would it be possible to get some help figuring out how to unpick Google Drive support from Gooby? And, ensure these changes aren't overwritten by say, rclean or scheduled task that pulls from this repo?

For context, I've done the following to test migrating away from Google Drive:

  1. Ran rclone config to add a new SMB mount.
  2. Edited the Plex section in /var/local/Gooby/Docker/docker-compose.yaml to contain a new volume (e.g. ${TV}:/tv).
  3. Copied this into 21-plex.yaml so I don't lose it for any reason.
  4. Edited the Mounts and locations section in /var/local/Gooby/Docker/.env to contain said path (e.g. TV=/mnt/tv).
  5. Ran the following to mount it: rclone mount tempsmb:TEMP/TV/ /mnt/tv/ --daemon --allow-other --log-file /home/myusername/logs/rclonetemp.log --uid 1000 --gid 1000 --umask=002 --dir-perms=770 --file-perms=0664
  6. Ran docker compose up -d to rebuild Plex so it can see /tv

This works, but I'm concerned that after a reboot the mounts won't come up (I don't actually know what is controlling rclone mounts being re-established after a reboot), or essentially that something is going to happen to break the changes without manual intervention to fix it. rclean was once amazing, now it's scary 😆

There are many .sh scripts in /opt/Gooby that reference rclone but I'm not sure I'd know quite where to start. Happy to try and help where I can :)

TechPerplexed commented 1 year ago

To be honest, I am not using Gooby or Omni at all for my NAS now. I use a Docker compose file, created a project on the Synology itself and that's enough for me/us. So I'm mighty glad it works for you ^_^

As for the reboot: there is a line in cron that runs @boot - just comment that out and a reboot shouldn't mess with anything.

To disable Gooby from updating after rclean, comment out or remove the line

sudo git clone -b v2 https://github.com/TechPerplexed/Gooby /opt/.Gooby

in scripts/cron/rclone.sh. That will keep the version as you adapted it for your needs and shouldn't change anything then. I don't know though if that would mess with the adaptations you have made with your configuration, so I would actually advise against running rclean at all.... not quite the answer you wanted to hear but that is about as far as my knowledge goes of not using Google Drive in combination with Gooby :)

bifa2 commented 1 year ago

Unfortunately my server ran out of space and I had to reboot it, and then it deleted all the values I'd added to the .env file so docker compose no longer works (invalid volumes). An easy fix thankfully.

I've now commented out all the lines in the cron file:

#@reboot /opt/Gooby/scripts/cron/rclean.sh > /dev/null 2>&1
#0,15,30,45 * * * * /opt/Gooby/scripts/cron/syncmount.sh > /dev/null 2>&1
#15 2 * * SUN /opt/Gooby/scripts/cron/backup.sh > /dev/null 2>&1
#10 2 1 * * /bin/resetbackup > /dev/null 2>&1

and edited the rclean.sh file to remove that line also just incase it is ran.

Do you know how Gooby was making rclone mount google drive after every reboot?

TechPerplexed commented 1 year ago

Well, basically don't run rclean at all.... Because just about everything between the Docker down and Docker up commands has become obsolete, because a large part of Gooby was making sure that the mount was up and running before bringing up the containers. Since you/we have everything local now, none of that is needed any longer.

bifa2 commented 1 year ago

I was unclear; apologies. I'm trying to make sure my rclone SMB mounts come up after every reboot as they didn't after the last reboot (they aren't local, so in essence I'm replacing Google Drive with the SMB alternative hosted on another server). Google Drive still gets mounted after reboots but that isn't a problem - I will find a way to stop that somehow. I'll see if I can make a cron job that runs something like @reboot /home/myusername/mountsmb.sh > /dev/null 2>&1.