Giter Club home page Giter Club logo

bzflag-bzfls3's Introduction

BZFlag Central Services v3

The BZFlag project hosts centralized services for listing public servers and authenticating registered players. This project is the third iteration of the central services and aims to provide a legacy interface compatible with the v2 services and also provide a modern REST API with additional functionality. Another goal is support for CGNAT and, on the REST API, IPv6, both of which are pain points with the current v2 authentication system.

Requirements

  • Apache
  • PHP 8.2 FPM
  • Composer
  • MariaDB
  • Redis
  • An existing phpBB installation

Installation

Install dependencies:

composer install --no-dev

Ensure that PHP can write to var/log/:

sudo chown www-data:www-data var/log/

Create a config.php file at the top level of the source with at least the following, adjusting values as needed:

<?php

return [
  'legacy_host' => 'my.bzflag.whatever',
  'phpbb' => [
    'root_path' => '/var/www/forum/',
    'database' => 'forum',
  ],
  'database' => [
    'database' => 'central',
    'username' => 'central',
    'password' => 'PutPasswordHere'
  ]
];

See public/index.php for additional configuration options.

Database Setup

This assumes the phpbb database is 'forum' with a prefix of 'phpbb_', the central services database is 'central', and the central services user is 'central'. Adjust the below to match your environment.

GRANT SELECT, INSERT, UPDATE, DELETE ON central.* TO central@localhost;
GRANT SELECT ON forum.phpbb_groups TO central@localhost;
GRANT SELECT ON forum.phpbb_user_group TO central@localhost;
GRANT SELECT, UPDATE ON forum.phpbb_users TO central@localhost;

Import structure.sql into the 'central' database.

Generating REST Documentation

The REST API uses PHP 8 Attributes to describe the API and zircote/swagger-php to generate an OpenAPI specification. Swagger UI can then be used to display the API specification in a developer friendly way that allows trying it out in a browser. To generate the specification, run the following commands:

composer -d tools install
./tools/vendor/bin/openapi src/Controller/v1 -o ../central.bzflag.org-docs/public/v1.yaml -b vendor/autoload.php

License

Copyright (C) 2023-2024 BZFlag & Associates

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

Some files are distributed under different licenses:

  • public/js/js-cookie.min.js: MIT License, Copyright (c) 2018 Copyright 2018 Klaus Hartl, Fagner Brack, GitHub Contributors
  • public/images/weblogin_logo.png (and other formats): GNU LGPL 2.1, Copyright (c) 2024 Tim Riker
  • theme toggle SVG/CSS in views/weblogin.html.twig and public/css/weblogin.css: MIT License, Copyright (c) 2021 Alfred Jones
  • public/css/bootstrap.min.css and public/css/bootstrap.min.css.map (copied during composer install): MIT License, Copyright (c) 2011-2024 The Bootstrap Authors

bzflag-bzfls3's People

Contributors

blast007 avatar dependabot[bot] avatar

Watchers

Joe Van Overberghe avatar  avatar Konstantinos Kanavouras avatar Tim Riker avatar Alfredo Tupone avatar Jeff Makey avatar  avatar

bzflag-bzfls3's Issues

Consider switching away from Redis

Redis is being used to handle rate limiting. Recently, Redis dropped their open-source license, so new versions will not be open-source, and likely won't be packaged in any Linux distributions. There are two forks main forks that came out of this change that I expect will get some traction in Linux packaging:

  • Valkey, a fork by The Linux Foundation which has industry support and will continue on the roadmap to add new features
  • Redict, which aims to keep the feature scope where it is and focus on stability and long-term maintability

Another alternative would be memcached or similar.

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.