I'm forced to map a port in librespeed

This commit is contained in:
William 2025-10-17 11:07:55 -03:00
parent c6b5cc16c1
commit d0793fb125

View file

@ -11,27 +11,12 @@ let
in
{
systemd.services.init-librespeed-network = {
description = "Create the network bridge for librespeed.";
after = [ "network.target" ];
wantedBy = [ "podman-librespeed.service" ];
serviceConfig.Type = "oneshot";
script = ''
check=$(${config.virtualisation.podman.package}/bin/podman network ls | grep "librespeed" || true)
if [ -z "$check" ]; then
${config.virtualisation.podman.package}/bin/podman network create librespeed
else
echo "librespeed network already exists"
fi
'';
};
virtualisation.oci-containers.containers."librespeed" = {
image = "lscr.io/linuxserver/librespeed:latest";
environment = {
TZ = "America/Bahia";
};
networks = [ "librespeed" ];
ports = [ "127.0.0.1:58080:80" ];
extraOptions = [
"--pull=newer"
"--label=io.containers.autoupdate=registry"
@ -40,6 +25,6 @@ in
services.nginx.virtualHosts = mkNginxVHosts {
acmeHost = "baduhai.dev";
domains."speedtest.baduhai.dev".locations."/".proxyPass = "http://librespeed:80/";
domains."speedtest.baduhai.dev".locations."/".proxyPass = "http://127.0.0.1:58080/";
};
}