Unverified Commit 18a91c2f authored by Thomas Gerbet's avatar Thomas Gerbet Committed by GitHub
Browse files

morty: drop (#446354)

parents 48cbc248 3c6d1656
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1237,7 +1237,6 @@
  ./services/networking/mmsd.nix
  ./services/networking/modemmanager.nix
  ./services/networking/monero.nix
  ./services/networking/morty.nix
  ./services/networking/mosquitto.nix
  ./services/networking/mozillavpn.nix
  ./services/networking/mptcpd.nix
+3 −0
Original line number Diff line number Diff line
@@ -211,6 +211,9 @@ in
      "services"
      "moinmoin"
    ] "The corresponding package was removed from nixpkgs.")
    (mkRemovedOptionModule [ "services" "morty" ]
      "services.morty has been removed from NixOS. As the morty package was unmaintained and removed and searxng, its main consumer, dropped support for it."
    )
    (mkRemovedOptionModule [ "services" "mwlib" ] "The corresponding package was removed from nixpkgs.")
    (mkRemovedOptionModule [ "services" "pantheon" "files" ] ''
      This module was removed, please add pkgs.pantheon.elementary-files to environment.systemPackages directly.
+0 −97
Original line number Diff line number Diff line
{
  config,
  lib,
  pkgs,
  ...
}:

with lib;

let

  cfg = config.services.morty;

in

{

  ###### interface

  options = {

    services.morty = {

      enable = mkEnableOption "Morty proxy server. See <https://github.com/asciimoo/morty>";

      ipv6 = mkOption {
        type = types.bool;
        default = true;
        description = "Allow IPv6 HTTP requests?";
      };

      key = mkOption {
        type = types.str;
        default = "";
        description = ''
          HMAC url validation key (hexadecimal encoded).
          Leave blank to disable. Without validation key, anyone can
          submit proxy requests. Leave blank to disable.
          Generate with `printf %s somevalue | openssl dgst -sha1 -hmac somekey`
        '';
      };

      timeout = mkOption {
        type = types.int;
        default = 2;
        description = "Request timeout in seconds.";
      };

      package = mkPackageOption pkgs "morty" { };

      port = mkOption {
        type = types.port;
        default = 3000;
        description = "Listing port";
      };

      listenAddress = mkOption {
        type = types.str;
        default = "127.0.0.1";
        description = "The address on which the service listens";
      };

    };

  };

  ###### Service definition

  config = mkIf config.services.morty.enable {

    users.users.morty = {
      description = "Morty user";
      createHome = true;
      home = "/var/lib/morty";
      isSystemUser = true;
      group = "morty";
    };
    users.groups.morty = { };

    systemd.services.morty = {
      description = "Morty sanitizing proxy server.";
      after = [ "network.target" ];
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {
        User = "morty";
        ExecStart = ''
          ${cfg.package}/bin/morty              \
                      -listen ${cfg.listenAddress}:${toString cfg.port} \
                      ${optionalString cfg.ipv6 "-ipv6"}                \
                      ${optionalString (cfg.key != "") "-key " + cfg.key} \
        '';
      };
    };
    environment.systemPackages = [ cfg.package ];

  };
}
+0 −1
Original line number Diff line number Diff line
@@ -935,7 +935,6 @@ in
  moosefs = runTest ./moosefs.nix;
  mopidy = runTest ./mopidy.nix;
  morph-browser = runTest ./morph-browser.nix;
  morty = runTest ./morty.nix;
  mosquitto = runTest ./mosquitto.nix;
  movim = import ./web-apps/movim { inherit recurseIntoAttrs runTest; };
  mpd = runTest ./mpd.nix;

nixos/tests/morty.nix

deleted100644 → 0
+0 −31
Original line number Diff line number Diff line
{ pkgs, ... }:

{
  name = "morty";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ leenaars ];
  };

  nodes = {
    mortyProxyWithKey =

      { ... }:
      {
        services.morty = {
          enable = true;
          key = "78a9cd0cfee20c672f78427efb2a2a96036027f0";
          port = 3001;
        };
      };

  };

  testScript =
    { ... }:
    ''
      mortyProxyWithKey.wait_for_unit("default.target")
      mortyProxyWithKey.wait_for_open_port(3001)
      mortyProxyWithKey.succeed("curl -fL 127.0.0.1:3001 | grep MortyProxy")
    '';

}
Loading