diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2bc8972..10a9a64 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,17 +6,21 @@ name: Release to GitHub Pages # tagged v. on: release: - types: [published] + # "released" also fires when a pre-release is promoted to a full release. + types: [released] workflow_dispatch: inputs: tag: description: Existing release tag to redeploy (e.g. v1.0.0) required: true + allow_older: + description: Allow deploying a version older than what is live (rollback) + type: boolean + default: false +# Least privilege: only the deploy job can write to Pages. permissions: contents: read - pages: write - id-token: write concurrency: group: pages @@ -29,6 +33,8 @@ jobs: runs-on: ubuntu-latest env: TAG: ${{ github.event.release.tag_name || inputs.tag }} + ALLOW_OLDER: ${{ inputs.allow_older || false }} + GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v7 with: @@ -45,10 +51,21 @@ jobs: echo "::error::Release tag $TAG does not match package.json version ($want)" exit 1 fi + - name: Never deploy pre-releases or roll the live site back by accident + run: | + set -euo pipefail + if [ "$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json isPrerelease -q .isPrerelease)" = "true" ]; then + echo "::error::$TAG is a pre-release; pre-releases never deploy"; exit 1 + fi + live=$(curl -sSf https://seriesoftub.es/version.json 2>/dev/null | jq -r .version || echo "0.0.0") + new="${TAG#v}" + if [ "$ALLOW_OLDER" != "true" ] && [ "$(printf '%s\n%s\n' "$live" "$new" | sort -V | tail -n1)" != "$new" ]; then + echo "::error::$new is older than the live $live. Re-run with allow_older to roll back on purpose."; exit 1 + fi - run: npm ci - run: npm test - name: Build site - run: VERSION="${TAG#v}" npm run build + run: VERSION="${TAG#v}" REQUIRE_NOTES=1 npm run build - uses: actions/upload-pages-artifact@v5 with: path: ./_site @@ -56,6 +73,9 @@ jobs: deploy: needs: build runs-on: ubuntu-latest + permissions: + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 64fb427..210bf35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,215 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] +- Barcelona joins the map with Catnip-IX, local transit and peering. +- Community exchanges now include FRIES-IX, Paella-NIX, KleyWrecks, + LO-NAPS, JINXED-IX and IX Strayla, plus BB-Kicks in Tokyo and + DE-KICKS New York. FRIES-IX ports and LAG members up to 400G are free. + +## [1.10.0] — 2026-10-24 + +- Router ports are finite. Every transit, IX, PNI and cache port, every wave + and every fibre channel takes a router port; 10G ports ride a breakout, + four to a port. The Infra tab shows how many are left, and plugging in more + than you have is refused. +- More routers: up to six per POP, and six new models to swap in from the + Infra tab: Mikrowtik CCR-ish, Sonic the Whitebox 32 (cheap, crashes more), + Arrrhipster 7280R-ish and 7800R-ish (lots of ports, deep buffers, boots in + minutes), Disco 8K-ish (licence keys for everything) and Knockia 7750-ish. + A swap that would not fit what is already plugged in is refused. +- New cities: Milan, Rome, Palermo, Lisbon and Athens in Europe; Atlanta, + Denver, Phoenix, Boston, Houston and Salt Lake City in the US. New cables + land with them (Lisbon to Brazil, Africa and the US Southeast; Genoa to + Sicily and Athens; Palermo to Marseille and Alexandria; Athens to Istanbul; + Boston to Dublin), along with local networks to peer with. +- Rival exchanges: 25 big metros now have a second (sometimes third) IX. + Challengers are cheaper and share many members with the incumbent, but not + all of them. Each IX is its own port, LAG and route server. +- The long tail: 60 small, odd networks with a sliver of traffic each, spread + over random exchanges. "Request all willing peers" signs them up in one go, + and they fold into one row in the network lists. +- Europe's peering market is competitive: IX ports there cost 20% less, and + price wars between rival exchanges cut your port bill further. DE-KICKS + responds with a webinar. +- Voda-Phony has ended settlement-free peering. It now peers only over a paid + PNI, through its interconnection partner. +- New US eyeballs Spectre-um Cable and Very-Zone (paid peering only). +- Pausing now freezes the map too: packet dots, waves and clouds stop + moving until you press play again (#11). +- Ports in both buildings: with a second site, any transit port, PNI or IX + port can now be set to "Both". That splits it into a LAG with members in + each building (adding a member if needed), so a dark building only takes + out half the port instead of all of it (#8). +- The top bar no longer wraps onto a second row and covers the side panels + on laptop-sized screens. +- Routers make sense now: the Chonk 800 takes 800G waves and ports (a new + 800G wave sits between 400G and 1.6T), and only the Absolute Unit has 1.6T + ports and takes 6.4T waves, handed off as 4×1.6T. Existing waves keep + their size. +- London–Amsterdam is everywhere: three more cheap North Sea cables, and dark + fiber you can lease on them (and on the Channel), since you can't dig under + the sea. +- Your own IX can grow (#10): upgrade its fabric from 400G to 1.6T, 6.4T and + 25.6T. Bigger fabrics carry more and have room for more members. +- Wave prices follow real markets: Europe is cheap, North America average, + Asia and South America pricier, and anything into Africa several times the + price. Every route has its own going rate, and new leases get about 8% + cheaper each year. The link planner tells you how a route compares. +- Cairo–Dubai over the Red Sea, plus I-ME-WE-Us to Fujairah and Mumbai. +- The Gulf: Jeddah, Riyadh and Doha. Saudi POPs need a local telecom licence, + gigaprojects want enormous demo networks, and now and then the neighbours + fall out and every link between Qatar and Saudi Arabia or the UAE goes dark + for months. Qatar is on the map as a peninsula now, too. +- Tablets in landscape: slimmer side panels, bigger touch targets, and the + left panel tucks away while a city is open (tap "Goals & NOC" to bring it + back). + +## [1.9.0] — 2026-10-23 + +- RouteScript: program your Auto-TE controller from the NOC tab with a tiny + rule language: `spill at 80%`, `prefer pni for goggle`, `avoid transit for + netchill`, `cap transit cogentle at 20 gbps`, `drain paris`, `avoid link + fra-ams` and `blackhole ddos`. Check runs a dry run against live traffic + and shows what would change; Deploy makes it real. Typos get a "did you + mean". Two new badges: Script Kiddie and Fat Finger. +- Zoom in twice as far as before, handy for crowded spots like the UAE, + Singapore or Central Europe. +- Half speed: a new ½× button, or press 0. +- NOC dashboard: a legend explains the colours in "How it arrives", the + network table sorts by any column (traffic, transit cost, loss, name), and a + new "Who your transit carries" list shows the networks you pay transit to + reach, with the cheapest way to move each one to peering (#7). +- The Transit tab shows the top destinations on each transit port, with the + same hint, so you can see who to peer with in that city (#7). +- A full code review, and about 40 fixes from it: + - Saves and imported files are checked and repaired before use, so a + damaged or hand-edited save can no longer break the game or inject + anything into the page. + - Loophole fixes: flipping crypto loans for profit, free repairs of + geopolitical cable cuts, re-rolling DE-KICKS quotes, walking out of a + failing event, and selling the same trench twice. + - The Red Sea scenario really cuts the Red Sea now, the weekly challenge + gives everyone the same world, and its "pricey" and "poor" twists work. + - China Telecomet and China Unicorn no longer act like Tier 1s. + - Metro ring cuts now alert you, overlapping site outages no longer cancel + each other, and alien waves work on unlit fiber. + - Routing is several times faster on big networks. + - The map fills wide screens at any zoom, pinch zoom goes as far as the + mouse wheel, and touch scrolling and cancelled touches behave. + - Starting a scenario from a running game asks first, and Space no longer + pauses when you meant to press a button. +- Settings for animations and sound, in the menu and on the help screen. + Animations can follow your device's reduce-motion setting (the default), + or be forced on or off. Off freezes the map: no moving packets, pulses or + floating text. + +## [1.8.0] — 2026-10-23 + +- Traceroute and looking glass: tap 🔍 Traceroute on any of your cities, or + open it from the NOC tab. See the exact path to any network or POP, hop by + hop, with latency, the exit it leaves through and the AS path, plus why + that exit won. +- Share card: an image of your network with a mini map, your stats and your + rarest badges, ready to post. Find it in the menu, after winning and after + a scenario. +- Scenarios: six hand-built challenges with a goal and a deadline (Only + Spätzle-IX, Red Sea Crisis, The Cogentle Spat, Carnaval, Mind the Gap and + Anchors Away), plus a weekly challenge where everyone gets the same world, + the same start city and the same two twists for a week. +- Sandbox mode: a billion dollars, every unlock and nothing ever breaks. + No badges, though. +- Conference season: NANOG-ish, RIPE-ish, DENOG-ish, APRICOT-ish and more + come round every year. Register in the Deals tab and selective networks in + that region need half the usual traffic to peer with you for 45 days. +- A guided first game for new players, step by step, with a skip button. +- Kyiv, with Varenyky-IX and KyivStar-ish. Blackouts are frequent, so bring + a generator. Nobody sells capacity between Kyiv and Moscow. +- 7 more badges for scenarios, the weekly challenge and conferences. + +## [1.7.0] — 2026-10-23 + +- Auto-TE: from customer level 3 you can install a traffic-engineering + controller in the NOC tab. When the shortest path is full, the overflow + spills onto up to two alternate paths with free capacity instead of being + dropped. Without it, traffic still reroutes around failures, but a full + link stays full, just like a real IGP. +- 16 more badges, mostly rare, epic and legendary: Traffic Whisperer, Same + Street, Anchors Aweigh, Samba Peering, DE-KICKS Bingo, Ring of Fire, Iron + Curtain Call, Island Hopper, Through the Wall, Darwin Award, Unbreakable, + Gigawatt Landlord, Blitz, Hundred Terabits and a few more, one of them + secret. That makes 46. + +## [1.6.0] — 2026-10-23 + +- South America is on the map properly: Fortaleza, Rio de Janeiro, Buenos + Aires, Santiago, Lima, Bogotá and Panama City, with new cables including a + ring round Cape Horn, a direct São Paulo–New York cable and the first + cable from Chile to Sydney. Nothing crosses the Darién Gap by land, transit + is pricier because so much traffic hairpins through Miami, and fiber over + the Andes costs double and breaks often. IX.brrr is run by a nonprofit + with cheap public prices, and small Brazilian provedores now buy transit + from you. +- More India: Delhi, Chennai, Bengaluru and Hyderabad, with east-coast cables + to Singapore and a lot of road widening. +- Taiwan: Taipei, with cables to Tokyo, Hong Kong, Los Angeles, Seattle and + Shanghai, and ships that keep dragging their anchors over them. +- The UAE: Abu Dhabi and Fujairah join Dubai. Only the licensed duopoly may + run fiber inside the country, so there is no dark fiber, waves cost 3×, and + POPs need a free-zone license. Most cables land in Fujairah. +- Cape Town, with Atlantic cables up the west coast of Africa and load + shedding: bring a generator. +- New local networks: Clarovision, Vivo-ish, Mercado Livre-ly, Jio-graphy, + Airtel-tale, Chunghwa Tele-calm and do-ish. +- Metro diversity: add a second data center in any POP's metro from the + Infra tab, joined by your own metro ring. A power cut, cleaner or A/C + failure then only takes out half the city. You choose which site each + transit, PNI and IX port plugs into, and metro ring cuts can cut site B + off. Some hyperscaler and AI customers now insist on two sites. +- More Asia-Pacific: Melbourne, Brisbane, Darwin, Osaka, Kuala Lumpur, + Bangkok, Ho Chi Minh City, Karachi, Dhaka and Colombo, with cables to match. + Vietnam's cables break a lot, and Darwin has crocodiles. +- Central and Eastern Europe: Warsaw, Prague, Vienna, Budapest, Bucharest, + Tallinn and Istanbul. Baltic cables meet a lot of anchors. +- The giants: at customer levels 3 and 4, hyperscalers and AI clouds bring + deals only they would ask for. Terabit AI WANs between gigawatt campuses, + training runs spread over three or four sites, week-long dataset ingests, + and hundreds of fiber pairs in a trench you dug yourself. Their campuses, + from Star-Gait Abilene to the Johor-ish Overflow, show up in each city's + "Who's here". +- Dark fiber pairs you lease out now earn even before you light your own + channels on that fiber. +- More local networks: KD-DIY, Opt-Out-Us, Mostly-True Move, Viet-tell, + PTC-hell, Telekom Ma-lazy-sia, Türk Tele-komik, Digi-tally Cheap and + UPC-You-Later. +- Badges: 30 achievements from common to legendary, shown under your goals. + Some take luck (Shark Bait), some take years (Five Nines, Speedrun), and a + couple are secret. Badges from earlier games stay on this device in a hall + of fame. +- Five new goals between Tier 2 and Tier 1: light your own dark fiber, be in + two buildings at once, five continents, sign a giant, and serve 10 Tbps. +- Tap your network's name in the top left for a menu to export or import a + save, or start a new network. + +## [1.5.0] — 2026-10-23 + +- Several transits in the same city now share the load instead of filling one + after the other. The same goes for any exits that are equally close: traffic + is spread by free capacity, and local exits still win over far ones (#4). +- Export your save to a file and import it on another device, from the help + screen or the title screen (#5). +- Full transit ports, IX ports, PNIs, caches and routers are now easy to spot. + They get red badges on the map (T, P, C, R), the IX hexagon blinks red when + its port is full, and the NOC lists everything running hot with a hint on + what to do (#6). +- Some routers take forever to boot. The Infra tab shows each chassis's boot + time and its forwarding chip, including the Junipurr PacketOinker™ in the + Chonk 800 and two of them in the Absolute Unit. On a slow booter, crashes + last a few days longer, a rush repair still needs a day of booting, and + swapping the only router takes three days. Bigger chassis are slow more + often. A second router hides all of it. + +## [1.4.0] — 2026-10-23 + - Big peers have moods now. In some cities, large selective networks refuse new peering for a few months, or only take PNIs there, each with a reason ("the peering coordinator is on sabbatical", "a new VP wants to monetise @@ -17,16 +226,14 @@ All notable changes to this project are documented here. The project follows yours. Goggle, Faceplant, Comecast and several other selective networks refuse remote members outright. The route server still gets you every open network, and building a real POP removes all of this. -- Amsterdam has a second exchange: FRIES-IX, run by volunteers out of the - Science Park. Ports up to 400G are free, LAG members too. It has fewer - members than HAMS-IX (Drizzle, Akamaybe, Crowdflare, Slowly and Microsnoft), - and you can join either exchange or both. -- More cities got a second exchange, each with its own members and its own - price: Paella-NIX in Madrid, KleyWrecks in Frankfurt, LO-NAPS in London, - DE-KICKS New York, JINXED-IX in Johannesburg, IX Strayla in Sydney and - BB-Kicks in Tokyo. The community ones charge less for ports. -- New city: Barcelona, home of the Catnip-IX. Local networks find it - impossible to resist. +- DE-KICKS Group (Frankfurt, Madrid, Marseille, Dubai, Mumbai and New York) + really hates open pricing. There is no price list, only a personalised + quote that grows with how big you look. Haggling can get you a discount, + raise the price "after consulting with management", or stall for a week + behind an NDA. Prices are "harmonised" upwards once a year. Add-ons like + Route Server Gold and Premium Port LEDs appear on your invoice until you opt + out, which takes two clicks. Trying to leave gets you a retention discount + that ends with a loyalty fee. ## [1.3.0] — 2026-10-23 diff --git a/README.md b/README.md index 8dcada4..46104b1 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ site/ everything that is deployed robots.txt, sitemap.xml, llms.txt, 404.html, CNAME scripts/build.sh copies site/ to _site/ and stamps __VERSION__ / __BUILD_DATE__ tests/ node:test + jsdom -.github/workflows/ ci.yml (every push) and release.yml (Pages deploy) +.github/workflows/ ci.yml (pushes to main and PRs) and release.yml (Pages deploy) ``` ## Releasing @@ -65,13 +65,18 @@ Only published releases reach [seriesoftub.es](https://seriesoftub.es). Pushes t 3. Publish a GitHub release tagged `v`, e.g. `gh release create v1.1.0 --generate-notes`. The release workflow checks that the tag matches `package.json`, runs the tests, -builds, deploys to GitHub Pages and pings IndexNow. Pre-releases never deploy. +builds, deploys to GitHub Pages and pings IndexNow. It refuses to build when the +CHANGELOG has no `## []` section (rename `[Unreleased]` first). +Pre-releases never deploy, also not when run by hand, and a version older than +the live one is refused unless you tick `allow_older` (a deliberate rollback). To redeploy an existing release, run the workflow manually with its tag. ## Hosting setup GitHub Pages serves the site with **Source: GitHub Actions** and the custom domain -`seriesoftub.es`. DNS for the apex domain: +`seriesoftub.es`. Releases deploy from tags, so in **Settings → Environments → +github-pages → Deployment branches and tags**, add a tag rule for `v*` (by default +only the default branch may deploy). DNS for the apex domain: ``` seriesoftub.es. A 185.199.108.153 diff --git a/package-lock.json b/package-lock.json index 5567cab..d164dc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "seriesoftubes", - "version": "1.2.0", + "version": "1.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "seriesoftubes", - "version": "1.2.0", + "version": "1.10.0", "devDependencies": { "jsdom": "24.1.3" }, diff --git a/package.json b/package.json index 3f1ab18..bd88310 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "seriesoftubes", - "version": "1.3.0", + "version": "1.10.0", "description": "A cartoon browser game about building the internet.", "private": true, "homepage": "https://seriesoftub.es/", "repository": { "type": "git", "url": "git+https://github.com/fjaeckel/seriesoftubes.git" }, "scripts": { - "test": "node --test --test-concurrency=1 tests/game.test.js tests/build.test.js tests/persist.test.js tests/services.test.js tests/peering.test.js", + "test": "node --test --test-concurrency=1 tests/game.test.js tests/build.test.js tests/persist.test.js tests/services.test.js tests/peering.test.js tests/issues.test.js tests/regions.test.js tests/modes.test.js", "build": "bash scripts/build.sh", "serve": "npm run build && npx --yes serve@14.2.4 _site" }, diff --git a/scripts/build.sh b/scripts/build.sh index 15acf88..7f9f7d4 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,15 +1,22 @@ #!/usr/bin/env bash -# Builds the deployable site into _site/: copies site/ and stamps the version -# (from package.json) and the build date into the pages that carry them. +# Builds the deployable site into _site/ (or $OUT): copies site/ and stamps the +# version (from package.json) and the build date into the pages that carry them. +# Set REQUIRE_NOTES=1 to fail when CHANGELOG.md has no bullets for this version. set -euo pipefail cd "$(dirname "$0")/.." VERSION="${VERSION:-$(node -p "require('./package.json').version")}" BUILD_DATE="${BUILD_DATE:-$(date -u +%Y-%m-%d)}" +OUT="${OUT:-_site}" -rm -rf _site -cp -R site _site -for f in _site/index.html _site/sitemap.xml _site/llms.txt; do +if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+([-.+][0-9A-Za-z.-]+)?$ ]]; then + echo "error: VERSION '$VERSION' is not a semantic version" >&2 + exit 1 +fi + +rm -rf "$OUT" +cp -R site "$OUT" +for f in "$OUT/index.html" "$OUT/sitemap.xml" "$OUT/llms.txt"; do sed -i.bak -e "s/__VERSION__/${VERSION}/g" -e "s/__BUILD_DATE__/${BUILD_DATE}/g" "$f" rm -f "$f.bak" done @@ -17,15 +24,21 @@ done # Release notes for this version, baked into the page ("What's new") and # published as version.json so open games can spot a newer release. NOTES="$(node scripts/release-notes.js "$VERSION")" -node -e ' - const fs=require("fs"),[,v,d,notes]=process.argv; - const f="_site/index.html"; - fs.writeFileSync(f,fs.readFileSync(f,"utf8").replace("/*__RELEASE_NOTES__*/[]",notes)); - fs.writeFileSync("_site/version.json",JSON.stringify({version:v,date:d,notes:JSON.parse(notes)},null,2)+"\n"); -' "$VERSION" "$BUILD_DATE" "$NOTES" - -if grep -rl "__VERSION__\|__BUILD_DATE__" _site >/dev/null; then - echo "error: unreplaced placeholders left in _site" >&2 +if [ "${REQUIRE_NOTES:-}" = "1" ] && [ "$NOTES" = "[]" ]; then + echo "error: CHANGELOG.md has no '## [$VERSION]' section with bullets (still under [Unreleased]?)" >&2 exit 1 fi -echo "Built Series of Tubes ${VERSION} (${BUILD_DATE}) into _site/" +node -e ' + const fs=require("fs"),[,out,v,d,notes]=process.argv; + const f=out+"/index.html",ph="/*__RELEASE_NOTES__*/[]",html=fs.readFileSync(f,"utf8"); + if(!html.includes(ph)){console.error("error: release-notes placeholder missing from index.html");process.exit(1);} + // Function replacer: no $& / $$ expansion. Escape "<" so a note can never close the