Commit Graph
81 Commits
Author SHA1 Message Date
Erik Arvstedt f58d67677e netns-isolation: separate host and netns setup
- Improves readability

- `netns exec ...` (called via `netnsIptables`) incurs a large
  overhead: In addition to netns switching, a mount namespace
  is setup and populated with the contents of /etc/netns/<ns>/.
  Instead, simply run `nsenter`.
2021-11-08 12:46:28 +01:00
Erik Arvstedt cb6e5ef702 netns-isolation: fix routing issues due to netns restarting
Previously, restarting a service implied restarting its netns.
For unknown reasons, this sometimes caused the netns-local address
to not be routable from the root netns for up to 20 s.
I.e., the service was sometimes unreachable after restarting.

Now the netns is no longer stopped when the service is stopped.
2021-11-08 12:46:27 +01:00
Erik Arvstedt c30fe1919b netns-isolation: don't auto-assign IPv6 addrs to peer links
This simplifies the host's address configuration.

This also removes unused addresses that are returned when resolving
container hostnames via nss-mymachines:
`getent ahosts nb-test`
2021-11-02 17:40:43 +01:00
Erik Arvstedt aada35fc7b minor improvements
- README: add matrix room

- examples/configuration.nix: explain why bitcoind is enabled by default

- btcpayserver: group lnd service settings

- clightning:
  Use public onion port only when the onion service is public

  This allows users to enable the onion service while announcing a
  non-onion public address.

- netns-isolation: move `readOnly` attr to the top

- tests: use mkDefault to allow for easier overriding

- tests/btcpayserver: test web server response
2021-10-30 15:34:48 +02:00
nixbitcoin a10aa21c69 joinmarket: 0.9.2 -> 0.9.3 2021-10-27 16:02:59 +02:00
nixbitcoin 63836127c9 bitcoind: one-option i2p support 2021-10-12 10:22:09 +00:00
Erik Arvstedt a92d6a8e80 netns: expose bridgeIp as an option
Previously, this variable was not accessible to other modules.
2021-10-04 00:33:26 +02:00
Erik Arvstedt 27c45b82cc modules: move options to the top
This greatly improves readability and makes it easier to discover options.

This commit was genereated by running the following script inside the
repo root dir:

#!/usr/bin/env ruby

def transform(src)
  return false if src.include?('inherit options;')

  success = false

  options = nil
  src.sub!(/^  options.*?^  }.*?;/m) do |match|
    options = match
    "  inherit options;"
  end
  return false if !options

  src.sub!(/^with lib;\s*let\n+/m) do |match|
    success = true
    <<~EOF
      with lib;
      let
      #{options}

    EOF
  end

  success
end

Dir['modules/**/*.nix'].each do |f|
  src = File.read(f)
  if transform(src)
    puts "Changed file #{f}"
    File.write(f, src)
  end
