Skip to content
Snippets Groups Projects
Commit c6ada17a authored by Florian Sesser's avatar Florian Sesser
Browse files

Pull internal payment server port number 1061 out into a variable

... so it can be used in the nginx config instead of duplicating the number
parent 260c50f5
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,8 @@ in {
# list.
domain = builtins.head cfg.domains;
certServiceName = "acme-${domain}";
# Payment server internal http port (arbitrary, non-priviledged):
internalHttpPort = "1061";
in lib.mkIf cfg.enable {
# Add a systemd service to run PaymentServer.
......@@ -165,8 +167,7 @@ in {
if cfg.database == "Memory"
then "--database Memory"
else "--database SQLite3 --database-path ${cfg.databasePath}";
# Arbitrary non-priviledged port:
httpArgs = "--http-port 1061";
httpArgs = "--http-port ${internalHttpPort}";
prefixOption = s: "--cors-origin=" + s;
originStrings = map prefixOption cfg.allowedChargeOrigins;
......@@ -206,7 +207,7 @@ in {
enableACME = cfg.tls;
forceSSL = cfg.tls;
locations."/" = {
proxyPass = "http://127.0.0.1:1061";
proxyPass = "http://127.0.0.1:${internalHttpPort}";
};
locations."/metrics" = {
# Only allow our monitoringvpn subnet
......@@ -214,7 +215,7 @@ in {
allow 172.23.23.0/24;
deny all;
'';
proxyPass = "http://127.0.0.1:1061";
proxyPass = "http://127.0.0.1:${internalHttpPort}";
};
};
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment