caelum0x 1bc04fa81b feat(insights): the Insights fork behind the add-on, site entries, tenant summaries, caps that say what happens (PY1.3)
Railyard side of PY1.3 (RYP-D2, RYP-E1, SC-E3). Acceptance:
1. apps/insights: umami-software/umami v3.4.0 (MIT, commit ec0ff503),
   vendored --depth 1, LICENSE kept, NOTICE added. Fork additions only:
   src/railyard/{ingest,summary,tenancy,api-only}.ts, /v1/ingest/batch (the
   edge collector contract v1, bearer INSIGHTS_INGEST_TOKEN, no IP ever,
   retried batches de-duplicated by migration 90_railyard_ingest_receipts),
   /api/v1/tenants/{org}/summary (bearer INSIGHTS_API_TOKEN), src/proxy.ts
   (INSIGHTS_API_ONLY=1 serves only the Railyard API and the heartbeat).
   Tenant isolation is tested at the API level (an app id owned by another org
   is refused) and at the SQL level (upstream migrations 01-26 plus 90 on a
   throwaway cluster: org B never reads org A's rows, even naming its app).
   Upstream vitest suite: not run on the Mac (pnpm 12.3.4 pinned upstream,
   disk floor); it runs in the image build on box 2 or CI.
2. No upstream product name in anything a customer loads: the page tag, the
   console pages and the fork's additions (tests); the upstream dashboard is
   never served in API-only mode.
3. The console writes the collector's site entry on "Add app", on
   auto-created apps from deploys, and rewrites every entry on add-on, plan or
   pause changes (lib/sites.ts, SITES KV binding). The bridge gains
   `sites` (the project's app, site key, page tag and collector URLs, entry
   written) and the analytics proof is the first event from Insights. The
   console's Insights page shows visitors, events, first event and the
   visit -> signup -> first action funnel.
5. insights-edge/src/caps.ts: at 100% of the cap events are still counted and
   not stored until the next UTC month; the console shows the same message
   from a byte-identical copy (lib/caps.ts, tested).
4 (384 MB at 50 events a second for 10 min) is measured on staging before deploy.

Env: INSIGHTS_API_URL, INSIGHTS_API_TOKEN, SITES KV binding (console);
INSIGHTS_INGEST_TOKEN, INSIGHTS_API_TOKEN, INSIGHTS_API_ONLY (Insights).

Tests: console 54/54 (tsc clean), insights fork 7/7 (incl. SQL isolation),
insights-edge caps + collector + sim 14/14, tests/contract 3/3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:23:38 +03:00

253 lines
5.6 KiB
JSON

{
"AF": "Afghanistan",
"AX": "\u00c5land",
"AL": "Albani\u00eb",
"DZ": "Algerije",
"AS": "Amerikaans-Samoa",
"VI": "Amerikaanse Maagdeneilanden",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
"AG": "Antigua en Barbuda",
"AR": "Argentini\u00eb",
"AM": "Armeni\u00eb",
"AW": "Aruba",
"AU": "Australi\u00eb",
"AZ": "Azerbeidzjan",
"BS": "Bahama\u2019s",
"BH": "Bahrein",
"BD": "Bangladesh",
"BB": "Barbados",
"BY": "Belarus",
"BE": "Belgi\u00eb",
"BZ": "Belize",
"BJ": "Benin",
"BM": "Bermuda",
"BT": "Bhutan",
"BO": "Bolivia",
"BA": "Bosni\u00eb en Herzegovina",
"BW": "Botswana",
"BV": "Bouveteiland",
"BR": "Brazili\u00eb",
"IO": "Brits Indische Oceaanterritorium",
"VG": "Britse Maagdeneilanden",
"BN": "Brunei",
"BG": "Bulgarije",
"BF": "Burkina Faso",
"BI": "Burundi",
"KH": "Cambodja",
"CA": "Canada",
"BQ": "Caribisch Nederland",
"CF": "Centraal-Afrikaanse Republiek",
"CL": "Chili",
"CN": "China",
"CX": "Christmaseiland",
"CC": "Cocoseilanden",
"CO": "Colombia",
"KM": "Comoren",
"CG": "Congo-Brazzaville",
"CD": "Congo-Kinshasa",
"CK": "Cookeilanden",
"CR": "Costa Rica",
"CU": "Cuba",
"CW": "Cura\u00e7ao",
"CY": "Cyprus",
"DK": "Denemarken",
"DJ": "Djibouti",
"DM": "Dominica",
"DO": "Dominicaanse Republiek",
"DE": "Duitsland",
"EC": "Ecuador",
"EG": "Egypte",
"SV": "El Salvador",
"GQ": "Equatoriaal-Guinea",
"ER": "Eritrea",
"EE": "Estland",
"SZ": "eSwatini",
"ET": "Ethiopi\u00eb",
"FO": "Faer\u00f6er",
"FK": "Falklandeilanden",
"FJ": "Fiji",
"PH": "Filipijnen",
"FI": "Finland",
"FR": "Frankrijk",
"GF": "Frans-Guyana",
"PF": "Frans-Polynesi\u00eb",
"TF": "Franse Gebieden in de zuidelijke Indische Oceaan",
"GA": "Gabon",
"GM": "Gambia",
"GE": "Georgi\u00eb",
"GH": "Ghana",
"GI": "Gibraltar",
"GD": "Grenada",
"GR": "Griekenland",
"GL": "Groenland",
"GP": "Guadeloupe",
"GU": "Guam",
"GT": "Guatemala",
"GG": "Guernsey",
"GN": "Guinee",
"GW": "Guinee-Bissau",
"GY": "Guyana",
"HT": "Ha\u00efti",
"HM": "Heard en McDonaldeilanden",
"HN": "Honduras",
"HU": "Hongarije",
"HK": "Hongkong SAR van China",
"IE": "Ierland",
"IS": "IJsland",
"IN": "India",
"ID": "Indonesi\u00eb",
"IQ": "Irak",
"IR": "Iran",
"IM": "Isle of Man",
"IL": "Isra\u00ebl",
"IT": "Itali\u00eb",
"CI": "Ivoorkust",
"JM": "Jamaica",
"JP": "Japan",
"YE": "Jemen",
"JE": "Jersey",
"JO": "Jordani\u00eb",
"KY": "Kaaimaneilanden",
"CV": "Kaapverdi\u00eb",
"CM": "Kameroen",
"KZ": "Kazachstan",
"KE": "Kenia",
"KG": "Kirgizi\u00eb",
"KI": "Kiribati",
"UM": "Kleine afgelegen eilanden van de Verenigde Staten",
"KW": "Koeweit",
"XK": "Kosovo",
"HR": "Kroati\u00eb",
"LA": "Laos",
"LS": "Lesotho",
"LV": "Letland",
"LB": "Libanon",
"LR": "Liberia",
"LY": "Libi\u00eb",
"LI": "Liechtenstein",
"LT": "Litouwen",
"LU": "Luxemburg",
"MO": "Macau SAR van China",
"MG": "Madagaskar",
"MW": "Malawi",
"MV": "Maldiven",
"MY": "Maleisi\u00eb",
"ML": "Mali",
"MT": "Malta",
"MA": "Marokko",
"MH": "Marshalleilanden",
"MQ": "Martinique",
"MR": "Mauritani\u00eb",
"MU": "Mauritius",
"YT": "Mayotte",
"MX": "Mexico",
"FM": "Micronesia",
"MD": "Moldavi\u00eb",
"MC": "Monaco",
"MN": "Mongoli\u00eb",
"ME": "Montenegro",
"MS": "Montserrat",
"MZ": "Mozambique",
"MM": "Myanmar (Birma)",
"NA": "Namibi\u00eb",
"NR": "Nauru",
"NL": "Nederland",
"NP": "Nepal",
"NI": "Nicaragua",
"NC": "Nieuw-Caledoni\u00eb",
"NZ": "Nieuw-Zeeland",
"NE": "Niger",
"NG": "Nigeria",
"NU": "Niue",
"KP": "Noord-Korea",
"MK": "Noord-Macedoni\u00eb",
"MP": "Noordelijke Marianen",
"NO": "Noorwegen",
"NF": "Norfolk",
"UG": "Oeganda",
"UA": "Oekra\u00efne",
"UZ": "Oezbekistan",
"OM": "Oman",
"TL": "Oost-Timor",
"AT": "Oostenrijk",
"PK": "Pakistan",
"PW": "Palau",
"PS": "Palestijnse gebieden",
"PA": "Panama",
"PG": "Papoea-Nieuw-Guinea",
"PY": "Paraguay",
"PE": "Peru",
"PN": "Pitcairneilanden",
"PL": "Polen",
"PT": "Portugal",
"PR": "Puerto Rico",
"QA": "Qatar",
"RE": "R\u00e9union",
"RO": "Roemeni\u00eb",
"RU": "Rusland",
"RW": "Rwanda",
"KN": "Saint Kitts en Nevis",
"LC": "Saint Lucia",
"VC": "Saint Vincent en de Grenadines",
"BL": "Saint-Barth\u00e9lemy",
"MF": "Saint-Martin",
"PM": "Saint-Pierre en Miquelon",
"SB": "Salomonseilanden",
"WS": "Samoa",
"SM": "San Marino",
"ST": "Sao Tom\u00e9 en Principe",
"SA": "Saoedi-Arabi\u00eb",
"SN": "Senegal",
"RS": "Servi\u00eb",
"SC": "Seychellen",
"SL": "Sierra Leone",
"SG": "Singapore",
"SH": "Sint-Helena",
"SX": "Sint-Maarten",
"SI": "Sloveni\u00eb",
"SK": "Slowakije",
"SD": "Soedan",
"SO": "Somali\u00eb",
"ES": "Spanje",
"SJ": "Spitsbergen en Jan Mayen",
"LK": "Sri Lanka",
"SR": "Suriname",
"SY": "Syri\u00eb",
"TJ": "Tadzjikistan",
"TW": "Taiwan",
"TZ": "Tanzania",
"TH": "Thailand",
"TG": "Togo",
"TK": "Tokelau",
"TO": "Tonga",
"TT": "Trinidad en Tobago",
"TD": "Tsjaad",
"CZ": "Tsjechi\u00eb",
"TN": "Tunesi\u00eb",
"TR": "Turkije",
"TM": "Turkmenistan",
"TC": "Turks- en Caicoseilanden",
"TV": "Tuvalu",
"UY": "Uruguay",
"VU": "Vanuatu",
"VA": "Vaticaanstad",
"VE": "Venezuela",
"GB": "Verenigd Koninkrijk",
"AE": "Verenigde Arabische Emiraten",
"US": "Verenigde Staten",
"VN": "Vietnam",
"WF": "Wallis en Futuna",
"EH": "Westelijke Sahara",
"ZM": "Zambia",
"ZW": "Zimbabwe",
"ZA": "Zuid-Afrika",
"GS": "Zuid-Georgia en Zuidelijke Sandwicheilanden",
"KR": "Zuid-Korea",
"SS": "Zuid-Soedan",
"SE": "Zweden",
"CH": "Zwitserland"
}