mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-02-24 13:12:32 -05:00
add octoprint
This commit is contained in:
parent
0d5c570f3e
commit
0c526c0588
3 changed files with 36 additions and 0 deletions
26
modules/services/octoprint/default.nix
Normal file
26
modules/services/octoprint/default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ 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;
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue