nixcfg/README.md

51 lines
1.8 KiB
Markdown
Raw Normal View History

2021-12-30 20:23:24 +00:00
# Deuxfleurs on NixOS!
This repository contains code to run Deuxfleur's infrastructure on NixOS.
It sets up the following:
- A Wireguard mesh between all nodes
- Consul, with TLS
- Nomad, with TLS
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
## How to welcome a new administrator
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
See: https://guide.deuxfleurs.fr/operations/acces/pass/
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
Basically:
- The new administrator generates a GPG key and publishes it on Gitea
- All existing administrators pull their key and sign it
- An existing administrator reencrypt the keystore with this new key and push it
- The new administrator clone the repo and check that they can decrypt the secrets
2022-10-16 09:58:11 +00:00
- Finally, the new administrator must choose a password to operate over SSH with `./passwd prod rick` where `rick` is the target username
2022-04-20 16:14:56 +00:00
2022-10-16 09:14:50 +00:00
## How to create files for a new zone
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
*The documentation is written for the production cluster, the same apply for other clusters.*
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
Basically:
- Create your `site` file in `cluster/prod/site/` folder
- Create your `node` files in `cluster/prod/node/` folder
2022-10-16 09:58:11 +00:00
- Add your wireguard configuration to `cluster/prod/cluster.nix` (you will have to edit your NAT config manually)
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
## How to deploy a Nix configuration on a fresh node
2022-04-20 14:13:14 +00:00
2022-10-16 09:58:11 +00:00
We suppose that the node name is `datura`.
Start by doing the deployment one node at a time, you will have plenty of time
in your operator's life to break everything through automation.
Run:
- `./deploy_wg prod datura` - to generate wireguard's keys
- `./deploy_nixos prod datura` - to deploy the nix configuration files (need to be redeployed on all nodes as hte new wireguard conf is needed everywhere)
- `./deploy_password prod datura` - to deploy user's passwords
- `./deploy_pki prod datura` - to deploy Nomad's and Consul's PKI
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
## How to operate a node
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
*To be written*
2022-04-20 14:13:14 +00:00
2022-10-16 09:14:50 +00:00
## More
2021-12-30 20:23:24 +00:00
2022-10-16 09:14:50 +00:00
Please read README.more.md for more detailed information