]> Untitled Git - awful.systems.git/blob - README.md
initial repo docs
[awful.systems.git] / README.md
1 # awful.systems infrastructure flake
2
3 This is the Nix flake that deploys the awful.systems server infrastructure. It
4 provides a set of files and commands that allow you to deploy the full set of
5 awful.systems software and configuration for each host to anything running NixOS
6 (though the provided commands default to the static IPs of the current
7 awful.systems machines).
8
9 ## Requirements
10
11 To use this flake, you'll want a [Nix evaluator](https://nixos.org/download) --
12 that is, you'll want the Nix package manager (either on NixOS or in an
13 environment where it's installed). This is a
14 [dependency-free](https://www.haskellforall.com/2023/01/announcing-nixos-rebuild-new-deployment.html)
15 stateless deployment mechanism, so this git repo and an authorized ssh key are
16 all you need to deploy the whole stack.
17
18 This flake builds everything locally for speed and then uploads it, so you'll
19 want a fair bit of available disk space (20GB is safe) and the ability to upload
20 a lot of data.
21
22 *If you're not on x86_64-linux or you're limited on disk or upload*: you should
23 use the deployment hosts to build. First, use `df -h` to make sure they've got
24 enough disk space, then use the deployment command with the argument
25 `--build-host root@<hostname>`, where `<hostname>` is the full domain name of
26 the host you want to deploy to.
27
28 ## Optional Dependencies
29
30 [nix-direnv](https://github.com/nix-community/nix-direnv) is convenient, since
31 it'll make all of the awful.systems commands available in your shell with no
32 other setup, and I use that to cache some larger dependencies as well.
33
34 ## Hosts
35 ### `more.awful.systems`
36 - Hosts the production Lemmy server at https://awful.systems (`lemmy-prod`).
37 - Proxies https://awful.systems/git and https://awful.systems/archives to
38   `these.awful.systems`.
39 - Assumes it's running being a load balancer that terminates SSL, so it doesn't
40   handle anything related to HTTPS itself.
41
42 ### `these.awful.systems`
43 - Hosts the development Lemmy server at https://making.awful.systems (`lemmy-dev`).
44 - Hosts the r/SneerClub archive (`sneer-archive`).
45 - Stores git repos in `/home/git/repos`.
46 - Hosts `gitweb`.
47 - Runs a git daemon for pull-only access to the git repos.
48
49 ## Commands
50
51 If you have `nix-direnv`, these commands will be available in your shell after
52 it finishes a build. Otherwise, run `nix develop` to kick off a build, and the
53 resulting shell will have all of these commands available.
54
55 - `deploy-these`: Kick off a deployment to the host `these`. Any arguments are
56   passed to `nixos-rebuild`.
57 - `deploy-more`: Same as above for `more`.
58 - `go-these`: Use your SSH key to log into `these` as `root`. Any arguments are
59   treated as commands for SSH to run; IE `go-these df -h` will run `df -h` on
60   `these`, display its output, and exit.
61 - `go-more`: Same as above for `more`.
62 - `rekey-secrets`: With a file argument, tells `sops` to re-encrypt the secrets
63   in that file with the currently configured encryption keys. Will definitely
64   need to be run by someone who previously has access to the secrets in order to
65   succeed.