end
2021-09-13 13:41:47 +02:00
nixbitcoin 00a0759884 joinmarket-ob-watcher: extra permissions & functionality for fidelity bonds 2021-08-30 13:37:04 +02:00
Erik Arvstedt 178a0dcf8f services: use new 'tor' options 2021-08-14 10:46:41 +02:00
nixbitcoin 54810ce1bf btcpayserver: add L-BTC support 2021-08-10 10:04:54 +00:00
Martin Milata b666bb2903 charge-lnd: add module 2021-07-12 17:36:31 +02:00
kon eb21012745 pool: add pkg, module & tests 2021-03-01 10:59:35 +01:00
Erik Arvstedt 0b5b29a2a3 netns-isolation: simplify permission definition for netns-exec
The new definition is equivalent to the old one.
2021-02-07 22:39:06 +01:00
Erik Arvstedt af2040f4c4 netns-isolation: use 'true' for systemd option 2021-02-07 22:39:05 +01:00
nixbitcoin 8c125ec48c joinmarket-obwatcher: add pkg & module 2021-01-17 17:40:12 +00:00
Erik Arvstedt 09e0042aa8 spark-wallet: add consistent address options 2021-01-14 13:25:05 +01:00
Erik Arvstedt 39f16c0b4a liquidd: add consistent address options 2021-01-14 13:25:05 +01:00
Erik Arvstedt 8fa32b7f91 btcpayserver: add consistent address options 2021-01-14 13:25:04 +01:00
Erik Arvstedt e78a609687 clightning: add consistent address options
Also remove option 'autolisten'. This option has no effect because
option 'bind-addr' is always set.
2021-01-14 13:25:04 +01:00
Erik Arvstedt b41a720c28 lnd: add consistent address options
Also fix btcpayserver by connecting to the lnd restAddress instead of the p2p address.
2021-01-14 13:25:03 +01:00
Erik Arvstedt dd4a0238f9 bitcoind: group rpc options under parent option 'rpc' 2021-01-14 13:25:03 +01:00
Erik Arvstedt 5b7e0d09b2 bitcoind: add consistent address options 2021-01-14 13:25:03 +01:00
Jonas Nick 79f4723cda lightning-charge: remove package and module 2021-01-01 19:16:46 +00:00
Jonas Nick 58de79d401 nanopos: remove package and module 2021-01-01 17:37:30 +00:00
Erik Arvstedt f1681f5b45 add option nix-bitcoin.pkgs, remove overlay
This works around a nixpkgs bug where overlays are ignored in containers.
2020-11-09 22:10:07 +01:00
Erik Arvstedt 0972af55f1 netns: fix setup service restarts 2020-11-03 21:55:13 +01:00
Erik Arvstedt 63a464431b netns: fail when netns already exists
Under normal circumstances, service-specific netns should never exist
before the netns setup service starts.
An existing netns is a genuine error that should not be silently ignored.
2020-11-03 21:55:13 +01:00
Erik Arvstedt b4b607dfa5 netns: simplify firewall setup 2020-10-29 22:36:20 +01:00
Erik Arvstedt 25639cec42 netns: fix error msg when starting netns
Previously, the failing initial `netns delete` resulted in a
"Cannot remove namespace file ..." error visible in the journal
and status output.
2020-10-29 21:21:30 +01:00
Erik Arvstedt 67068afd6b netns: fix error when stopping netns
A short time after `netns delete` finishes, the peer link in the main
netns is automatically removed.
When `link del` is run before that, it fails with
`Cannot find device "nb-veth-br-*"` and the netns service enters a failed state.
2020-10-29 21:21:30 +01:00
Erik Arvstedt 8da01fe8a6 lightning-loop: allow RPC access from main netns
Note that this also exposes the REST server, which is secured by
macaroon auth like the RPC server.
2020-10-29 21:21:29 +01:00
Erik Arvstedt e66636ef0e liquidd: use type str for rpcbind 2020-10-29 21:21:29 +01:00
Erik Arvstedt de23fdd377 lnd: use type str for rpclisten, restlisten 2020-10-29 21:21:28 +01:00
Erik Arvstedt 8b053326cc bitcoind: use type str for rpcbind
Extra RPC bind addresses can still be added via extraConfig.
2020-10-29 21:21:28 +01:00
Erik Arvstedt 6903e8afcc netns-liquidd: allow RPC access from main netns 2020-10-29 21:21:28 +01:00
Erik Arvstedt 82f4901880 netns-lnd: allow RPC access from main netns 2020-10-29 21:21:27 +01:00
Erik Arvstedt 58d24e735d netns-bitcoind: allow RPC access from main netns 2020-10-29 21:21:27 +01:00
Erik Arvstedt 5e0e16529c netns: fix default addressblock value type
Also remove redundant definition in secure-node.nix
2020-10-20 18:21:37 +02:00
Erik Arvstedt 1935c252ec lnd: remove redundant option 'bitcoind-host'
Also set bitcoind rpc port.
2020-10-16 18:01:51 +02:00
Erik Arvstedt c24ac5d363 clightning: remove redundant option 'bitcoin-rpcconnect' 2020-10-16 18:01:50 +02:00
Erik Arvstedt 480d0d3959 liquid: fix bitcoin rpc settings
- Remove redundant option mainchainrpchost.
  This option is already provided by bitcoind.
- Set a working default for rpcport and rpcuser.
  Enables use without secure-node.
2020-10-16 16:46:55 +02:00
Erik Arvstedt 9aa19c3fdd extract operator module 2020-10-16 16:46:55 +02:00
Erik Arvstedt 611cfe5a28 electrs: remove redundant daemonrpc option 2020-09-30 11:26:41 +02:00
nixbitcoin 173891fa5b joinmarket: add module 2020-09-22 13:50:37 +00:00
nixbitcoin 15b574faa7 nbxplorer/btcpayserver: add module 2020-09-15 12:09:12 +00:00
nixbitcoin b97584f5cb netns: allow return traffic to outgoing connections 2020-09-15 12:08:58 +00:00
Erik Arvstedt 91ebc2d517 netns-exec: simplify installation 2020-08-25 14:53:12 +02:00
Erik Arvstedt 809e754851 netns: improve bridge setup
- Explain why we don't use option `networking.bridges`
- Make the bridge setup service part of NixOS' network-setup.service.
  This yields no noticable functional changes for now, but it's
  conceptually cleaner to finish the network setup before network.target
  becomes active.
- Add 'nb-' prefix to service name
2020-08-25 14:53:12 +02:00
Erik Arvstedt b7450877a0 netns: rename bridge peer devices br-nb-veth* -> nb-veth-br*
This ensures a consistent 'nb-' namespace and simplifies the
dhcpcd.denyInterfaces rules.

Also rename vethName -> veth.
2020-08-25 14:53:12 +02:00