mirror of
https://github.com/genebean/dots.git
synced 2026-05-31 07:45:20 -04:00
Add dots.ports module: fleet-wide service port registry (nixnuc + hetznix01)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
84a5c695b0
commit
94fdc678e4
15 changed files with 353 additions and 135 deletions
|
|
@ -16,10 +16,10 @@ in
|
|||
];
|
||||
hostname = "emqx1.hetznix01.technicalissues.us";
|
||||
ports = [
|
||||
"1883:1883"
|
||||
"${toString config.dots.ports.mqtt.port}:1883"
|
||||
#"8083:8083"
|
||||
#"8084:8084"
|
||||
"18083:18083"
|
||||
"${toString config.dots.ports.emqx-admin.port}:18083"
|
||||
];
|
||||
volumes = [
|
||||
"${volume_base}/data:/opt/emqx/data"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ in
|
|||
services = {
|
||||
collabora-online = {
|
||||
enable = true;
|
||||
port = 9980; # default
|
||||
inherit (config.dots.ports.collabora) port;
|
||||
settings = {
|
||||
# Rely on reverse proxy for SSL
|
||||
ssl = {
|
||||
|
|
@ -51,7 +51,7 @@ in
|
|||
enable = true;
|
||||
configureNginx = true;
|
||||
environment = {
|
||||
PHOTON_API_HOST = "nixnuc.${config.private-flake.tailnetDomain}:2322";
|
||||
PHOTON_API_HOST = "nixnuc.${config.private-flake.tailnetDomain}:${toString config.dots.ports.photon.port}";
|
||||
PHOTON_API_USE_HTTPS = "false";
|
||||
};
|
||||
extraEnvFiles = [
|
||||
|
|
@ -122,7 +122,7 @@ in
|
|||
server = {
|
||||
baseUrl = "https://stats.${domain}";
|
||||
disableRegistration = true;
|
||||
port = 8001;
|
||||
inherit (config.dots.ports.plausible) port;
|
||||
# secretKeybaseFile is a path to the file which contains the secret generated
|
||||
# with openssl as described above.
|
||||
secretKeybaseFile = config.sops.secrets.plausible_secret_key_base.path;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
signing_key_path = config.sops.secrets.matrix_homeserver_signing_key.path;
|
||||
listeners = [
|
||||
{
|
||||
port = 8008;
|
||||
inherit (config.dots.ports.matrix-synapse) port;
|
||||
tls = false;
|
||||
type = "http";
|
||||
x_forwarded = true;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ in
|
|||
{
|
||||
job_name = "node";
|
||||
static_configs = [
|
||||
{ targets = [ "127.0.0.1:9100" ]; }
|
||||
{ targets = [ "127.0.0.1:${toString config.dots.ports.node-exporter.port}" ]; }
|
||||
];
|
||||
metric_relabel_configs = [
|
||||
{
|
||||
|
|
@ -37,7 +37,7 @@ in
|
|||
{
|
||||
job_name = "nginx";
|
||||
static_configs = [
|
||||
{ targets = [ "127.0.0.1:9113" ]; }
|
||||
{ targets = [ "127.0.0.1:${toString config.dots.ports.nginx-exporter.port}" ]; }
|
||||
];
|
||||
metric_relabel_configs = [
|
||||
{
|
||||
|
|
@ -84,7 +84,7 @@ in
|
|||
prometheus.exporters.node = {
|
||||
enable = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
port = 9100;
|
||||
inherit (config.dots.ports.node-exporter) port;
|
||||
enabledCollectors = [
|
||||
"systemd"
|
||||
];
|
||||
|
|
@ -98,7 +98,7 @@ in
|
|||
prometheus.exporters.nginx = {
|
||||
enable = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
port = 9113;
|
||||
inherit (config.dots.ports.nginx-exporter) port;
|
||||
scrapeUri = "https://127.0.0.1/server_status";
|
||||
sslVerify = false;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
domain = "technicalissues.us";
|
||||
http_port = 80;
|
||||
https_port = 443;
|
||||
private_btc = "umbrel.${config.private-flake.tailnetDomain}";
|
||||
in
|
||||
{
|
||||
|
|
@ -25,13 +23,13 @@ in
|
|||
streamConfig = ''
|
||||
server {
|
||||
# https://docs.emqx.com/en/emqx/latest/deploy/cluster/lb-nginx.html
|
||||
listen 8883 ssl;
|
||||
listen ${toString config.dots.ports.mqtt-tls.port} ssl;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_certificate ${config.security.acme.certs."mqtt.${domain}".directory}/fullchain.pem;
|
||||
ssl_certificate_key ${config.security.acme.certs."mqtt.${domain}".directory}/key.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
|
||||
proxy_pass 127.0.0.0:1883;
|
||||
proxy_pass 127.0.0.0:${toString config.dots.ports.mqtt.port};
|
||||
proxy_protocol on;
|
||||
proxy_connect_timeout 10s;
|
||||
# Default keep-alive time is 10 minutes
|
||||
|
|
@ -41,17 +39,17 @@ in
|
|||
}
|
||||
|
||||
server {
|
||||
listen 0.0.0.0:8333;
|
||||
listen 0.0.0.0:9333;
|
||||
listen [::]:8333;
|
||||
listen [::]:9333;
|
||||
proxy_pass ${private_btc}:8333;
|
||||
listen 0.0.0.0:${toString config.dots.ports.bitcoin-core.port};
|
||||
listen 0.0.0.0:${toString config.dots.ports.bitcoin-knots.port};
|
||||
listen [::]:${toString config.dots.ports.bitcoin-core.port};
|
||||
listen [::]:${toString config.dots.ports.bitcoin-knots.port};
|
||||
proxy_pass ${private_btc}:${toString config.dots.ports.bitcoin-core.port};
|
||||
}
|
||||
|
||||
server {
|
||||
listen 0.0.0.0:9735;
|
||||
listen [::]:9735;
|
||||
proxy_pass ${private_btc}:9735;
|
||||
listen 0.0.0.0:${toString config.dots.ports.lnd.port};
|
||||
listen [::]:${toString config.dots.ports.lnd.port};
|
||||
proxy_pass ${private_btc}:${toString config.dots.ports.lnd.port};
|
||||
}
|
||||
'';
|
||||
virtualHosts = {
|
||||
|
|
@ -137,32 +135,32 @@ in
|
|||
"matrix.${domain}" = {
|
||||
listen = [
|
||||
{
|
||||
port = http_port;
|
||||
inherit (config.dots.ports.http) port;
|
||||
addr = "0.0.0.0";
|
||||
}
|
||||
{
|
||||
port = http_port;
|
||||
inherit (config.dots.ports.http) port;
|
||||
addr = "[::]";
|
||||
}
|
||||
|
||||
{
|
||||
port = https_port;
|
||||
inherit (config.dots.ports.https) port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
{
|
||||
port = https_port;
|
||||
inherit (config.dots.ports.https) port;
|
||||
addr = "[::]";
|
||||
ssl = true;
|
||||
}
|
||||
|
||||
{
|
||||
port = 8448;
|
||||
inherit (config.dots.ports.matrix-federation) port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
{
|
||||
port = 8448;
|
||||
inherit (config.dots.ports.matrix-federation) port;
|
||||
addr = "[::]";
|
||||
ssl = true;
|
||||
}
|
||||
|
|
@ -182,9 +180,9 @@ in
|
|||
};
|
||||
# Forward all Matrix API calls to the synapse Matrix homeserver. A trailing slash
|
||||
# *must not* be used here.
|
||||
"/_matrix".proxyPass = "http://[::1]:8008";
|
||||
"/_matrix".proxyPass = "http://[::1]:${toString config.dots.ports.matrix-synapse.port}";
|
||||
# Forward requests for e.g. SSO and password-resets.
|
||||
"/_synapse/client".proxyPass = "http://[::1]:8008";
|
||||
"/_synapse/client".proxyPass = "http://[::1]:${toString config.dots.ports.matrix-synapse.port}";
|
||||
};
|
||||
};
|
||||
"mqtt.${domain}" = {
|
||||
|
|
@ -199,7 +197,7 @@ in
|
|||
forceSSL = true;
|
||||
basicAuthFile = config.sops.secrets.owntracks_basic_auth.path;
|
||||
# OwnTracks Frontend container
|
||||
locations."/".proxyPass = "http://127.0.0.1:8082";
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString config.dots.ports.owntracks-frontend.port}";
|
||||
};
|
||||
"pack1828.org" = {
|
||||
enableACME = true;
|
||||
|
|
@ -217,26 +215,26 @@ in
|
|||
locations = {
|
||||
# OwnTracks Recorder
|
||||
"/" = {
|
||||
proxyPass = "http://127.0.0.1:8083";
|
||||
proxyPass = "http://127.0.0.1:${toString config.dots.ports.owntracks-recorder.port}";
|
||||
};
|
||||
"/pub" = {
|
||||
# Client apps need to point to this path
|
||||
extraConfig = "proxy_set_header X-Limit-U $remote_user;";
|
||||
proxyPass = "http://127.0.0.1:8083/pub";
|
||||
proxyPass = "http://127.0.0.1:${toString config.dots.ports.owntracks-recorder.port}/pub";
|
||||
};
|
||||
"/static/" = {
|
||||
proxyPass = "http://127.0.0.1:8083/static/";
|
||||
proxyPass = "http://127.0.0.1:${toString config.dots.ports.owntracks-recorder.port}/static/";
|
||||
};
|
||||
"/utils/" = {
|
||||
proxyPass = "http://127.0.0.1:8083/utils/";
|
||||
proxyPass = "http://127.0.0.1:${toString config.dots.ports.owntracks-recorder.port}/utils/";
|
||||
};
|
||||
"/view/" = {
|
||||
extraConfig = "proxy_buffering off;";
|
||||
proxyPass = "http://127.0.0.1:8083/view/";
|
||||
proxyPass = "http://127.0.0.1:${toString config.dots.ports.owntracks-recorder.port}/view/";
|
||||
};
|
||||
"/ws" = {
|
||||
extraConfig = "rewrite ^/(.*) /$1 break;";
|
||||
proxyPass = "http://127.0.0.1:8083";
|
||||
proxyPass = "http://127.0.0.1:${toString config.dots.ports.owntracks-recorder.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -244,7 +242,7 @@ in
|
|||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
locations."/".proxyPass = "http://127.0.0.1:8001";
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString config.dots.ports.plausible.port}";
|
||||
locations."/".proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
access_log /var/log/nginx/stats.${domain}.log;
|
||||
|
|
@ -259,7 +257,7 @@ in
|
|||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
locations."/".proxyWebsockets = true;
|
||||
locations."/".proxyPass = "http://127.0.0.1:3001";
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString config.dots.ports.uptime-kuma.port}";
|
||||
};
|
||||
}; # end virtualHosts
|
||||
}; # end nginx
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue