mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-02-25 05:32:33 -05:00
26 lines
498 B
Nix
26 lines
498 B
Nix
{ config, lib, ... }:
|
|
let
|
|
port = lib.custom.autoport "octoprint";
|
|
in
|
|
{
|
|
services.caddy.virtualHosts."octoprint.wanderingcrow.net".extraConfig = ''
|
|
@auth {
|
|
path /caddy-security/*
|
|
}
|
|
|
|
route @auth {
|
|
authenticate with myportal
|
|
}
|
|
route /* {
|
|
authorize with octoprint
|
|
reverse_proxy http://localhost:${builtins.toString config.services.octoprint.port}
|
|
}
|
|
'';
|
|
|
|
services.octoprint = {
|
|
inherit port;
|
|
enable = true;
|
|
openFirewall = true;
|
|
};
|
|
|
|
}
|