mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
chhoto-url: 7.2.1 -> 7.4.1 (#537795)
This commit is contained in:
commit
2f240ca64a
3 changed files with 16 additions and 9 deletions
|
|
@ -30,7 +30,7 @@ in
|
|||
settings = lib.mkOption {
|
||||
description = ''
|
||||
Configuration of Chhoto URL.
|
||||
See <https://github.com/SinTan1729/chhoto-url/blob/main/compose.yaml> for a list of options.
|
||||
See <https://github.com/SinTan1729/chhoto-url/blob/main/docs/INSTALLATION.md#configuration-options> 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 <https://github.com/SinTan1729/chhoto-url/blob/main/compose.yaml> for a list of options.
|
||||
See <https://github.com/SinTan1729/chhoto-url/blob/main/docs/INSTALLATION.md#configuration-options> for a list of options.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue