Giter VIP home page Giter VIP logo

guweb's Introduction

Table of Contents

What is guweb?

guweb is the front-facing appearance of the osu! server protocol, gulag! Using native async/await syntax written on top of Quart and cmyui's multipurpose library, guweb achieves flexability, cleanliness, and efficiency not seen in other frontend implementations - all while maintaining the simplicity of Python.

Requirements

  • Some know-how with Linux (tested on Ubuntu 18.04), Python, and general-programming knowledge.
  • MySQL
  • NGINX

Setup

Setup is relatively simple - these commands should set you right up.

Notes:

  • Ubuntu 20.04 is known to have issues with NGINX and osu! for unknown reasons?
  • If you have any difficulties setting up guweb, feel free to join the Discord server at the top of the README, we now have a bit of a community!
# Install Python >=3.9 and latest version of PIP.
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9 python3.9-dev python3.9-distutils
wget https://bootstrap.pypa.io/get-pip.py
python3.9 get-pip.py && rm get-pip.py

# Install MySQL and NGINX.
sudo apt install mysql-server nginx

# Clone guweb from GitHub.
git clone https://github.com/varkaria/guweb.git
cd guweb

# Initialize and update the submodules.
git submodule init && git submodule update

# Install requirements from pip.
python3.9 -m pip install -r ext/requirements.txt

# Add and configure guweb's NGINX config to your nginx/sites-enabled.
sudo ln -r -s ext/nginx.conf /etc/nginx/sites-enabled/guweb.conf
sudo nano ext/nginx.conf
sudo nginx -s reload

# Configure guweb.
cp ext/config.sample.py config.py
nano config.py

# Run guweb (on port 8000).
python3.9 main.py # Run directly to access debug features for development!
hypercorn main.py # Please run guweb with hypercorn when in production! It will improve performance drastically by disabling all of the debug features a developer would need!

Directory Structure

.
โ”œโ”€โ”€ blueprints   # Modular routes such as the API, Frontend, or Admin Panel.
โ”œโ”€โ”€ docs         # Markdown files used in guweb's documentation system.
โ”œโ”€โ”€ ext          # External files from guweb's primary operation.
โ”œโ”€โ”€ objects      # Code for representing privileges, global objects, and more.
โ”œโ”€โ”€ static       # Code or content that is not modified or processed by guweb itself.
โ”œโ”€โ”€ templates    # HTML that contains content that is rendered after the page has loaded.
    โ”œโ”€โ”€ admin    # Templated content for the admin panel (/admin).
    โ”œโ”€โ”€ settings # Templated content for settings (/settings).
    โ”” ...         # Templated content for all of guweb (/).

The team

  • Yoru | Backend, Grammar Checking [Deprecated]
  • Varkaria | Frontend, Backend?

The End

Well know that you know everything, why not check out the original code guweb was based off of in this i think i should continue this work to finish work?

guweb's People

Contributors

7ez avatar alowave223 avatar arily avatar cdwcgt avatar cmyui avatar def750 avatar f11y11 avatar g1-1-1 avatar gamerboy80 avatar jkbgl avatar ledlamp avatar lenforiee avatar minisbett avatar tsunyoku avatar varkaria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

guweb's Issues

"Field 'mode' doesn't have a default value" when register

When register and it said InternalError (1364, "Field 'mode' doesn't have a default value")

To reproduce
Steps to reproduce the behavior:

  1. Go to 'register'
  2. Fill form
  3. Click 'register'
  4. See error

Expected behavior
complete registration

Screenshots
image
image

Environment (please complete the following information):

  • OS: Windows 11 Build 22483.1011
  • Gulag running on WSL2 (Ubuntu)
  • MySQL 8.0.26
