Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa4afea341 | ||
|
|
b12731a100 | ||
|
|
ce2c9c76a7 | ||
|
|
dc083ddf1a | ||
|
|
75e71f9ce9 | ||
|
|
19540ea1da | ||
|
|
431f78f8af | ||
|
|
95eea6fc26 | ||
|
|
387a34ffff |
@@ -115,10 +115,15 @@ in
|
|||||||
"@\tIN\tSOA\t${config.networking.hostName}\tgreg@thehellings.com (1 1m 1m 1m 1m)"
|
"@\tIN\tSOA\t${config.networking.hostName}\tgreg@thehellings.com (1 1m 1m 1m 1m)"
|
||||||
"\tIN\tNS\t${config.networking.hostName}"
|
"\tIN\tNS\t${config.networking.hostName}"
|
||||||
];
|
];
|
||||||
makeHost = host: "${host.name}\tIN\tA\t${host.address}";
|
makeHost =
|
||||||
|
host:
|
||||||
|
[ "${host.name}\tIN\tA\t${host.address}" ]
|
||||||
|
++ lib.map (a: "${a}\tIN\tA\t${host.address}") (
|
||||||
|
if builtins.hasAttr "aliases" host then host.aliases else [ ]
|
||||||
|
);
|
||||||
in
|
in
|
||||||
pkgs.writeText "${domain}" (
|
pkgs.writeText "${domain}" (
|
||||||
builtins.concatStringsSep "\n" (preamble ++ (lib.map makeHost hosts) ++ [ "" ])
|
builtins.concatStringsSep "\n" (preamble ++ (lib.flatten (lib.map makeHost hosts)) ++ [ "" ])
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
lib.mapAttrs
|
lib.mapAttrs
|
||||||
|
|||||||
@@ -2,12 +2,24 @@
|
|||||||
# them by the following commands:
|
# them by the following commands:
|
||||||
# nix run nixpkgs.matrix-synapse
|
# nix run nixpkgs.matrix-synapse
|
||||||
# register_new_matrix_user -k "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa" http://localhost:8448
|
# register_new_matrix_user -k "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa" http://localhost:8448
|
||||||
{ config, lib, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
domain = "${config.networking.domain}";
|
domain = "${config.networking.domain}";
|
||||||
fqdn = "matrix.${domain}";
|
fqdn = "matrix.${domain}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
greg.proxies."${fqdn}" = {
|
||||||
|
extraConfig = ''
|
||||||
|
error_log /var/log/nginx/debug.log debug;
|
||||||
|
proxy_ssl_verify off;
|
||||||
|
proxy_ssl_server_name on;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Forwarded-Ssl on;
|
||||||
|
'';
|
||||||
|
genAliases = false;
|
||||||
|
ssl = true;
|
||||||
|
target = "https://matrix.shire-zebra.ts.net";
|
||||||
|
};
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
# Server the '.well-known' files to find the Matrix API server
|
# Server the '.well-known' files to find the Matrix API server
|
||||||
@@ -44,36 +56,6 @@ in
|
|||||||
return 200 '${builtins.toJSON client}';
|
return 200 '${builtins.toJSON client}';
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Reverse proxy in front of the actual Matrix server
|
|
||||||
"${fqdn}" = {
|
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
error_log /var/log/nginx/debug.log debug;
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Not the appropriate place for the chat client
|
|
||||||
locations =
|
|
||||||
(builtins.listToAttrs (
|
|
||||||
builtins.map
|
|
||||||
(
|
|
||||||
val:
|
|
||||||
lib.nameValuePair "/_${val}" {
|
|
||||||
proxyPass = "https://matrix.shire-zebra.ts.net";
|
|
||||||
}
|
|
||||||
)
|
|
||||||
[
|
|
||||||
"matrix"
|
|
||||||
"synapse"
|
|
||||||
"dendrite"
|
|
||||||
]
|
|
||||||
))
|
|
||||||
// {
|
|
||||||
"/".extraConfig = "return 404;";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,5 @@ in
|
|||||||
ssl = true;
|
ssl = true;
|
||||||
genAliases = false;
|
genAliases = false;
|
||||||
};
|
};
|
||||||
"doubles.thehellings.com" = {
|
|
||||||
target = "http://localhost:8081";
|
|
||||||
ssl = true;
|
|
||||||
genAliases = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
(name: value: {
|
(name: value: {
|
||||||
inherit name;
|
inherit name;
|
||||||
address = builtins.getAttr netAttr value;
|
address = builtins.getAttr netAttr value;
|
||||||
|
aliases = lib.optionals (builtins.hasAttr "aliases" value) (builtins.getAttr "aliases" value);
|
||||||
})
|
})
|
||||||
(
|
(
|
||||||
lib.filterAttrs (
|
lib.filterAttrs (
|
||||||
|
|||||||
@@ -47,6 +47,12 @@ spec:
|
|||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
port: 32222
|
port: 32222
|
||||||
nodePort: 32222
|
nodePort: 32222
|
||||||
|
# Anubis sidecar port — ingress routes here; Anubis proxies to :3000
|
||||||
|
additionalPorts:
|
||||||
|
- name: anubis
|
||||||
|
port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
|
||||||
gitea:
|
gitea:
|
||||||
admin:
|
admin:
|
||||||
@@ -119,6 +125,46 @@ spec:
|
|||||||
cpu: "100m"
|
cpu: "100m"
|
||||||
memory: "2Gi"
|
memory: "2Gi"
|
||||||
|
|
||||||
|
# Anubis anti-crawler sidecar
|
||||||
|
# Anubis listens on :8080 and proxies to Gitea at http://localhost:3000
|
||||||
|
# Ingress is updated to route to the anubis port instead of http
|
||||||
|
extraContainers:
|
||||||
|
- name: anubis
|
||||||
|
image: ghcr.io/techarohq/anubis:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
env:
|
||||||
|
- name: BIND
|
||||||
|
value: ":8080"
|
||||||
|
- name: DIFFICULTY
|
||||||
|
value: "4"
|
||||||
|
- name: METRICS_BIND
|
||||||
|
value: ":9090"
|
||||||
|
- name: SERVE_ROBOTS_TXT
|
||||||
|
value: "true"
|
||||||
|
- name: TARGET
|
||||||
|
value: "http://localhost:3000"
|
||||||
|
- name: OG_PASSTHROUGH
|
||||||
|
value: "true"
|
||||||
|
- name: OG_EXPIRY_TIME
|
||||||
|
value: "24h"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: "750m"
|
||||||
|
memory: "256Mi"
|
||||||
|
requests:
|
||||||
|
cpu: "250m"
|
||||||
|
memory: "256Mi"
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
runAsNonRoot: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
type: RollingUpdate
|
type: RollingUpdate
|
||||||
rollingUpdate:
|
rollingUpdate:
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ spec:
|
|||||||
service:
|
service:
|
||||||
name: gitea-release-http
|
name: gitea-release-http
|
||||||
port:
|
port:
|
||||||
name: http
|
# Route through Anubis anti-crawler sidecar instead of directly to Gitea
|
||||||
|
name: anubis
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- gitea
|
- gitea
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ spec:
|
|||||||
storage: |-
|
storage: |-
|
||||||
MINIO_ACCESS_KEY_ID={{ .minio_nas1_key }}
|
MINIO_ACCESS_KEY_ID={{ .minio_nas1_key }}
|
||||||
MINIO_SECRET_ACCESS_KEY={{ .minio_nas1_secret }}
|
MINIO_SECRET_ACCESS_KEY={{ .minio_nas1_secret }}
|
||||||
#minio_key: "{{ .minio_nas1_key }}"
|
minio_key: "{{ .minio_nas1_key }}"
|
||||||
#minio_secret: "{{ .minio_nas1_secret }}"
|
minio_secret: "{{ .minio_nas1_secret }}"
|
||||||
secretStoreRef:
|
secretStoreRef:
|
||||||
name: bitwarden-login
|
name: bitwarden-login
|
||||||
kind: ClusterSecretStore
|
kind: ClusterSecretStore
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ spec:
|
|||||||
kind: HelmRepository
|
kind: HelmRepository
|
||||||
name: mariadb-operator
|
name: mariadb-operator
|
||||||
interval: "1h"
|
interval: "1h"
|
||||||
|
version: "26.3.0"
|
||||||
---
|
---
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
@@ -33,6 +34,7 @@ spec:
|
|||||||
kind: HelmRepository
|
kind: HelmRepository
|
||||||
name: mariadb-operator
|
name: mariadb-operator
|
||||||
interval: "1h"
|
interval: "1h"
|
||||||
|
version: "26.3.0"
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: mariadb-operator-crds
|
- name: mariadb-operator-crds
|
||||||
- name: longhorn
|
- name: longhorn
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ spec:
|
|||||||
kind: HelmRepository
|
kind: HelmRepository
|
||||||
name: mariadb-operator
|
name: mariadb-operator
|
||||||
interval: "1h"
|
interval: "1h"
|
||||||
|
version: "26.3.0"
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: mariadb-operator-crds
|
- name: mariadb-operator-crds
|
||||||
- name: mariadb-operator
|
- name: mariadb-operator
|
||||||
|
|||||||
+2
-1
@@ -13,7 +13,8 @@
|
|||||||
"ip": "10.42.1.4",
|
"ip": "10.42.1.4",
|
||||||
"pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEBecZUva9OnZuXLaBun6/1ITo5f9p0YMLPD+q0egLRS",
|
"pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEBecZUva9OnZuXLaBun6/1ITo5f9p0YMLPD+q0egLRS",
|
||||||
"external": true,
|
"external": true,
|
||||||
"ts": "100.119.228.115"
|
"ts": "100.119.228.115",
|
||||||
|
"aliases": [ "s3" ]
|
||||||
},
|
},
|
||||||
"exodus": {
|
"exodus": {
|
||||||
"ip": null,
|
"ip": null,
|
||||||
|
|||||||
Reference in New Issue
Block a user