Unverified Commit 91f33137 authored by Evgeny Kurnevsky's avatar Evgeny Kurnevsky
Browse files

prosody: allow to specify http_external_url for http_file_share module

parent 9b20b4d9
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -453,6 +453,11 @@ let
            or use a reverse proxy to handle the HTTP for that domain.
          '';
        };
        http_external_url = mkOption {
          type = types.nullOr types.str;
          default = null;
          description = "External URL in case Prosody sits behind a reverse proxy.";
        };
        size_limit = mkOption {
          type = types.int;
          default = 10 * 1024 * 1024;
@@ -596,7 +601,17 @@ let
        ${lib.optionalString (cfg.httpFileShare.http_host != null) ''
          http_host = "${cfg.httpFileShare.http_host}"
        ''}
        ${settingsToLua "  http_file_share_" (cfg.httpFileShare // { domain = null; })}
        ${lib.optionalString (cfg.httpFileShare.http_external_url != null) ''
          http_external_url = "${cfg.httpFileShare.http_external_url}"
        ''}
        ${settingsToLua "  http_file_share_" (
          cfg.httpFileShare
          // {
            domain = null;
            http_host = null;
            http_external_url = null;
          }
        )}
      ''}

      ${lib.concatStringsSep "\n" (