Migrate to blag
- Convert old html blogposts to markdown - Organize things into blag's folder structure - Adjust html and css templates
This commit is contained in:
73
content/2023/06/28/_draft_automating-some-things.md
Normal file
73
content/2023/06/28/_draft_automating-some-things.md
Normal file
@@ -0,0 +1,73 @@
|
||||
title: (DRAFT) Automating some things...
|
||||
description: Automating some stuff
|
||||
tags: automation, gitops, freebsd
|
||||
date: 2023-06-28 12:00
|
||||
|
||||
# Automating some things...
|
||||
|
||||
So, you've got yourself a webserver. Congratulations! You've taken the first step toward taking ownership of any public webservices you'd like to use. Now... What do you *do* with it?
|
||||
|
||||
Well, if you're me, you overenginner it (sort of). I'm at least, *trying* not to overengineer things as much. But there are definitely avenues for improvement on my current deployment. This site runs on a raspberry pi. Specifically, a raspberry pi 4b+ with 8 gigs of ram running FreeBSD 13.2. I've done the basics to harden the system (restricted SSH to keys only, on a port and ip that's on a management vlan - inaccessible from the 'net... and some other things I won't mention here ;P). The nginx webserver runs inside a FreeBSD [jail](https://docs.freebsd.org/en/books/handbook/jails/) on this bare-metal system. It is also networked to a public-facing vlan, separate from the management vlan (and my private stuff). This is accomplished with some networking trickery which I'll go into in depth in the future. For now, essentially: we create a vlan device, a bridge, and several 'epair' devices (one for each jail) then config the jail + host to give the jail its own 'network' thru this epair.
|
||||
|
||||
Okay, so we've described the system. How do I get files on/off the server? How do I manage it? That, [my dear data,](https://memory-alpha.fandom.com/wiki/Elementary,_Dear_Data_(episode)) is achieved via ssh. An unprivileged account on the pi has some public keys in the `~/.ssh/authorized_keys` file. That lets me in, and with `sshftp` I can easily drop files onto the server, then with a quick `cp -a /path/to/files /path/to/jail/webroot` I can update the server. Dope. That's awfully manual though... How can we automate this process?
|
||||
|
||||
## Gitops! (sort of?)
|
||||
|
||||
Well, we can do a couple things here...
|
||||
|
||||
- We can just keep doing it this way forever (lame)
|
||||
- We can do some sort of 'gitops' to speed things up.
|
||||
|
||||
Naturally, we choose 2. (There are of course more options, but I won't list them here. Because I haven't thought of them. Not cus they don't exist.) The idea goes like this: since we only need to push static files to update the webserver, I'll just keep the static files in a git repo. Then I can devise a method whereupon updates pushed to the repo are propagated to the webserver automatically via scripts, instead of doing all that manual nonsense each time.
|
||||
|
||||
---
|
||||
|
||||
__EDIT: 2024-01-17 11:34:__
|
||||
|
||||
This was converted from original html:
|
||||
|
||||
```html
|
||||
|
||||
<s>
|
||||
<h1>Automating some things...</h1>
|
||||
|
||||
|
||||
<p>So, you've got yourself a webserver. Congratulations! You've taken the first step toward taking ownership of any
|
||||
public webservices you'd like to use. Now... What do you *do* with it?</p>
|
||||
|
||||
|
||||
<p>Well, if you're me, you overenginner it (sort of). I'm at least, *trying* not to overengineer things as much. But
|
||||
there are definitely avenues for improvement on my current deployment. This site runs on a raspberry pi.
|
||||
Specifically, a raspberry pi 4b+ with 8 gigs of ram running FreeBSD 13.2. I've done the basics to harden the
|
||||
system (restricted SSH to keys only, on a port and ip that's on a management vlan - inaccessible from the
|
||||
'net... and some other things I won't mention here ;P). The nginx webserver runs inside a FreeBSD <a
|
||||
href="https://docs.freebsd.org/en/books/handbook/jails/">jail</a> on this bare-metal system. It is also
|
||||
networked to a public-facing vlan, separate from the management vlan (and my private stuff). This is
|
||||
accomplished with some networking trickery which I'll go into in depth in the future. For now, essentially: we
|
||||
create a vlan device, a bridge, and several 'epair' devices (one for each jail) then config the jail + host to
|
||||
give the jail its own 'network' thru this epair.</p>
|
||||
|
||||
|
||||
<p>Okay, so we've described the system. How do I get files on/off the server? How do I manage it? That, <a
|
||||
href="https://memory-alpha.fandom.com/wiki/Elementary,_Dear_Data_(episode)">my dear data,</a> is achieved
|
||||
via ssh. An unprivileged account on the pi has some public keys in the `~/.ssh/authorized_keys` file. That lets
|
||||
me in, and with `sshftp` I can easily drop files onto the server, then with a quick `cp -a /path/to/files
|
||||
/path/to/jail/webroot` I can update the server. Dope. That's awfully manual though... How can we automate this
|
||||
process?</p>
|
||||
|
||||
<h2>Gitops! (sort of?)</h2>
|
||||
<p>Well, we can do a couple things here...
|
||||
<ol>
|
||||
|
||||
<li>We can just keep doing it this way forever (lame)</li>
|
||||
<li>We can do some sort of 'gitops' to speed things up.</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>Naturally, we choose 2. (There are of course more options, but I won't list them here. Because I haven't thought
|
||||
of them. Not cus they don't exist.) The idea goes like this: since we only need to push static files to update
|
||||
the webserver, I'll just keep the static files in a git repo. Then I can devise a method whereupon updates
|
||||
pushed to the repo are propagated to the webserver automatically via scripts, instead of doing all that manual
|
||||
nonsense each time.</p>
|
||||
</s>
|
||||
|
||||
```
|
||||
48
content/2023/06/28/hello-world.md
Normal file
48
content/2023/06/28/hello-world.md
Normal file
@@ -0,0 +1,48 @@
|
||||
title: Hello, world!
|
||||
description: Hello, world!
|
||||
tags: hello world
|
||||
date: 2023-06-28 11:03
|
||||
|
||||
# Hello? Is anyone listening? Is this thing on?
|
||||
|
||||
Hello, world. I'm Freyja (Rae? idk dude, names are as difficult as gender for me.) This is my website. Well... *one* of my websites. I have a few domains. This one is low-effort. Going forward, I'm just gonna use this thing as a sort of blog.Since... I can? I mean, its not like HTML is complicated... It was designed mainly as a way to do books, but better - and with HYPERTEXT. Modern web design has more or less bastardized existing technologies to do fancy things with web browsers. But at the end of the day, raw HTML still works just fine - it just isn't as purdy.
|
||||
|
||||
---
|
||||
__EDIT 2024-01-17 11:22:__ This was originally written in html for an html-only version of this blog. I got tired of that rather quickly. Its difficult to maintain HTML by hand. I wanted something a *little* more automatic, so the blog has been updated to that end.
|
||||
|
||||
Here's the original HTML of this blog entry:
|
||||
|
||||
```html
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Hello, world!</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a href="/index.html">Index</a>
|
||||
<a href="/about.html">About</a>
|
||||
<a href="/contact.html">Contact</a>
|
||||
</nav>
|
||||
<hr>
|
||||
<!-- CONTENT GOES HERE -->
|
||||
<h1>Hello? Is anyone listening? Is this thing on?</h1>
|
||||
<h2>11:03am(PDT)</h2>
|
||||
<p>Hello, world. I'm Freyja (Rae? idk dude, names are as difficult as gender for me.) This is my website. Well... *one*
|
||||
of my websites. I have a few domains. This one is low-effort. Going forward, I'm just gonna use this thing as a sort
|
||||
of blog.Since... I can? I mean, its not like HTML is complicated... It was designed mainly as a way to do books, but
|
||||
better - and with HYPERTEXT. Modern web design has more or less bastardized existing technologies to do fancy things
|
||||
with web browsers. But at the end of the day, raw HTML still works just fine - it just isn't as purdy.</p>
|
||||
<!-- END CONTENT -->
|
||||
<hr>
|
||||
<footer>
|
||||
<p>Published: 28th June, 2023</p>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user