-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
website alternative? #157
Comments
Not that I'm aware of. |
I'm looking at possibly using Brython to deploy a GitHub pages (or some other static site host) version of mcstatus. This would alleviate the need for running a server as a backend by running Python code directly in the web browser of the visitor. The issue is that not all Python code is supported, such as asyncio. Instead, there are other built-in async functions that are mostly identical, so this may be tricky to do. The cost of running a backend server and the time involved to set one up in a serverless environment has deterred me thus far, so Brython seems promising and therefore possibly worth the effort. No ETA on when I'll have something working, but I am tinkering with this. |
Maybe close this? There are CLI part and interpreter interactive session for investigating API. |
A handful of people believe Dinnerbone used this repo to deploy his website. While this confusion might be less likely to happen now that mcstatus is in an organization, I would still like to leave it open for this reason and ... I still see deploying to a web browser as convenient for some users. Imagine installing Python is a barrier for some and being on mobile would make using mcstatus tricky too. It is low-priority work, because I am waiting for something that supports async Python (or an expert on porting Python to web to swoop in and do it). Web assembly keeps gaining traction, and someone could make a Python interpreter or compiler that supports mcstatus someday. |
Actually, WA interpreter for python is already a thing, because of RustPyhon. It's a python compiler written in rust, and rust can be compiled into web assembly. It's a pretty cool project, but it's still in beta: https://github.com/RustPython/RustPython For now, it certainly not work with our codebase, as from my testing, even basic asyncio or sockets didn't seem to work, as some of the standard library tooling that requires implementation specific logic just isn't there yet. But that's to be expected considering the WIP status of this project, however it could be something to keep an eye on and once more language features are actually supported, this might just be the way to go about this. They do have a demo version where the compiler is already running in WA hosted on their github pages: https://rustpython.github.io/demo/ |
Can we just write some API in FastAPI (or any another framework) and then frontend for it? Like alternative for https://mcstatus.io and https://mcsrvstat.us? |
We absolutely could, but I'm pretty sure we can't host that on GitHub pages. We'd need something else and I'm not sure how willing we are to invest into a VPS just for mcstatus. The alternative would be to use some of the free hosting services, which have their own issues, but it would certainly be doable. |
Well, VPS is not so expensive. I have 3 VPSes for ~$1.4 each of them (1 shared vCPU core, 8gb RAM and 20gb SSD). They are excellent for their price. Although, if we will have many people that want to use us, it would be much more expensive to host. But why just not just buy more VPSes instead of better ones?) |
I'm aware of the prices, that's not the biggest issue. The much bigger concern that I have is the other annoyances that come with this. Things like managing the VPS long term, keeping things secure and up to date, but also the fact that a VPS like this would ideally need to be shared between all maintainers, and it's just quite a fair bit of work to set everything up and keeping it working. I would honestly much rather see a 3rd party site be created that uses mcstatus under the hood, which we could maybe even link to from here. I was actually considering making such site myself a while ago, but I never got to it. If this 3rd party site would then get popular enough, it could even move under the py-mine org's umbrella. As to handling this from this repository, the best possibility I see is to go with github pages, but those don't allow running full backend servers like fastAPI (afaik). This is why we were talking about WebAssembly based version, which could actually run the python code itself in the browser, making it easy enough to maintain for us directly from here. |
I have just checked RustPython with our project in default GitHub codespace. The curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
# from https://rustpython.github.io/blog/2021/01/26/pip-support.html
cargo install --git https://github.com/RustPython/RustPython --features ssl
curl https://bootstrap.pypa.io/get-pip.py -O
rustpython get-pip.py
rustpython -m pip install mcstatus And the output of the try:
So the import crashes because of unimplemented PEP 567, they have an issue for this - RustPython/RustPython#3188. So looks like this issue is blocked by it. P.S. I found, that FastAPI's sponsor Deta.cloud proposes free hosting for FastAPI (and not only) applications, also Vercel can propose free hosting for frontend. This frees us from spending any money and additional efforts on managing all the things, so we need to spend time only on writing code. Although, if there will be many users, we possibly need to use some CDN to cache answers (CloudFlare free plan?). As backend is a task for a few minutes (dataclasses, that were introduced in #306, can be easily transformed to JSON by This, of course, will not give an interactive shell, but would be a much more stable decision, as RustPython is still in beta, and looks like, it will be there for a long time. |
Frontend static hosting is not a concern of mine. GitHub pages and many other free hosts can fit that. My trepidations are for running a backend. I don't want to maintain, secure, or deal with setting up a backend. While I know how to do all those things, they all cost both time and money to do them well and right. So, I would prefer a Python runtime that could embed into the user's web browser to run the code. |
So I wrote simple backend in FastAPI and deployed it to Deta in half a hour. Although this all needs to be automaticated (to deploy, you need to write |
Oops, their apps are private by default, I have made it public now. |
Reiterating this stuff is not complicated, I still do not want to be on the hook for maintaining, securing, and hosting it. Those backends have to receive regular updates in order to select newer versions of Python when security fixes are released. Going to have to enable CORS on the API to handle another domain referencing it in the web browser. And whatever else I'm forgetting from the last time I deployed a serverless application that had a split backend/frontend. |
Well, while you do not like to maintain this, I can. It's not necessarily that we all will maintain this all. I still see backend as a few files of code, which in most, are just models for not returning redundant data and wrapping mcstatus itself. If someone wants to write frontend - we can start it right now (although it would be great to hear ItsDrike's mind too). |
I fully agree with Kevin on this, I brought up sinilar concerns that Kevin mentioned in my earlier message too. I'm aware that making the API or even a full website wouldn't be particularly hard, but this repository isn't the place for such a website. The only acceptable solution when it comes to websites that I see is the static approach, with github pages. Not to mention that setting up and maintaining a server, while not that difficult either is simply not something I want to have to think about as one of the responsibilities of mcstatus maintainers. As for external projects, obviously, you can do anything you like. And I fully encourage you to, working with FastAPI, or something like Sanic or perhaps Flask can be fun, and if you feel like it, you can certainly go ahead with it. If the project gets to some meaningful state, we might even mention it in the readme, and it can perhaps be transferred under the py-mine organization eventually. All that said, again, as an issue opened on this repo, being about adding a website for mcstatus here, I don't see that happening with any active backends. |
I know that the license allows me almost everything (even this), but I do not know frontend and I do not plan to learn it soon. So if some frontend dev is interested in this, they can email or DM me in Discord (you will find the links on my site). |
so i see that dinnerbone's page is down because of a recapatcha issue. is anyone hosting a mirror or alternative web page?
The text was updated successfully, but these errors were encountered: