
    
    
    
        
            
    
    
        
            
    
    
        
                
    
    
        
            
    
    
        
        
{"version":"https:\/\/jsonfeed.org\/version\/1","title":"blog.laubacher.io","home_page_url":"https:\/\/blog.laubacher.io\/","feed_url":"https:\/\/blog.laubacher.io\/blog.json","description":"technology blog","author":{"name":"C\u00e9dric Laubacher"},"items":[{"title":"Keycloak with 2FA as Nextcloud backend","date_published":"2021-02-10T15:01:01+00:00","id":"https:\/\/blog.laubacher.io\/keycloak-with-2fa-as-nextcloud-backend","url":"https:\/\/blog.laubacher.io\/keycloak-with-2fa-as-nextcloud-backend","content_html":"<p>I've searched for a tutorial on how to use Keycloak as a user Backend for Nextcloud for weeks, but wasn't able to find one fitting my needs.<\/p>\n<p>I wanted a solution that fulfills the following criteria:<\/p>\n<ul>\n<li>use the correct username as the uid<\/li>\n<li>be able to manage the quota of users<\/li>\n<li>the least amount of running programs<\/li>\n<li>use only a single protocol<\/li>\n<\/ul>\n<p>This setup reduces the amount of passwords and 2FA needed for different services.\nIt also reduces the amount of logins, as you only need to login to one account.<\/p>\n<p>I used the following software:<\/p>\n<ul>\n<li><a href=\"https:\/\/nextcloud.com\">Nextcloud<\/a><\/li>\n<li><a href=\"https:\/\/www.keycloak.org\">Keycloak<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pulsejet\/nextcloud-oidc-login\">OpenID Connect Login Nextcloud App<\/a><\/li>\n<\/ul>\n<p>I assume you already have set up Nextcloud and an instance of Keycloak with a realm and users with the following URLs:<\/p>\n<ul>\n<li>Nextcloud: <a href=\"https:\/\/cloud.example.com\">https:\/\/cloud.example.com<\/a><\/li>\n<li>Keycloak: <a href=\"https:\/\/auth.example.com\">https:\/\/auth.example.com<\/a> with realm <code>example.com<\/code><\/li>\n<\/ul>\n<h2>Keycloak Configuration<\/h2>\n<h3>Add Client in Keycloak<\/h3>\n<ul>\n<li>In the Keycloak admin console, select your realm<\/li>\n<li>Create a new client: <code>Configure<\/code> &gt; <code>Clients<\/code> &gt; <code>Create<\/code>\n<ul>\n<li><code>Client ID<\/code>: <code>nextcloud<\/code><\/li>\n<\/ul><\/li>\n<li>Save and edit the new client\n<ul>\n<li><code>Access Typ<\/code>: <code>confidential<\/code><\/li>\n<li><code>Valid Redirect URIs<\/code>: <code>https:\/\/cloud.example.com\/apps\/oidc_login\/oidc<\/code> or <code>https:\/\/cloud.example.com\/*<\/code><\/li>\n<\/ul><\/li>\n<li>Copy the the secret under <code>Credentials<\/code><\/li>\n<\/ul>\n<h3>Create\/Modify Groups<\/h3>\n<p>Create groups as you like, eg. <code>admin<\/code>, and add your users to them. The groups will be mapped 1:1 to those in Nextcloud.\nNote that groups won't be created automatically in Nextcloud (Open <a href=\"https:\/\/github.com\/pulsejet\/nextcloud-oidc-login\/pull\/73\">PR<\/a>).<\/p>\n<p>Add a new attribute to the groups:  <code>Manage<\/code> &gt; <code>Groups<\/code> &gt; <strong><code>GROUP_NAME<\/code><\/strong> &gt; <code>Attributes<\/code> &gt; <code>Add<\/code><\/p>\n<ul>\n<li><code>Key<\/code>: <code>nextcloudquota<\/code><\/li>\n<li><code>Value<\/code>: <code>549755813888<\/code> This is the size in bytes, here 512GiB<\/li>\n<\/ul>\n<h3>Add Mappers<\/h3>\n<ul>\n<li>\n<p>Create a new Mapper:  <code>Configure<\/code> &gt; <code>Clients<\/code> &gt; <code>nextcloud<\/code> &gt; <code>Mappers<\/code> &gt; <code>Create<\/code><\/p>\n<ul>\n<li><code>Name<\/code>: <code>Nextcloud Quota<\/code><\/li>\n<li><code>Mapper Type<\/code>: <code>User Attribute<\/code><\/li>\n<li><code>User Attribute<\/code>: <code>nextcloudquota<\/code><\/li>\n<li><code>Token Claim Name<\/code>: <code>nextcloudquota<\/code><\/li>\n<li><code>Claim JSON Type<\/code>: <code>String<\/code><\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Create another Mapper:  <code>Configure<\/code> &gt; <code>Clients<\/code> &gt; <code>nextcloud<\/code> &gt; <code>Mappers<\/code> &gt; <code>Create<\/code><\/p>\n<ul>\n<li><code>Name<\/code>: <code>Groups Mapper<\/code><\/li>\n<li><code>Mapper Type<\/code>: <code>Group Membership<\/code><\/li>\n<li><code>Token Claim Name<\/code>: <code>groups<\/code><\/li>\n<li><code>Full group path<\/code>: <code>OFF<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Configure Nextcloud<\/h2>\n<ul>\n<li>Install <a href=\"https:\/\/github.com\/pulsejet\/nextcloud-oidc-login\">OpenID Connect Login<\/a> from the App Store<\/li>\n<li>\n<p>Edit the <code>config.php<\/code> file (there are no UI settings) with the according settings:<\/p>\n<pre><code>&lt;?php\n$CONFIG = array (\n\/\/ STANDARD NEXTCLOUD CONFIG\n\n\/\/ Some Nextcloud options that might make sense here\n'allow_user_to_change_display_name' =&gt; false,\n'lost_password_link' =&gt; 'disabled',\n\n\/\/ OIDC SPECIFIC CONFIG\n\n\/\/ URL of provider. All other URLs are auto-discovered from .well-known\n'oidc_login_provider_url' =&gt; 'https:\/\/auth.example.com\/auth\/realms\/example.com',\n\n\/\/ Client ID and secret registered with the provider\n'oidc_login_client_id' =&gt; 'nextcloud',\n\/\/ the secret you copied from Keycloak\n'oidc_login_client_secret' =&gt; '$SECRET',\n\n\/\/ Automatically redirect the login page to the provider\n'oidc_login_auto_redirect' =&gt; true,\n\n\/\/ Redirect to this page after logging out the user\n'oidc_login_logout_url' =&gt; 'https:\/\/auth.example.com\/auth\/realms\/example.com\/protocol\/openid-connect\/logout?redirect_uri=https%3A%2F%2Fcloud.example.com%2F',\n\n\/\/ Quota to assign if no quota is specified in the OIDC response (bytes)\n\/\/ 15GB\n'oidc_login_default_quota' =&gt; '549755813888',\n\n\/\/ Hide the NextCloud password change form.\n'oidc_login_hide_password_form' =&gt; true,\n\n\/\/ Attribute map for OIDC response\n'oidc_login_attributes' =&gt; array (\n    'id' =&gt; 'preferred_username',\n    'name' =&gt; 'name',\n    'mail' =&gt; 'email',\n    'quota' =&gt; 'nextcloudquota',\n    'groups' =&gt; 'groups',\n),\n\n\/\/ Set OpenID Connect scope\n'oidc_login_scope' =&gt; 'openid profile',\n\n\/\/ Disable creation of new...<\/code><\/pre><\/li><\/ul>","tags":["software","Nextcloud","LDAP","Keycloak","security"]},{"title":"The perfect nginx config","date_published":"2020-12-24T10:20:35+00:00","id":"https:\/\/blog.laubacher.io\/the-perfect-nginx-config","url":"https:\/\/blog.laubacher.io\/the-perfect-nginx-config","content_html":"<p>I use docker for all of my applications running on my unRAID server, but for nginx I didn't find any image that fulfilled all my needs. So I wrote my own dockerimage which you can find here: <a href=\"https:\/\/github.com\/Starbix\/dockerimages\/tree\/master\/nginx\">https:\/\/github.com\/Starbix\/dockerimages\/tree\/master\/nginx<\/a>.<\/p>\n<p>The following is my config and should explain what most things do and why.<\/p>\n<p><strong>nginx.conf<\/strong><\/p>\n<p>This limits the maximal connections per IP<\/p>\n<pre><code>worker_processes auto;\npid \/nginx\/run\/nginx.pid;\ndaemon off;\npcre_jit on;\n\nevents {\n    worker_connections 2048;\n    use epoll;\n}\n\nhttp {\n    limit_conn_zone $binary_remote_addr zone=limit_per_ip:10m;\n    limit_conn limit_per_ip 128;\n    limit_req_zone $binary_remote_addr zone=allips:10m rate=150r\/s;\n    limit_req zone=allips burst=150 nodelay;<\/code><\/pre>\n<p><br>The custom log format is needed for <a href=\"https:\/\/www.nginx.com\/products\/nginx-amplify\/\">nginx amplify<\/a> (statistics and more)<\/p>\n<pre><code>    include \/nginx\/conf\/mime.types;\n    default_type  application\/octet-stream;\n\n    log_format  main_ext  '$remote_addr - $remote_user [$time_local] \"$request\" '\n                          '$status $body_bytes_sent \"$http_referer\" '\n                          '\"$http_user_agent\" \"$http_x_forwarded_for\" '\n                          '\"$host\" sn=\"$server_name\" '\n                          'rt=$request_time '\n                          'ua=\"$upstream_addr\" us=\"$upstream_status\" '\n                          'ut=\"$upstream_response_time\" ul=\"$upstream_response_length\" '\n                          'cs=$upstream_cache_status' ;\n\n    access_log \/nginx\/logs\/nginx_access.log main_ext;\n    error_log \/nginx\/logs\/nginx_error.log warn;<\/code><\/pre>\n<p><br>The maximum upload size is 25GB\nnginx doesn't send that the webserver is <code>nginx<\/code> but <code>server<\/code><\/p>\n<pre><code>    client_max_body_size 25G;\n\n    aio threads;\n    aio_write on;\n    sendfile on;\n    keepalive_timeout 15;\n    keepalive_disable msie6;\n    keepalive_requests 100;\n    tcp_nopush on;\n    tcp_nodelay on;\n    server_tokens off;\n    more_set_headers 'Server: secret';<\/code><\/pre>\n<p><br>Content will be encoded in <a href=\"https:\/\/github.com\/google\/brotli\">br&ouml;tli<\/a> (which Safari now supports)<\/p>\n<pre><code>    gzip off;\n\n    brotli on;\n    brotli_static on;\n    brotli_buffers 16 8k;\n    brotli_comp_level 6;\n    brotli_types\n        text\/css\n        text\/javascript\n        text\/xml\n        text\/plain\n        text\/x-component\n        application\/javascript\n        application\/x-javascript\n        application\/json\n        application\/xml\n        application\/rss+xml\n        application\/vnd.ms-fontobject\n        font\/truetype\n        font\/opentype\n        image\/svg+xml;<\/code><\/pre>\n<p><br> This will include all config files from \/sites-enabled. The following configuration is the part you'll configure yourself.<\/p>\n<pre><code>    include \/sites-enabled\/*.conf;\n    include \/nginx\/custom_sites\/*.conf;\n    include \/nginx\/conf.d\/stub_status.conf;\n}<\/code><\/pre>\n<p>The preceding configuration is part of the included nginx.conf of my Dockerimage.\n<br><\/p>\n<p>\/sites-enabled\/<strong>default.conf<\/strong><\/p>\n<p>These TLS parameters currently result in a 100% score in all categories on <a href=\"https:\/\/www.ssllabs.com\/ssltest\">https:\/\/www.ssllabs.com\/ssltest<\/a><\/p>\n<ul>\n<li>OCSP stapling is enabled you can learn more about it <a href=\"https:\/\/scotthelme.co.uk\/ocsp-stapling-speeding-up-ssl\/\">here<\/a><\/li>\n<li>I use <a href=\"https:\/\/scotthelme.co.uk\/hybrid-rsa-and-ecdsa-certificates-with-nginx\/\">hybrid certificates<\/a><\/li>\n<\/ul>\n<pre><code>upstream php-handler {\n    server unix:\/php\/run\/php-fpm.sock;\n}\n\nssl_protocols TLSv1.2 TLSv1.3;\nssl_ciphers [TLS13+AESGCM+AES256|TLS13+CHACHA20]:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;\nssl_ecdh_curve secp521r1:secp384r1;\nssl_prefer_server_ciphers on;\nssl_session_cache shared:SSL:20m;\nssl_session_timeout 15m;\nssl_session_tickets off;\nssl_stapling on;\nssl_dyn_rec_enable on;\nresolver 1.1.1.1 1.0.0.1 ipv6=off;\nssl_stapling_verify on;\n#RSA certificates\nssl_certificate \/certs\/example.com\/fullchain.pem;\nssl_certificate_key \/certs\/example.com\/key.pem;\n#ECDSA certificates\nssl_certificate \/certs\/example.com_ecc\/fullchain.pem;\nssl_certificate_key \/certs\/example.com_ecc\/key.pem;\n\nssl_trusted_certificate \/certs\/example.com\/fullchain.pem;<\/code><\/pre>\n<p><br>I use custom HTTP error pages and I used this for creating them: <a href=\"https:\/\/github.com\/AndiDittrich\/HttpErrorPages\">https:\/\/github.com\/AndiDittrich\/HttpErrorPages<\/a><\/p>\n<pre><code>error_page 400 401 402 403 404 500 501 502 503 520 521 533 \/error\/HTTP$status.html;<\/code><\/pre>\n<p><br> This server redirects all of the unencrypted connections to https. It uses the same url, except when it's accessed over the IP address, then it redirects to the root of the domain.<\/p>\n<pre><code>server {\n  listen 8000 default_server;\n  server_name _;\n  include \/sites-enabled\/headers.conf;\n\n  if ($host  ~ \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\" ) {\n    return 301 https:\/\/example.com$request_uri;\n\n  }\n\n  return 301 https:\/\/$host$request_uri;\n}<\/code><\/pre>\n<p><br> This server redirects unused subdomains.<\/p>\n<pre><code>server {\n  listen 4430 ssl http2;\n  server_name www.example.com;\n  return 301 https:\/\/example.com$request_uri;\n  include \/nginx\/conf.d\/hsts.conf;\n  include \/sites-enabled\/headers.conf;\n}<\/code><\/pre>\n<p><br> This is the server that listens on the root of the domain, in my case it redirects to the <code>media<\/code> subdomain.<\/p>\n<pre><code>server {\n  listen 4430 ssl http2 default_server;\n  #listen [::]:4430 ssl http2;\n  server_name example.com;\n  include \/nginx\/conf.d\/hsts.conf;\n  include \/sites-enabled\/headers.conf;\n\n  return 301 https:\/\/media.example.com$request_uri;\n\n  location \/error\/ {\n    alias \/www\/errorpages\/;\n    internal;\n    }\n\n  }<\/code><\/pre>\n<p><br> I use <a href=\"https:\/\/github.com\/causefx\/Organizr\">Organizr<\/a> to organize (duh) all of my apps I regularly use. Definitely check it out if...<\/p>","tags":["software","Plex","nginx"]},{"title":"Use Plex credentials for Nextcloud","date_published":"2018-02-16T16:31:00+00:00","id":"https:\/\/blog.laubacher.io\/use-plex-credentials-for-nextcloud","url":"https:\/\/blog.laubacher.io\/use-plex-credentials-for-nextcloud","content_html":"<p>This tutorial will show you how you can use your and your friend's Plex login to login to Nextcloud.<\/p>\n<h3>Setup LDAP-for-Plex<\/h3>\n<p>First you need to setup <a href=\"https:\/\/github.com\/hjone72\/LDAP-for-Plex\">this<\/a> piece of software, you can install it natively or use my docker for which you can find the tutorial <a href=\"https:\/\/github.com\/Starbix\/dockerimages\/tree\/master\/plex-ldap\">here<\/a>.<\/p>\n<p>If you use unRAID you can add <a href=\"https:\/\/github.com\/Starbix\/docker-templates\">https:\/\/github.com\/Starbix\/docker-templates<\/a> to your template repositories if you want to use the docker template.<\/p>\n<h3>Setup Nextcloud<\/h3>\n<ul>\n<li>\n<p>You need to enable <code>LDAP user and group backend<\/code> in Nextcloud which is an official app.<\/p>\n<\/li>\n<li>\n<p>Then go into the <code>LDAP user and group backend<\/code> settings and set like the following pictures:<\/p>\n<\/li>\n<\/ul>\n<p><img alt=\"Use the IP your LDAP for Plex instance runs on\" src=\"\/images\/1\/-\/1\/e\/e\/1-1ee5cc2a.png\" \/> <em>Use the IP your LDAP for Plex instance runs on<\/em><\/p>\n<hr \/>\n<p><img alt=\"\" src=\"\/user\/pages\/blog\/use-plex-credentials-for-nextcloud\/2.png\" \/><\/p>\n<hr \/>\n<p><img alt=\"\" src=\"\/user\/pages\/blog\/use-plex-credentials-for-nextcloud\/3.png\" \/><\/p>\n<hr \/>\n<p><img alt=\"\" src=\"\/user\/pages\/blog\/use-plex-credentials-for-nextcloud\/4.png\" \/><\/p>\n<hr \/>\n<p><img alt=\"\" src=\"\/user\/pages\/blog\/use-plex-credentials-for-nextcloud\/5.png\" \/><\/p>\n<hr \/>\n<p><img alt=\"\" src=\"\/user\/pages\/blog\/use-plex-credentials-for-nextcloud\/6.png\" \/><\/p>\n<hr \/>\n<p><img alt=\"\" src=\"\/user\/pages\/blog\/use-plex-credentials-for-nextcloud\/7.png\" \/><\/p>\n<hr \/>\n<p><img alt=\"\" src=\"\/user\/pages\/blog\/use-plex-credentials-for-nextcloud\/8.png\" \/><\/p>\n<p><strong>Note:<\/strong> It doesn't add the Plex users to the Plex.tv group automagically, you need to do that manually.<\/p>","tags":["Plex","cloud","Nextcloud","LDAP"],"image":"\/user\/pages\/blog\/use-plex-credentials-for-nextcloud\/1.png"},{"title":"Hyperion on Odroid C2","date_published":"2017-10-09T18:29:00+00:00","id":"https:\/\/blog.laubacher.io\/hyperion-on-odroid-c2","url":"https:\/\/blog.laubacher.io\/hyperion-on-odroid-c2","content_html":"<p>I wrote this tutorial because Hyperion doesn't support Odroid C2 out of the box and I didn't find an easy tutorial for it. I'm using LibreELEC, but with minor changes it'll work on any other OS.<\/p>\n<h4>Requirements<\/h4>\n<ul>\n<li>Odroid C2<\/li>\n<li>Arduino Uno<\/li>\n<li>APA102 LED stripe<\/li>\n<li>USB type B to USB type A cable<\/li>\n<li>Jumper cables<\/li>\n<li>5V Power Supply<\/li>\n<\/ul>\n<h3>Introduction<\/h3>\n<p>I'm not going into how to create the Hyperion config and how to install the LEDs on your TV. There are already a lot tutorials for that, like <a href=\"http:\/\/awesomepi.com\/diy-breath-taking-ambilight-for-your-own-tv-raspberry-pi-2-tutorial-part-1\/\">Awesome Pi<\/a>. Instead of the WS2801 LEDs I recommend the APA102 LEDs which have better colors and the cabling needs to be different as we're going to use an Arduino between the LEDs and Odroid.<\/p>\n<p>Now, there are two problems with the Odroid C2. The first one is, that it doesn't support SPI, a serial communication interface used to communicate with the APA102. This can be solved by using an Arduino between the Odroid and the LEDs.\nThe second problem is, that there's no official hyperion binary for the Odroid C2. Which meant that I had to compile it on my own, but more on that later.<\/p>\n<h3>Hardware<\/h3>\n<p>First you need to prepare your Arduino. For that you need to download the Arduino IDE from <a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\">here<\/a>.\nAfter you've installed the Arduino IDE, you need to select your Board Type under <strong>Tools&gt;Board<\/strong> where you select Arduino\/Genuino Uno and just below you also need to select the serial port for the Arduino, this can change from computer to computer.\nYou then need to paste the code from <a href=\"https:\/\/raw.githubusercontent.com\/hyperion-project\/hyperion\/master\/dependencies\/LightberryHDUSBAPA1021.1\/LightberryHDUSBAPA1021.1.ino\">here<\/a> into the IDE and then upload it to the Arduino.\nYou can then plug the LED pins into the Arduino with jumper cables. SPI data out is digital pin 11 and clock is digital pin 13. If you want to test if you've connected it correctly you can also uncomment the test pattern part. You should then see a red, green and blue flash.<\/p>\n<h3>Software<\/h3>\n<p>Now comes the interesting part. <\/p>\n<p>So you don't have to compile Hyperion for yourself, I have a <a href=\"https:\/\/github.com\/Starbix\/hyperion-files\">Github Repository<\/a> with precompiled binaries. If you don't trust me, you can also compile them yourself. I also have a slightly modified <a href=\"https:\/\/github.com\/Starbix\/hyperion\">Gtihub Repo<\/a> for that, as it won't compile otherwise. You need to use this command: <code>cmake -DENABLE_DISPMANX=OFF -DENABLE_SPIDEV=OFF -DENABLE_AMLOGIC=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev ..<\/code><\/p>\n<p>Install <a href=\"https:\/\/libreelec.tv\">LibreELEC<\/a> on your Odroid.<\/p>\n<p>In order to install Hyperion on your Odroid you need to make sure to <strong>enable SSH<\/strong>, you might need to restart after that. Then you need to connect to it over SFTP. For that I use Cyberduck, but any other SFTP client should work. Navigate to <code>\/storage<\/code> and create a <code>hyperion<\/code> directory.<\/p>\n<p>To get the files you need to put into the <code>hyperion<\/code> folder, navigate to my <a href=\"https:\/\/github.com\/Starbix\/hyperion-files\">precompiled binaries<\/a>. There are different folders for different binaries. You need to use the <strong>hyperion (v1) odroid-aml patched<\/strong>. Upload its content to the previously created <code>hyperion<\/code> directory. Make sure you delete my config and replace...<\/p>","tags":["Odroid C2","software","hardware"]},{"title":"Unlimited Plex Server on unRAID","date_published":"2017-09-12T17:27:00+00:00","id":"https:\/\/blog.laubacher.io\/unlimited-plex-server-on-unraid","url":"https:\/\/blog.laubacher.io\/unlimited-plex-server-on-unraid","content_html":"<p>This tutorial is not as detailed as <a href=\"https:\/\/hoarding.me\">https:\/\/hoarding.me<\/a> so I suggest first reading through that tutorial to get a broad view of how it rclone, Sonarr and Radarr work with the cloud.<\/p>\n<p>unRAID makes running a cloud based unlimited Plex server not as easy as it's on Ubuntu. So here's a tutorial for unRAID.<\/p>\n<h2>Required Plugins<\/h2>\n<ul>\n<li><a href=\"https:\/\/forums.lime-technology.com\/topic\/38582-plug-in-community-applications\">Community Applications<\/a><\/li>\n<li>CA User Scripts (search in Community Applications)<\/li>\n<li>rclone or rclone-beta by Waseh (search in Community Applications)<\/li>\n<li><a href=\"https:\/\/raw.githubusercontent.com\/Starbix\/unRAID-plugins\/master\/plugins\/unionfs.plg\">unionfs<\/a><\/li>\n<li><a href=\"https:\/\/raw.githubusercontent.com\/Starbix\/unRAID-plugins\/master\/plugins\/plexdrive.plg\">plexdrive<\/a><\/li>\n<\/ul>\n<p>To install the needed plugins, just enter <\/p>\n<pre><code>https:\/\/raw.githubusercontent.com\/Squidly271\/community.applications\/master\/plugins\/community.applications.plg<\/code><\/pre>\n<p>to <strong>Plugins &gt; Install Plugin<\/strong>.\nAfter refreshing the site you should see a new Tab called <strong>Apps<\/strong>, under that Tab you just search for <strong>User Scripts<\/strong> and <strong>rclone<\/strong> and install both of those plugins.<\/p>\n<p>For our setup we also need unionfs and plexdrive for which I didn't find any plugin, so I wrote my own. Install it like Community Applications with <a href=\"https:\/\/raw.githubusercontent.com\/Starbix\/unRAID-plugins\/master\/plugins\/unionfs.plg\">https:\/\/raw.githubusercontent.com\/Starbix\/unRAID-plugins\/master\/plugins\/unionfs.plg<\/a> and <a href=\"https:\/\/raw.githubusercontent.com\/Starbix\/unRAID-plugins\/master\/plugins\/plexdrive.plg\">https:\/\/raw.githubusercontent.com\/Starbix\/unRAID-plugins\/master\/plugins\/plexdrive.plg<\/a>.<\/p>\n<p>To edit your rclone config, SSH into your server and execute <code>rclone config<\/code>.<\/p>\n<p>Add the following remotes:<\/p>\n<pre><code>Name                 Type\n====                 ====\ngdrive               drive\ngdrivecrypt          crypt  (\"remote\" = \"\/mnt\/disks\/pd\/crypt\")\nuploadcrypt          crypt  (\"remote\" = \"gdrive:crypt\")<\/code><\/pre>\n<p>Note: Use the same password for the crypt remotes.<\/p>\n<p>Then create the config file of plexdrive using<\/p>\n<pre><code>plexdrive mount \/mnt\/disks\/pd -c \"\/mnt\/user\/appdata\/plexdrive\" -o allow_other -v 2<\/code><\/pre>\n<p>then upload mountcheck files used for checking whether everything is mounted properly or not<\/p>\n<pre><code>touch mountcheck\nrclone copy mountcheck uploadcrypt:Series -vv --no-traverse\nrclone copy mountcheck uploadcrypt:Movies -vv --no-traverse\nrclone copy mountcheck uploadcrypt: -vv --no-traverse\n<\/code><\/pre>\n<p>Then go to <\/p>\n<p>After setting up your rclone shares, go into <strong>Settings &gt; User Scripts<\/strong>.<\/p>\n<p>Here we'll need to add several scripts.\n(These scripts are mostly stolen from <a href=\"https:\/\/hoarding.me\">hoarding.me<\/a>)<\/p>\n<p><strong>fuse_mount<\/strong> - at Startup of the Array<\/p>\n<pre><code>#!\/bin\/bash\nif [[ -f \"\/mnt\/user\/media\/cloud\/Series\/mountcheck\" ]] &amp;&amp; [[ -f \"\/mnt\/user\/media\/cloud\/Movies\/mountcheck\" ]]; then\necho \"$(date \"+%d.%m.%Y %T\") INFO: Check successful, Series and Movies fuse mounted.\"\nexit\nelse\necho \"$(date \"+%d.%m.%Y %T\") ERROR: Series and Movies not mounted, remount in progress.\"\n# Unmount before remounting\nfusermount -uz \/mnt\/user\/media\/cloud\/Series\nfusermount -uz \/mnt\/user\/media\/cloud\/Filme\nunionfs -o cow,allow_other,direct_io,auto_cache,sync_read \/mnt\/user\/media\/cloud\/Seriestmp=RW:\/mnt\/disks\/crypt\/Series=RO \/mnt\/user\/media\/cloud\/Series\nunionfs -o cow,allow_other,direct_io,auto_cache,sync_read \/mnt\/user\/media\/cloud\/Moviestmp=RW:\/mnt\/disks\/crypt\/Movies=RO \/mnt\/user\/media\/cloud\/Movies\nif [[ -f \"\/mnt\/user\/media\/cloud\/Series\/mountcheck\" ]] &amp;&amp; [[ -f \"\/mnt\/user\/media\/cloud\/Movies\/mountcheck\" ]]; then\necho \"$(date \"+%d.%m.%Y %T\") INFO: Remount of Series and Movies successful.\"\nelse\necho \"$(date \"+%d.%m.%Y %T\") CRITICAL: Remount failed.\"\nfi\nfi\nexit<\/code><\/pre>\n<p><strong>rclone_mount<\/strong> - at Startup of the Array<\/p>\n<pre><code>#!\/bin\/bash\n\nmkdir -p \/mnt\/disks\/pd\nmkdir -p \/mnt\/disks\/crypt\n\n#This section mounts the various cloud storage into the folders that were created above.\nif [[ -f \"\/mnt\/disks\/crypt\/mountcheck\" ]]; then\necho \"$(date \"+%d.%m.%Y %T\") INFO: Check successful, crypt mounted.\"\nexit\nelse\necho \"$(date \"+%d.%m.%Y %T\") ERROR: Drive not mounted, remount in progress.\"\n# Unmount before remounting\nfusermount -uz \/mnt\/disks\/crypt\nfusermount -uz \/mnt\/disks\/pd\nplexdrive mount \/mnt\/disks\/pd -c \"\/mnt\/user\/appdata\/plexdrive\" -o allow_other -v 2 &amp;\nrclone mount --max-read-ahead 512M --allow-other --allow-non-empty -v --buffer-size 1G gdrivecrypt: \/mnt\/disks\/crypt &amp;\nif [[ -f \"\/mnt\/disks\/crypt\/mountcheck\" ]]; then\necho \"$(date \"+%d.%m.%Y %T\") INFO: Remount successful.\"\nelse\necho \"$(date \"+%d.%m.%Y %T\") CRITICAL: Remount failed.\"\nfi\nfi\nexit<\/code><\/pre>\n<p><strong>rclone_unmount<\/strong> - at Stopping of the Array<\/p>\n<pre><code>#!\/bin\/bash\nfusermount -uz \/mnt\/user\/media\/cloud\/Movies\nfusermount -uz...<\/code><\/pre>","tags":["software","Plex","cloud","rclone","unRAID"]}]}
