captive-browser: 0-unstable-2021-08-01 -> 0-unstable-2025-11-05 (#538118)

This commit is contained in:
Maximilian Bosch 2026-07-04 06:32:09 +00:00 committed by GitHub
commit 0be9f9b2fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 27 deletions

View file

@ -21,8 +21,6 @@ let
types
;
requiresSetcapWrapper = config.boot.kernelPackages.kernelOlder "5.7" && cfg.bindInterface;
browserDefault =
chromium:
concatStringsSep " " [
@ -30,11 +28,20 @@ let
"${chromium}/bin/chromium"
"--user-data-dir=\${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive"
''--proxy-server="socks5://$PROXY"''
''--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost"''
''--proxy-bypass-list="<-loopback>"''
"--no-first-run"
"--new-window"
"--incognito"
"-no-default-browser-check"
"--no-crash-upload"
"--disable-extensions"
"--disable-sync"
"--disable-background-networking"
"--disable-client-side-phishing-detection"
"--disable-component-update"
"--disable-translate"
"--disable-web-resources"
"--safebrowsing-disable-auto-update"
"http://cache.nixos.org/"
];
@ -144,12 +151,5 @@ in
else
throw "programs.captive-browser.dhcp-dns must be set"
);
security.wrappers.captive-browser = mkIf requiresSetcapWrapper {
owner = "root";
group = "root";
capabilities = "cap_net_raw+p";
source = "${captive-browser-configured}/bin/captive-browser";
};
};
}

View file

@ -2,34 +2,25 @@
lib,
fetchFromGitHub,
buildGoModule,
fetchpatch,
}:
buildGoModule {
buildGoModule (finalAttrs: {
pname = "captive-browser";
version = "0-unstable-2021-08-01";
version = "0-unstable-2025-11-05";
src = fetchFromGitHub {
owner = "FiloSottile";
owner = "pacoorozco";
repo = "captive-browser";
rev = "9c707dc32afc6e4146e19b43a3406329c64b6f3c";
sha256 = "sha256-65lPo5tpE0M/VyyvlzlcVSuHX4AhhVuqK0UF4BIAH/Y=";
rev = "ca6f74e132ecf298c87936d4c946fd551aefbbf7";
sha256 = "sha256-wojx28GFg9whfkNxUbOVDVNHp8M7SLsmRBTP/Jh8nLQ=";
};
vendorHash = "sha256-2MFdQ2GIDAdLPuwAiGPO9wU3mm2BDXdyTwoVA1xVlcQ=";
deleteVendor = true;
patches = [
# Add go modules support
(fetchpatch {
url = "https://github.com/FiloSottile/captive-browser/commit/ef50837778ef4eaf38b19887e79c8b6fa830c342.patch";
hash = "sha256-w+jDFeO94pMu4ir+G5CzqYlXxYOm9+YfyzbU3sbTyiY=";
})
];
vendorHash = "sha256-8FMFgCJUTalJ45GR5UnyXqN6s0gVFtiy6zjugbngDYQ=";
ldflags = [
"-s"
"-w"
"-X main.Version=${finalAttrs.version}"
];
meta = {
@ -38,4 +29,4 @@ buildGoModule {
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ma27 ];
};
}
})