NixOS configs for new Redbrick deployment
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Cian Butler 5a4ff8d355 Update '' 1 year ago
common Change TLD to 1 year ago
hosts Fix rainloop 1 year ago
packages/httpd-error-pages fix building error page 1 year ago
services trailing / are important and quote everything 1 year ago
.gitignore Add working phpfpm config for first few users 1 year ago
LICENSE Add license 1 year ago Update '' 1 year ago

NixOS Configurations

Repo Migration

This repo has been moved to so as to avoid circular dependecies

Used to deploy redbrick 2.0


cd /etc/nixos
tar -cjf ~/nixos_backup.tar.bz2 *
rm *
git clone $THIS_REPO .
ln -s hosts/$(hostname)/configuration.nix .
nixos-rebuild switch

Deploying Apache/httpd

users.nix needs to be generated before deploying Apache. Use this command:

cd services/httpd
ldapsearch -b o=redbrick -h ldap.internal -xLLL objectClass=posixAccount uid homeDirectory gidNumber | python3 /storage/webtree/ > users.nix

Then generate the preliminary certs for every domain so that httpd can start:

# List all acme-selfsigned-* services and put them in a txt file. Do this with `systemctl status acme-selfsigned-<tab>`
cat selfsigned-svcs.txt | xargs systemctl start

Now apache will start. Generate the real certs for each domain, one at a time as to not get rate limited

cd /var/lib/acme
for cert in *; do journalctl -fu acme-$cert.service & systemctl start acme-$cert.service && kill $!; done
systemctl reload httpd