Commit Graph

38 Commits

Author SHA1 Message Date
Chris Wilson ad4451276d
WebHost: Add `robots.txt` to WebHost (#3157)
* Add a `robots.txt` file to prevent crawlers from scraping the site

* Added `ASSET_RIGHTS` entry to config.yaml to control whether `/robots.txt` is served or not

* Always import robots.py, determine config in route function

* Finish writing a comment

* Remove unnecessary redundant import and config
2024-04-20 20:58:56 -04:00
black-sliver d471dcc067
Core, WebHost: lazy-load worlds in unpickler, WebHost and WebHostLib (#2156)
* Core: lazy-load worlds in unpickler

this should hopefully fix customserver's memory consumption

* WebHost: move imports around to save memory in MP

* MultiServer: prefer loading _speedups without pyximport

This saves ~15MB per MP and speeds up module import if it was built in-place.

* Tests: fix tests for changed WebHost imports

* CustomServer: run GC after setup

* CustomServer: cleanup exception handling
2023-09-20 16:05:56 +02:00
Fabian Dill 2b9e8fa273
WebHost: flask caching doesn't do lazy init anymore (#2155) 2023-09-09 05:02:05 +02:00
Remy Jette 354a182859
WebHost: Fix docs generation from a .apworld (#1862)
zfile.filename is the full path within the archive, so by default
zf.extract will maintain that directory structure when extracting.

This causes the docs to be placed in the wrong place, as the Javascript
code expects them to be placed directly in the game folder.
2023-07-05 23:36:46 +02:00
black-sliver 827444f5a4
Core: Add settings API ("auto settings") for host.yaml (#1871)
* Add settings API ("auto settings") for host.yaml

* settings: no BOM when saving

* settings: fix saving / groups resetting themselves

* settings: fix AutoWorldRegister import

Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>

* Lufia2: settings: clean up imports

* settings: more consistent class naming

* Docs: update world api for settings api refactor

* settings: fix access from World instance

* settings: update migration timeline

* Docs: Apply suggestions from code review

Co-authored-by: Zach Parks <zach@alliware.com>

* Settings: correctly resolve .exe in UserPath and LocalPath

---------

Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>
Co-authored-by: Zach Parks <zach@alliware.com>
2023-07-05 22:39:35 +02:00
Fabian Dill 7fdf38b2ad
WebHost: automatically fill PATCH_TARGET -> HOST_ADDRESS and re-use it for rooms (#1518) 2023-03-09 21:31:00 +01:00
Fabian Dill 94c6562f82 Tests: make sure DB overwrite actually takes 2023-01-02 20:23:00 +01:00
Fabian Dill bb46ee7fc1 WebHost: optimize imports 2022-10-17 01:24:02 +02:00
black-sliver fcfc2c2e10
WebHost: fix local_path on python 3.8 (#981)
* WebHost: fix local_path on python 3.8

`__file__` is relative in 3.8, so `os.path.dirname(__file__)` ends up being an empty string breaking calls to `local_path()` (without arguments)

* WebHost: add comment to local_path override
2022-08-31 00:10:18 +02:00
strotlog 4c94bb0ad5 WebHost: sort game list case-insensitively again 2022-08-26 18:20:37 +02:00
Fabian Dill a1aa9c17ff Core: convert is_zip to zip_path 2022-08-18 01:20:30 +02:00
Fabian Dill ca83905d9f
Core: allow loading worlds from zip modules (#747)
* Core: allow loading worlds from zip modules
RoR2: make it zipimport compatible (remove relative imports beyond local top-level)

* WebHost: add support for .apworld
2022-08-15 23:52:03 +02:00
Fabian Dill f2e83c37e9
WebHost: use title-typical sorting for game titles (#883) 2022-08-09 22:21:45 +02:00
Fabian Dill c1e9d0ab4f
WebHost: allow customserver to skip importing worlds subsystem for hosting a Room (#877)
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2022-08-07 18:28:50 +02:00
Chris Wilson 17ba73b0b8 Rename author to authors for consistency 2022-06-25 19:10:20 +02:00
alwaysintreble 3e86fd4e57
Tutorials: hide ArchipIDLE (#622)
* Don't copy files of hidden worlds

* tutorials: hardcode not generating ArchipIDLE tutorial files outside april

* tutorials: ignore hidden worlds unless it's 'Archipelago'

* add parenthesis to prevent ambiguity
2022-06-10 19:49:12 -04:00
Fabian Dill e47527087e
WebHost: some updates (#603)
* WebHost: Make custom server prefer ipv4 for display

* WebHost: Make server retry saving in case of connection issues

* WebHost: fix autolaunch guardians getting stuck waiting for the oldest two rooms.
Probably not related to the issues of the system itself getting stuck, but should be fixed anyway.

* WebHost: logfile is meant to be guarded by access cookie

* WebHost: set patch target to null if port is not valid, disabling auto-connect
2022-06-08 00:35:35 +02:00
alwaysintreble 977159e572
Webworld docs: move gameinfo documentation to their world folders and copy them for webhost use. (#455) 2022-05-11 20:05:53 +02:00
Fabian Dill 7fad0b0f51
Test: introduce test for every game has a tutorial (#478) 2022-05-03 22:14:03 +02:00
black-sliver 7d830362a7
Setup, Launcher, Linux Support (#359) 2022-03-31 05:08:15 +02:00
strotlog c471a70b35 Documentation: Fix order, title, and link to SMZ3 2022-03-31 04:57:52 +02:00
Fabian Dill 8b78477c69 WebHost: order guides by alphabet 2022-03-14 21:30:18 +01:00
Fabian Dill 3f20bdaaa2 WebHost: split autolaunch and autogen services 2021-12-13 05:48:33 +01:00
Fabian Dill 105a2d4e13 WebHost: make LttP sprites optional 2021-09-07 00:42:02 +02:00
Fabian Dill 78f565c706 renamed /hosted/ to /room/
remove no longer used options
allow loading of json data files from webhost when it gets run by gunicorn and similar
2021-07-24 14:08:45 +02:00
Fabian Dill 34ff5d9662 create options files on WebHost startup 2021-07-22 18:21:31 +02:00
Fabian Dill b53c5593a8 Automate dumpSprites.py - and then remove it 2021-07-20 18:23:06 +02:00
Fabian Dill c095c28618 Split requirements into world types, automatically discover and resolve them. 2021-06-06 15:30:20 +02:00
Fabian Dill cae1188ff8 Allow ModuleUpdate to use multiple requirements files, no longer need to care about naming, and use conventional requirement parsing. Also add WebHost to it. 2021-06-06 15:11:17 +02:00
Fabian Dill d35adc5868 Update Flask and Jinja
Flask Autoversion is now integrated
Flask config.from_file is now integrated
2021-05-13 00:28:53 +02:00
Berserker66 cdee9e5a3a WebHost: Move module into WebHostLib to prevent shadowing WebHost.py 2020-07-11 16:59:37 +02:00
Fabian Dill d190fe65c6 webhost update 2020-07-10 17:42:22 +02:00
Berserker66 e6fec46265 move PORT and DEBUG into WebHost config 2020-07-10 15:32:58 +02:00
Fabian Dill dacecc4637 optimize tracker, using more RAM, less CPU 2020-06-28 09:28:13 +02:00
Fabian Dill 74cbfe07a3 fix tracker auto update 2020-06-27 18:17:36 +02:00
Fabian Dill 647c802b2f after some testing, introduce multithreading 2020-06-24 08:34:53 +02:00
Fabian Dill 53d3b4eb38 fine tune tracker 2020-06-23 05:46:32 +02:00
Fabian Dill 9e18c6f1cd Database-backed Webhosting 2020-06-20 20:03:06 +02:00