Commit Graph

1133 Commits

Author SHA1 Message Date
Uriel 2725720406 reformat file and change create_random_port_socket test 2026-03-08 07:01:29 -03:00
Uriel 10d2908339 add tests 2026-03-08 06:32:22 -03:00
Uriel 9653c8d29c simplify tuple conversion check 2026-03-07 22:50:04 -03:00
Uriel 62afec9733 Update WebHostLib/customserver.py
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2026-03-07 22:24:13 -03:00
Uriel 62f56e165a add return type to weighted random 2026-03-07 18:10:44 -03:00
Uriel eebd83df76 fix while loop 2026-03-07 17:48:21 -03:00
Uriel 33f03387c4 this should check all usable ports before failing 2026-03-07 17:37:50 -03:00
Uriel 779dd46658 do it the duck way 2026-03-07 17:26:54 -03:00
Uriel 4ea7fbbcba only use ranges 2026-03-07 17:18:03 -03:00
Uriel 9ab7c56791 use a named tuple on parse_game_ports 2026-03-07 17:13:50 -03:00
Uriel e2823aa044 Apply suggestions from code review
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
2026-03-07 16:52:57 -03:00
Uriel 368eafae86 fix random choices and move game_port conversion into tuple 2026-03-07 16:30:20 -03:00
Uriel 6779b4fcf3 fix last_used_ports not being updated locally 2026-03-07 15:09:53 -03:00
Uriel 6a94a9e6ca change game_ports to be tuple 2026-03-07 15:02:08 -03:00
Uriel c290386950 lazy init get_used_ports 2026-03-07 14:59:33 -03:00
Uriel 60773ddf83 rename variables and functions 2026-03-07 14:43:06 -03:00
Uriel 980a229aaa fix net_connections not working on macOS 2026-03-05 19:07:44 -03:00
Uriel f03d1cad3e use weights for random port and remove more-itertools 2026-03-05 17:01:08 -03:00
Uriel 551dbf44f6 fix some reviews 2026-03-05 16:03:29 -03:00
Uriel 61f893437a Apply suggestions from code review
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
2026-03-05 15:51:09 -03:00
Uriel 08a6ee2b3a fix port randomizer 2026-03-05 11:15:33 -03:00
Uriel b0615590fc add used ports cache and filter used ports when looking for ports 2026-03-05 10:34:33 -03:00
Uriel 0a0faefab2 reuse sockets with websockets api instead of opening and closing them 2026-03-05 09:53:23 -03:00
Uriel d6473fa0ed fix value type bug on ephemeral type 2026-03-05 08:42:09 -03:00
Uriel f8b730308d use yaml lists instead of string for config 2026-03-05 08:35:51 -03:00
Uriel 8800124c4e try fixing test with try 2026-03-05 08:08:45 -03:00
Uriel 88dc83e557 remove unused argument 2026-03-05 07:47:32 -03:00
Uriel ed77f58f13 fix what reviewers said and add some improvements 2026-03-05 07:42:33 -03:00
Uriel 9b098d6f6a Merge branch 'main' into custom-port-range 2026-03-05 05:16:44 -03:00
DrAwesome4333 699ca8adf6 WebHost: Add CORS headers to API Endpoints (#5777) 2026-02-25 02:47:54 +01:00
Fabian Dill d83da1b818 WebHost: memory leak fixes (#5966) 2026-02-22 21:22:22 +01:00
josephwhite f2a6a769b0 Webhost: Fix defaults for NamedRange and TextChoice (#5139) 2026-02-15 17:46:40 +01:00
black-sliver 9b421450b1 Doc: WebHost: update readme and style guide (#4853)
* Doc: WebHost living standard

* Docs: update style guide for HTML, CSS and JS

* Unblame phar

* Too many words

* The better choice

* More rules

* Removed too much

* Docs: add recommendations for script defer and async
2026-01-28 20:57:12 +01:00
black-sliver 8dee460397 customserver: don't set last_activity that will be overwritten later (#5844) 2026-01-17 13:46:20 +01:00
Remy Jette cda54e0bea WebHost: Fix world sorting in /tutorial/ (#5785) 2026-01-15 22:21:44 +01:00
Fabian Dill 01e1e1fe11 WebHost: increase form upload limit (#5756) 2025-12-17 19:12:10 +01:00
Fabian Dill 4a0a65d604 WebHost: add played game to static tracker (#5731) 2025-12-09 00:45:02 +01:00
Duck 0905e3ce32 WebHost/Game Guides: Change links to stay on current instance (#5699)
* Remove absolute links to archipelago.gg

* Fix other link issues
2025-12-02 00:40:05 +01:00
Colin 886cc68051 Timespinner: Exclude Removed Location from Web Tracker (#5701) 2025-11-29 19:13:43 +01:00
Ziktofel e60ea1765c SC2: Migrate external resources from user repos to sc2 organization (#5653) 2025-11-24 20:29:41 +01:00
josephwhite 24aa4af7c2 WebHost: Validation for webworld themes (#5083) 2025-11-15 16:55:13 +01:00
Phaneros 93d3d8b084 SC2: Fixing a gap in the ascendant upgrades in the tracker (#5570) 2025-11-15 02:12:51 +01:00
Ziktofel bec625621a SC2 Tracker: Fix bundled Protoss W/A upgrade display (#5612) 2025-11-09 22:45:55 +01:00
NewSoupVi 4b0306102d WebHost: Pin Flask-Compress to 1.18 for all versions of Python (#5590)
* WebHost: Pin Flask-Compress to 1.18 for all versions of Python

* oop
2025-10-26 11:40:21 +01:00
black-sliver 8837e617e4 WebHost, Multiple Worlds: fix images not showing in guides (#5576)
* Multiple: resize FR RA network commands screenshot

This is now more in line with the text (and the english version).

* Multiple: optimize EN RA network commands screenshot

The URL has changed, so it's a good time to optimize.

* WebHost, Worlds: fix retroarch images not showing

Implements a src/url replacement for relative paths.
Moves the RA screenshots to worlds/generic since they are shared.
Also now uses the FR version in ffmq.
Also fixes the formatting that resultet in the list breaking.
Also moves imports in render_markdown.

Guides now also properly render on Github.

* Factorio: optimize screenshots

The URL has changed, so it's a good time to optimize.

* Factorio: change guide screenshots to use relative URL

* Test: markdown: fix tests on Windows

We also can't use delete=True, delete_on_close=False
because that's not supported in Py3.11.

* Test: markdown: fix typo

I hope that's it now. *sigh*

* Landstalker: fix doc images not showing

Change to relative img urls.

* Landstalker: optimize doc PNGs

The URL has changed, so it's a good time to optimize.
2025-10-25 22:19:38 +02:00
black-sliver 6b91ffecf1 WebHost: add missing docutils requirement ... (#5583)
... and update it to latest.
This is being used in WebHostLib.options directly.
A recent change bumped our required version, so this is actually a fix.
2025-10-24 00:55:10 +02:00
NewSoupVi 7cd73e2710 WebHost: Fix generate argparse with --config-override + add autogen unit tests so we can test that (#5541)
* Fix webhost argparse with extra args

* accidentally added line

* WebHost: fix some typing

B64 url conversion is used in test/hosting,
so it felt appropriate to include this here.

* Test: Hosting: also test autogen

* Test: Hosting: simplify stop_* and leave a note about Windows compat

* Test: Hosting: fix formatting error

* Test: Hosting: add limitted Windows support

There are actually some differences with MP on Windows
that make it impossible to run this in CI.

---------

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2025-10-20 17:40:32 +02:00
NewSoupVi 708df4d1e2 WebHost: Fix flask-compress to 1.18 for Python 3.11 (to get CI to pass again) (#5573)
From Discord:

Well, flask-compress updated and now our 3.11 CI is failing

Why? They switched to a lib called backports.zstd
And 3.11 pkg_resources can't handle that.

pip finds it. But in our ModuleUpdate.py, we first pkg_resources.require packages, and this fails. I can't reproduce this locally yet, but in CI, it seems like even though backports.zstd is installed, it still fails on it and prompts installing it over and over in every unit test
Now what do we do :KEKW:
Black Sliver suggested pinning flask-compress for 3.11
But I would just like to point out that this means we can't unpin it until we drop 3.11
the real thing is we probably need to move away from pkg_resources? lol 
since it's been deprecated literally since the oldest version we support
2025-10-20 17:06:07 +02:00
black-sliver 914a534a3b WebHost: fix gen timeout/exception resource handling (#5540)
* WebHost: reset Generator proc title on error

* WebHost: fix shutting down autogen

This is still not perfect but solves some of the issues.

* WebHost: properly propagate JOB_TIME

* WebHost: handle autogen shutdown
2025-10-20 09:16:29 +02:00
Nicholas Saylor 00acfe63d4 WebHost: Update publish_parts parameters (#5544)
old name is deprecated and new name allows both writer instance or alias/name.
2025-10-19 03:40:25 +02:00