Swapped to hugo as blog engine

Main
Johannes Hendrik Gerard van der Weide 2024-03-14 10:37:29 +01:00
parent 03bfe05103
commit 5da72aef54
6 changed files with 178 additions and 0 deletions

View File

@ -0,0 +1,8 @@
---
title: HermitBlogs by HermitCollective.net
---
# Welcome to the [HermitCollective](https://hermitcollective.net) blog site.
Here you can find posts about Game dev, Foss, Philosphy and Politics.
Each post will have a link to the authors site or fediverse profile.

View File

@ -0,0 +1,3 @@
+++
title = "Posts"
+++

View File

@ -0,0 +1,105 @@
+++
author = "[Hertog](https://hertog.hermitcollective.net)"
title = "Setting up Owncast with NixOS"
date = "2023-10-27"
description = "A quick and simple setup guide for Owncast on NixOS."
tags = [
"Nix",
"Selfhosting",
"Tutorial",
]
+++
## What is Owncast?
[Owncast](https://owncast.online/) is a lightweight program to set up your own livestreaming website as an alternative to streaming on twitch or youtube.
It is fully free and open source licensed under the [MIT license](https://mit-license.org/) and can even be linked with the [fediverse!](https://en.wikipedia.org/wiki/Fediverse)
Which to me is perfect! I really wanted to get back into livestreaming (I used to do this on twitch allot) but I wanted a platform without adds or corporate influence and thus owncast.
## As for NixOS
I use NixOS to selfhost everything I can (including this website!) but I couldn't find any wiki pages or concrete owncast configurations online, I did eventually get it working and will share my configuration here.
## The Owncast part of the config
This part is the easiest it is simply enabling it setting an unused port (the default and recommended is 8080) and then let owncast open that part of the firewall.
```
services.owncast = {
enable = true;
port = 8080;
openFirewall = true;
};
```
## The nginx part!
Nginx is needed to setup a proxy so we can link owncast to our domain and ensure everything will run securely.
We begin by setting the (sub)domain that we wish to point at owncast and we enable SSL and ACME.
The locations part needs to point at the port we set earlier so that nginx knows to point at owncast.
Owncast also needs websockets so we set that to true as wel, the extra config is to ensure our proxy works.
```
services.nginx.virtualHosts."live.hermitcollective.net" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:8080";
proxyWebsockets = true; # needed if you need to use WebSocket
extraConfig =
# required when the target is also TLS server with multiple hosts
"proxy_ssl_server_name on;" +
# required when the server wants to use HTTP Authentication
"proxy_pass_header Authorization;"
;
};
};
```
## The full config
Your entire config should look something like this now at which point you can sudo nixos-rebuild switch!:
```
{ config, pkgs, ... }:
{
services.owncast = {
enable = true;
port = 8080;
openFirewall = true;
};
# Homepages
services.nginx.virtualHosts."yourdomain.net" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:8080";
proxyWebsockets = true; # needed if you need to use WebSocket
extraConfig =
# required when the target is also TLS server with multiple hosts
"proxy_ssl_server_name on;" +
# required when the server wants to use HTTP Authentication
"proxy_pass_header Authorization;"
;
};
};
}
```
## Extra information
We are not done yet however there is one more this that is required on the nixos side of things and quite a few things in your owncast webpage.
While we did setup nginx for this owncast we didn't do a full nginx setup, this is because in my homeserver nginx is used for many things and I want to avoid duplicate nix code so I have a separate nginx config which can be found [here](https://git.saragerretsen.nl/Hertog/HermitCollective.nix/src/branch/main/services/nginx.nix).
Now that that is done we can go into our owncast web page at https://yourdomain.net/admin.
Here it will ask you to log in the default for this is Username: Admin and Password: abc123 you want to replace this as soon as possible!
Luckely there is the owncast admin page you just logged into for that, either hit view next to streaming keys in the home page or head to Stream Keys in Server Setup under the Configuration tab.
When you are done with that open your favourite streaming application set the livestreaming service to custom and use this link rtmp://yourdomain.net:1935/live with the streamkey you just set!
Feedback on this blog can be left [here](https://tech.lgbt/@hertog/111306437367785113) thank you!
## Further help
If you need extra configuring (and know what you are doing) more owncast options can be found [here](https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=owncast) and the owncast documentation can be found [here](https://owncast.online/docs/).
Is your version not up to date with Nix pkgs? run ``` nix-channel --update ```.
Lastely if this guide gets out of date my current owncast config can be found [here](https://git.saragerretsen.nl/Hertog/HermitCollective.nix/src/branch/Main/services/owncast.nix).

View File

@ -0,0 +1,61 @@
# Basic config
baseURL = "https://blog.hermitcollective.net"
theme = "hugo-simple"
languageCode = "en" # zh-Hans
title = "HermitBlog"
copyright = "© 2024 HermitCollective"
# Generate a nice robots.txt for SEO
enableRobotsTXT = true
# https://github.com/gohugoio/hugo/issues/12152
capitalizeListTitles = false
# Generate "Bearblog"-like URLs !only!, see https://bearblog.dev/.
disableKinds = ["taxonomy"]
# ignoreErrors = ["error-disable-taxonomy"]
[taxonomies]
tag = "tags"
[permalinks]
blog = "/:slugorfilename/"
tags = "/blog/:slug"
[markup.goldmark.renderer]
unsafe = true
[markup.tableOfContents]
startLevel = 2
endLevel = 3
[markup.highlight]
lineNos = true
lineNumbersInTable = false
noClasses = true
style = "catppuccin-mocha"
[params]
title = "HermitBlog"
description = "The blogging subsite of the HermitCollective network."
favicon = "images/favicon.png"
dateFormat = "2006-01-02"
hideMadeWithLine = false
[params.author]
name = "Hertog"
email = "hertog@fsfe.org"
[[menu.main]]
name = "Home"
pageRef = "/"
weight = 10
[[menu.main]]
name = "Blog"
pageRef = "/blog"
weight = 20
[services.rss]
limit = 42
[outputs]
# Generate RSS for home only.
section = ["html"]
taxonomy = ["html"]
term = ["html"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

@ -0,0 +1 @@
Subproject commit c73dfd156ff43e0e42118ac35a2d2e091e52b127