nixos-servers/kubenix-modules/hedgedoc.nix

99 lines
2.4 KiB
Nix
Raw Normal View History

2024-05-09 19:03:27 +00:00
{ lib, ... }: {
kubernetes.resources = {
configMaps = {
hedgedoc-env.data = {
CMD_DOMAIN = "md.kun.is";
CMD_PORT = "3000";
CMD_URL_ADDPORT = "false";
CMD_ALLOW_ANONYMOUS = "true";
CMD_ALLOW_EMAIL_REGISTER = "false";
CMD_PROTOCOL_USESSL = "true";
CMD_CSP_ENABLE = "false";
};
2024-05-09 19:03:27 +00:00
hedgedoc-config.data.config = lib.generators.toJSON { } {
useSSL = false;
};
};
secrets.hedgedoc.stringData = {
2024-04-14 12:48:27 +00:00
databaseURL = "ref+sops://secrets/sops.yaml#/hedgedoc/databaseURL";
sessionSecret = "ref+sops://secrets/sops.yaml#/hedgedoc/sessionSecret";
};
deployments.hedgedoc = {
metadata.labels.app = "hedgedoc";
spec = {
selector.matchLabels.app = "hedgedoc";
template = {
metadata.labels.app = "hedgedoc";
spec = {
containers.hedgedoc = {
2024-04-29 15:23:53 +00:00
image = "quay.io/hedgedoc/hedgedoc:1.9.9";
envFrom = [{ configMapRef.name = "hedgedoc-env"; }];
2024-04-14 19:43:31 +00:00
ports.web.containerPort = 3000;
2024-04-14 19:00:15 +00:00
env = {
CMD_DB_URL.valueFrom.secretKeyRef = {
name = "hedgedoc";
key = "databaseURL";
};
2024-04-14 19:00:15 +00:00
CMD_SESSION_SECRET.valueFrom.secretKeyRef = {
name = "hedgedoc";
key = "sessionSecret";
};
};
volumeMounts = [
{
name = "uploads";
mountPath = "/hedgedoc/public/uploads";
}
{
name = "config";
mountPath = "/hedgedoc/config.json";
subPath = "config";
}
];
};
2024-04-14 19:00:15 +00:00
volumes = {
uploads.persistentVolumeClaim.claimName = "hedgedoc-uploads";
2024-04-14 19:00:15 +00:00
config.configMap.name = "hedgedoc-config";
};
securityContext = {
fsGroup = 65534;
fsGroupChangePolicy = "OnRootMismatch";
};
};
};
};
};
services.hedgedoc.spec = {
selector.app = "hedgedoc";
2024-04-14 19:43:31 +00:00
ports.web = {
port = 80;
2024-04-14 19:43:31 +00:00
targetPort = "web";
};
};
};
lab = {
ingresses.hedgedoc = {
host = "md.kun.is";
service = {
name = "hedgedoc";
portName = "web";
};
};
};
}