From d4971f01382797658f3d1223f25181aec535639c Mon Sep 17 00:00:00 2001 From: Dave Gallant Date: Thu, 17 Apr 2025 23:16:56 -0400 Subject: [PATCH] Add content/blog/replicating-truenas-datasets-to-sftpgo-over-tailscale/index.md --- .../index.md | 28 +++++++++++++++++++ .../assets/css/non-critical/00-vendor.css | 10 +++---- 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 content/blog/replicating-truenas-datasets-to-sftpgo-over-tailscale/index.md diff --git a/content/blog/replicating-truenas-datasets-to-sftpgo-over-tailscale/index.md b/content/blog/replicating-truenas-datasets-to-sftpgo-over-tailscale/index.md new file mode 100644 index 00000000..95935aa9 --- /dev/null +++ b/content/blog/replicating-truenas-datasets-to-sftpgo-over-tailscale/index.md @@ -0,0 +1,28 @@ +--- +title: "Replicating TrueNAS datasets to sftpgo over Tailscale" +date: "2025-04-17T22:03:33-04:00" +draft: false +comments: true +toc: false +author: "Dave Gallant" +tags: + [ + "tailscale", + "truenas", + "sftpgo", + ] +--- + +I've recently spun up an instance of TrueNAS SCALE after salvaging a couple hard drives from a past computer build and decided I could use additional network storage for various backups such as Proxmox VMs and home directory backups. + + + +The only app I've needed to install has been Tailscale which has enabled me to access the TrueNAS Web UI from anywhere. I've setup a few datasets and NFS shares to store various backups and the rest of the periodic backups have routinely been working without a hitch. Since my homelab is becoming more of a vital piece of infrastructure for my daily needs, I wanted to ensure that these datasets had [Cloud Sync Tasks](https://www.truenas.com/docs/scale/scaletutorials/dataprotection/cloudsynctasks/) setup for offsite backups. These encrypted backups are mostly being stored in places such as Google Drive and other blob storage providers. + +More recently, to reduce cloud costs, I've setup some a small node at another physical location and installed both Tailscale and [sftpgo](https://github.com/drakkan/sftpgo) on it to facilitate offsite backups. After setting up the infrastructure and adding a Cloud Sync Task in TrueNAS SCALE to replicate these backups offsite to sftpgo, I noticed that Tailscale's Magic DNS was not working, nor was the Tailscale IPv4 address. + +After reading the [Tailscale docs](https://tailscale.com/kb/1483/truenas#route-non-tailnet-traffic-through-truenas) , it became clear that the **Userspace** box had to be unchecked in the Tailscale app settings. This is because the Tailscale app is running within a docker container on the TrueNAS SCALE VM. After unchecking the **Userspace** box, I was able to verify that the Backup Credentials created for sftpgo worked when specifying the host as a Tailscale IPv4 address. This was probably good enough since the IP won't change unless the node is re-registered, but I figured setting up MagicDNS would make the setup more portable. + +To get MagicDNS working, I went to Network > Global Configuration and set "Nameserver 1" to **100.100.100.100**. After this, I was able to specify the FQDN in the Backup Credentials and the Cloud Sync Tasks started. + + diff --git a/themes/custom-theme/assets/css/non-critical/00-vendor.css b/themes/custom-theme/assets/css/non-critical/00-vendor.css index 5b30dd23..3a7b9097 100644 --- a/themes/custom-theme/assets/css/non-critical/00-vendor.css +++ b/themes/custom-theme/assets/css/non-critical/00-vendor.css @@ -1,12 +1,12 @@ /*! purgecss start ignore */ -/* Prism Plugins */ {{ range $.Site.Params.prism.plugins }} {{ $path := printf "prismjs/plugins/%s/prism-%s.css" . . }} - {{ $plugin := resources.Get $path }} - {{ if $plugin }} - {{ printf "/*%s*/" $plugin }} - @import "{{ $plugin }}"; + {{ $pluginCSS := resources.Get $path }} + {{ if $pluginCSS }} + {{ $importPath := trim $pluginCSS.RelPermalink "/" }} + {{ printf "/* Import stylesheet for Prism plugin '%s' from '%s' */" . $importPath }} + @import "{{ $importPath }}"; {{ end }} {{ end }}