Advertisement
whateverworks240

Setup

Apr 22nd, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. Using ocamlfuse as mount with rclone decrypting locally with gdrive :
  2.  
  3. 1. Edit /etc/fuse.conf & uncomment user_allow_other.
  4.  
  5. 2. Enable root with (optional):
  6.  
  7. sudo passwd root
  8. (write password for root)
  9. sudo passwd -u root
  10.  
  11. 3. Install UFW firewall
  12.  
  13. apt‐get install ufw
  14. sudo ufw default deny incoming
  15. sudo ufw default allow outgoing
  16. ufw allow X ( X being your SSH port)
  17. ufw allow 32400
  18. ufw allow 8181
  19. ufw enable
  20.  
  21. 4. Install rclone
  22.  
  23. curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
  24. apt install unzip
  25. unzip rclone-current-linux-amd64.zip
  26. cd rclone-*-linux-amd64
  27.  
  28. sudo cp rclone /usr/sbin/
  29. sudo chown root:root /usr/bin/rclone
  30. sudo chmod 755 /usr/bin/rclone
  31.  
  32. sudo mkdir -p /usr/local/share/man/man1
  33. sudo cp rclone.1 /usr/local/share/man/man1/
  34. sudo mandb
  35.  
  36. 5. Install ocamlfuse
  37.  
  38. sudo add-apt-repository ppa:alessandro-strada/ppa
  39. sudo apt-get update
  40. sudo apt-get install google-drive-ocamlfuse
  41.  
  42. 6. Install plex
  43.  
  44. wget https://downloads.plex.tv/plex-media-server/1.5.5.3634-995f1dead/plexmediaserver_1.5.5.3634-995f1dead_amd64.deb
  45.  
  46. dpkg -i plexmediaserver_1.5.5.3634-995f1dead_amd64.deb
  47.  
  48. 7. Install plexpy as daemon
  49.  
  50. apt-get install python2.7
  51. apt-get install git-core
  52. cd /opt
  53. git clone https://github.com/JonnyWong16/plexpy.git
  54.  
  55. Create file "plexpyservice.system" at /etc/systemd/system with :
  56.  
  57. [Unit]
  58. Description=PlexPy - Stats for Plex Media Server usage
  59.  
  60. [Service]
  61. ExecStart=/opt/plexpy/PlexPy.py --quiet --daemon --nolaunch --config /opt/plexpy/config.ini --datadir /opt/plexpy
  62. GuessMainPID=no
  63. Type=forking
  64. User=plexpy
  65. Group=nogroup
  66.  
  67. [Install]
  68. WantedBy=multi-user.target
  69.  
  70. Then run :
  71.  
  72. ln -s /usr/bin/python2.7 /usr/bin/python
  73. sudo adduser --system --no-create-home plexpy
  74. sudo chown plexpy:nogroup -R /opt/plexpy
  75. systemctl daemon-reload
  76. systemctl enable plexpy.service
  77. systemctl start plexpy.service
  78.  
  79. 8. To set up ocamlfuse
  80.  
  81. su plex
  82. google-drive-ocamlfuse -headless -label me -id [redacted]apps.googleusercontent.com -secret [redacted]
  83.  
  84. 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.
  85.  
  86. 10. Create media folder and set up rclone to run as plex user
  87.  
  88. mkdir /var/lib/plexmediaserver/media/
  89. cd /var/lib/plexmediaserver/
  90. mkdir .config
  91. mkdir .config/rclone
  92. cd /var/lib/plexmediaserver/.config/rclone
  93. touch rclone.conf
  94. mkdir /var/lib/plexmediaserver/mount/
  95.  
  96. 11. Edit your rclone.conf file to reflect the one you already have but you'll edit this :
  97.  
  98. [crypt]
  99. type = crypt
  100. remote = /var/lib/plexmediaserver/mount ## or mount/path/
  101. filename_encryption = standard
  102. password = xxxxx
  103. password2 = xxxxx
  104.  
  105. 12. Mount with ocamlfuse
  106.  
  107. su plex
  108. google-drive-ocamlfuse -label me /var/lib/plexmediaserver/mount/
  109.  
  110. 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 &
  111.  
  112. 13. Edit /etc/rc.local to mount the drive and start plex
  113.  
  114. service plexmediaserver stop
  115.  
  116. sleep 1s
  117.  
  118. sudo -u plex google-drive-ocamlfuse -label me /var/lib/plexmediaserver/mount/
  119.  
  120. sleep 2s
  121.  
  122. 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 &
  123.  
  124. sleep 7s
  125.  
  126. service plexmediaserver start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement