Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Using ocamlfuse as mount with rclone decrypting locally with gdrive :
- 1. Edit /etc/fuse.conf & uncomment user_allow_other.
- 2. Enable root with (optional):
- sudo passwd root
- (write password for root)
- sudo passwd -u root
- 3. Install UFW firewall
- apt‐get install ufw
- sudo ufw default deny incoming
- sudo ufw default allow outgoing
- ufw allow X ( X being your SSH port)
- ufw allow 32400
- ufw allow 8181
- ufw enable
- 4. Install rclone
- curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
- apt install unzip
- unzip rclone-current-linux-amd64.zip
- cd rclone-*-linux-amd64
- sudo cp rclone /usr/sbin/
- sudo chown root:root /usr/bin/rclone
- sudo chmod 755 /usr/bin/rclone
- sudo mkdir -p /usr/local/share/man/man1
- sudo cp rclone.1 /usr/local/share/man/man1/
- sudo mandb
- 5. Install ocamlfuse
- sudo add-apt-repository ppa:alessandro-strada/ppa
- sudo apt-get update
- sudo apt-get install google-drive-ocamlfuse
- 6. Install plex
- wget https://downloads.plex.tv/plex-media-server/1.5.5.3634-995f1dead/plexmediaserver_1.5.5.3634-995f1dead_amd64.deb
- dpkg -i plexmediaserver_1.5.5.3634-995f1dead_amd64.deb
- 7. Install plexpy as daemon
- apt-get install python2.7
- apt-get install git-core
- cd /opt
- git clone https://github.com/JonnyWong16/plexpy.git
- Create file "plexpyservice.system" at /etc/systemd/system with :
- [Unit]
- Description=PlexPy - Stats for Plex Media Server usage
- [Service]
- ExecStart=/opt/plexpy/PlexPy.py --quiet --daemon --nolaunch --config /opt/plexpy/config.ini --datadir /opt/plexpy
- GuessMainPID=no
- Type=forking
- User=plexpy
- Group=nogroup
- [Install]
- WantedBy=multi-user.target
- Then run :
- ln -s /usr/bin/python2.7 /usr/bin/python
- sudo adduser --system --no-create-home plexpy
- sudo chown plexpy:nogroup -R /opt/plexpy
- systemctl daemon-reload
- systemctl enable plexpy.service
- systemctl start plexpy.service
- 8. To set up ocamlfuse
- su plex
- google-drive-ocamlfuse -headless -label me -id [redacted]apps.googleusercontent.com -secret [redacted]
- 9. Get the code and then go to /var/lib/plexmediaserver/.gdfuse/me and add your custom config file there with that code and your client id & secret & authorization code.
- 10. Create media folder and set up rclone to run as plex user
- mkdir /var/lib/plexmediaserver/media/
- cd /var/lib/plexmediaserver/
- mkdir .config
- mkdir .config/rclone
- cd /var/lib/plexmediaserver/.config/rclone
- touch rclone.conf
- mkdir /var/lib/plexmediaserver/mount/
- 11. Edit your rclone.conf file to reflect the one you already have but you'll edit this :
- [crypt]
- type = crypt
- remote = /var/lib/plexmediaserver/mount ## or mount/path/
- filename_encryption = standard
- password = xxxxx
- password2 = xxxxx
- 12. Mount with ocamlfuse
- su plex
- google-drive-ocamlfuse -label me /var/lib/plexmediaserver/mount/
- rclone mount crypt: /var/lib/plexmediaserver/media/ --read-only --allow-other --max-read-ahead 1024k --buffer-size 512M --log-level DEBUG --log-file=/var/lib/plexmediaserver/mount.log &
- 13. Edit /etc/rc.local to mount the drive and start plex
- service plexmediaserver stop
- sleep 1s
- sudo -u plex google-drive-ocamlfuse -label me /var/lib/plexmediaserver/mount/
- sleep 2s
- sudo -u plex rclone mount crypt: /var/lib/plexmediaserver/media/ --read-only --allow-non-empty --allow-other --max-read-ahead 1024k --buffer-size 900M --log-level INFO --log-file=/var/lib/plexmediaserver/mount.log &
- sleep 7s
- service plexmediaserver start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement