use suggested project layout from: https://plainvanillaweb.com/pages/sites.html
This commit is contained in:
parent
2d4ac41cfa
commit
eea8e10cab
10 changed files with 49 additions and 45 deletions
154
public/blog/2025/01/28-leveraging-nixos-dufs-cloud-storage.html
Normal file
154
public/blog/2025/01/28-leveraging-nixos-dufs-cloud-storage.html
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../../../index.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>Will Holdsworth</h1>
|
||||
<hr>
|
||||
<nav>
|
||||
<a href="../../../index.html">Home</a>
|
||||
|
|
||||
<a href="../../../projects/index.html">Projects</a>
|
||||
| Blog |
|
||||
<a href="../../../pages/about.html">About</a>
|
||||
|
|
||||
<a href="../../../pages/contact.html">Contact</a>
|
||||
</nav>
|
||||
<hr>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<a href="../../index.html">« Return to posts</a>
|
||||
<h1>Quick & easy cloud storage with dufs and NixOS</h1>
|
||||
<p>
|
||||
dufs<sup><a id="footnote-1-ref" href="#footnote-1" title="link to footnote">1</a></sup> (the distinctive file
|
||||
utility server) is a cloud storage replacement for those looking to move away from third-party services like
|
||||
Google Drive or Proton Drive. it supports WebDAV and HTTPS file transfer protocols.
|
||||
</p>
|
||||
<p>It's very easy to set up and get going in NixOS using a Docker container.</p>
|
||||
|
||||
<h2>Set up dufs</h2>
|
||||
<p>First, enable docker in your <code>configuration.nix</code>:</p>
|
||||
<pre>
|
||||
<code>
|
||||
virtualisation.docker.enable = true;
|
||||
</code>
|
||||
</pre>
|
||||
Then define a Docker container, either in your <code>configuration.nix</code> or in a custom module:
|
||||
<pre>
|
||||
<code>
|
||||
virtualisation.oci-containers = {
|
||||
backend = "docker";
|
||||
containers.dufs = {
|
||||
|
||||
# automatically restart server after reboot
|
||||
autoStart = true;
|
||||
|
||||
image = "sigoden/dufs";
|
||||
|
||||
ports = [
|
||||
"5000:5000"
|
||||
];
|
||||
|
||||
# the files i want to serve are in /srv/dufs
|
||||
volumes = [
|
||||
"/srv/dufs:/data"
|
||||
];
|
||||
|
||||
# tells dufs to serve the files in the docker volume /data
|
||||
cmd = [
|
||||
"-A"
|
||||
"/data"
|
||||
];
|
||||
};
|
||||
};
|
||||
</code>
|
||||
</pre>
|
||||
Rebuild your configuration by running <code>sudo nixos-rebuild switch</code> and head on over to
|
||||
<code>http://localhost:5000</code> to behold your lovely files. Now we need a method to access our files on other
|
||||
devices inside (and outside) of our home network. Tailscale<sup><a id="footnote-2-ref" href="#footnote-2"
|
||||
title="link to footnote">2</a></sup> provides commands to accomplish this easily.
|
||||
|
||||
<h2>Set up Tailscale</h2>
|
||||
<p>
|
||||
You can use Tailscale to access the files on other devices inside (and outside) of your home network. Tailscale is
|
||||
like a crazy-fast vpn with a bunch of other comfort features like MagicDNS<sup><a id="footnote-3-ref"
|
||||
href="#footnote-3" title="link to footnote">3</a></sup>, keyless SSH<sup><a id="footnote-4-ref"
|
||||
href="#footnote-4" title="link to footnote">4</a></sup> and
|
||||
easy HTTPS<sup><a id="footnote-5-ref" href="#footnote-5" title="link to footnote">5</a></sup>.
|
||||
</p>
|
||||
<p>To enable it in nixos, add the following to your <code>configuration.nix</code>:</p>
|
||||
<pre>
|
||||
<code>
|
||||
services.tailscale.enable = true;
|
||||
networking.firewall.trustedInterfaces = [ "tailscale0" ];
|
||||
</code>
|
||||
</pre>
|
||||
<p>
|
||||
Once again, rebuild your configuration by running <code>sudo nixos-rebuild switch</code> and run
|
||||
<code>tailscale up</code> to start tailscale. The tailscale connection will persist on reboot, so no need to worry
|
||||
about adding it to your init process.
|
||||
</p>
|
||||
<p>
|
||||
I recommend enabling MagicDNS in the admin console > DNS > MagicDNS, but if you prefer not to, your server's IP
|
||||
address will be visible by running <code>tailscale ip -4</code>.
|
||||
</p>
|
||||
<p>
|
||||
Head over to <code>http://<hostname or ip>:5000</code> on one of your other machines running tailscale to
|
||||
upload,
|
||||
download, and view your self-hosted files.
|
||||
</p>
|
||||
|
||||
<h2>dufs clients</h2>
|
||||
<p>
|
||||
As for client recommendations, Round Sync<sup><a id="footnote-6-ref" href="#footnote-6"
|
||||
title="link to footnote">6</a></sup> on android is quite good. it supports both WebDAV and HTTPS remotes, I
|
||||
chose to use WebDAV when connecting.
|
||||
</p>
|
||||
<br>
|
||||
<p>Thanks for stopping by ^.^</p>
|
||||
|
||||
<h2>Footnotes</h2>
|
||||
<ol>
|
||||
<li id="footnote-1">
|
||||
<a href="https://github.com/sigoden/dufs">dufs</a>
|
||||
<a href="#footnote-1-ref" title="return to text">↩</a>
|
||||
</li>
|
||||
<li id="footnote-2">
|
||||
<a href="https://tailscale.com/">Tailscale</a>
|
||||
<a href="#footnote-2-ref" title="return to text">↩</a>
|
||||
</li>
|
||||
<li id="footnote-3">
|
||||
<a href="https://tailscale.com/kb/1081/magicdns">MagicDNS</a>
|
||||
<a href="#footnote-3-ref" title="return to text">↩</a>
|
||||
</li>
|
||||
<li id="footnote-4">
|
||||
<a href="https://tailscale.com/kb/1193/tailscale-ssh">Tailscale SSH</a>
|
||||
<a href="#footnote-4-ref" title="return to text">↩</a>
|
||||
</li>
|
||||
<li id="footnote-5">
|
||||
<a href="https://tailscale.com/kb/1153/enabling-https">Tailscale HTTPS</a>
|
||||
<a href="#footnote-5-ref" title="return to text">↩</a>
|
||||
</li>
|
||||
<li id="footnote-6">
|
||||
<a href="https://github.com/newhinton/Round-Sync">Round Sync</a>
|
||||
<a href="#footnote-6-ref" title="return to text">↩</a>
|
||||
</li>
|
||||
</ol>
|
||||
<a href="#top">^ Back to top</a>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<hr>
|
||||
Copyright (C) 2025 Will Holdsworth under MPLv2
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
40
public/blog/index.html
Normal file
40
public/blog/index.html
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../index.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>Will Holdsworth</h1>
|
||||
<hr>
|
||||
<nav>
|
||||
<a href="../index.html">Home</a>
|
||||
|
|
||||
<a href="../projects/index.html">Projects</a>
|
||||
| Blog |
|
||||
<a href="../pages/about.html">About</a>
|
||||
|
|
||||
<a href="../pages/contact.html">Contact</a>
|
||||
</nav>
|
||||
<hr>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Posts</h2>
|
||||
<ul>
|
||||
<li>2025-01-28 | <a href="2025/01/28-leveraging-nixos-dufs-cloud-storage.html">Quick and easy cloud storage
|
||||
with dufs and NixOS
|
||||
</a></li>
|
||||
</ul>
|
||||
</main>
|
||||
<footer>
|
||||
<hr>
|
||||
Copyright (C) 2025 Will Holdsworth under MPLv2
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
2
public/index.css
Normal file
2
public/index.css
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@import "./styles/variables.css";
|
||||
@import "./styles/global.css";
|
||||
36
public/index.html
Normal file
36
public/index.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="index.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>Will Holdsworth</h1>
|
||||
<hr>
|
||||
<nav>
|
||||
Home |
|
||||
<a href="projects/index.html">Projects</a>
|
||||
|
|
||||
<a href="blog/index.html">Blog</a>
|
||||
|
|
||||
<a href="pages/about.html">About</a>
|
||||
|
|
||||
<a href="pages/contact.html">Contact</a>
|
||||
</nav>
|
||||
<hr>
|
||||
</header>
|
||||
<main>
|
||||
<p>🚧 Page under construction 🚧</p>
|
||||
</main>
|
||||
<footer>
|
||||
<hr>
|
||||
Copyright (C) 2025 Will Holdsworth under MPLv2
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
37
public/pages/about.html
Normal file
37
public/pages/about.html
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../index.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>Will Holdsworth</h1>
|
||||
<hr>
|
||||
<nav>
|
||||
<a href="../index.html">Home</a>
|
||||
|
|
||||
<a href="../projects/index.html">Projects</a>
|
||||
|
|
||||
<a href="../blog/index.html">Blog</a>
|
||||
| About |
|
||||
<a href="contact.html">Contact</a>
|
||||
</nav>
|
||||
<hr>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Summary</h2>
|
||||
<p>I am a Kiwi living in Australia and studying a Bachelor of Science at The
|
||||
University of Melbourne.</p>
|
||||
</main>
|
||||
<footer>
|
||||
<hr>
|
||||
Copyright (C) 2025 Will Holdsworth under MPLv2
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
42
public/pages/contact.html
Normal file
42
public/pages/contact.html
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../index.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>Will Holdsworth</h1>
|
||||
<hr>
|
||||
<nav>
|
||||
<a href="../index.html">Home</a>
|
||||
|
|
||||
<a href="../projects/index.html">Projects</a>
|
||||
|
|
||||
<a href="../blog/index.html">Blog</a>
|
||||
|
|
||||
<a href="about.html">About</a>
|
||||
| Contact
|
||||
</nav>
|
||||
<hr>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Email Address</h2>
|
||||
<p>This forwarding address is provided by <a href="https://duckduckgo.com/email/">DuckDuckGo</a> and is periodically
|
||||
regenerated to reduce spam.</p>
|
||||
<a href="mailto:canyon-scary-tutu@duck.com">canyon-scary-tutu@duck.com</a>
|
||||
<h2>Social Media</h2>
|
||||
<p>I currently use social media exclusively among close friends. If this ever changes, I will add some links.
|
||||
</p>
|
||||
</main>
|
||||
<footer>
|
||||
<hr>
|
||||
Copyright (C) 2025 Will Holdsworth under MPLv2
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
35
public/projects/index.html
Normal file
35
public/projects/index.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../index.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>Will Holdsworth</h1>
|
||||
<hr>
|
||||
<nav>
|
||||
<a href="../index.html">Home</a>
|
||||
| Projects |
|
||||
<a href="../blog/index.html">Blog</a>
|
||||
|
|
||||
<a href="../pages/about.html">About</a>
|
||||
|
|
||||
<a href="../pages/contact.html">Contact</a>
|
||||
</nav>
|
||||
<hr>
|
||||
</header>
|
||||
<main>
|
||||
<p>🚧 Page under construction 🚧</p>
|
||||
</main>
|
||||
<footer>
|
||||
<hr>
|
||||
Copyright (C) 2025 Will Holdsworth under MPLv2
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
44
public/styles/global.css
Normal file
44
public/styles/global.css
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
html {
|
||||
background-color: var(--background-color);
|
||||
color: var(--color);
|
||||
font-family: sans-serif;
|
||||
font-size: large;
|
||||
line-height: 1.4;
|
||||
margin: 2em auto;
|
||||
max-width: 800px;
|
||||
padding: 1em;
|
||||
scrollbar-gutter: stable both-edges;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--link-color);
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: var(--visited-link-color);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--hover-link-color);
|
||||
background-color: var(--link-color);
|
||||
}
|
||||
|
||||
a:visited:hover {
|
||||
color: var(--hover-link-color);
|
||||
background-color: var(--visited-link-color);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.75em;
|
||||
}
|
||||
|
||||
header {
|
||||
h1 {
|
||||
font-size: 2.5em;
|
||||
font-family: serif;
|
||||
}
|
||||
}
|
||||
|
||||
footer {
|
||||
font-size: smaller;
|
||||
}
|
||||
7
public/styles/variables.css
Normal file
7
public/styles/variables.css
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
:root {
|
||||
--color: #d9d9d9;
|
||||
--background-color: #000;
|
||||
--link-color: #00a2e7;
|
||||
--visited-link-color: #ca1a70;
|
||||
--hover-link-color: white;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue