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

{
"AF": "Afghanistan",
"AL": "Albania",
"DZ": "Algeria",
"UM": "Altre isole americane del Pacifico",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antartide",
"AG": "Antigua e Barbuda",
"SA": "Arabia Saudita",
"AR": "Argentina",
"AM": "Armenia",
"AW": "Aruba",
"AU": "Australia",
"AT": "Austria",
"AZ": "Azerbaigian",
"BS": "Bahamas",
"BH": "Bahrein",
"BD": "Bangladesh",
"BB": "Barbados",
"BE": "Belgio",
"BZ": "Belize",
"BJ": "Benin",
"BM": "Bermuda",
"BT": "Bhutan",
"BY": "Bielorussia",
"BO": "Bolivia",
"BA": "Bosnia ed Erzegovina",
"BW": "Botswana",
"BR": "Brasile",
"BN": "Brunei",
"BG": "Bulgaria",
"BF": "Burkina Faso",
"BI": "Burundi",
"KH": "Cambogia",
"CM": "Camerun",
"CA": "Canada",
"CV": "Capo Verde",
"BQ": "Caraibi olandesi",
"CZ": "Cechia",
"TD": "Ciad",
"CL": "Cile",
"CN": "Cina",
"CY": "Cipro",
"VA": "Citt\u00e0 del Vaticano",
"CO": "Colombia",
"KM": "Comore",
"CD": "Congo - Kinshasa",
"CG": "Congo-Brazzaville",
"KP": "Corea del Nord",
"KR": "Corea del Sud",
"CI": "Costa d\u2019Avorio",
"CR": "Costa Rica",
"HR": "Croazia",
"CU": "Cuba",
"CW": "Cura\u00e7ao",
"DK": "Danimarca",
"DM": "Dominica",
"EC": "Ecuador",
"EG": "Egitto",
"SV": "El Salvador",
"AE": "Emirati Arabi Uniti",
"ER": "Eritrea",
"EE": "Estonia",
"ET": "Etiopia",
"FJ": "Figi",
"PH": "Filippine",
"FI": "Finlandia",
"FR": "Francia",
"GA": "Gabon",
"GM": "Gambia",
"GE": "Georgia",
"GS": "Georgia del Sud e Sandwich australi",
"DE": "Germania",
"GH": "Ghana",
"JM": "Giamaica",
"JP": "Giappone",
"GI": "Gibilterra",
"DJ": "Gibuti",
"JO": "Giordania",
"GR": "Grecia",
"GD": "Grenada",
"GL": "Groenlandia",
"GP": "Guadalupa",
"GU": "Guam",
"GT": "Guatemala",
"GG": "Guernsey",
"GN": "Guinea",
"GQ": "Guinea Equatoriale",
"GW": "Guinea-Bissau",
"GY": "Guyana",
"GF": "Guyana francese",
"HT": "Haiti",
"HN": "Honduras",
"IN": "India",
"ID": "Indonesia",
"IR": "Iran",
"IQ": "Iraq",
"IE": "Irlanda",
"IS": "Islanda",
"BV": "Isola Bouvet",
"CX": "Isola Christmas",
"IM": "Isola di Man",
"NF": "Isola Norfolk",
"AX": "Isole \u00c5land",
"KY": "Isole Cayman",
"CC": "Isole Cocos (Keeling)",
"CK": "Isole Cook",
"FO": "Isole F\u00e6r \u00d8er",
"FK": "Isole Falkland",
"HM": "Isole Heard e McDonald",
"MP": "Isole Marianne settentrionali",
"MH": "Isole Marshall",
"PN": "Isole Pitcairn",
"SB": "Isole Salomone",
"TC": "Isole Turks e Caicos",
"VI": "Isole Vergini Americane",
"VG": "Isole Vergini Britanniche",
"IL": "Israele",
"IT": "Italia",
"JE": "Jersey",
"KZ": "Kazakistan",
"KE": "Kenya",
"XK": "Kosovo",
"KG": "Kirghizistan",
"KI": "Kiribati",
"KW": "Kuwait",
"LA": "Laos",
"LS": "Lesotho",
"LV": "Lettonia",
"LB": "Libano",
"LR": "Liberia",
"LY": "Libia",
"LI": "Liechtenstein",
"LT": "Lituania",
"LU": "Lussemburgo",
"MK": "Macedonia del Nord",
"MG": "Madagascar",
"MW": "Malawi",
"MY": "Malaysia",
"MV": "Maldive",
"ML": "Mali",
"MT": "Malta",
"MA": "Marocco",
"MQ": "Martinica",
"MR": "Mauritania",
"MU": "Mauritius",
"YT": "Mayotte",
"MX": "Messico",
"FM": "Micronesia",
"MD": "Moldavia",
"MC": "Monaco",
"MN": "Mongolia",
"ME": "Montenegro",
"MS": "Montserrat",
"MZ": "Mozambico",
"MM": "Myanmar (Birmania)",
"NA": "Namibia",
"NR": "Nauru",
"NP": "Nepal",
"NI": "Nicaragua",
"NE": "Niger",
"NG": "Nigeria",
"NU": "Niue",
"NO": "Norvegia",
"NC": "Nuova Caledonia",
"NZ": "Nuova Zelanda",
"OM": "Oman",
"NL": "Paesi Bassi",
"PK": "Pakistan",
"PW": "Palau",
"PA": "Panam\u00e1",
"PG": "Papua Nuova Guinea",
"PY": "Paraguay",
"PE": "Per\u00f9",
"PF": "Polinesia francese",
"PL": "Polonia",
"PT": "Portogallo",
"PR": "Portorico",
"QA": "Qatar",
"HK": "RAS di Hong Kong",
"MO": "RAS di Macao",
"GB": "Regno Unito",
"CF": "Repubblica Centrafricana",
"DO": "Repubblica Dominicana",
"RE": "Riunione",
"RO": "Romania",
"RW": "Ruanda",
"RU": "Russia",
"EH": "Sahara occidentale",
"KN": "Saint Kitts e Nevis",
"LC": "Saint Lucia",
"MF": "Saint Martin",
"VC": "Saint Vincent e Grenadine",
"BL": "Saint-Barth\u00e9lemy",
"PM": "Saint-Pierre e Miquelon",
"WS": "Samoa",
"AS": "Samoa americane",
"SM": "San Marino",
"SH": "Sant\u2019Elena",
"ST": "S\u00e3o Tom\u00e9 e Pr\u00edncipe",
"SN": "Senegal",
"RS": "Serbia",
"SC": "Seychelles",
"SL": "Sierra Leone",
"SG": "Singapore",
"SX": "Sint Maarten",
"SY": "Siria",
"SK": "Slovacchia",
"SI": "Slovenia",
"SO": "Somalia",
"ES": "Spagna",
"LK": "Sri Lanka",
"US": "Stati Uniti",
"SS": "Sud Sudan",
"ZA": "Sudafrica",
"SD": "Sudan",
"SR": "Suriname",
"SJ": "Svalbard e Jan Mayen",
"SE": "Svezia",
"CH": "Svizzera",
"SZ": "Swaziland",
"TJ": "Tagikistan",
"TW": "Taiwan",
"TZ": "Tanzania",
"TF": "Terre australi francesi",
"PS": "Territori palestinesi",
"IO": "Territorio britannico dell\u2019Oceano Indiano",
"TH": "Thailandia",
"TL": "Timor Est",
"TG": "Togo",
"TK": "Tokelau",
"TO": "Tonga",
"TT": "Trinidad e Tobago",
"TN": "Tunisia",
"TR": "Turchia",
"TM": "Turkmenistan",
"TV": "Tuvalu",
"UA": "Ucraina",
"UG": "Uganda",
"HU": "Ungheria",
"UY": "Uruguay",
"UZ": "Uzbekistan",
"VU": "Vanuatu",
"VE": "Venezuela",
"VN": "Vietnam",
"WF": "Wallis e Futuna",
"YE": "Yemen",
"ZM": "Zambia",
"ZW": "Zimbabwe"
}