Add host bekkalokk

`bekkalokk` is a new machine, meant to host web services and eventually
miscellaneous services.
This commit is contained in:
2023-01-29 01:51:35 +01:00
parent 387794fbe0
commit 796155481f
12 changed files with 279 additions and 19 deletions

View File

@@ -0,0 +1,26 @@
{ config, values, ... }:
{
sops.secrets."postgres/gitea/password" = { };
services.gitea = {
enable = true;
rootUrl = "https://git2.pvv.ntnu.no/";
stateDir = "/data/gitea";
appName = "PVV Git";
enableUnixSocket = true;
database = {
type = "postgres";
host = values.bicep.ipv4;
port = config.services.postgresql.port;
passwordFile = config.sops.secrets."postgres/gitea/password".path;
createDatabase = false;
};
settings = {
service.DISABLE_REGISTRATION = true;
session.COOKIE_SECURE = true;
};
};
}

View File

@@ -0,0 +1,23 @@
{ values, config, ... }:
{
sops.secrets = {
"mediawiki/password" = { };
"postgres/mediawiki/password" = { };
};
services.mediawiki = {
enable = true;
name = "PVV";
passwordFile = config.sops.secrets."mediawiki/password".path;
virtualHost = {
};
database = {
type = "postgres";
host = values.bicep.ipv4;
port = config.services.postgresql.port;
passwordFile = config.sops.secrets."postgres/mediawiki/password".path;
};
};
}

View File

@@ -0,0 +1,30 @@
{ config, ... }:
{
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedProxySettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
virtualHosts = {
"www.pvv.ntnu.no" = {
forceSSL = true;
locations = {
"/pvv" = {
proxyPass = "http://localhost:${config.services.mediawiki.virtualHost.listen.pvv.port}";
};
};
};
"git.pvv.ntnu.no" = {
locations."/" = {
proxyPass = "http://unix:${config.services.gitea.settings.server.HTTP_ADDR}";
proxyWebsockets = true;
};
};
};
};
}

View File

@@ -0,0 +1,4 @@
{ ... }:
{
}