ports test

This commit is contained in:
4DBug
2026-03-03 17:05:04 -06:00
parent 4974969c6f
commit c10eca565f
17 changed files with 85 additions and 55 deletions

View File

@@ -1,10 +1,12 @@
{ inputs, ... }: {
den.aspects.copyparty = {
nixos = {
nixos = { config, ... }: {
imports = [ inputs.copyparty.nixosModules.default ];
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
den.tunnels = [ "files" ];
services.copyparty = {
enable = true;
@@ -13,7 +15,7 @@
settings = {
i = "0.0.0.0";
p = [ 3210 3211 ];
p = [ config.den.portmap.files (config.den.portmap.files + 1) ];
no-reload = true;
ignored-flag = false;
};
@@ -22,10 +24,6 @@
bug = {
passwordFile = "/home/bug/mailserver/bug.passwd";
};
#sang = {
#passwordFile = "/home/bug/nix/sang.passwd";
#};
};
groups = {

View File

@@ -2,7 +2,9 @@
den.aspects.gitea = {
includes = [ den.aspects.gitea-mirrors ];
nixos = {
nixos = { config, ... }: {
den.tunnels = [ "git" ];
services.gitea = {
enable = true;
@@ -12,7 +14,7 @@
DISABLE_REGISTRATION = true;
};
settings.server.HTTP_PORT = 3002;
settings.server.HTTP_PORT = config.den.portmap.git;
mirrors = {
admin = {

View File

@@ -1,6 +1,8 @@
{
den.aspects.glances = {
nixos = { pkgs, ... }: {
nixos = { pkgs, config, ... }: {
den.tunnels = [ "monitor" ];
environment.systemPackages = [ pkgs.glances ];
users.users.glances = {
@@ -24,7 +26,7 @@
ExecStart = ''
${pkgs.glances}/bin/glances \
-w \
-p 61208 \
-p ${toString config.den.portmap.monitor} \
-B 0.0.0.0
'';

View File

@@ -1,10 +1,13 @@
{ den, lib, ... }: {
den.aspects.invidious = {
nixos = { pkgs, ... }: let
nixos = { pkgs, config, ... }: let
companionPort = 8282;
companionPath = "/companion";
companionKey = "kKg3RKeZjE7frmvw";
port = config.den.portmap.tube;
in {
den.tunnels = [ "tube" ];
virtualisation.podman.enable = true;
virtualisation.oci-containers.backend = lib.mkDefault "podman";
@@ -29,7 +32,7 @@
package = pkgs.invidious;
address = "127.0.0.1";
port = 3030;
port = port;
nginx.enable = false;
sig-helper.enable = false;
@@ -37,7 +40,7 @@
settings = {
domain = "tube.bug.tools";
https_only = false;
external_port = 3030;
external_port = port;
invidious_companion = [
{ private_url = "http://127.0.0.1:${toString companionPort}${companionPath}"; }

View File

@@ -6,6 +6,7 @@
lib,
...
}: let
port = config.den.portmap.matrix;
domain = "bug.tools";
matrixDomain = "matrix.${domain}";
clientConfig = {
@@ -29,7 +30,7 @@
listeners = [
{
port = 8008;
port = port;
bind_addresses = ["127.0.0.1"];
type = "http";
tls = false;
@@ -89,7 +90,7 @@
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8008";
proxyPass = "http://127.0.0.1:${toString port}";
extraConfig = ''
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;

View File

@@ -1 +0,0 @@
{}

View File

@@ -0,0 +1,7 @@
{ lib, ... }: {
den.aspects.portmap.nixos.options.den.portmap = lib.mkOption {
type = lib.types.attrsOf lib.types.port;
readOnly = true;
default = import ../../../portmap.nix;
};
}

View File

@@ -1,11 +1,13 @@
{
den.aspects.redlib = {
nixos = {
nixos = { config, ... }: {
den.tunnels = [ "reddit" ];
services.redlib = {
enable = true;
address = "127.0.0.1";
port = 8975;
port = config.den.portmap.reddit;
openFirewall = false;
settings = {

View File

@@ -1,6 +1,8 @@
{
den.aspects.searxng = {
nixos = {
nixos = { config, ... }: {
den.tunnels = [ "search" ];
systemd.services.searx-init.serviceConfig.EnvironmentFile = [
"/home/bug/.searxng.env"
];
@@ -15,7 +17,7 @@
settings = {
general.instance_name = "search.bug.tools";
server.port = 8888;
server.port = config.den.portmap.search;
server.bind_address = "0.0.0.0";
server.secret_key = "$SEARX_SECRET_KEY";
};