Clean up caddy module
This commit is contained in:
parent
ae2bf387f5
commit
67483e3373
6 changed files with 31 additions and 272 deletions
|
|
@ -20,22 +20,6 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
enableAI = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable alternative search engine with AI. Requires [Perplexica](https://github.com/ItzCrazyKns/Perplexica)
|
||||
'';
|
||||
};
|
||||
|
||||
perplexicaUrl = lib.mkOption {
|
||||
default = "";
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
URL to the Perplexica instance. It assumes that the Perplexica instance is running on port 3000 and the API on port 3001
|
||||
'';
|
||||
};
|
||||
|
||||
proxy = {
|
||||
enable = lib.mkEnableOption "Set the proxy entry for this service";
|
||||
|
||||
|
|
@ -114,21 +98,6 @@ in
|
|||
import cloudflare_${domain}
|
||||
'';
|
||||
|
||||
virtualHosts."${perplexicaSubdomain}.${domain}".extraConfig = lib.mkIf cfg.enableAI ''
|
||||
@websockets {
|
||||
header Connection *Upgrade*
|
||||
header Upgrade websocket
|
||||
}
|
||||
reverse_proxy ${cfg.perplexicaUrl}:3000
|
||||
reverse_proxy /api* ${cfg.perplexicaUrl}:3001
|
||||
reverse_proxy @websockets {
|
||||
header_up Host ${cfg.perplexicaUrl}
|
||||
to ${cfg.perplexicaUrl}:3001
|
||||
}
|
||||
|
||||
import cloudflare_${domain}
|
||||
'';
|
||||
|
||||
};
|
||||
})
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue