2024-05-09 19:03:27 +00:00
|
|
|
{ lib, ... }: {
|
2024-03-29 09:24:54 +00:00
|
|
|
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;
|
|
|
|
};
|
2024-03-29 09:24:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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";
|
2024-03-29 09:24:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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";
|
2024-03-29 09:24:54 +00:00
|
|
|
envFrom = [{ configMapRef.name = "hedgedoc-env"; }];
|
2024-04-14 19:43:31 +00:00
|
|
|
ports.web.containerPort = 3000;
|
2024-03-29 09:24:54 +00:00
|
|
|
|
2024-04-14 19:00:15 +00:00
|
|
|
env = {
|
|
|
|
CMD_DB_URL.valueFrom.secretKeyRef = {
|
|
|
|
name = "hedgedoc";
|
|
|
|
key = "databaseURL";
|
|
|
|
};
|
2024-03-29 09:24:54 +00:00
|
|
|
|
2024-04-14 19:00:15 +00:00
|
|
|
CMD_SESSION_SECRET.valueFrom.secretKeyRef = {
|
|
|
|
name = "hedgedoc";
|
|
|
|
key = "sessionSecret";
|
|
|
|
};
|
|
|
|
};
|
2024-03-29 09:24:54 +00:00
|
|
|
|
|
|
|
volumeMounts = [
|
|
|
|
{
|
|
|
|
name = "uploads";
|
|
|
|
mountPath = "/hedgedoc/public/uploads";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "config";
|
|
|
|
mountPath = "/hedgedoc/config.json";
|
|
|
|
subPath = "config";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-04-14 19:00:15 +00:00
|
|
|
volumes = {
|
2024-05-20 15:47:49 +00:00
|
|
|
uploads.persistentVolumeClaim.claimName = "hedgedoc-uploads";
|
2024-04-14 19:00:15 +00:00
|
|
|
config.configMap.name = "hedgedoc-config";
|
|
|
|
};
|
2024-05-20 16:10:26 +00:00
|
|
|
|
|
|
|
securityContext = {
|
|
|
|
fsGroup = 65534;
|
|
|
|
fsGroupChangePolicy = "OnRootMismatch";
|
|
|
|
};
|
2024-03-29 09:24:54 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.hedgedoc.spec = {
|
|
|
|
selector.app = "hedgedoc";
|
|
|
|
|
2024-04-14 19:43:31 +00:00
|
|
|
ports.web = {
|
2024-03-29 09:24:54 +00:00
|
|
|
port = 80;
|
2024-04-14 19:43:31 +00:00
|
|
|
targetPort = "web";
|
|
|
|
};
|
2024-03-29 09:24:54 +00:00
|
|
|
};
|
2024-04-14 21:11:19 +00:00
|
|
|
};
|
2024-03-29 09:24:54 +00:00
|
|
|
|
2024-04-14 21:34:54 +00:00
|
|
|
lab = {
|
|
|
|
ingresses.hedgedoc = {
|
|
|
|
host = "md.kun.is";
|
|
|
|
|
|
|
|
service = {
|
|
|
|
name = "hedgedoc";
|
|
|
|
portName = "web";
|
|
|
|
};
|
2024-03-29 09:24:54 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|