Coder Social home page Coder Social logo

goonstation / api Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 5.84 MB

Goonhub API v2 (and Goonhub)

Home Page: https://goonhub.com

PHP 53.94% Dockerfile 1.29% Shell 0.17% JavaScript 2.24% SCSS 0.53% Vue 40.67% Blade 1.06% CSS 0.11%
api laravel php ss13 goonstation

api's Introduction

Goonhub

Development

Uses docker via Laravel Sail. https://laravel.com/docs/11.x/installation#laravel-and-docker

On Windows, I highly suggest doing all development on WSL 2, using VSCode with the remote development extension.

Automatically generated docs will be available at http://localhost/docs/api, and the Laravel development assistance thing will be at http://localhost/telescope.

Initial setup

  • Navigate to your project root
  • Create a shared docker network:
docker network create sail
  • Install dependencies:
docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/var/www/html" \
    -w /var/www/html \
    laravelsail/php83-composer:latest \
    composer install --ignore-platform-reqs
  • Prepare your environment:
echo -e "\nalias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'" >> ~/.bashrc
source ~/.bashrc
  • Bootstrap your application:

    This might take a while as it builds the docker containers.

sail up -d
sail artisan initial-setup

The above will initialize the database, guide you through creating a user, and then guide you through creating an API token.

  • Start the frontend
sail npm i
sail npm run dev

The above will install the frontend packages and start the dev server, allowing you to access the web UI at http://localhost.

Limitations

There are some external services that the API relies on that are not yet public/integrated. As such, the following features are unavailable during development:

  • Any communication with game servers
  • Map switches
  • VPN checking (unless you configure with your own IPQualityScore credentials)

api's People

Contributors

tarmunora avatar tealseer avatar wirewraith avatar zewaka avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

api's Issues

Detecting of round end is wonky.

https://goonhub.com/admin/logs?sort_by=ended_at

image

Currently an entire page (and one extra row) of "Round in progress" rounds.

Examining one of those rounds shows "In Progress" in the top right, even though it isn't.

I would expect to see only rounds that are actually in progress show as in progress. I would imagine this is to do with how round end is determined, and possibly coincides with hard restarts.

setup instructions broke

  1. needs a docker network create sail
  2. fails at artisan migrate:
beluga@beluga:~/repos/goonstation/api$ ./vendor/bin/sail artisan migrate
WARN[0000] /home/beluga/repos/goonstation/api/docker-compose.yml: `version` is obsolete 
WARN[0000] /home/beluga/repos/goonstation/api/docker-compose.yml: `version` is obsolete 

   Illuminate\Database\QueryException 

  SQLSTATE[08006] [7] connection to server at "pgsql" (172.18.0.2), port 5432 failed: FATAL:  password authentication failed for user "sail" (Connection: pgsql, SQL: select c.relname as name, n.nspname as schema, pg_total_relation_size(c.oid) as size, obj_description(c.oid, 'pg_class') as comment from pg_class c, pg_namespace n where c.relkind in ('r', 'p') and n.oid = c.relnamespace and n.nspname not in ('pg_catalog', 'information_schema') order by c.relname)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:813
    809▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    810▕                 );
    811▕             }
    812▕ 
  ➜ 813▕             throw new QueryException(
    814▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    815▕             );
    816▕         }
    817▕     }

      +37 vendor frames 

  38  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

Goonhub Ban Page FQ: Dates

Right now you just don't know when a ban was applied. Pretty basic lacking feature, no idea how this got through testing.

Can't edit additional connection details

Under the old system each evasion attempt was considered its own separate ban that could be edited, but currently you can only delete an entire row of connection details.

Goonhub Terminal FQ: Obsfucation

It's pretty laughable just looking at F12 currently.
image

Especially seeing how i can just go to https://goonhub.com/build/assets/evidentaj-5653443d.js

image

https://github.com/getkey/rollup-plugin-obfuscator would probably work for the JS, but the filesystem is defined in JSON so unsure on ordering there - if it's obsfucated after the JSON is inlined or not.

Of course, the source is in this repo, but it might not necessarily be if we decide to add to the terminal in the future.

API FQ: API Method Categories

Part of the 'Let players make some API calls' series.

We need a way to categorize API calls into certain categories. This will let us differentiate between calls that are 'server-only, 'admin-only', and 'publicly-callable'. Perhaps more categories exist but I cannot think of them.

Log filtering can't handle ckeys with spaces

Trying to filter a round log view by a ckey containing spaces will fail unless you include the spaces. The old log viewer handles this, and most of our admin tools show the ckey without spaces for copy-pasting purposes.

Unable to delete player saves/data that have trailing spaces in the name/key field

Some records have trailing spaces in the name/key field for player saves/data. When deleting records, the backend presumably trims spaces before performing the lookup on the database, resulting in an inability to find the offending records.

  • Identify whether it is possible to create records with trailing spaces, or if the offending records are only from old migrated data.
  • Either adjust the controller routes to avoid trimming spaces, or modify all records that have a trailing space.

Map images are uncompressed

The map images on goonhub appear to be using raw uncompressed screencaps leading to longer load times

Previously map images were compressed via pngquant to reduce file sizes and improve load times for slower connections

FQ: Medals v2

Desire: Replace the BYOND medal system entirely, since it's pretty dogshit.

  • Mass-import existing medals slowly (we can slowly do this via an ingestion route we run for a month or two before releasing this feature, then on-demand when no medals and rounds played)
  • Make a whole page for listing them out
  • Per-player medal unlock page list
  • Perhaps handle some logic like requiring another medal before unlocking one
  • Support: Icon, Name, Description, Hidden

I think we should break with byond and make hidden medals not visible anywhere until you have them, then you can see them.

Add player save data to Player page for admins

Let us see what data a player has in their cloudsave, for a combination of administrative reasons and debugging reasons.

Obvious additional layer:

Let us see what data a player has in their server-specific saves.

The save data would probably easiest best presented as a serialized JSON string, with some optional pretty-printing.

Goonhub FQ: User PATs

Part of the 'Let players make some API calls' series.

This feature entails letting users create PATs that are associated to their user account, nothing more.
Usage not included in this story.
This would probably be a copy of the existing page to do it, available from or on the user page.

Goooonhub Logs FQ: error.log summary

I would like to see a summary over the past [TIMEFRAME] of error.log entries

Like, we got:

This runtime has occurred 246 times.

File _component.dm 
Line 370 
Error undefined proc or verb /datum/component/complexsignal/outermost_movable/().  
Usr Abraham Kadel the Radio Show Host (varshie) 

 Description
proc name:  SendSignal (/datum/proc/_SendSignal)
  source file: _component.dm,370

so kinda like a list of the different Error lines with a number counter, and then within on a page or a modal have the description and such is what i'm thinking

This will allow us to track error.logs that occur often more easily, and we could potentially make this page public (see: just remove entries that have +secret or are in the admin code module etc)

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.