[2021-10-24 12:30:49,249] ERROR in app: Exception on request POST /register
Traceback (most recent call last):
  File "C:\Python39\lib\site-packages\quart\app.py", line 1807, in handle_request
    return await self.full_dispatch_request(request_context)
  File "C:\Python39\lib\site-packages\quart\app.py", line 1829, in full_dispatch_request
    result = await self.handle_user_exception(error)
  File "C:\Python39\lib\site-packages\quart\app.py", line 1074, in handle_user_exception
    raise error
  File "C:\Python39\lib\site-packages\quart\app.py", line 1827, in full_dispatch_request
    result = await self.dispatch_request(request_context)
  File "C:\Python39\lib\site-packages\quart\app.py", line 1875, in dispatch_request
    return await handler(**request_.view_args)
  File "Z:\Github\gulag-web\blueprints\frontend.py", line 475, in register_post
    await glob.db.execute(
  File "C:\Python39\lib\site-packages\cmyui\mysql.py", line 48, in execute
    await cur.execute(query, params)
  File "C:\Python39\lib\site-packages\aiomysql\cursors.py", line 239, in execute
    await self._query(query)
  File "C:\Python39\lib\site-packages\aiomysql\cursors.py", line 457, in _query
    await conn.query(q)
  File "C:\Python39\lib\site-packages\aiomysql\connection.py", line 428, in query
    await self._read_query_result(unbuffered=unbuffered)
  File "C:\Python39\lib\site-packages\aiomysql\connection.py", line 622, in _read_query_result
    await result.read()
  File "C:\Python39\lib\site-packages\aiomysql\connection.py", line 1105, in read
    first_packet = await self.connection._read_packet()
  File "C:\Python39\lib\site-packages\aiomysql\connection.py", line 593, in _read_packet
    packet.check_error()
  File "C:\Python39\lib\site-packages\pymysql\protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "C:\Python39\lib\site-packages\pymysql\err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.InternalError: (1364, "Field 'mode' doesn't have a default value")

Cannot change contents in the static folder

Describe the bug
When I try to change files on the static folder, the files I change won't take effect.

To reproduce
Steps to reproduce the behavior:

  1. Go to folder "static"
  2. For example, change the mascot from "css/pages/home.css"
  3. Restart server
  4. Clear browser cache, try different network, try different device but it wont change
  5. Try the same for mascot images
  6. Won't work
  7. Changing through styling from the template HTMLs, works in that case

Additional context
When new files are added, they are still visible

upon executing 'python3.9 main.py

upon executing 'python3.9 main.py' i get this, any fix?

  • Serving Quart app 'main'
  • Debug mode: False
  • Please use an ASGI server (e.g. Hypercorn) directly in production
  • Running on http://127.0.0.1:8000 (CTRL + C to quit)
    [2024-03-23 13:01:33,429] ERROR in app: Exception
    Traceback (most recent call last):
    File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 1671, in startup
    await self.ensure_async(func)()
    File "/home/kiyo/osu-nuts/guweb/main.py", line 31, in mysql_conn
    await glob.db.connect(glob.config.mysql) # type: ignore
    File "/usr/local/lib/python3.9/dist-packages/cmyui/mysql.py", line 37, in connect
    self.pool = await aiomysql.create_pool(**config, autocommit=True)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/pool.py", line 29, in _create_pool
    await pool._fill_free_pool(False)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/pool.py", line 182, in _fill_free_pool
    conn = await connect(echo=self._echo, loop=self._loop,
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 75, in _connect
    await conn._connect()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 540, in _connect
    await self._request_authentication()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 855, in _request_authentication
    await self._process_auth(plugin_name, auth_packet)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 907, in _process_auth
    pkt = await self._read_packet()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 652, in _read_packet
    packet.raise_for_error()
    File "/usr/local/lib/python3.9/dist-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
    File "/usr/local/lib/python3.9/dist-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
    pymysql.err.OperationalError: (1045, "Access denied for user 'kiyo'@'localhost' (using password: YES)")
    Traceback (most recent call last):
    File "/usr/local/lib/python3.9/dist-packages/quart/asgi.py", line 320, in call
    await self.app.startup()
    File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 1671, in startup
    await self.ensure_async(func)()
    File "/home/kiyo/osu-nuts/guweb/main.py", line 31, in mysql_conn
    await glob.db.connect(glob.config.mysql) # type: ignore
    File "/usr/local/lib/python3.9/dist-packages/cmyui/mysql.py", line 37, in connect
    self.pool = await aiomysql.create_pool(**config, autocommit=True)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/pool.py", line 29, in _create_pool
    await pool._fill_free_pool(False)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/pool.py", line 182, in _fill_free_pool
    conn = await connect(echo=self._echo, loop=self._loop,
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 75, in _connect
    await conn._connect()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 540, in _connect
    await self._request_authentication()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 855, in _request_authentication
    await self._process_auth(plugin_name, auth_packet)
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 907, in _process_auth
    pkt = await self._read_packet()
    File "/usr/local/lib/python3.9/dist-packages/aiomysql/connection.py", line 652, in _read_packet
    packet.raise_for_error()
    File "/usr/local/lib/python3.9/dist-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
    File "/usr/local/lib/python3.9/dist-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
    pymysql.err.OperationalError: (1045, "Access denied for user 'kiyo'@'localhost' (using password: YES)")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/kiyo/osu-nuts/guweb/main.py", line 74, in
app.run(port=8000, debug=glob.config.debug) # blocking call
File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 850, in run
loop.run_until_complete(asyncio.gather(*tasks))
File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/usr/local/lib/python3.9/dist-packages/hypercorn/asyncio/init.py", line 44, in serve
await worker_serve(
File "/usr/local/lib/python3.9/dist-packages/hypercorn/asyncio/run.py", line 87, in worker_serve
raise exception
File "/usr/local/lib/python3.9/dist-packages/hypercorn/asyncio/lifespan.py", line 43, in handle_lifespan
await self.app(
File "/usr/local/lib/python3.9/dist-packages/hypercorn/app_wrappers.py", line 34, in call
await self.app(scope, receive, send)
File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 1638, in call
await self.asgi_app(scope, receive, send)
File "/usr/local/lib/python3.9/dist-packages/quart/app.py", line 1664, in asgi_app
await asgi_handler(receive, send)
File "/usr/local/lib/python3.9/dist-packages/quart/asgi.py", line 322, in call
await send(
File "/usr/local/lib/python3.9/dist-packages/hypercorn/asyncio/lifespan.py", line 101, in asgi_send
raise LifespanFailureError("startup", message.get("message", ""))
hypercorn.utils.LifespanFailureError: Lifespan failure in startup. '(1045, "Access denied for user 'kiyo'@'localhost' (using password: YES)")'

hypercorn not working properly

It runs but it runs as if running main.py directly.

Then if i ctrl C, it restarts with hypercorn.

ctrl C again makes it exit.

Leaderboard and scores on profiles not working

leaderboard not working

i get only "there are no players to display!" even if scores is showing in osu

this is what i see on site
image

and this is what i see in osu
image

Profile stats not working

*this is what i see on player profile
image

Note: on admin page Recent scores works

image

little info

bancho.py version: 4.3.2
guweb version: 1.30

doesnt load any webpages

the error prompt

[2023-10-05 09:59:29 +0200] [18169] [INFO] Running on http://127.0.0.1:8000 (CTRL + C to quit)
[2023-10-05 09:59:34,250] ERROR in app: Exception on request GET /
Traceback (most recent call last):
File "/home/magsec/.local/lib/python3.9/site-packages/quart/app.py", line 1358, in handle_request
return await self.full_dispatch_request(request_context)
File "/home/magsec/.local/lib/python3.9/site-packages/quart/app.py", line 1396, in full_dispatch_request
result = await self.handle_user_exception(error)
File "/home/magsec/.local/lib/python3.9/site-packages/quart/app.py", line 999, in handle_user_exception
raise error
File "/home/magsec/.local/lib/python3.9/site-packages/quart/app.py", line 1394, in full_dispatch_request
result = await self.dispatch_request(request_context)
File "/home/magsec/.local/lib/python3.9/site-packages/quart/app.py", line 1488, in dispatch_request
return await self.ensure_async(handler)(**request_.view_args)
File "/home/magsec/guweb/blueprints/frontend.py", line 45, in home
return await render_template('home.html')
File "/home/magsec/.local/lib/python3.9/site-packages/quart/templating.py", line 46, in render_template
template = current_app.jinja_env.get_or_select_template(template_name_or_list) # type: ignore
File "/home/magsec/.local/lib/python3.9/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
return self.get_template(template_name_or_list, parent, globals)
File "/home/magsec/.local/lib/python3.9/site-packages/jinja2/environment.py", line 1010, in get_template
return self._load_template(name, globals)
File "/home/magsec/.local/lib/python3.9/site-packages/jinja2/environment.py", line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
File "/home/magsec/.local/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
source, filename, uptodate = self.get_source(environment, name)
File "/home/magsec/.local/lib/python3.9/site-packages/flask/templating.py", line 63, in get_source
if self.app.config["EXPLAIN_TEMPLATE_LOADING"]:
KeyError: 'EXPLAIN_TEMPLATE_LOADING'

Captcha not working

When attempting to register after successful captcha completion the register page will show that the captcha has been failed

Development branch not working

Whenever i use the development branch both the leaderboards and profiles are completely blank with no errors in console.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.