Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e0818a153055
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8c14a6f641b7
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 14, 2019

  1. nixos/captive-browser: fix module

    Fixes the broken metrics evaluation which was caused by a `trace`
    warning in stdout which confused `jq` in `pkgs/top-level/metrics.nix`.
    
    Also made the `bind-device` feature optional as suggested after the
    merge.
    Ma27 committed Jun 14, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Ma27 Maximilian Bosch
    Copy the full SHA
    d9f7bac View commit details

Commits on Jun 15, 2019

  1. Merge pull request #63135 from Ma27/captive-browser-regression

    nixos/captive-browser: fix module
    samueldr authored Jun 15, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8c14a6f View commit details
Showing with 17 additions and 3 deletions.
  1. +17 −3 nixos/modules/programs/captive-browser.nix
20 changes: 17 additions & 3 deletions nixos/modules/programs/captive-browser.nix
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@ in
package = mkOption {
type = types.package;
default = pkgs.captive-browser;
defaultText = "pkgs.captive-browser";
description = "Which package to use for captive-browser";
};

interface = mkOption {
@@ -35,7 +37,7 @@ in
''http://cache.nixos.org/''
];
description = ''
the shell (/bin/sh) command executed once the proxy starts.
The shell (/bin/sh) command executed once the proxy starts.
When browser exits, the proxy exits. An extra env var PROXY is available.
Here, we use a separate Chrome instance in Incognito mode, so that
@@ -51,7 +53,7 @@ in
dhcp-dns = mkOption {
type = types.str;
description = ''
the shell (/bin/sh) command executed to obtain the DHCP
The shell (/bin/sh) command executed to obtain the DHCP
DNS server address. The first match of an IPv4 regex is used.
IPv4 only, because let's be real, it's a captive portal.
'';
@@ -62,6 +64,16 @@ in
default = "localhost:1666";
description = ''the listen address for the SOCKS5 proxy server'';
};

bindInterface = mkOption {
default = true;
type = types.bool;
description = ''
Binds <package>captive-browser</package> to the network interface declared in
<literal>cfg.interface</literal>. This can be used to avoid collisions
with private subnets.
'';
};
};
};

@@ -99,7 +111,9 @@ in
browser = """${cfg.browser}"""
dhcp-dns = """${cfg.dhcp-dns}"""
socks5-addr = """${cfg.socks5-addr}"""
bind-device = """${cfg.interface}"""
${optionalString cfg.bindInterface ''
bind-device = """${cfg.interface}"""
''}
''}
exec ${cfg.package}/bin/captive-browser
'';