No description
Find a file
2024-02-18 14:52:34 +00:00
.gitlab/issue_templates misc: added other important info 2023-08-11 08:04:24 +00:00
applications fix: cors is now being handled by the backend 2024-02-18 14:52:34 +00:00
config Update Minecraft server DNS entry 2024-02-16 13:12:32 +00:00
machines fix: the network issues 2024-01-27 23:04:48 +00:00
secrets feat: add a test server for trainees to use 2023-11-20 16:10:09 +00:00
sync doc: added instructions on how to force a new linking for teh sync 2023-12-27 23:04:26 +00:00
.gitattributes git: enforce use of LF since we have linux servers 2023-08-07 02:11:07 +01:00
.gitignore fix: ignore tmp files as well 2023-10-14 16:31:29 +01:00
.gitlab-ci.yml Added config folder to changes 2024-01-27 20:49:18 +00:00
flake.lock [skip ci] Updated flake for skynet_ldap_backend 2024-02-18 14:35:33 +00:00
flake.nix [skip ci] fix: bump nixpkgs 2024-02-04 20:17:46 +00:00
ITD_Firewall.csv doc: updated server lists 2023-12-20 13:17:51 +00:00
mailmap feat: Seeing if mailmap works 2023-10-22 21:10:06 +00:00
Possible_Server_Names.md feat: added possible server names and updated the ITD csv 2023-10-21 23:10:39 +00:00
README.md [skip ci] fix: bump nixpkgs 2024-02-04 20:17:46 +00:00

Skynet

This is teh core config for teh skynet cluster which uses NixOS.

Dev

Prep

  1. Install Nix
  2. Enable Flakes

The system ye use does nto matter much, I (@silver) use nix in wsl and it works grand.

Shell

Now ye got nix installed and flakes enabled run nix develop in the root folder (same place this readme is).
The dev dependencies you need to work with the project will be automatically installed.
The specific config for this can be found here.

Specifically it installs Colmena and Agenix.
Colmena is a build and deployment tool, Agenix is for secret management.

All following commands are inside the shell.

Colmena

Building

To build all nodes (servers) run:

colmena build

To build a specific one

colmena build --on skynet

To build a group (for example the dns servers)

colmena build --on @active-dns

Deploy

Deploying is putting (apply-ing) the config tat was built onto the server, there is no need to build first, it will automatically do so.

While the recommended way of deploying is using the CI/CD process there are times when you will have to manually deploy the config.
One such case is the @active-gitlab group if either Gitlab or Gitlab-runner got updated.
Another is if ye have fecked up DNS.

Your ~/.ssh/config should be set up as follows and you should be a member of skynet-admins-linux

Host *.skynet.ie 193.1.99.* 193.1.96.165
   User username
   IdentityFile ~/.ssh/skynet/username
   IdentitiesOnly yes

Then you can run the following commands like so:

colmena apply
colmena apply --on @active-dns
colmena apply --on @active-gitlab

The CI/CD pipeline has a manual job that can be triggered to update @active-gitlab if you know it wont cause issues.

Agenix

Agenix is for storing secrets in an encrypted manner using ssh keys.

All these commands require you to be in the secrets folder cd secrets

Prep

  1. Go to yer .ssh folder and see if you have a id_ed25519 key (tutorial)
  2. Make a pull request to add (id_ed25519.pub) to the secrets config.
  3. An existing admin will pull, run agenix --rekey and commit changes.
  4. Once committed and pushed up and merged in, you will be able to edit secrets.

id_ed25519 is preferred due to its neatness and security (Yes @silver is pedantic.)

Editing

When editing a terminal editor will open (nano).
You must use teh path defined in the secrets.nix file.

agenix -e stream_ulfm.age
agenix -e ldap/self_service.age
agenix -e gitlab/runners/runner01.age

Updating inputs

Occasionally you will want to update the inputs for the project.
It is best to do this every few months or so, there is always a risk of things changing so a small pain often is better than a nightmare if left longer.
As seen in this merge request the layout of one config changed which had to be fixed.

We should be updating nixpkgs at least once a semester, ideally to teh next NixOS release so we cna show ITD our servers are patched and up to date.

nix flake lock --update-input nixpkgs
# newser versions
nix flake update nixpkgs

Formatting

Formatting helps keep everything nice and consistent.
The pipeline will only run if the file is correctly formatted.

nix fmt