Adding a Chromebook
I have a network with wiki-farm server to support my writing, a NAS and a home-made laptop. All of these things are based on Raspberry Pi's. Besides using the wiki-farm (which is used to write novels), I also use Zim-Wiki for making copious notes, character creation, world-building and plot development. Zim-Wiki is available on both Linux and Windows, and there is an ARM build that runs happily on the Raspberry Pi. And then I added a Chromebook, and that went from good idea to nightmare and back again.
Imagine yourself attempting to do what I wanted: write on my desktop when it was convenient to do so, and my laptop (or even my phone) at other times. The solution was the Wiki-Farm, which is available to me wherever I am and on whatever device I happen to be using, just so long as I can reach inside my home network. At home that was no problem, but out in the world my trusty router blocks all attempts to enter the network from the Big Wide World. There are only three solutions to this:
- Disable the firewall on the router (that's not going to happen, ever!)
- Open a port on the router and forward it to the wiki-farm (just as bad!)
- Create a VPN. It's like option #2, but is secure.
I went with option #3 of course. I opted to use Wireguard as the software, because it is simple, quick to connect and fast. Installing on a Raspberry Pi that wasn't doing much else created a gateway to the rest of my network. The home-made laptop is based on the same hardware and operating system, so no problems there.
As a bonus, I also wanted to access my extensive collection of music from my phone. The music is on a drive on the NAS, and the phone is android - so installing Wireguard was simple. Wireguard on the Pi can be asked to display a QR code in the text terminal, so uploading a configuration to the phone was as simple as scanning the code. That made my music available both straight from the NAS (by browsing its folders) or through a DLNA server I setup on one of RPI-based music centres.
Using the Wiki-farm is simple enough - it's web-based so all I need is a browser, and every device with a GUI has one. The problems really begin with Zim-Wiki, the note-keeper. For any given novel, the notes are going to run into 50k words or more. I can put the notes themselves somewhere on the network that's accessible to all devices and that should solve the problem of updating on any device and yet have the notes up-to-date all the time. However I had to allow for the fact that when I'm out in the world and using my laptop, I may not be able to access my home network.
SyncThing is like OneDrive or GoogleDrive. Those programs sync a device with a server, and SyncThing is pretty much the same except firstly it is peer-to-peer (so there is no server), and secondly you have greater control. For example, you can set one peer to only send or only receive (the default is to do both). You can also set it up for file versioning. For my use I just needed a two-way synchronisation.
Before I left the house, I would have to turn on the RPI laptop so it could grab the latest versions of the Zim-Wiki files, but I didn't want to have the hassle of also booting up my desktop at the same time to allow that to happen. I setup SyncThing on my desktop, the RPI laptop and on a machine (another Raspberry Pi) that was permanently running and had a network share from the NAS mounted. The desktop and laptop sent and received updates with the Pi that was acting as a man-in-the-middle. It also meant that I had a backup of the files on the network and each of the end-point machines - the desktop and laptop.
At this point, I can access everything I wanted with ease whether I was at home or not. The only thing I couldn't do was access the Zim-Wiki notes on my phone, but I can live with that.
Then I added a Chromebook, and the nightmare began.
Adding A Chromebook
The problem with the Chromebook is it runs on Chrome OS, which is a version of Android adapted to work well in a laptop environment. However, that doesn't necessarily mean it can run Android apps. The latest versions of the operating system (which itself is built on a Linux kernel) is able to run a Linux sandbox, and you can allow folders of your choice to be visible within that sandbox. This made installing Zim-Wiki very easy.
I next installed SyncThing, which also has to be loaded in the Linux sandbox, and installed that as a service so it is running whenever I boot the Chromebook. There is some fiddling to be done here. Firstly you have to edit the SyncThing configuration so it listens on all interfaces and not just localhost, and you have to open the ports in the sandbox so it can post to and listen on the network. For convenience (this isn't necessary) I created a folder in the Android file system, and then shared that with the Linux sandbox. That way Zim-Wiki can read the files (remember it runs in the sandbox) and also I can easily get a listing of the folder contents using the default file browser (good for resolving issues).
Because my Chromebook is new, it supports the latest version of the Chrome OS, so luckily that means it can install and run Android apps from the Play Store. On the VPN Server I created a new account for the Chromebook, and copied the configuration file to a network share, mounted that share on the Chromebook, installed Wireguard from the Play Store and added the configuration from the network share.
As with the RPI laptop, the Chromebook has to be booted before I leave the house to ensure it has the latest sync of the Zim-Wiki files, but if I forget I can always enable the VPN, tether using my phone and it will sync for me. Actually, I have Wireguard configured on my phone too, so I don't generally need it on the Chromebook, but if I can connect to a local WiFi hotspot I can avoid burning up my phone's precious GB allowance (which is deliberately pitiful). If I do have to use the phone to access my home network (and the internet), having Wireguard on the Chromebook means it is doing all the VPN encryption/decryption and not my phone, which will preserve some of the phone's battery life.