Skip to content
Snippets Groups Projects
Select Git revision
  • 08377895a815dd52ce1b5f20b37ff2515ea9f613
  • develop default protected
  • production protected
  • nixpkgs-upgrade-2025-06-16
  • nixpkgs-upgrade-2024-12-23
  • 190-our-regular-updates-fill-up-the-servers-boot-partitions
  • nixpkgs-upgrade-2024-10-14
  • hro-cloud protected
  • 162.flexible-grafana-module
  • nixpkgs-upgrade-2024-05-13
  • nixpkgs-upgrade-2024-04-22
  • nixpkgs-upgrade-2024-03-25
  • nixpkgs-upgrade-2024-03-18
  • nixpkgs-upgrade-2024-03-11
  • nixpkgs-upgrade-2024-03-04
  • 163.jp-to-ben-for-prod
  • nixpkgs-upgrade-2024-02-26
  • 164.grafana-alert-rules
  • 157.authorize-new-hro-key
  • nixpkgs-upgrade-2024-02-19
  • nixpkgs-upgrade-2024-02-12
21 results

spending.nix

Blame
  • private-storage.nix 10.96 KiB
    { pkgs }:
    let
      sshPrivateKey = ./probeuser_ed25519;
      sshPublicKey = ./probeuser_ed25519.pub;
      sshUsers = {
        root = (builtins.readFile sshPublicKey);
        probeuser = (builtins.readFile sshPublicKey);
      };
      # Generate a command which can be used with runOnNode to ssh to the given
      # host.
      ssh = username: hostname: [
        "cp" sshPrivateKey "/tmp/ssh_key" ";"
        "chmod" "0400" "/tmp/ssh_key" ";"
        "ssh" "-oStrictHostKeyChecking=no" "-i" "/tmp/ssh_key" "${username}@${hostname}" ":"
      ];
    
      # Separate helper programs so we can write as little python inside a string
      # inside a nix expression as possible.
      run-introducer = ./run-introducer.py;
      run-client = ./run-client.py;
      get-passes = ./get-passes.py;
      exercise-storage = ./exercise-storage.py;
    
      # This is a test double of the Stripe API server.  It is extremely simple.
      # It barely knows how to respond to exactly the API endpoints we use,
      # exactly how we use them.
      stripe-api-double = ./stripe-api-double.py;
    
      # The root URL of the Ristretto-flavored PrivacyPass issuer API.
      issuerURL = "http://issuer/";
    
      voucher = "xyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxy";
    
      # The issuer's signing key.  Notionally, this is a secret key.  This is only
      # the value for this system test though so I don't care if it leaks to the
      # world at large.
      ristrettoSigningKeyPath =
        let
          key = "wumQAfSsJlQKDDSaFN/PZ3EbgBit8roVgfzllfCK2gQ=";
          basename = "signing-key.private";
        in
          pkgs.writeText basename key;
    
      stripeSecretKeyPath =
        let
          # Ugh.
          key = "sk_test_blubblub";
          basename = "stripe.secret";
        in
          pkgs.writeText basename key;
    
      # Here are the preconstructed secrets which we can assign to the introducer.
      # This is a lot easier than having the introducer generate them and then
      # discovering and configuring the other nodes with them.
      pemFile = ./node.pem;
    
      tubID = "rr7y46ixsg6qmck4jkkc7hke6xe4sv5f";
      swissnum = "2k6p3wrabat5jrj7otcih4cjdema4q3m";
      introducerPort = 35151;
      location = "tcp:introducer:${toString introducerPort}";
      introducerFURL = "pb://${tubID}@${location}/${swissnum}";
      introducerFURLFile = pkgs.writeTextFile {
        name = "introducer.furl";
        text = introducerFURL;
      };
      networkConfig = {
        # Just need to disable the firewall so all the traffic flows freely.  We
        # could do other network configuration here too, if we wanted.  Initially
        # I thought we might need to statically asssign IPs but we can just use
        # the node names, "introducer", etc, instead.