aboutsummaryrefslogtreecommitdiff
path: root/profiles/replaceAllUrls.nix
blob: 4c047ea8778b136cabbc60b4b4c48f16569f07fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
{ config, lib, ... }:

with lib;
let
  # Requirements:
  # - is valid connection target (from FF perspective)
  # - doesn't have any negative effects on the user privacy or security
  h = "127.0.0.1";
  u = lib.mkForce "http://${h}";
in {
  options.dataFrugality.replaceAllUrls = mkOption {
    type = types.bool;
    default = false;
    description = ''
      Firefox communicates with external services in many different ways. Not all of them
      happen on startup, and they can be triggered on different intervals.

      This is a desperate effort to prevent as much of that communication as possible, by depriving FF of all configurable
      URLs. It will break things, put the users security/privacy at risk, and probably shouldn't be enabled.

      Even so, this list may be insufficient. It was created manually from an about:config listing
      for the searchterms "url", "uri", "endpoint", and "server", so it will miss hidden (but defaulted) and hardcoded URLs.

      Further consideration for the placeholder value is required.

      Known issues:
        * This list will get outdated rather quickly
        * Typos and renaming of keys are not caught in any way
    '';
  };

  config.preferences = lib.mkIf config.dataFrugality.replaceAllUrls {
    app = {
      feedback.baseURL = u;
      releaseNotesURL = u;
      support.baseURL = u;
      update = {
        url.details = u;
        url.manual = u;
      };
    };

    browser = {
      uitour.url = u;

      contentblocking = {
        report = {
          cookie.url = u;
          cryptominer.url = u;
          fingerprinter.url = u;

          lockwise = {
            how_it_works.url = u;
          };

          monitor = {
            enabled = false;
            url = u;
            how_it_works.url = u;
            sign_in_url = u;
          };
        };
      };

      newtabpage.activity-stream = {
        discoverystream = {
          config = "{}";
          endpoints = u;
          endpointSpocsClear = u;
        };

        default.sites = "";
        feeds = {
          snippets = false;
          section.topstories.options = "{}";
        };
        asrouter.providers.snippets = false;

        fxaccounts.endpoint = u;

        telemetry.structuredIngestion.endpoint = u;
      };

      safebrowsing = {
        downloads.remote.url = u;
        provider =
          let mock = {
                advisoryURL = u;
                dataSharingURL = u;
                gethashURL = u;
                reportMalwareMistakeURL = u;
                reportPhishMistakeURL = u;
                reportURL = u;
                updateURL = u;
              };
          in {
            google = mock;
            google4 = mock;
            mozilla = mock;
          };
      };

      search.searchEnginesURL = u;
    };

    captivedetect.canonicalURL = u;
    datareporting = {
      healthreport.infoURL = u;
      firstRunURL = u;
      policy.firstRunURL = u;
    };

    dom.push.serverURL = "wss://${h}";

    extensions = {
      abuseReport = {
        amoDetailsURL = u;
        url = u;
      };

      blocklist = {
        detailsURL = u;
        itemURL = u;
      };

      getAddons = {
        discovery.api_url = u;
        get.url = u;
        langpacks.url = u;
        link.url = u;
        search.browseURL = u;
      };

      recommendations = {
        privacyPolicyUrl = u;
        themeRecommendationUrl = u;
      };

      systemAddon.update.url = u;
      update.background.url = u;
      update.url = u;
      webservice.discoverURL = u;
    };

    media.gmp-manager.url = u;

    identity = {
      fxaccounts = {
        remote.root = u;
        auth.uri = u;
        remote = {
          oauth.uri = u;
          pairing.uri = u;
          profile.uri = u;
        };

        service = {
          monitorLoginUrl = u;
          sendLoginUrl = u;
        };
      };
      sync.tokenserver.uri = u;
      sendtabpromo.url = u;
    };

    services.settings.server = u;

    network.trr.uri = u;

    toolkit = {
      telemetry.server = u;
      coverage.endpoint.base = u;
    };

    security = {
      # TODO: investigate exploit potential (I told you not to enable it!)
      certerrors.mitm.priming.endpoint = u;

      ssl.errorReporting.url = u;

      remote_settings = {
        intermediates.enabled = false;
        intermediates.signer = "";
        crlite_filters.enabled = false;
        crlite_filters.signer = "";
      };
    };

    signon.management.page = {
      breachAlertUrl = u;
      mobileAndroidURL = u;
      mobileAppleURL = u;
    };

    webextensions.storage.sync.serverURL = u;
  };
}