From 2e022b88399932b45e076c9bce598a132818cb62 Mon Sep 17 00:00:00 2001 From: toufic ar Date: Thu, 6 Aug 2026 14:28:06 +0300 Subject: adonis/autopush: prepare mollysocket support --- adonis/autopush/default.nix | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'adonis/autopush/default.nix') diff --git a/adonis/autopush/default.nix b/adonis/autopush/default.nix index 2cd112c..d24aadc 100644 --- a/adonis/autopush/default.nix +++ b/adonis/autopush/default.nix @@ -12,6 +12,7 @@ in { sops.secrets = { "autopush/autoconnect" = {}; "autopush/autoendpoint" = {}; + "autopush/mollysocket" = {}; }; environment.systemPackages = [autopush]; @@ -49,25 +50,37 @@ in { }; }; }; + + services.mollysocket = { + enable = true; + settings = { + allowed_endpoints = ["https://${domain}"]; + webserver = true; + }; + }; + services.nginx.virtualHosts.${domain} = { forceSSL = true; enableACME = true; - locations."/" = { - proxyPass = "http://127.0.0.1:8080"; - extraConfig = '' - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_connect_timeout 3m; - proxy_send_timeout 3m; - proxy_read_timeout 3m; - client_max_body_size 0; - proxy_buffering off; - proxy_request_buffering off; - proxy_redirect off; - ''; + locations = { + "/" = { + proxyPass = "http://127.0.0.1:8080"; + extraConfig = '' + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_connect_timeout 3m; + proxy_send_timeout 3m; + proxy_read_timeout 3m; + client_max_body_size 0; + proxy_buffering off; + proxy_request_buffering off; + proxy_redirect off; + ''; + }; + "/mollysocket".proxyPass = "http://127.0.0.1:8020"; }; }; services.nginx.virtualHosts."updates.${domain}" = { -- cgit v1.3.1