From 05a1ea8741cd31cd698dd5d81c3f007308721037 Mon Sep 17 00:00:00 2001 From: mat ess Date: Mon, 8 Aug 2022 00:31:56 -0400 Subject: [PATCH] Migrate to new site with zola --- .envrc | 1 + .gitignore | 3 + .gitlab-ci.yml | 11 -- ...T6Fl0FSgyx68Z8hXpcm2tBO31j6q7vylwBJiYvv2OQ | 1 - README.md | 5 +- config.toml | 28 ++++ content/about.md | 15 ++ content/posts/_index.md | 5 + content/posts/gitea-on-fly-io.md | 146 ++++++++++++++++++ content/projects.md | 12 ++ content/resume.md | 41 +++++ flake.lock | 65 ++++++++ flake.nix | 43 ++++++ sass/extra.scss | 39 +++++ sass/theme/dark.scss | 10 ++ sass/theme/light.scss | 10 ++ site/index.html | 14 -- site/style.css | 9 -- static/favicon.svg | 3 + templates/base.html | 22 +++ templates/index.html | 5 + templates/partials/footer.html | 6 + templates/partials/nav.html | 15 ++ templates/posts.html | 32 ++++ 24 files changed, 504 insertions(+), 37 deletions(-) create mode 100644 .envrc create mode 100644 .gitignore delete mode 100644 .gitlab-ci.yml delete mode 100644 .well-known/acme-challenge/8T6Fl0FSgyx68Z8hXpcm2tBO31j6q7vylwBJiYvv2OQ create mode 100644 config.toml create mode 100644 content/about.md create mode 100644 content/posts/_index.md create mode 100644 content/posts/gitea-on-fly-io.md create mode 100644 content/projects.md create mode 100644 content/resume.md create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 sass/extra.scss create mode 100644 sass/theme/dark.scss create mode 100644 sass/theme/light.scss delete mode 100644 site/index.html delete mode 100644 site/style.css create mode 100644 static/favicon.svg create mode 100644 templates/base.html create mode 100644 templates/index.html create mode 100644 templates/partials/footer.html create mode 100644 templates/partials/nav.html create mode 100644 templates/posts.html diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e3f6337 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.direnv/ +themes/ +public/ \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ec63ad2..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,11 +0,0 @@ -image: alpine - -pages: - script: - - mkdir public - - cp site/* public - artifacts: - paths: - - public - only: - - master diff --git a/.well-known/acme-challenge/8T6Fl0FSgyx68Z8hXpcm2tBO31j6q7vylwBJiYvv2OQ b/.well-known/acme-challenge/8T6Fl0FSgyx68Z8hXpcm2tBO31j6q7vylwBJiYvv2OQ deleted file mode 100644 index 89dd4de..0000000 --- a/.well-known/acme-challenge/8T6Fl0FSgyx68Z8hXpcm2tBO31j6q7vylwBJiYvv2OQ +++ /dev/null @@ -1 +0,0 @@ -8T6Fl0FSgyx68Z8hXpcm2tBO31j6q7vylwBJiYvv2OQ.CpU7Tczxh1oEMK5KYXO2cu3syEqOIuT38UVhliQaydg diff --git a/README.md b/README.md index b55b975..1fab617 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # mat.services +## my personal site -> my personal site +built using zola and nix -wip +inspired by diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..f15989e --- /dev/null +++ b/config.toml @@ -0,0 +1,28 @@ +# The URL the site will be built for +base_url = "https://mat.services" +title = "mat.services" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = false + +theme = "apollo" + +[markdown] +# Whether to do syntax highlighting +highlight_code = true + +[extra] +theme = "auto" +favicon = "/favicon.svg" +stylesheets = ["extra.css"] + +menu = [ + { name = "/posts", url = "/posts", external = false }, + { name = "/projects", url = "/projects", external = false }, + { name = "/about", url = "/about", external = false }, + { name = "git", url = "https://git.mat.services/explore/repos", external = true }, +] + diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..e7d9c43 --- /dev/null +++ b/content/about.md @@ -0,0 +1,15 @@ ++++ +title = "about me" +path = "about" ++++ + +# matthew ess +i'm a 'software engineer'/'code monkey' by trade, currently employed by yelp inc in the engineering effectiveness department. my work is focused on improving the tooling used by other engineers at yelp to develop python services. + +[you can look at my resume here](/resume). + +in my spare time, i try to research programming language theory and practice, hack on useful tools, and change the world. in reality, i spend a considerable amount of time consuming movies and television, but i'm always looking for inspiration and opportunities to pursue my passions. + +## contact + +email: mat@mat.services diff --git a/content/posts/_index.md b/content/posts/_index.md new file mode 100644 index 0000000..86f39b2 --- /dev/null +++ b/content/posts/_index.md @@ -0,0 +1,5 @@ ++++ +path = "posts" +template = "posts.html" +sort_by = "date" ++++ \ No newline at end of file diff --git a/content/posts/gitea-on-fly-io.md b/content/posts/gitea-on-fly-io.md new file mode 100644 index 0000000..d14afce --- /dev/null +++ b/content/posts/gitea-on-fly-io.md @@ -0,0 +1,146 @@ ++++ +title = "diy code hosting with gitea and fly.io" +date = "2022-08-07" ++++ + +## Setting the scene +Inspired by the [Give Up Github campaign](https://sfconservancy.org/GiveUpGitHub/), I recently decided I wanted to spin up my own instance of [Gitea](https://gitea.io/). There are free (as in beer), free (as in freedom), public instances of Gitea and other FOSS-leaning code forges, but self-hosted Gitea struck me as a nice way to take even a bit more ownership over my own code. + +I maintain a small PC running in my home as a server for a few services running via Proxmox, but I am really dissatisfied with my workflows for managing that box lately (picture SSHing into LXC containers and manually editing systemd configurations... yuck). I recently read a couple of different articles singing the praises of [Fly.io](https://fly.io/), a platform as a service (PaaS) that replicates most of the good parts of the classic Heroku developer experience. Further enticed by their generous-looking free tier, I took the plunge and created a Fly.io account. + +## Getting started +First things first: in order to interact with Fly.io, we primarily use the `flyctl` command line tool. It's available from a variety of sources: +```bash +# Nix +nix-shell -p flyctl +nix-env -iA nixpkgs.flyctl + +# macOS +brew install flyctl + +# Linux + non-Homebrew users +curl -L https://fly.io/install.sh | sh + +# Windows users +iwr https://fly.io/install.ps1 -useb | iex +``` + +`flyctl` can handle signing up for a Fly.io account if you haven't done that, otherwise you can use it to sign in: +```bash +# Opens your browser to set up an account +# This step requires a credit card, in the event you exceed the free tier limits +# See https://fly.io/docs/about/pricing/ for details +flyctl auth signup + +# Opens your browser to sign in +flyctl auth login +``` + +## Configuring apps with `flyctl` +In order to avoid even the appearance of disorganization, we'll start off with a git repository for tracking our Fly.io configurations: +```bash +mkdir fly-apps; cd fly-apps +git init +mkdir gitea; cd gitea +``` + +Next up, we create our app configuration and register it with Fly.io. `flyctl` takes care of this for us in a single command, `flyctl launch`. The command will prompt you interactively for some input, but here we'll just pass some flags directly: +```bash +flyctl launch \ + # use the official Gitea docker image \ + --image gitea/gitea:latest \ + # give our instance a unique name, this will be used to generate a development hostname like gitea-mat-services.fly.dev \ + --name gitea-mat-services \ + # region where the app runs, don't supply this option if you want to interactively choose a region \ + --region ewr \ + # don't immediately deploy, we need to edit our fly.toml first \ + --no-deploy + +# don't forget to commit! +git add fly.toml +git commit -m "Add default generated configuration" +``` + +We will also need a volume for persisting git repositories: +```bash +# Create a 3GB volume +# Note: this will consume your entire free tier allotment for volume storage! +flyctl volumes create gitea_data +# Alternatively, create a smaller volume +flyctl volumes create gitea_data --size 1 +``` + +Now our app is ready to deploy, but first we're going to make some changes to the `fly.toml` configuration that was generated for us. [Gitea has their own post on Fly.io which includes a sample configuration](https://blog.gitea.io/2022/04/running-gitea-on-fly.io/), and we can reference that to end up with something like the following: +```diff + + +[env] ++ GITEA____APP_NAME = "git.mat.services: Gitea for me" ++ GITEA__database__DB_TYPE = "sqlite3" ++ GITEA__database__PATH = "/data/gitea/gitea.db" ++ GITEA__server__DOMAIN = "gitea-on-fly.fly.dev" ++ GITEA__server__SSH_DOMAIN = "gitea-on-fly.fly.dev" ++ GITEA__server__ROOT_URL = "https://gitea-on-fly.fly.dev" ++ GITEA__security__INSTALL_LOCK = "true" # Don't show installer ++ # GITEA__service__DISABLE_REGISTRATION = "true" # TODO: uncomment once you have created your first user + ++ [mounts] ++ destination = "/data" ++ source = "gitea_data" + + + ++ # ssh traffic ++ [[services]] ++ internal_port = 22 ++ protocol = "tcp" ++ [[services.ports]] ++ port = 22 + +[[services]] + +- internal_port = 8080 ++ internal_port = 3000 + +``` + +Don't forget to save your work! +```bash +git add fly.toml +git commit -m "Add Gitea specific configuration" +``` + +## Liftoff! +The stars are aligned. The witching hour has arrived. Let's deploy our app: +```bash +flyctl deploy +``` + +After `flyctl` does its thing, your Gitea instance should be up and running at `https://.fly.dev`! For the extremely lazy, `flyctl` will do the work for you: +```bash +flyctl open +``` + +Now you can register your account! If you want to keep your Gitea instance private, uncomment the last line in the `env` section and rerun `flyctl deploy` after registering. + +## Bonus round: configuring your custom domain with Fly.io +Some, like myself, will not be satisfied accessing their Gitea instances with a `.fly.dev` URL. Thankfully, Fly.io makes it a breeze to configure a secure custom domain with the help of LetsEncrypt. + +Fly.io and `flyctl` seem to offer tooling for managing your domains and DNS records entirely within the Fly.io system, but I personally didn't explore this route, as my own domains and DNS records are managed elsewhere. Whatever you use to manage your own domains and DNS, you will need to create two records for your domain name corresponding with the IPv4 and IPv6 addresses of the application: +```bash +flyctl ips list +TYPE ADDRESS REGION CREATED AT +v4 1.2.3.4 global 2022-07-03T04:39:18Z +v6 dead:beef:1::a:a global 2022-07-03T04:39:19Z +``` + +Create an A record for the v4 address, and an AAAA record for the v6 address. With those records in place, you should be clear to provision a certificate: +```bash +flyctl certs add git.mat.services +``` + +Now open up your custom domain and revel in your new code hosting powers. + +### Acknowledgements +- [Thank you to Xe Iaso for xer blog post on Fly.io that inspired me to try it in the first place!](https://xeiaso.net/blog/fly.io-heroku-replacement) +- [Thank you to techknowlogick for their instructive post on running Gitea on Fly.io!](https://blog.gitea.io/2022/04/running-gitea-on-fly.io/) \ No newline at end of file diff --git a/content/projects.md b/content/projects.md new file mode 100644 index 0000000..ba24fb5 --- /dev/null +++ b/content/projects.md @@ -0,0 +1,12 @@ ++++ +title = "selected projects" +path = "projects" ++++ + +# gemini for rust + +`gemini` is a rust crate providing a small set of types useful for working with the Gemini protocol + +[`gemini` on crates.io](https://crates.io/crates/gemini) + +[`gemini` source on the pijul nest](https://nest.pijul.com/mat/gemini-projects:main/5II6T7YETYWUI.BEAAA) \ No newline at end of file diff --git a/content/resume.md b/content/resume.md new file mode 100644 index 0000000..d701b2b --- /dev/null +++ b/content/resume.md @@ -0,0 +1,41 @@ ++++ +title = "resume" +path = "resume" ++++ + +# skills + +## professional +* python +* relational databases + * redshift + * mysql +* apache spark +* flink + +## personal +* nix package maanger +* rust +* haskell +* java + +# experience + +## yelp inc, 2017-present + +### 2022-present +_software engineer, core services team_ + +### 2019-2022 +_software engineer, marketplace data observability team_ + +### 2018-2019 +_software engineer, food ordering experience team_ + +### 2017 +_software engineering intern, transactions team_ + +# education + +## purdue university, 2014-2018 +_bachelor of science, computer science_ \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4c4a610 --- /dev/null +++ b/flake.lock @@ -0,0 +1,65 @@ +{ + "nodes": { + "apollo": { + "flake": false, + "locked": { + "lastModified": 1653996138, + "narHash": "sha256-zZL3UinCbvu+gHdefqCt3ymuEPyzyIAWdGmpdruOb1U=", + "owner": "not-matthias", + "repo": "apollo", + "rev": "04ded9ffd63fd3dd085da72c4153057001b67003", + "type": "github" + }, + "original": { + "owner": "not-matthias", + "repo": "apollo", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1657102481, + "narHash": "sha256-62Fuw8JgPub38OdgNefkIKOodM9nC3M0AG6lS+7smf4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "608ed3502263d6f4f886d75c48fc2b444a4ab8d8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1659803779, + "narHash": "sha256-+5zkHlbcbFyN5f3buO1RAZ9pH1wXLxCesUJ0vFmLr9Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f44884060cb94240efbe55620f38a8ec8d9af601", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "apollo": "apollo", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..98291f8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "personal site"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + flake-parts.inputs.nixpkgs.follows = "nixpkgs"; + + apollo.url = "github:not-matthias/apollo"; + apollo.flake = false; + }; + + outputs = { self, flake-parts, ... }@inputs: + let + theme = inputs.apollo; + themeName = ((builtins.fromTOML (builtins.readFile "${theme}/theme.toml")).name); + in + flake-parts.lib.mkFlake { inherit self; } { + imports = [ ]; + systems = inputs.nixpkgs.lib.systems.flakeExposed; + perSystem = { config, self', inputs', pkgs, system, ... }: { + packages.default = pkgs.stdenv.mkDerivation { + pname = "personal-site"; + version = "2022-08-07"; + src = ./.; + nativeBuildInputs = [ pkgs.zola ]; + configurePhase = '' + mkdir -p "themes/${themeName}" + cp -r ${theme}/* "themes/${themeName}" + ''; + buildPhase = "zola build"; + installPhase = "cp -r public $out"; + }; + devShells.default = pkgs.mkShell { + packages = [ pkgs.zola ]; + shellHook = '' + mkdir -p themes + ln -sn "${theme}" "themes/${themeName}" + ''; + }; + }; + }; +} diff --git a/sass/extra.scss b/sass/extra.scss new file mode 100644 index 0000000..5cb7fa2 --- /dev/null +++ b/sass/extra.scss @@ -0,0 +1,39 @@ +// Logo + +div.brand>* { + padding: 0 0.25em; +} + +div.brand:hover img.logo { + filter: brightness(0) invert(1); +} + +img.logo { + border: none; + height: 0.75em; + width: 0.75em; + padding-right: 0.25em; +} + +// Footer +.content { + display: flex; + flex-direction: column; + min-height: 100vh; +} + +div.inner { + flex-grow: 1; +} + +header, +footer { + flex-grow: 0; + flex-shrink: 0; +} + +footer { + margin: 2em; + color: grey; + font-size: 0.75em; +} \ No newline at end of file diff --git a/sass/theme/dark.scss b/sass/theme/dark.scss new file mode 100644 index 0000000..9bfc76c --- /dev/null +++ b/sass/theme/dark.scss @@ -0,0 +1,10 @@ +:root { + --text-0: rgba(255, 255, 255, 87%); + --text-1: rgba(255, 255, 255, 60%); + + --bg-0: #121212; + --bg-1: rgba(255, 255, 255, 5%); + + --primary-color: lightcoral; + --hover-color: white; +} \ No newline at end of file diff --git a/sass/theme/light.scss b/sass/theme/light.scss new file mode 100644 index 0000000..dd395ce --- /dev/null +++ b/sass/theme/light.scss @@ -0,0 +1,10 @@ +:root { + --text-0: rgba(0, 0, 0, 87%); + --text-1: rgba(0, 0, 0, 66%); + + --bg-0: #fff; + --bg-1: #f2f2f2; + + --primary-color: lightcoral; + --hover-color: white; +} \ No newline at end of file diff --git a/site/index.html b/site/index.html deleted file mode 100644 index e0ee0de..0000000 --- a/site/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - matthew ess - - - - - - -

matthew ess

-

is working on making something nice here

- - diff --git a/site/style.css b/site/style.css deleted file mode 100644 index dfcaf46..0000000 --- a/site/style.css +++ /dev/null @@ -1,9 +0,0 @@ -body { - background-color: #ddacd4; - margin: 2em; -} - -h1, p { - color: #34415e; - font-family: -apple-system, BlinkMacSystemFont, Helvetica, sans-serif; -} diff --git a/static/favicon.svg b/static/favicon.svg new file mode 100644 index 0000000..b2fea0f --- /dev/null +++ b/static/favicon.svg @@ -0,0 +1,3 @@ + + +Untitled.svg \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..01b1230 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,22 @@ +{% import "macros/macros.html" as post_macros %} + + + +{% include "partials/header.html" %} + + +
+ {% include "partials/nav.html" %} + + {# Post page is the default #} +
+ {% block main_content %} + Nothing here?! + {% endblock main_content %} +
+ + {% include "partials/footer.html" %} +
+ + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..477bd51 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block main_content %} +{{ post_macros::page_header(title="a sadware company")}} +{% endblock main_content %} \ No newline at end of file diff --git a/templates/partials/footer.html b/templates/partials/footer.html new file mode 100644 index 0000000..5bd4083 --- /dev/null +++ b/templates/partials/footer.html @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/templates/partials/nav.html b/templates/partials/nav.html new file mode 100644 index 0000000..d706bc5 --- /dev/null +++ b/templates/partials/nav.html @@ -0,0 +1,15 @@ +
+ + + +
\ No newline at end of file diff --git a/templates/posts.html b/templates/posts.html new file mode 100644 index 0000000..1e346a7 --- /dev/null +++ b/templates/posts.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} + +{% block main_content %} +{{ post_macros::page_header(title="blog posts") }} + +
+ {%- if paginator %} + {%- set show_pages = paginator.pages -%} + {% else %} + {% set section = get_section(path="posts/_index.md") %} + {%- set show_pages = section.pages -%} + {% endif -%} + + {{ post_macros::list_posts(pages=show_pages) }} +
+ +{% if paginator %} +
    + {% if paginator.previous %} + + + + {% endif %} + + {% if paginator.next %} + + + + {% endif %} +
+{% endif %} +{% endblock main_content %} \ No newline at end of file