VEGAS/api: init
This commit is contained in:
parent
c31f061a65
commit
87ac835148
2 changed files with 39 additions and 0 deletions
38
hosts/VEGAS/services/api/default.nix
Normal file
38
hosts/VEGAS/services/api/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, tools, ... }:
|
||||
let
|
||||
inherit (tools.meta) domain;
|
||||
apiAddr = "api.${domain}";
|
||||
proxyTarget = "http://127.0.0.1:${config.portsStr.api}";
|
||||
proxy = tools.nginx.vhosts.proxy proxyTarget;
|
||||
in
|
||||
{
|
||||
reservePortsFor = [ "api" ];
|
||||
|
||||
services.n8n = {
|
||||
enable = true;
|
||||
settings = {
|
||||
port = config.ports.api;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.n8n.environment = {
|
||||
N8N_LISTEN_ADDRESS = "127.0.0.1";
|
||||
N8N_ENDPOINT_WEBHOOK = "api";
|
||||
N8N_ENDPOINT_WEBHOOK_TEST = "test";
|
||||
WEBHOOK_URL = "https://${apiAddr}";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."${apiAddr}" = lib.recursiveUpdate proxy {
|
||||
locations."/api" = {
|
||||
proxyPass = proxyTarget;
|
||||
extraConfig = "auth_request off;";
|
||||
};
|
||||
locations."/test" = {
|
||||
proxyPass = proxyTarget;
|
||||
extraConfig = "auth_request off;";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
services.oauth2_proxy.nginx.virtualHosts = [ apiAddr ];
|
||||
}
|
|
@ -15,6 +15,7 @@
|
|||
inputs.agenix.nixosModules.age
|
||||
|
||||
# Services
|
||||
./services/api
|
||||
./services/backbone-routing
|
||||
./services/bitwarden
|
||||
./services/cdn-shield
|
||||
|
|
Loading…
Add table
Reference in a new issue