Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Seedbox Mount Tool

NotificationsYou must be signed in to change notification settings

LGUG2Z/sbmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card

sbmt

Plexdrive, Rclone and UnionFS mount management made easier.

Overview

The Seedbox Mount Tool (sbmt) is a single binary intended to help ensure the integrityof Plexdrive, Rclone and UnionFS mounts on a seedbox and synchronise data between localand cloud storage.

This project takes heavy inspiration from work already done byMads Lundt,Jamie and all the contributors over athoarding.me and the variousscripts and tips I found posted on thePlexACD subreddit.

Withsbmt I am trying to hit the sweet spot between the approach of Dockerising everythingand maintaining an array of bash scripts to enable the smooth running of a seedbox runningPlex and the seamless synchronisation of local and remotely stored media.An additional consideration that has had a big influence on the direction ofsbmt isthe desire to easily be able to switch from one seedbox to another and get up and runningagain as quickly as possible.

With a single binary managing mounting and ensuring mount integrity, dealing with synchronisingof local and remote data as well as ensuring any required cleanups of local and remote data,cron jobs can be copied easily from one seedbox to another, either maintaining an old folderstructure or implementing a new folder structure just by changing the flags passed to differentcommands.

Installation

The latest version of bfm can be installed usinggo get.

go get -u github.com/LGUG2Z/sbmt

Make sure$GOPATH is set correctly that and that$GOPATH/bin is in your$PATH.

Thesbmt executable will be installed under the$GOPATH/bin directory.

Prior Setup

Before schedulingsbmt commands to be run on a seedbox, there are some pieces of priorsetup required:

  1. Create anunencrypted remote for Google Drive using Rclone.Files uploaded to this remote will be stored unencrypted.
  2. Create anencrypted remote for Google Drive using Rclone.Files uploaded to this remote will be stored encrypted.
  3. ConfigurePlexdrive to be able to access your Google Drive account.Encrypted files viewed on this mount remain encrypted.
  4. Create a remote todecrypt the encrypted files mounted by Plexdrive.Encrypted files viewed on this mount will be shown in their unencrypted form.

Usage

The three commands ofsbmt aremount,upload andcleanup.

mount

The encrypted remote files on Google Drive are mounted by Plexdrive in the folderspecified using the--plexdrive flag. A local Rclone mount then reads theencrypted files in the plexdrive folder and shows their unencrypted representationin the folder specified using the--decrypt flag. A UnionFS mount is thencreated at the location specified by the--union flag, which shows a unifiedrepresentation of all of the files stored in Google Drive (in their unencryptedform, in the--decrypt location), and files that have been downloaded tothe local machine, in a folder specified using the--local flag.

The flow of data is as follows:

GDrive (enc) -> Plexdrive (enc) -> Rclone (dec) -> UnionFS (dec).

In order to show an unencrypted representation of the data mounted by Plexdrive,a separate Rclone remote will have to be created, in which the remote locationis set to the local folder where Plexdrive will be mounted. The encryption typeand the encryption passwords should be the same as those set for the encryptedGoogle Drive remote. The name of this remote must be passed to the mount commandusing the--decrypt-remote flag.

If the mount command is run and all mounts are intact, no further action will betaken. Conversely, if any single mount is broken, every mount will be unmountedand remounted to re-establish mount integrity.

Example:

sbmt mount \    --plexdrive /plexdrive \    --decrypt-remote plexdrive-decryptor: \    --decrypt /decrypt \    --local /local \    --union /union

cleanup

Files deleted from read-only section of a UnionFS mount are not actually deleted butrather hidden from view. A record of these hidden files is kept in a hidden subfolder ofthe unionfs mount location (.unionfs). The cleanup command will iterate through all thefiles of this hidden subfolder, find the corresponding files in the location identifiedusing the--decrypt flag and remove them from Google Drive.

Example:

sbmt cleanup --decrypt /decrypt --union /union

upload

Files created in the read-write section of a UnionFS mount will be iterated over,encrypted, and uploaded to the Rclone remote specified using the--encrypt-remoteflag.

The upload command uses the rclonemoveto command, which ensures that the fileto be uploaded will automatically be removed from the local read-write folder assoon as the upload is confirmed as having been successful.

Example:

sbmt upload --local /local --encrypt-remote encrypted-remote:

unmount

The mounts are unmounted in the following order to ensure that there are no problemswith busy resources that prevent a successful unmounting operation:

UnionFS -> Rclone -> Plexdrive

Example:

sbmt unmount --union /union --decrypt /decrypt --plexdrive /plexdrive

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp