diff --git a/nixos/modules/services/web-apps/chhoto-url.nix b/nixos/modules/services/web-apps/chhoto-url.nix index 8b6df98dc53e..54cb6bd81e00 100644 --- a/nixos/modules/services/web-apps/chhoto-url.nix +++ b/nixos/modules/services/web-apps/chhoto-url.nix @@ -30,7 +30,7 @@ in settings = lib.mkOption { description = '' Configuration of Chhoto URL. - See for a list of options. + See for a list of options. ''; example = { port = 4567; @@ -152,7 +152,7 @@ in description = '' Files to load environment variables from in addition to [](#opt-services.chhoto-url.settings). This is useful to avoid putting secrets into the nix store. - See for a list of options. + See for a list of options. ''; }; }; diff --git a/nixos/tests/chhoto-url.nix b/nixos/tests/chhoto-url.nix index a2f443e9b0da..883b71117906 100644 --- a/nixos/tests/chhoto-url.nix +++ b/nixos/tests/chhoto-url.nix @@ -18,7 +18,6 @@ }; interactive.nodes.machine = { - services.glitchtip.listenAddress = "0.0.0.0"; networking.firewall.allowedTCPPorts = [ 8000 ]; virtualisation.forwardPorts = [ { @@ -29,9 +28,13 @@ ]; }; + interactive.sshBackdoor.enable = true; + interactive.defaults.virtualisation.graphics = false; + testScript = '' import json import re + import time machine.wait_for_unit("chhoto-url.service") machine.wait_for_open_port(8000) @@ -53,8 +56,10 @@ assert (match := re.search(r"(?m)^location: (.+?)\r?$", resp)) assert match[1] == "https://nixos.org/" + time.sleep(2) resp = json.loads(machine.succeed(f"curl -H 'X-API-Key: api_key' localhost:8000/api/expand -d '{slug}'")) assert resp["success"] is True + assert resp["longurl"] == "https://nixos.org/" assert resp["hits"] == 1 ''; } diff --git a/pkgs/by-name/ch/chhoto-url/package.nix b/pkgs/by-name/ch/chhoto-url/package.nix index e40b1fb1ca42..36218ff6c94e 100644 --- a/pkgs/by-name/ch/chhoto-url/package.nix +++ b/pkgs/by-name/ch/chhoto-url/package.nix @@ -8,28 +8,30 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "chhoto-url"; - version = "7.2.1"; + version = "7.4.1"; src = fetchFromGitHub { owner = "SinTan1729"; repo = "chhoto-url"; tag = finalAttrs.version; - hash = "sha256-n8fCQeY0gIyZuACKWa8Fk9TQ680PpVS2MHMFy7UgDwk="; + hash = "sha256-1kPXsN5gOfY8JyaV6J5X2cEH00Xm06nsU5GNuVDxBJo="; fetchLFS = true; }; - sourceRoot = "${finalAttrs.src.name}/actix"; + sourceRoot = "${finalAttrs.src.name}/backend"; postPatch = '' substituteInPlace src/{main.rs,services/get.rs,services/utils.rs} \ - --replace-fail "./resources/" "${placeholder "out"}/share/chhoto-url/resources/" + --replace-fail "./frontend/" "${placeholder "out"}/share/chhoto-url/frontend/" + substituteInPlace Cargo.toml \ + --replace-fail 'rust-version = "1.96"' 'rust-version = "1.95"' ''; - cargoHash = "sha256-9EVGsOipx9ObygpM37iZYLnhYjSMHFhHTDvjHkLWLz8="; + cargoHash = "sha256-H3HrHu1y8wIc0j3cCIPOUnFe1jzpx1vCSfZvushIf70="; postInstall = '' mkdir -p $out/share/chhoto-url - cp -r ${finalAttrs.src}/resources $out/share/chhoto-url/resources + cp -r ${finalAttrs.src}/frontend $out/share/chhoto-url/frontend ''; passthru = {