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.8 KiB
JSON

{
"AF": "Afganistan",
"AL": "Alb\u00e0nia",
"DE": "Alemanya",
"DZ": "Alg\u00e8ria",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Ant\u00e0rtida",
"AG": "Antigua i Barbuda",
"SA": "Ar\u00e0bia Saudita",
"AR": "Argentina",
"AM": "Arm\u00e8nia",
"AW": "Aruba",
"AU": "Austr\u00e0lia",
"AT": "\u00c0ustria",
"AZ": "Azerbaidjan",
"BS": "Bahames",
"BH": "Bahrain",
"BD": "Bangladesh",
"BB": "Barbados",
"BY": "Belar\u00fas",
"BE": "B\u00e8lgica",
"BZ": "Belize",
"BJ": "Ben\u00edn",
"BM": "Bermudes",
"BT": "Bhutan",
"BO": "Bol\u00edvia",
"BA": "B\u00f2snia i Hercegovina",
"BW": "Botswana",
"BV": "Bouvet",
"BR": "Brasil",
"BN": "Brunei",
"BG": "Bulg\u00e0ria",
"BF": "Burkina Faso",
"BI": "Burundi",
"KH": "Cambodja",
"CM": "Camerun",
"CA": "Canad\u00e0",
"CV": "Cap Verd",
"BQ": "Carib Neerland\u00e8s",
"VA": "Ciutat del Vatic\u00e0",
"CO": "Col\u00f2mbia",
"KM": "Comores",
"CG": "Congo - Brazzaville",
"CD": "Congo - Kinshasa",
"KP": "Corea del Nord",
"KR": "Corea del Sud",
"CR": "Costa Rica",
"CI": "C\u00f4te d\u2019Ivoire",
"HR": "Cro\u00e0cia",
"CU": "Cuba",
"CW": "Cura\u00e7ao",
"DK": "Dinamarca",
"DJ": "Djibouti",
"DM": "Dominica",
"EG": "Egipte",
"SV": "El Salvador",
"AE": "Emirats \u00c0rabs Units",
"EC": "Equador",
"ER": "Eritrea",
"SK": "Eslov\u00e0quia",
"SI": "Eslov\u00e8nia",
"ES": "Espanya",
"US": "Estats Units",
"EE": "Est\u00f2nia",
"SZ": "eSwatini",
"ET": "Eti\u00f2pia",
"FJ": "Fiji",
"PH": "Filipines",
"FI": "Finl\u00e0ndia",
"FR": "Fran\u00e7a",
"GA": "Gabon",
"GM": "G\u00e0mbia",
"GE": "Ge\u00f2rgia",
"GH": "Ghana",
"GI": "Gibraltar",
"GR": "Gr\u00e8cia",
"GD": "Grenada",
"GL": "Groenl\u00e0ndia",
"GP": "Guadeloupe",
"GF": "Guaiana Francesa",
"GU": "Guam",
"GT": "Guatemala",
"GG": "Guernsey",
"GN": "Guinea",
"GW": "Guinea Bissau",
"GQ": "Guinea Equatorial",
"GY": "Guyana",
"HT": "Hait\u00ed",
"HN": "Hondures",
"HK": "Hong Kong (RAE Xina)",
"HU": "Hongria",
"YE": "Iemen",
"CX": "Illa Christmas",
"RE": "Illa de la Reuni\u00f3",
"IM": "Illa de Man",
"HM": "Illa Heard i Illes McDonald",
"AX": "Illes \u00c5land",
"KY": "Illes Caiman",
"CC": "Illes Cocos",
"CK": "Illes Cook",
"FO": "Illes F\u00e8roe",
"GS": "Illes Ge\u00f2rgia del Sud i Sandwich del Sud",
"FK": "Illes Malvines",
"MP": "Illes Mariannes del Nord",
"MH": "Illes Marshall",
"UM": "Illes Perif\u00e8riques Menors dels EUA",
"PN": "Illes Pitcairn",
"SB": "Illes Salom\u00f3",
"TC": "Illes Turks i Caicos",
"VG": "Illes Verges Brit\u00e0niques",
"VI": "Illes Verges Nord-americanes",
"IN": "\u00cdndia",
"ID": "Indon\u00e8sia",
"IR": "Iran",
"IQ": "Iraq",
"IE": "Irlanda",
"IS": "Isl\u00e0ndia",
"IL": "Israel",
"IT": "It\u00e0lia",
"JM": "Jamaica",
"JP": "Jap\u00f3",
"JE": "Jersey",
"JO": "Jord\u00e0nia",
"KZ": "Kazakhstan",
"KE": "Kenya",
"KG": "Kirguizistan",
"KI": "Kiribati",
"XK": "Kosovo",
"KW": "Kuwait",
"LA": "Laos",
"LS": "Lesotho",
"LV": "Let\u00f2nia",
"LB": "L\u00edban",
"LR": "Lib\u00e8ria",
"LY": "L\u00edbia",
"LI": "Liechtenstein",
"LT": "Litu\u00e0nia",
"LU": "Luxemburg",
"MO": "Macau (RAE Xina)",
"MK": "Maced\u00f2nia del Nord",
"MG": "Madagascar",
"MY": "Mal\u00e0isia",
"MW": "Malawi",
"MV": "Maldives",
"ML": "Mali",
"MT": "Malta",
"MA": "Marroc",
"MQ": "Martinica",
"MU": "Maurici",
"MR": "Maurit\u00e0nia",
"YT": "Mayotte",
"MX": "M\u00e8xic",
"FM": "Micron\u00e8sia",
"MZ": "Mo\u00e7ambic",
"MD": "Mold\u00e0via",
"MC": "M\u00f2naco",
"MN": "Mong\u00f2lia",
"ME": "Montenegro",
"MS": "Montserrat",
"MM": "Myanmar (Birm\u00e0nia)",
"NA": "Nam\u00edbia",
"NR": "Nauru",
"NP": "Nepal",
"NI": "Nicaragua",
"NE": "N\u00edger",
"NG": "Nig\u00e8ria",
"NU": "Niue",
"NF": "Norfolk",
"NO": "Noruega",
"NC": "Nova Caled\u00f2nia",
"NZ": "Nova Zelanda",
"OM": "Oman",
"NL": "Pa\u00efsos Baixos",
"PK": "Pakistan",
"PW": "Palau",
"PA": "Panam\u00e0",
"PG": "Papua Nova Guinea",
"PY": "Paraguai",
"PE": "Per\u00fa",
"PF": "Polin\u00e8sia Francesa",
"PL": "Pol\u00f2nia",
"PT": "Portugal",
"PR": "Puerto Rico",
"QA": "Qatar",
"GB": "Regne Unit",
"CF": "Rep\u00fablica Centreafricana",
"ZA": "Rep\u00fablica de Sud-\u00e0frica",
"DO": "Rep\u00fablica Dominicana",
"RO": "Romania",
"RW": "Ruanda",
"RU": "R\u00fassia",
"EH": "S\u00e0hara Occidental",
"BL": "Saint Barth\u00e9lemy",
"KN": "Saint Christopher i Nevis",
"SH": "Saint Helena",
"LC": "Saint Lucia",
"MF": "Saint Martin",
"VC": "Saint Vincent i les Grenadines",
"PM": "Saint-Pierre-et-Miquelon",
"WS": "Samoa",
"AS": "Samoa Nord-americana",
"SM": "San Marino",
"ST": "S\u00e3o Tom\u00e9 i Pr\u00edncipe",
"SN": "Senegal",
"RS": "S\u00e8rbia",
"SC": "Seychelles",
"SL": "Sierra Leone",
"SG": "Singapur",
"SX": "Sint Maarten",
"SY": "S\u00edria",
"SO": "Som\u00e0lia",
"LK": "Sri Lanka",
"SD": "Sudan",
"SS": "Sudan del Sud",
"SE": "Su\u00e8cia",
"CH": "Su\u00efssa",
"SR": "Surinam",
"SJ": "Svalbard i Jan Mayen",
"TJ": "Tadjikistan",
"TH": "Tail\u00e0ndia",
"TW": "Taiwan",
"TZ": "Tanz\u00e0nia",
"IO": "Territori Brit\u00e0nic de l\u2019Oce\u00e0 \u00cdndic",
"TF": "Territoris Australs Francesos",
"PS": "Territoris palestins",
"TL": "Timor Oriental",
"TG": "Togo",
"TK": "Tokelau",
"TO": "Tonga",
"TT": "Trinitat i Tobago",
"TN": "Tun\u00edsia",
"TM": "Turkmenistan",
"TR": "Turquia",
"TV": "Tuvalu",
"TD": "Txad",
"CZ": "Tx\u00e8quia",
"UA": "Ucra\u00efna",
"UG": "Uganda",
"UY": "Uruguai",
"UZ": "Uzbekistan",
"VU": "Vanuatu",
"VE": "Vene\u00e7uela",
"VN": "Vietnam",
"WF": "Wallis i Futuna",
"CL": "Xile",
"CN": "Xina",
"CY": "Xipre",
"ZM": "Z\u00e0mbia",
"ZW": "Zimb\u00e0bue"
}