Compare commits
1 Commits
renovate/s
...
e78c1db248
Author | SHA1 | Date | |
---|---|---|---|
|
e78c1db248 |
3
.github/workflows/publish.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: "0.120.3"
|
||||
hugo-version: "0.121.1"
|
||||
extended: true
|
||||
|
||||
- run: npm ci
|
||||
@@ -41,4 +41,3 @@ jobs:
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: generated
|
||||
|
2
.gitignore
vendored
@@ -119,5 +119,3 @@ dist
|
||||
# End of https://www.toptal.com/developers/gitignore/api/hugo,node
|
||||
|
||||
public/
|
||||
|
||||
.obsidian/
|
||||
|
21
LICENSE
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Dave Gallant
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
31
Makefile
Normal file
@@ -0,0 +1,31 @@
|
||||
SHELL := bash
|
||||
.SHELLFLAGS := -eu -o pipefail -c
|
||||
.DELETE_ON_ERROR:
|
||||
MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
ifeq ($(origin .RECIPEPREFIX), undefined)
|
||||
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
|
||||
endif
|
||||
.RECIPEPREFIX = >
|
||||
|
||||
build: clean
|
||||
> npm ci
|
||||
> hugo --minify
|
||||
|
||||
clean:
|
||||
> rm -rf public/
|
||||
|
||||
## server: run server locally on port 1313 and open in a browser
|
||||
server:
|
||||
> hugo server --buildDrafts
|
||||
|
||||
|
||||
## help: Print this help message
|
||||
help:
|
||||
> @echo
|
||||
> @echo "Usage:"
|
||||
> @echo
|
||||
> @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' | sort
|
||||
> @echo
|
||||
.PHONY: help
|
23
config.yaml
@@ -1,18 +1,14 @@
|
||||
baseURL: /
|
||||
googleAnalytics: G-V8WJDERTX9
|
||||
copyright: Dave Gallant
|
||||
title: davegallant.ca
|
||||
enableGitInfo: true
|
||||
enableRobotsTXT: true
|
||||
paginate: 20
|
||||
|
||||
build:
|
||||
noJSConfigInAssets: true
|
||||
writeStats: true
|
||||
noJSConfigInAssets: true
|
||||
|
||||
params:
|
||||
author: Dave Gallant
|
||||
subtitle:
|
||||
description: "Dave Gallant is a software developer and a computer enthusiast."
|
||||
subtitle: blog
|
||||
|
||||
logo:
|
||||
text: davegallant.ca
|
||||
@@ -26,7 +22,7 @@ params:
|
||||
issueTerm: "pathname"
|
||||
github:
|
||||
username: davegallant
|
||||
repository: site
|
||||
repository: davegallant.github.io
|
||||
|
||||
prism:
|
||||
languages:
|
||||
@@ -51,12 +47,15 @@ params:
|
||||
|
||||
menu:
|
||||
main:
|
||||
- name: Home
|
||||
- name: Posts
|
||||
url: /
|
||||
weight: 1
|
||||
- name: Blog
|
||||
url: /blog
|
||||
- name: About
|
||||
url: /about
|
||||
weight: 2
|
||||
- name: RSS
|
||||
url: /index.xml
|
||||
weight: 3
|
||||
|
||||
permalinks:
|
||||
post: "/blog/:year/:month/:day/:slug/"
|
||||
@@ -68,7 +67,7 @@ markup:
|
||||
|
||||
module:
|
||||
imports:
|
||||
- path: custom-theme
|
||||
- path: hugo-theme-gruvbox
|
||||
mounts:
|
||||
- source: node_modules/simple-icons/icons
|
||||
target: assets/simple-icons
|
||||
|
@@ -1,27 +1,5 @@
|
||||
# Hello
|
||||
---
|
||||
title: Welcome
|
||||
---
|
||||
|
||||
👋 I'm a software tinkerer with a passion for infra, security, privacy, and self-hosting.
|
||||
|
||||
This is a space where I document my learnings and share them with others. I hope you find something useful here. Continuous improvement is what motivates me to keep learning.
|
||||
|
||||
I choose to host this site, alongside other tools, rather than relying exclusively on larger platforms because I believe in the open web. Interoperability is often not a consideration for popular platforms today and I find that concerning.
|
||||
|
||||
My blog can be found [here](./blog).
|
||||
|
||||
## Connect
|
||||
|
||||
If you would like to connect with me:
|
||||
|
||||
- [Email](mailto:davegallant@proton.me)
|
||||
- [LinkedIn](https://www.linkedin.com/in/dave-gallant)
|
||||
- [Cal.com](https://cal.com/davegallant)
|
||||
- [Mastodon](https://mastodon.social/@davegallant)
|
||||
- [GitHub](https://github.com/davegallant)
|
||||
- [RSS Feed](https://davegallant.ca/index.xml)
|
||||
- [gitea.snake-cloud.ts.net](https://gitea.snake-cloud.ts.net/explore/repos)
|
||||
|
||||
## Credits
|
||||
|
||||
- The site is generated with [hugo](https://gohugo.io/)
|
||||
- The theme is a modified version of [hugo-theme-gruvbox](https://github.com/schnerring/hugo-theme-gruvbox)
|
||||
- The comments system is powered by [utterances](https://github.com/utterance/utterances)
|
||||
This is a space where I share notes about problems and solutions I've been exploring. Check out the links in the menu bar for more information on how to connect with me.
|
||||
|
29
content/about.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: "About"
|
||||
draft: false
|
||||
---
|
||||
|
||||
👋 I'm a software tinkerer with a passion for infra, security and self-hosting.
|
||||
|
||||
My primary motivation for hosting this website is to document my learnings and share them with others. I hope you find something useful here. Continuous improvement is what motivates me to keep learning.
|
||||
|
||||
I choose to self-host this site and other tools instead of relying exclusively on larger platforms because I believe in the open web. Interopability is often not a primary concern for popular platforms today and I find that concerning. I first got access to the internet in 1996 and have seen it evolve into what it is today. I want to do my part to keep it open and free.
|
||||
|
||||
If you would like to reach out, find out how to contact me [here](/contact/).
|
||||
|
||||
## Contact
|
||||
|
||||
Connect with me by using any of the following methods:
|
||||
|
||||
- [me@davegallant.ca](mailto:me@davegallant.ca)
|
||||
- <https://www.linkedin.com/in/dave-gallant>
|
||||
- <https://mastodon.social/@davegallant>
|
||||
- <https://github.com/davegallant>
|
||||
- <https://davegallant.ca/index.xml>
|
||||
- <https://git.davegallant.ca/explore/repos>
|
||||
|
||||
## Credits
|
||||
|
||||
- The site is generated with [hugo](https://gohugo.io/)
|
||||
- The theme is a modified version of [hugo-theme-gruvbox](https://github.com/schnerring/hugo-theme-gruvbox)
|
||||
- The comments system uses [utterances](https://github.com/utterance/utterances)
|
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Blog
|
||||
---
|
||||
|
||||
Subscribe via [RSS](https://davegallant.ca/index.xml).
|
@@ -1,95 +0,0 @@
|
||||
---
|
||||
title: "Amazon EBS CSI driver with terraform"
|
||||
date: "2024-04-07T15:20:23-04:00"
|
||||
draft: false
|
||||
comments: true
|
||||
toc: false
|
||||
author: "Dave Gallant"
|
||||
tags: ['aws', 'eks', 'ebs', 'aws-ebs-csi-driver', 'oidc', 'efs', 'aws-efs-csi-driver']
|
||||
---
|
||||
|
||||
I recently configured the Amazon EBS CSI driver and found the setup with terraform to be more effort than expected. I wanted to avoid third-party modules and keep it as simple as possible, while remaining least privilege.
|
||||
|
||||
> UPDATE: This approach can also be used for the aws-efs-csi-driver
|
||||
|
||||
<!--more-->
|
||||
|
||||
The [Amazon EBS CSI driver docs](https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html) mention that the following are needed:
|
||||
|
||||
- an existing EKS cluster
|
||||
- IAM role (that allows communication to the EC2 API)
|
||||
- EKS add-on (aws-ebs-csi-driver)
|
||||
- OIDC provider
|
||||
|
||||
This sounded simple enough but I was unable to find a "grab-and-go" terraform example that followed the recommendations in the docs. I saw some suggestions about attaching an `AmazonEBSCSIDriverPolicy` policy to the node groups but did not think this was the best idea since this would allow many pods to potentially have access to the EC2 API.
|
||||
|
||||
After a few minutes of LLM prompting, I was unimpressed with the results. I began to piece together the config myself, and after some trial and error, this is the terraform that I came up with:
|
||||
|
||||
```hcl
|
||||
|
||||
# TLS needed for the thumbprint
|
||||
provider "tls" {}
|
||||
|
||||
data "tls_certificate" "oidc" {
|
||||
url = aws_eks_cluster.main.identity[0].oidc[0].issuer
|
||||
}
|
||||
|
||||
# EKS addon
|
||||
resource "aws_eks_addon" "ebs_csi_driver" {
|
||||
cluster_name = aws_eks_cluster.main.name
|
||||
addon_name = "aws-ebs-csi-driver"
|
||||
addon_version = "v1.29.1-eksbuild.1"
|
||||
service_account_role_arn = aws_iam_role.ebs_csi_driver.arn
|
||||
}
|
||||
|
||||
# AWS Identity and Access Management (IAM) OpenID Connect (OIDC) provider
|
||||
|
||||
resource "aws_iam_openid_connect_provider" "eks" {
|
||||
url = aws_eks_cluster.main.identity.0.oidc.0.issuer
|
||||
client_id_list = ["sts.amazonaws.com"]
|
||||
thumbprint_list = [data.tls_certificate.oidc.certificates[0].sha1_fingerprint]
|
||||
}
|
||||
|
||||
# IAM
|
||||
resource "aws_iam_role" "ebs_csi_driver" {
|
||||
name = "ebs-csi-driver"
|
||||
assume_role_policy = data.aws_iam_policy_document.ebs_csi_driver_assume_role.json
|
||||
}
|
||||
|
||||
data "aws_iam_policy_document" "ebs_csi_driver_assume_role" {
|
||||
statement {
|
||||
effect = "Allow"
|
||||
|
||||
principals {
|
||||
type = "Federated"
|
||||
identifiers = [aws_iam_openid_connect_provider.eks.arn]
|
||||
}
|
||||
|
||||
actions = [
|
||||
"sts:AssumeRoleWithWebIdentity",
|
||||
]
|
||||
|
||||
condition {
|
||||
test = "StringEquals"
|
||||
variable = "${aws_iam_openid_connect_provider.eks.url}:aud"
|
||||
values = ["sts.amazonaws.com"]
|
||||
}
|
||||
|
||||
condition {
|
||||
test = "StringEquals"
|
||||
variable = "${aws_iam_openid_connect_provider.eks.url}:sub"
|
||||
values = ["system:serviceaccount:kube-system:ebs-csi-controller-sa"]
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_iam_role_policy_attachment" "AmazonEBSCSIDriverPolicy" {
|
||||
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy"
|
||||
role = aws_iam_role.ebs_csi_driver.name
|
||||
}
|
||||
```
|
||||
|
||||
The above configuration follows the docs, binding an IAM role to the service account `kube-system/ebs-csi-controller-sa` using an OpenID connect provider.
|
||||
|
||||
After applying the changes above, I deployed [the sample application](https://docs.aws.amazon.com/eks/latest/userguide/ebs-sample-app.html) and noticed that the persistent volume claims were bound to EBS volumes.
|
@@ -1,43 +0,0 @@
|
||||
---
|
||||
title: "Opting out of haveibeenpwned"
|
||||
date: "2025-02-16T21:15:07-05:00"
|
||||
draft: false
|
||||
comments: true
|
||||
toc: false
|
||||
author: "Dave Gallant"
|
||||
tags:
|
||||
[
|
||||
"breach",
|
||||
"darkweb",
|
||||
"haveibeenpwned",
|
||||
"hibp",
|
||||
"passwords",
|
||||
"privacy",
|
||||
]
|
||||
author: "Dave Gallant"
|
||||
---
|
||||
|
||||
Data breaches are a concern for anyone trying to live a life of relative privacy. Last month, PowerSchool informed its customers that [hackers stole data of 62 million students](https://www.bleepingcomputer.com/news/security/powerschool-hacker-claims-they-stole-data-of-62-million-students/). This may not have impacted you, but unless you have been practicing [Extreme Privacy](https://inteltechniques.com/book7.html) techniques for decades, you likely have been impacted by a data breach in the past.
|
||||
|
||||
<!--more-->
|
||||
|
||||
## Understanding Data Breaches
|
||||
|
||||
Data breaches occur when unauthorized individuals gain access to sensitive information (names, addresses, emails, phone numbers among other details). If the breach is substantial enough, the raw data is likely to make it into the hands of data brokers that will collect, aggregate, and sell the information on the [dark web](https://en.wikipedia.org/wiki/Dark_web).
|
||||
|
||||
## Check if you have been impacted
|
||||
|
||||
There are a number of services that can be used to check if you have been impacted by a data breach, including [Mozilla monitor](https://monitor.mozilla.org), [Google Dark web report](https://myactivity.google.com/dark-web-report/dashboard), and [haveibeenpwned.com](https://haveibeenpwned.com/). Some password managers offer features that compare your credentials against known breaches. These services can also be configured to send you notifications when a breach occurs. It is a good idea to become aware of these breaches as soon as you can, so that you can protect yourself from malicious behaviour such as phishing.
|
||||
|
||||
If you have been an email or phone number for any length of time, there is a high probability that some of your data has been exposed. You can easily check by querying [haveibeenpwned.com](https://haveibeenpwned.com/). Many of the tools that offer breach detection, query the haveibeenpwned database. Although I believe this is service is a public good, it also opens the door for anyone who may be looking to gain more information about your present and past usages of various websites and services.
|
||||
|
||||
## Opting out
|
||||
|
||||
If you have an identity that you'd like to protect, I'd suggest [opting out of public searchability](https://haveibeenpwned.com/OptOut/). This of course does not undo the data breach that happened, but does it make it more challenging for someone to quickly search for an impacted email address. Even after opting out, you can still [subscribe to breach notifications](https://haveibeenpwned.com/NotifyMe), as long as you can validate that you have access to the email in question.
|
||||
|
||||
There are other websites that offer similar style lookups, but many of them are either paywalled or require account registration.
|
||||
|
||||
## Email aliases
|
||||
|
||||
A more proactive method of reducing the likelihood of future exposures is to use an email aliasing service such as [Firefox Relay](https://relay.firefox.com), [DuckDuckGo Email Protection](https://duckduckgo.com/email/), or if you use Proton Mail, [hide-my-email aliases](https://proton.me/support/addresses-and-aliases#hide). This will allow you sign up for services using an alias instead of revealing your email address. The service then forwards all emails to your real address that you configure when setting up the alias.
|
||||
|
@@ -1,30 +0,0 @@
|
||||
---
|
||||
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.
|
||||
|
||||
<!--more-->
|
||||
|
||||
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.
|
||||
|
||||
~~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.~~
|
||||
|
||||
This method of adding MagicDNS can lead to issues with DNS when updating the tailscale application in TrueNAS, so I ended using the Tailscale IP directly.
|
||||
|
||||
|
Before Width: | Height: | Size: 34 KiB |
@@ -1,83 +0,0 @@
|
||||
---
|
||||
title: "Using a Realtek NIC with OPNsense"
|
||||
date: "2025-04-21T17:17:46-04:00"
|
||||
draft: false
|
||||
comments: true
|
||||
toc: false
|
||||
author: "Dave Gallant"
|
||||
tags:
|
||||
[
|
||||
linux,
|
||||
freebsd,
|
||||
opnsense,
|
||||
pfsense,
|
||||
proxmox,
|
||||
realtek,
|
||||
nic,
|
||||
]
|
||||
---
|
||||
|
||||
For the past few years, I've been running pfSense (and more recently OPNsense) in a virtual machine within Proxmox. This has been running fine with a single onboard Intel NIC. A few months ago, I upgraded to a machine that has a CPU that supports hardware-accelerated transcoding, has more SATA ports, and has more PCI slots for future expansion. With the goal of having a dedicated NIC for WAN, I bought an inexpensive 1Gbps PCIe NIC (TG-3468) despite reading about some of the concerns around Realtek NICs (sluggish performance, driver instability, and in some cases system crashes).
|
||||
|
||||
I've been running a Realtek NICs reliably on Linux and Windows desktops, so I figured I could make it work without too much effort, but it turns out Realtek NICs really can be problematic when it comes to FreeBSD-based routers, and commonly documented workarounds did not solve my problems.
|
||||
|
||||
<!--more-->
|
||||
|
||||
## Environment
|
||||
|
||||
My environment consists of:
|
||||
|
||||
- Proxmox 8.4
|
||||
- OPNsense 25.1 (QEMU VM)
|
||||
- Ethernet controller: Intel Corporation Ethernet Connection (5) I219-LM
|
||||
- Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
|
||||
|
||||
# Goal
|
||||
|
||||
The goal is to upgrade the OPNsense router from a single NIC to two NICs. The NICs are responsible for:
|
||||
|
||||
1. **LAN**: the internal network for computers, phones, cameras, printers, etc (NIC 1)
|
||||
2. **WAN**: the connection from the ISP (NIC 2)
|
||||
|
||||
Having two separate physical interfaces for LAN and WAN creates clear, physical separation between the trusted internal network and the untrusted external network at the hardware level. This also should improve performance and throughput since the same physical connection is no longer shared between LAN and WAN.
|
||||
|
||||
## Device Passthrough
|
||||
|
||||
For maximum performance and reduced hypervisor overhead, passing through a physical NIC for WAN directly to the VM seemed to make the most sense, so I passed it through to the OPNsense VM.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
I added the PCI device and restarted the OPNsense VM and re-configured the WAN in OPNsense to use this device.
|
||||
|
||||
I received the WAN IP and everything appeared to be working. I ran a few speed tests and noticed that the download speeds were much lower than normal from all of my devices. I checked my instance of [speedtest-tracker](https://docs.speedtest-tracker.dev) noticed that the download speeds were significantly slower than historical records:
|
||||
|
||||

|
||||
|
||||
These speeds tests were going through Mullvad, which occasionally is inconsistent, but the results remained consistently lower than the previous configuration.
|
||||
|
||||
I reverted the WAN back to the original NIC, and the download speeds returned to more average results immediately so it became obvious that something was not right with this setup.
|
||||
|
||||
### Realtek drivers
|
||||
|
||||
I did some web searching / LLM prompting and discovered that some people have had improved results after installing the OPNsense plugin **os-realtek-re**.
|
||||
|
||||
After installing the plugin and ensuring the kernel module was loaded at boot by following the post-install instructions, the throughput was still signicantly slower than before adding a second NIC.
|
||||
|
||||
I was starting to think that there might be a problem with the hardware and began the process to return it to the vendor.
|
||||
|
||||
## Virtualized NIC with a Linux bridge
|
||||
|
||||
As one last shot, I created Linux Bridge in the Proxmox GUI with the Realtek NIC and passed it through to the OPNsense VM:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
I re-configured the WAN interface in OPNsense to use the newly added network device, and the download and upload speeds returned to the typical speeds. Another added benefit to this setup is that it bypasses the need for installing Realtek FreeBSD drivers on the OPNsense VM, since the network device is virtual and managed on the Proxmox host (debian-based).
|
||||
|
||||
|
||||
## Conclusion
|
||||
|
||||
Although I am not sure why passing through a Realtek NIC to an OPNsense VM causes so much degradation in throughput, I am glad that there is a workaround. If I get ahold of another NIC, I would be interested in trying to reproduce the issue.
|
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 140 KiB |
Before Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 216 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 45 KiB |
@@ -29,18 +29,17 @@ Actions (gitea's implementation) has me excited because it makes spinning up a n
|
||||
|
||||
## Integration with Tailscale
|
||||
|
||||
> **2024-02-10**: I had originally written this post to include [Tailscale-Traefik Proxy Integration](https://traefik.io/blog/exploring-the-tailscale-traefik-proxy-integration/), but have since removed it in favour of Tailscale Serve after learning from this [example](https://github.com/tailscale-dev/docker-guide-code-examples). This simplifies the setup and reduces the number of moving parts.
|
||||
|
||||
So how does Tailscale help here? Well, more recently I've been exposing my self-hosted services using Tailscale [Serve](https://tailscale.com/kb/1312/serve). This allows for a nice looking dns name (i.e. gitea.my-tailnet-name.ts.net), automatic tls certificate management, and optionally allowing the address to be publically accessible (by using [Funnel](https://tailscale.com/kb/1223/funnel)).
|
||||
So how does Tailscale help here? Well, more recently I've been exposing my self-hosted services through a combination of traefik and the tailscale (through the tailscale-traefik proxy integration described [here](https://traefik.io/blog/exploring-the-tailscale-traefik-proxy-integration/)). This allows for a nice looking dns name (i.e. gitea.my-tailnet-name.ts.net) and automatic tls certificate management. I can also share this tailscale node securely with other tailscale users without configuring any firewall rules on my router.
|
||||
|
||||
## Deploying Gitea, Traefik, and Tailscale
|
||||
|
||||
In my case, the following is already set up:
|
||||
|
||||
- [docker-compose is installed](https://docs.docker.com/compose/install/linux/)
|
||||
- [tailscale is installed on the gitea host](https://tailscale.com/kb/1017/install/)
|
||||
- [tailscale magic dns is enabled](https://tailscale.com/kb/1081/magicdns/)
|
||||
|
||||
My preferred approach to deploying code in a homelab environment is with docker compose. I have deployed this in a LXC on Proxmox. You could run this on a virtual machine or a physical host as well.
|
||||
My preferred approach to deploying code in a homelab environment is with docker compose. I have deployed this in a [proxmox lxc container](https://pve.proxmox.com/wiki/Linux_Container) based on debian with a hostname `gitea`. This could be deployed in any environment and with any hostname (as long you updated the tailscale machine name to your preferred subdomain for magic dns).
|
||||
|
||||
The `docker-compose.yaml` file looks like:
|
||||
|
||||
@@ -50,7 +49,6 @@ services:
|
||||
gitea:
|
||||
image: gitea/gitea:1.21.1
|
||||
container_name: gitea
|
||||
network_mode: service:ts-gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
@@ -64,63 +62,81 @@ services:
|
||||
- ./data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ts-gitea:
|
||||
image: tailscale/tailscale:v1.58
|
||||
container_name: ts-gitea
|
||||
hostname: gitea
|
||||
environment:
|
||||
- TS_AUTHKEY=<FILL THIS IN>
|
||||
- TS_SERVE_CONFIG=/config/gitea.json
|
||||
- TS_STATE_DIR=/var/lib/tailscale
|
||||
volumes:
|
||||
- ${PWD}/state:/var/lib/tailscale
|
||||
- ${PWD}/config:/config
|
||||
- /dev/net/tun:/dev/net/tun
|
||||
cap_add:
|
||||
- net_admin
|
||||
- sys_module
|
||||
traefik:
|
||||
image: traefik:v3.0.0-beta4
|
||||
container_name: traefik
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
volumes:
|
||||
- ./traefik/data/traefik.yaml:/traefik.yaml:ro
|
||||
- ./traefik/data/dynamic.yaml:/dynamic.yaml:ro
|
||||
- /var/run/tailscale/tailscaled.sock:/var/run/tailscale/tailscaled.sock
|
||||
```
|
||||
|
||||
Note that you must specify a `TS_AUTHKEY` in the `ts-gitea` service. You can generate an auth key [here](https://login.tailscale.com/admin/settings/keys).
|
||||
|
||||
`config/gitea.json`:
|
||||
`traefik/data/traefik.yaml`:
|
||||
|
||||
```yaml
|
||||
{
|
||||
"TCP": { "443": { "HTTPS": true } },
|
||||
"Web":
|
||||
{
|
||||
"${TS_CERT_DOMAIN}:443":
|
||||
{ "Handlers": { "/": { "Proxy": "http://127.0.0.1:3000" } } },
|
||||
},
|
||||
"AllowFunnel": { "${TS_CERT_DOMAIN}:443": false }
|
||||
}
|
||||
entryPoints:
|
||||
https:
|
||||
address: ":443"
|
||||
providers:
|
||||
file:
|
||||
filename: dynamic.yaml
|
||||
certificatesResolvers:
|
||||
myresolver:
|
||||
tailscale: {}
|
||||
log:
|
||||
level: INFO
|
||||
```
|
||||
|
||||
After adding the above configuration, running `docker compose up -d` should be enough to get an instance up and running. It will be accessible at [https://gitea.my-tailnet-name.ts.net](https://gitea.my-tailnet-name.ts.net) from within the tailnet.
|
||||
and finally `traefik/data/dynamic/dynamic.yaml`:
|
||||
|
||||
```yaml
|
||||
http:
|
||||
routers:
|
||||
gitea:
|
||||
rule: Host(`gitea.my-tailnet-name.ts.net`)
|
||||
entrypoints:
|
||||
- "https"
|
||||
service: gitea
|
||||
tls:
|
||||
certResolver: myresolver
|
||||
services:
|
||||
gitea:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: "http://gitea:3000"
|
||||
```
|
||||
|
||||
Something to consider is whether or not you want to use ssh with git. One method to get this to work with containers is to use [ssh container passthrough](https://docs.gitea.com/installation/install-with-docker#ssh-container-passthrough). I decided to keep it simple and not use ssh, since communicating over https is perfectly fine for my use case.
|
||||
|
||||
After adding the above configuration, running `docker compose up -d` should be enough to get an instance up and running. It will be accessible at [https://gitea.my-tailnet-name.ts.net](https://gitea.my-tailnet-name.ts.net) from within the tailnet.
|
||||
|
||||
## Theming
|
||||
|
||||
I discovered some themes for gitea [here](https://git.sainnhe.dev/sainnhe/gitea-themes).
|
||||
I discovered some themes for gitea [here](https://git.sainnhe.dev/sainnhe/gitea-themes) and decided to try out gruvbox.
|
||||
|
||||
I added the theme by copying [theme-palenight.css](https://git.sainnhe.dev/sainnhe/gitea-themes/raw/branch/master/dist/theme-palenight.css) into `./data/gitea/public/assets/css`. I then added the following to `environment` in `docker-compose.yml`:
|
||||
I added the theme by cloning [theme-gruvbox-auto.css](https://git.sainnhe.dev/sainnhe/gitea-themes/raw/branch/master/dist/theme-gruvbox-auto.css) into `./data/gitea/public/assets/css`. I then added the following to `environment` in `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
- GITEA__ui__DEFAULT_THEME=palenight
|
||||
- GITEA__ui__THEMES=palenight
|
||||
- GITEA__ui__DEFAULT_THEME=gruvbox-auto
|
||||
- GITEA__ui__THEMES=gruvbox-auto
|
||||
```
|
||||
|
||||
After restarting the gitea instance, the default theme was applied.
|
||||
|
||||
## Connecting runners
|
||||
|
||||
I installed the runner by [following the docs](https://docs.gitea.com/usage/actions/quickstart#set-up-runner). I opted for installing it on a separate host as recommended in the docs. I used the systemd unit file to ensure that the runner comes back online after system reboots. I installed tailscale on the gitea runner as well, so that it can be part of the same tailnet as the main instance.
|
||||
I installed the runner by [following the docs](https://docs.gitea.com/usage/actions/quickstart#set-up-runner). I opted for installing it on a separate host (another lxc container) as recommended in the docs. I used the systemd unit file to ensure that the runner comes back online after system reboots. I installed tailscale on this gitea runner as well, so that it can have the same "networking privileges" as the main instance.
|
||||
|
||||
After registering this runner and starting the daemon, the runner appeared in `/admin/actions/runners`. I added two other runners to help with parallelization.
|
||||
|
||||

|
||||
|
||||
## Running a workflow
|
||||
|
||||
Now it's time start running some automation. I used the [demo workflow](https://docs.gitea.com/usage/actions/quickstart#use-actions) as a starting point to verify that the runner is executing workflows.
|
||||
@@ -139,6 +155,20 @@ on:
|
||||
jobs:
|
||||
run-ansible-playbook:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
host:
|
||||
- changedetection
|
||||
- homer
|
||||
- invidious
|
||||
- jackett
|
||||
- ladder
|
||||
- miniflux
|
||||
- plex
|
||||
- qbittorrent
|
||||
- tailscale-exit-node
|
||||
- tailscale-subnet-router
|
||||
- uptime-kuma
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
@@ -152,6 +182,7 @@ jobs:
|
||||
requirements: requirements.yml
|
||||
options: |
|
||||
--inventory inventory
|
||||
--limit ${{ matrix.host }}
|
||||
- name: Send failure notification
|
||||
uses: dawidd6/action-send-mail@v3
|
||||
if: always() && failure()
|
||||
@@ -161,7 +192,7 @@ jobs:
|
||||
secure: true
|
||||
username: myuser
|
||||
password: ${{ secrets.MAIL_PASSWORD }}
|
||||
subject: ansible runbook failed
|
||||
subject: ansible runbook '${{ matrix.host }}' failed
|
||||
to: me@davegallant.ca
|
||||
from: RFD Notify
|
||||
body: |
|
||||
@@ -183,5 +214,3 @@ One enhancement that I would like to see is the ability to send notifications on
|
||||
Gitea Actions are fast and the resource footprint is minimal. My gitea instance is currently using around 250mb of memory and a small fraction of a single cpu core (and the runner is using a similar amount of resources). This is impressive since many alternatives tend to require substantially more resources. It likely helps that the codebase is largely written in go.
|
||||
|
||||
By combining gitea with the networking marvel that is tailscale, running workflows becomes simple and fun. Whether you are working on a team or working alone, this setup ensures that your workflows are securely accessible from anywhere with an internet connection.
|
||||
|
||||
Check out my gitea instance exposed via Funnel [here](https://gitea.snake-cloud.ts.net).
|
@@ -22,10 +22,11 @@ tags:
|
||||
author: "Dave Gallant"
|
||||
---
|
||||
|
||||
I ran into a roadblock recently where I wanted to conveniently connect to a managed postgres database within Azure that was not running on public subnets. And by conveniently, I mean that I'd rather not have to spin up an ephemeral virtual machine running in the same network and proxy the connection, and I'd like to use a local client (preferably with a GUI). After several web searches, it became evident that Azure does not readily provide much tooling to support this.
|
||||
I ran into a roadblock recently where I wanted to be able to conveniently connect to a managed postgres database within Azure that was not running on public subnets. And by conveniently, I mean that I'd rather not have to spin up an ephemeral virtual machine running in the same network and proxy the connection, and I'd like to use a local client (preferably with a GUI). After several web searches, it became evident that Azure does not readily provide much tooling to support this.
|
||||
|
||||
<!--more-->
|
||||
|
||||
|
||||
## Go Public?
|
||||
|
||||
Should the database be migrated to public subnets? Ideally not, since it is good practice to host internal infrastructure in restricted subnets.
|
||||
@@ -81,6 +82,4 @@ If these stars align, than this solution might work as a stopgap for accessing a
|
||||
|
||||
It would be nice if Azure provided tooling similar to cloud-sql-proxy, so that using private databases would be more of a convenient experience.
|
||||
|
||||
~~One other thing to note is that some clients (such as [dbeaver](https://dbeaver.io/)) [do not provide DNS resolution over SOCKS](https://github.com/dbeaver/dbeaver/issues/872). So in this case, you won't be able to use DNS as if you were inside the cluster, but instead have to rely on knowing private ip addresses.~~
|
||||
|
||||
> **2025-01-16:**: DNS over SOCKS now works with the latest dbeaver client.
|
||||
One other thing to note is that some clients (such as [dbeaver](https://dbeaver.io/)) [do not provide DNS resolution over SOCKS](https://github.com/dbeaver/dbeaver/issues/872). So in this case, you won't be able to use DNS as if you were inside the cluster, but instead have to rely on knowing private ip addresses.
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 935 KiB After Width: | Height: | Size: 935 KiB |
@@ -83,32 +83,10 @@ After invidious was up and running, I installed [Tailscale](https://tailscale.co
|
||||
|
||||
I figured it would be nice to redirect existing YouTube links that others send me, so that I could seamlessly watch the videos using invidious.
|
||||
|
||||
I went looking for a way to redirect paths at the browser level. I found [Redirector](https://github.com/einaregilsson/Redirector), which can be used to modify http requests in the browser. I created the following redirect (exported as json):
|
||||
I went looking for a way to redirect paths at the browser level. I found the lightweight proxy [requestly](https://requestly.io/), which can be used to modify http requests in my browser. I created the following rules:
|
||||
|
||||
```json
|
||||
{
|
||||
"redirects": [
|
||||
{
|
||||
"description": "youtube to invidious",
|
||||
"exampleUrl": "https://www.youtube.com/watch?v=-lz30by8-sU",
|
||||
"exampleResult": "http://invidious:3000/watch?v=-lz30by8-sU",
|
||||
"error": null,
|
||||
"includePattern": "https://*youtube.com/*",
|
||||
"excludePattern": "",
|
||||
"patternDesc": "Any youtube video should redirect to invidious",
|
||||
"redirectUrl": "http://invidious:3000/$2",
|
||||
"patternType": "W",
|
||||
"processMatches": "noProcessing",
|
||||
"disabled": false,
|
||||
"grouped": false,
|
||||
"appliesTo": [
|
||||
"main_frame"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||

|
||||
|
||||
Now the link <https://www.youtube.com/watch?v=-lz30by8-sU> will redirect to [http://invidious:3000/watch?v=-lz30by8-sU](http://invidious:3000/watch?v=-lz30by8-sU)
|
||||
Now the link https://www.youtube.com/watch?v=-lz30by8-sU will redirect to [http://invidious:3000/watch?v=-lz30by8-sU](http://invidious:3000/watch?v=-lz30by8-sU)
|
||||
|
||||
I'm still looking for ways to improve this invidious setup. There doesn't appear to be a way to stream in 4K yet.
|
BIN
content/post/watching-youtube-in-private/requestly-rules.png
Normal file
After Width: | Height: | Size: 86 KiB |
@@ -12,9 +12,9 @@ A homelab can be an inexpensive way to host a multitude of internal/external ser
|
||||
|
||||
<!--more-->
|
||||
|
||||
Do you want host your own media server? ad blocker? reverse proxy?
|
||||
Do you want host your own Media server? Ad blocker? Web server?
|
||||
Are you interested in learning more about Linux? Virtualization? Networking? Security?
|
||||
A homelab can be a playground to enhance your computer skills, without worrying about breaking anything important.
|
||||
Building a homelab can be an entertaining playground to enhance your computer skills.
|
||||
|
||||
One of the best parts about building a homelab is that it doesn't have to be a large investment in terms of hardware. One of the simplest ways to build a homelab is out of a [refurbished computer](https://ca.refurb.io/products/hp-800-g1-usff-intel-core-i5-4570s-16gb-ram-512gb-ssd-wifi-windows-10-pro?variant=33049503825943).
|
||||
Having multiple machines/nodes provides the advantage of increased redundancy, but starting out with a single node is enough to reap many of the benefits of having a homelab.
|
||||
@@ -30,23 +30,20 @@ A hypervisor such as [Proxmox](https://www.proxmox.com/en/proxmox-ve/get-started
|
||||
|
||||
## Services
|
||||
|
||||
Here is a list of some useful services to consider:
|
||||
So what are some useful services to deploy?
|
||||
|
||||
- [Jellyfin](https://jellyfin.org/) or [Plex](https://www.plex.tv/) - a common gateway to self-hosting that enables a "self-hosted Netflix" experience that puts you in control of the content (guaranteed to make your partner and kids happy)
|
||||
- [changedetection](https://github.com/dgtlmoon/changedetection.io) - is a self-hosted equivalent to something like [visualping.io](https://visualping.io/) that can notify you when a webpage changes and keep track of the diffs
|
||||
- [Adguard](https://github.com/AdguardTeam/AdGuardHome) or [Pihole](https://pi-hole.net/) - can block a list of known trackers for all clients on your local network with the added benefit of speeding up web page load times
|
||||
- [gitea](https://gitea.io/) - A lightweight git server that can be used to mirror git repos and host private content
|
||||
- [miniflux](https://github.com/miniflux/v2) - a minimalist RSS reader
|
||||
- [gethomepage](https://github.com/gethomepage/homepage) - A customizable landing page for quick access to services with many supported widgets that can query APIs and display information
|
||||
- [Uptime Kuma](https://github.com/louislam/uptime-kuma) - A tool for monitoring the uptime of services, with notification support
|
||||
- [Speedtest Tracker](https://github.com/alexjustesen/speedtest-tracker) - a way to monitor the performance of your internet connection and/or vpn connection
|
||||
- [Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF) - a self-hosted PDF manipulation tool that will keep your data private
|
||||
- [Jellyfin](https://jellyfin.org/) or [Plex](https://www.plex.tv/) - basically a self-hosted Netflix that can be used to stream from multiple devices, and the best part is that you manage the content! Unlike Plex, Jellyfin is open source and can be found [here](https://github.com/jellyfin/jellyfin).
|
||||
- [changedetection](https://github.com/dgtlmoon/changedetection.io) - is a self-hosted equivalent to something like [visualping.io](https://visualping.io/) that will notify you when a webpage changes and keep track of the diffs
|
||||
- [Adguard](https://github.com/AdguardTeam/AdGuardHome) or [Pihole](https://pi-hole.net/) - can block a list of known trackers for all clients on your local network. I've used pihole for a long time, but have recently switched to Adguard since the UI is more modern and it has the ability to toggle on/off a pre-defined list of services, including Netflix (this is useful if you have stealthy young kids). Either of these will speed up your internet experience, simply because you won't need to download all of the extra tracking bloat.
|
||||
- [Gitea](https://gitea.io/) - A lightweight git server. I use this to mirror git repos from GitHub, GitLab, etc.
|
||||
- [Homer](https://github.com/bastienwirtz/homer) - A customizable landing page for services you need to access (including the ability to quickly search).
|
||||
- [Uptime Kuma](https://github.com/louislam/uptime-kuma) - A fancy tool for monitoring the uptime of services.
|
||||
|
||||
There is a large number of services you can self-host, including your own applications that you might be developing. Homelabbing allows you to have control over your data and services, and gives you the opportunity to be a software, network, and infrastructure engineer all at once.
|
||||
There is a large number of services you can self-host, including your own applications that you might be developing. [awesome-self-hosted](https://github.com/awesome-selfhosted/awesome-selfhosted) provides a curated list of services that might be of interest to you.
|
||||
|
||||
## VPN
|
||||
|
||||
[Tailscale](https://tailscale.com/) is a quick way to create a flat network for all of your services. With its [MagicDNS](https://tailscale.com/kb/1081/magicdns/), your can reference the names of machines like `changedetection` rather than using an IP address, or managing DNS yourself. By using this mesh-like VPN, you can easily create a secure tunnel to your homelab from anywhere.
|
||||
You could certainly setup and manage your own VPN by using something like [OpenVPN](https://openvpn.net/community-downloads/), but there is also something else you can try: [tailscale](https://tailscale.com/). It is a very quick way to create fully-encrypted connections between clients. With its [MagicDNS](https://tailscale.com/kb/1081/magicdns/), your can reference the names of machines like `homer` rather than using an IP address. By using this mesh-like VPN, you can easily create a secure tunnel to your homelab from anywhere.
|
||||
|
||||
## Monitoring
|
||||
|
||||
@@ -63,5 +60,3 @@ As mentioned above, [Uptime Kuma](https://github.com/louislam/uptime-kuma) is a
|
||||
## In Summary
|
||||
|
||||
Building out a homelab can be a rewarding experience and it doesn't require buying a rack full of expensive servers to get a significant amount of utility. There are many services that you can run that require very minimal setup, making it possible to get a server up and running in a short period of time, with monitoring, and that can be securely connected to remotely.
|
||||
|
||||
If you're looking for a steady stream of ideas for your homelab, check out [selfhosted.show](https://selfhosted.show/).
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
BIN
content/post/what-to-do-with-a-homelab/proxmox.png
Normal file
After Width: | Height: | Size: 157 KiB |
BIN
content/post/what-to-do-with-a-homelab/uptime-kuma.png
Normal file
After Width: | Height: | Size: 117 KiB |
@@ -182,5 +182,3 @@ In ways, home-manager can be seen as a gateway to the nix ecosystem. If you have
|
||||
## Wrapping up
|
||||
|
||||
The title of this post is slightly misleading, since it's possible to retain some of your dotfiles and have them intermingle with home-manager by including them alongside nix. The idea of defining user configuration using nix can provide a clean way to maintain your configuration, and allow it to be portable across platforms. Is it worth the effort to migrate away from shell scripts and dotfiles? I'd say so.
|
||||
|
||||
You can find my nix config [here](https://github.com/davegallant/nix-config).
|
10
justfile
@@ -1,10 +0,0 @@
|
||||
build: clean
|
||||
npm ci
|
||||
hugo --minify
|
||||
|
||||
clean:
|
||||
rm -rf public/
|
||||
|
||||
server: clean
|
||||
npm ci
|
||||
hugo server --buildDrafts
|
@@ -3,7 +3,7 @@
|
||||
src="https://storage.ko-fi.com/cdn/widget/Widget_2.js"
|
||||
></script>
|
||||
<script type="text/javascript">
|
||||
kofiwidget2.init("Buy me a coffee", "#32344a", "F1F2S4LWI");
|
||||
kofiwidget2.init("Buy me a coffee", "#458588", "F1F2S4LWI");
|
||||
kofiwidget2.draw();
|
||||
</script>
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
{{- $utterancesEnabled := $config.utterances.enable -}}
|
||||
|
||||
{{- if $utterancesEnabled -}}
|
||||
<br>
|
||||
<br>
|
||||
<section id='comments' class='comments'>
|
||||
<div class='container sep-before'>
|
||||
<div class='comments'>
|
||||
|
@@ -5,15 +5,25 @@
|
||||
.Page.Site.Params.comments.utterances.github.repository -}}
|
||||
|
||||
<script>
|
||||
// load comments
|
||||
let theme = "dark-blue";
|
||||
let script = document.createElement("script");
|
||||
script.src = "https://utteranc.es/client.js";
|
||||
script.setAttribute("repo", '{{ print $username "/" $repository }}');
|
||||
script.setAttribute("issue-term", "{{ $issueTerm }}");
|
||||
script.setAttribute("theme", theme);
|
||||
script.setAttribute("crossorigin", "anonymous");
|
||||
script.setAttribute("async", "");
|
||||
// load utteranc comment
|
||||
var getTheme = window.localStorage && window.localStorage.getItem("theme");
|
||||
getTheme =
|
||||
getTheme == null
|
||||
? window.matchMedia &&
|
||||
window.matchMedia("(prefers-color-scheme: light)").matches
|
||||
? "light"
|
||||
: "dark"
|
||||
: getTheme;
|
||||
getTheme = getTheme == null ? "dark" : getTheme;
|
||||
|
||||
let theme = getTheme === "dark" ? "gruvbox-dark" : "github-light";
|
||||
let s = document.createElement("script");
|
||||
s.src = "https://utteranc.es/client.js";
|
||||
s.setAttribute("repo", '{{ print $username "/" $repository }}');
|
||||
s.setAttribute("issue-term", "{{ $issueTerm }}");
|
||||
s.setAttribute("theme", theme);
|
||||
s.setAttribute("crossorigin", "anonymous");
|
||||
s.setAttribute("async", "");
|
||||
document.querySelector("div.comments").innerHTML = "";
|
||||
document.querySelector("div.comments").appendChild(script);
|
||||
document.querySelector("div.comments").appendChild(s);
|
||||
</script>
|
||||
|
@@ -5,5 +5,3 @@
|
||||
data-cf-beacon='{"token": "b96799f53f9940dca6f660e6052ba009"}'
|
||||
></script>
|
||||
<!-- End Cloudflare Web Analytics -->
|
||||
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
@@ -1,2 +0,0 @@
|
||||
<!-- Umami Analytics -->
|
||||
<script defer src="https://umami.snake-cloud.ts.net/script.js" data-website-id="e8adafba-b892-4dad-a139-2bd61fe5fab9"></script>
|
125
package-lock.json
generated
@@ -227,9 +227,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/cascade-layer-name-parser": {
|
||||
"version": "1.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-1.0.13.tgz",
|
||||
"integrity": "sha512-MX0yLTwtZzr82sQ0zOjqimpZbzjMaK/h2pmlrLK7DCzlmiZLYFpoO94WmN1akRVo6ll/TdpHb53vihHLUMyvng==",
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-1.0.7.tgz",
|
||||
"integrity": "sha512-9J4aMRJ7A2WRjaRLvsMeWrL69FmEuijtiW1XlK/sG+V0UJiHVYUyvj9mY4WAXfU/hGIiGOgL8e0jJcRyaZTjDQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -241,13 +241,12 @@
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^14 || ^16 || >=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@csstools/css-parser-algorithms": "^2.7.1",
|
||||
"@csstools/css-tokenizer": "^2.4.1"
|
||||
"@csstools/css-parser-algorithms": "^2.5.0",
|
||||
"@csstools/css-tokenizer": "^2.2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/color-helpers": {
|
||||
@@ -320,9 +319,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/css-parser-algorithms": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.7.1.tgz",
|
||||
"integrity": "sha512-2SJS42gxmACHgikc1WGesXLIT8d/q2l0UFM7TaEeIzdFCE/FPMtTiizcPGGJtlPo2xuQzY09OhrLTzRxqJqwGw==",
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.5.0.tgz",
|
||||
"integrity": "sha512-abypo6m9re3clXA00eu5syw+oaPHbJTPapu9C4pzNsJ4hdZDzushT50Zhu+iIYXgEe1CxnRMn7ngsbV+MLrlpQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -334,18 +333,17 @@
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^14 || ^16 || >=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@csstools/css-tokenizer": "^2.4.1"
|
||||
"@csstools/css-tokenizer": "^2.2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/css-tokenizer": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.4.1.tgz",
|
||||
"integrity": "sha512-eQ9DIktFJBhGjioABJRtUucoWR2mwllurfnM8LuNGAqX3ViZXaUchqk+1s7jjtkFiT9ySdACsFEA3etErkALUg==",
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.2.3.tgz",
|
||||
"integrity": "sha512-pp//EvZ9dUmGuGtG1p+n17gTHEOqu9jO+FiCUjNN3BDmyhdA2Jq9QsVeR7K8/2QCK17HSsioPlTW9ZkzoWb3Lg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -357,15 +355,14 @@
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^14 || ^16 || >=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/media-query-list-parser": {
|
||||
"version": "2.1.13",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.13.tgz",
|
||||
"integrity": "sha512-XaHr+16KRU9Gf8XLi3q8kDlI18d5vzKSKCY510Vrtc9iNR0NJzbY9hhTmwhzYZj/ZwGL4VmB3TA9hJW0Um2qFA==",
|
||||
"version": "2.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.7.tgz",
|
||||
"integrity": "sha512-lHPKJDkPUECsyAvD60joYfDmp8UERYxHGkFfyLJFTVK/ERJe0sVlIFLXU5XFxdjNDTerp5L4KeaKG+Z5S94qxQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -377,13 +374,12 @@
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^14 || ^16 || >=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@csstools/css-parser-algorithms": "^2.7.1",
|
||||
"@csstools/css-tokenizer": "^2.4.1"
|
||||
"@csstools/css-parser-algorithms": "^2.5.0",
|
||||
"@csstools/css-tokenizer": "^2.2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/postcss-cascade-layers": {
|
||||
@@ -1676,9 +1672,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001700",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001700.tgz",
|
||||
"integrity": "sha512-2S6XIXwaE7K7erT8dY+kLQcpa5ms63XlRkMkReXjle+kf6c5g38vyMl+Z5y8dSxOFDhcFe+nxnn261PLxBSQsQ==",
|
||||
"version": "1.0.30001572",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001572.tgz",
|
||||
"integrity": "sha512-1Pbh5FLmn5y4+QhNyJE9j3/7dK44dGB83/ZMjv/qJk86TvDbjk0LosiZo0i0WB0Vx607qMX9jYrn1VLHCkN4rw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1693,8 +1689,7 @@
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "CC-BY-4.0"
|
||||
]
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
@@ -2474,9 +2469,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-prettier": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz",
|
||||
"integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.2.tgz",
|
||||
"integrity": "sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"prettier-linter-helpers": "^1.0.0",
|
||||
@@ -3402,9 +3397,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lint-staged": {
|
||||
"version": "15.2.2",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz",
|
||||
"integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==",
|
||||
"version": "15.2.0",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.0.tgz",
|
||||
"integrity": "sha512-TFZzUEV00f+2YLaVPWBWGAMq7So6yQx+GG8YRMDeOEIf95Zn5RyiLMsEiX4KTNl9vq/w+NqRJkLA1kPIo15ufQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chalk": "5.3.0",
|
||||
@@ -3412,7 +3407,7 @@
|
||||
"debug": "4.3.4",
|
||||
"execa": "8.0.1",
|
||||
"lilconfig": "3.0.0",
|
||||
"listr2": "8.0.1",
|
||||
"listr2": "8.0.0",
|
||||
"micromatch": "4.0.5",
|
||||
"pidtree": "0.6.0",
|
||||
"string-argv": "0.3.2",
|
||||
@@ -3441,9 +3436,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/listr2": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz",
|
||||
"integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.0.tgz",
|
||||
"integrity": "sha512-u8cusxAcyqAiQ2RhYvV7kRKNLgUvtObIbhOX2NCXqvp1UU32xIg5CT22ykS2TPKJXZWJwtK3IKLiqAGlGNE+Zg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cli-truncate": "^4.0.0",
|
||||
@@ -3820,9 +3815,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.8",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
|
||||
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -3830,7 +3825,6 @@
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
@@ -4072,11 +4066,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "2.3.1",
|
||||
@@ -4112,9 +4105,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.2",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.2.tgz",
|
||||
"integrity": "sha512-MjOadfU3Ys9KYoX0AdkBlFEF1Vx37uCCeN4ZHnmwm9FfpbsGWMZeBLMmmpY+6Ocqod7mkdZ0DT31OlbsFrLlkA==",
|
||||
"version": "8.4.32",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz",
|
||||
"integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -4130,11 +4123,10 @@
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.8",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.1"
|
||||
"nanoid": "^3.3.7",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
@@ -4332,9 +4324,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-custom-media": {
|
||||
"version": "10.0.8",
|
||||
"resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-10.0.8.tgz",
|
||||
"integrity": "sha512-V1KgPcmvlGdxTel4/CyQtBJEFhMVpEmRGFrnVtgfGIHj5PJX9vO36eFBxKBeJn+aCDTed70cc+98Mz3J/uVdGQ==",
|
||||
"version": "10.0.2",
|
||||
"resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-10.0.2.tgz",
|
||||
"integrity": "sha512-zcEFNRmDm2fZvTPdI1pIW3W//UruMcLosmMiCdpQnrCsTRzWlKQPYMa1ud9auL0BmrryKK1+JjIGn19K0UjO/w==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -4346,12 +4338,11 @@
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@csstools/cascade-layer-name-parser": "^1.0.13",
|
||||
"@csstools/css-parser-algorithms": "^2.7.1",
|
||||
"@csstools/css-tokenizer": "^2.4.1",
|
||||
"@csstools/media-query-list-parser": "^2.1.13"
|
||||
"@csstools/cascade-layer-name-parser": "^1.0.5",
|
||||
"@csstools/css-parser-algorithms": "^2.3.2",
|
||||
"@csstools/css-tokenizer": "^2.2.1",
|
||||
"@csstools/media-query-list-parser": "^2.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14 || ^16 || >=18"
|
||||
@@ -5841,11 +5832,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
||||
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@@ -6055,11 +6045,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/stylelint-prettier": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/stylelint-prettier/-/stylelint-prettier-5.0.3.tgz",
|
||||
"integrity": "sha512-B6V0oa35ekRrKZlf+6+jA+i50C4GXJ7X1PPmoCqSUoXN6BrNF6NhqqhanvkLjqw2qgvrS0wjdpeC+Tn06KN3jw==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/stylelint-prettier/-/stylelint-prettier-5.0.0.tgz",
|
||||
"integrity": "sha512-RHfSlRJIsaVg5Br94gZVdWlz/rBTyQzZflNE6dXvSxt/GthWMY3gEHsWZEBaVGg7GM+XrtVSp4RznFlB7i0oyw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"prettier-linter-helpers": "^1.0.0"
|
||||
},
|
||||
|
4
package.hugo.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "davegallant.github.io",
|
||||
"version": "0.1.0"
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"schedule": [
|
||||
"every weekend"
|
||||
],
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
}
|
11
shell.nix
@@ -1,11 +0,0 @@
|
||||
let
|
||||
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11";
|
||||
pkgs = import nixpkgs { config = { }; overlays = [ ]; };
|
||||
in
|
||||
|
||||
pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
hugo
|
||||
];
|
||||
|
||||
}
|
Before Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 46 KiB |
@@ -1,49 +0,0 @@
|
||||
{{ $themeContrast := .Param "themeContrast" | default "medium" }}
|
||||
{{ $backgroundColor := "bg0" }}
|
||||
{{ if eq $themeContrast "soft" }}
|
||||
{{ $backgroundColor = "bg0_s" }}
|
||||
{{ else if eq $themeContrast "hard" }}
|
||||
{{ $backgroundColor = "bg0_h" }}
|
||||
{{ end }}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--bg: var(--{{ $backgroundColor }});
|
||||
--bg0: #1a1b26;
|
||||
--bg0_h: #1d2021;
|
||||
--bg0_s: #32302f;
|
||||
--bg1: #181922;
|
||||
--bg2: #32344a;
|
||||
--bg3: #665c54;
|
||||
--bg4: #32344a;
|
||||
--fg: var(--fg1);
|
||||
--fg0: #a1a1a1;
|
||||
--fg1: #dddfeb;
|
||||
--fg2: #7da6ff;
|
||||
--fg3: #6a6c67;
|
||||
--fg4: #32344a;
|
||||
--gray1: var(--fg4);
|
||||
--gray2: #444b6a;
|
||||
--red1: #f7768e;
|
||||
--red2: #ff7a93;
|
||||
--green1: #9ece6a;
|
||||
--green2: #b9f27c;
|
||||
--yellow1: #e0af68;
|
||||
--yellow2: #ff9e64;
|
||||
--blue1: #63A8D3;
|
||||
--blue2: #63A8D3;
|
||||
--purple1: #ad8ee6;
|
||||
--purple2: #bb9af7;
|
||||
--aqua1: #449dab;
|
||||
--aqua2: #0db9d7;
|
||||
--orange1: #d65d0e;
|
||||
--orange2: #fe8019;
|
||||
|
||||
& .dark--hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
:root {
|
||||
--primary: var(--blue1);
|
||||
--primary-alt: var(--blue2);
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
{{ define "main" }}
|
||||
<div class="content-section">
|
||||
<h1>{{ .Title | markdownify }}</h1>
|
||||
{{ with .Content }}
|
||||
<div>{{ . }}</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
@@ -1,13 +0,0 @@
|
||||
{{ range $pageIndex, $page := .Pages }}
|
||||
<article class="post">
|
||||
<div class="post-header">
|
||||
<div class="post-meta">
|
||||
{{- with $page.Date -}}
|
||||
<span>{{ .Format "2006-01-02" }}</span>
|
||||
{{- end -}}: <a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
@@ -1,5 +0,0 @@
|
||||
<div class="post-meta">
|
||||
{{- with .page.Date -}}
|
||||
<span>{{ .Format "2006-01-02" }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
87
themes/hugo-theme-gruvbox/assets/css/critical/15-colors.css
Normal file
@@ -0,0 +1,87 @@
|
||||
{{ $themeContrast := .Param "themeContrast" | default "medium" }}
|
||||
{{ $backgroundColor := "bg0" }}
|
||||
{{ if eq $themeContrast "soft" }}
|
||||
{{ $backgroundColor = "bg0_s" }}
|
||||
{{ else if eq $themeContrast "hard" }}
|
||||
{{ $backgroundColor = "bg0_h" }}
|
||||
{{ end }}
|
||||
|
||||
:root[data-theme="light"] {
|
||||
--bg: var(--{{ $backgroundColor }});
|
||||
--bg0: #fbf1c7;
|
||||
--bg0_h: #f9f5d7;
|
||||
--bg0_s: #f2e5bc;
|
||||
--bg1: #ebdbb2;
|
||||
--bg2: #d5c4a1;
|
||||
--bg3: #bdae93;
|
||||
--bg4: #a89984;
|
||||
--fg: var(--fg1);
|
||||
--fg0: #282828;
|
||||
--fg1: #3c3836;
|
||||
--fg2: #504945;
|
||||
--fg3: #665c54;
|
||||
--fg4: #7c6f64;
|
||||
--gray1: var(--fg4);
|
||||
--gray2: #928374;
|
||||
--red1: #cc241d;
|
||||
--red2: #9d0006;
|
||||
--green1: #98971a;
|
||||
--green2: #797403;
|
||||
--yellow1: #d79921;
|
||||
--yellow2: #b57614;
|
||||
--blue1: #458588;
|
||||
--blue2: #076678;
|
||||
--purple1: #b16286;
|
||||
--purple2: #8f3f71;
|
||||
--aqua1: #689d6a;
|
||||
--aqua2: #427b58;
|
||||
--orange1: #d65d0e;
|
||||
--orange2: #af3a03;
|
||||
|
||||
& .light--hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--bg: var(--{{ $backgroundColor }});
|
||||
--bg0: #282828;
|
||||
--bg0_h: #1d2021;
|
||||
--bg0_s: #32302f;
|
||||
--bg1: #3c3836;
|
||||
--bg2: #504945;
|
||||
--bg3: #665c54;
|
||||
--bg4: #7c6f64;
|
||||
--fg: var(--fg1);
|
||||
--fg0: #fbf1c7;
|
||||
--fg1: #ebdbb2;
|
||||
--fg2: #d5c4a1;
|
||||
--fg3: #bdae93;
|
||||
--fg4: #a89984;
|
||||
--gray1: var(--fg4);
|
||||
--gray2: #928374;
|
||||
--red1: #cc241d;
|
||||
--red2: #fb4934;
|
||||
--green1: #98971a;
|
||||
--green2: #b8bb26;
|
||||
--yellow1: #d79921;
|
||||
--yellow2: #fabd2f;
|
||||
--blue1: #458588;
|
||||
--blue2: #83a598;
|
||||
--purple1: #b16286;
|
||||
--purple2: #d3869b;
|
||||
--aqua1: #689d6a;
|
||||
--aqua2: #8ec07c;
|
||||
--orange1: #d65d0e;
|
||||
--orange2: #fe8019;
|
||||
|
||||
& .dark--hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
:root {
|
||||
{{ $themeColor := .Param "themeColor" | default "blue" }}
|
||||
--primary: var(--{{ $themeColor }}1);
|
||||
--primary-alt: var(--{{ $themeColor }}2);
|
||||
}
|
@@ -65,7 +65,7 @@ header {
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: var(--fg1);
|
||||
color: var(--fg3);
|
||||
}
|
||||
|
||||
&[type="search"]::-webkit-search-cancel-button {
|
||||
@@ -194,7 +194,7 @@ nav#menu {
|
||||
}
|
||||
|
||||
& ul.menu--vertical {
|
||||
background: var(--bg1);
|
||||
background: var(--fg0);
|
||||
bottom: 0;
|
||||
margin: 0;
|
||||
padding: 3rem;
|
||||
@@ -207,10 +207,10 @@ nav#menu {
|
||||
z-index: 10;
|
||||
|
||||
& .menu__item {
|
||||
color: var(--fg1);
|
||||
color: var(--bg1);
|
||||
|
||||
&:hover {
|
||||
color: var(--fg3);
|
||||
color: var(--bg4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,7 +260,7 @@ nav#menu {
|
||||
}
|
||||
|
||||
& ~ svg {
|
||||
stroke: var(--fg1);
|
||||
stroke: var(--bg1);
|
||||
|
||||
& line:nth-of-type(1) {
|
||||
transform: translate(0, 6px) rotate(45deg);
|
@@ -1,7 +1,7 @@
|
||||
.post,
|
||||
.content-section {
|
||||
border-bottom: 2px dotted var(--bg1);
|
||||
padding: 0rem 0;
|
||||
padding: 2rem 0;
|
||||
}
|
||||
|
||||
.post {
|
||||
@@ -31,7 +31,6 @@
|
||||
margin-top: 1.3rem;
|
||||
}
|
||||
|
||||
.content-section,
|
||||
.post-header,
|
||||
.post-content {
|
||||
& a {
|
@@ -0,0 +1,29 @@
|
||||
.jr__item-meta {
|
||||
font-family: var(--font-monospace);
|
||||
}
|
||||
|
||||
.jr__item-meta {
|
||||
align-items: start;
|
||||
flex-flow: column;
|
||||
}
|
||||
|
||||
@media (--md) {
|
||||
.jr__item-meta {
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
|
||||
.jr__date,
|
||||
.jr__date-range,
|
||||
.jr-work__location {
|
||||
flex-grow: 1;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.jr-awards__awarder,
|
||||
.jr-publications__publisher,
|
||||
.jr-education__institution,
|
||||
.jr-volunteer__organization {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
.social-share {
|
||||
align-items: center;
|
||||
border-top: 2px dotted var(--bg1);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.9rem;
|
||||
margin: 3rem 0;
|
||||
padding-top: 3rem;
|
||||
|
||||
& svg {
|
||||
fill: var(--fg);
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
||||
&.icon-tabler {
|
||||
fill: none;
|
||||
stroke: var(--fg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.social-share__item {
|
||||
background: var(--bg1);
|
||||
padding: 0.5rem;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Sticky social bar left
|
||||
|
||||
@media (--xl) {
|
||||
.social-share {
|
||||
align-items: flex-start;
|
||||
border-top: none;
|
||||
flex-direction: column;
|
||||
|
||||
position: fixed;
|
||||
top: 15%;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.social-share__heading {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.social-share__item {
|
||||
transition: padding 0.2s ease-in;
|
||||
|
||||
&:hover {
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
& svg {
|
||||
&:hover {
|
||||
fill: var(--fg);
|
||||
}
|
||||
|
||||
&.icon-tabler {
|
||||
fill: none;
|
||||
|
||||
&:hover {
|
||||
stroke: var(--fg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
@@ -1,12 +1,12 @@
|
||||
/*! purgecss start ignore */
|
||||
|
||||
/* Prism Plugins */
|
||||
{{ range $.Site.Params.prism.plugins }}
|
||||
{{ $path := printf "prismjs/plugins/%s/prism-%s.css" . . }}
|
||||
{{ $pluginCSS := resources.Get $path }}
|
||||
{{ if $pluginCSS }}
|
||||
{{ $importPath := trim $pluginCSS.RelPermalink "/" }}
|
||||
{{ printf "/* Import stylesheet for Prism plugin '%s' from '%s' */" . $importPath }}
|
||||
@import "{{ $importPath }}";
|
||||
{{ $plugin := resources.Get $path }}
|
||||
{{ if $plugin }}
|
||||
{{ printf "/*%s*/" $plugin }}
|
||||
@import "{{ $plugin }}";
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@@ -1,40 +1,53 @@
|
||||
function getTheme() {
|
||||
if (localStorage && localStorage.getItem("theme")) {
|
||||
// User preference
|
||||
return localStorage.getItem("theme");
|
||||
}
|
||||
return "auto";
|
||||
// Undefined
|
||||
}
|
||||
|
||||
function saveTheme(theme) {
|
||||
localStorage.setItem("theme", theme);
|
||||
function getOSTheme() {
|
||||
if (window.matchMedia) {
|
||||
// OS preference
|
||||
return window.matchMedia("(prefers-color-scheme: light)").matches
|
||||
? "light"
|
||||
: "dark";
|
||||
}
|
||||
// Undefined
|
||||
}
|
||||
|
||||
function setPrismTheme(theme) {
|
||||
function setTheme(theme) {
|
||||
// Main theme
|
||||
document.documentElement.setAttribute("data-theme", theme);
|
||||
|
||||
// Prism theme
|
||||
const prismDark = document.getElementById("prism-dark");
|
||||
const prismLight = document.getElementById("prism-light");
|
||||
prismDark.toggleAttribute("disabled", theme === "light");
|
||||
prismLight.toggleAttribute("disabled", theme === "dark");
|
||||
}
|
||||
|
||||
function setCommentsTheme(theme) {
|
||||
if (document.querySelector(".utterances-frame")) {
|
||||
const iframe = document.querySelector(".utterances-frame");
|
||||
var message = {
|
||||
type: "set-theme",
|
||||
theme: theme == "dark" ? "gruvbox-dark" : "github-light",
|
||||
};
|
||||
iframe.contentWindow.postMessage(message, "https://utteranc.es");
|
||||
}
|
||||
function saveTheme(theme) {
|
||||
localStorage.setItem("theme", theme);
|
||||
}
|
||||
|
||||
function setTheme(theme) {
|
||||
document.documentElement.setAttribute("data-theme", theme);
|
||||
setPrismTheme(theme);
|
||||
setCommentsTheme(theme);
|
||||
// Initial load
|
||||
const theme = getTheme();
|
||||
const osTheme = getOSTheme();
|
||||
if (theme) {
|
||||
setTheme(theme);
|
||||
// Store user preference
|
||||
} else if (osTheme) {
|
||||
setTheme(osTheme);
|
||||
}
|
||||
|
||||
|
||||
setTheme("dark");
|
||||
function toggleTheme(e) {
|
||||
const theme = e.currentTarget.classList.contains("light--hidden")
|
||||
? "light"
|
||||
: "dark";
|
||||
setTheme(theme);
|
||||
saveTheme(theme);
|
||||
}
|
||||
|
||||
// This script is inlined in the <head> of the document, so we have to wait
|
||||
// for the DOM content before can add event listeners to the toggle buttons
|