Skip to content

davidangel/bolo

 
 

Repository files navigation

Bolo

image

Bolo is a top-down game of tank warfare originally written by Stuart Cheshire for the BBC Micro and Apple Macintosh, and also notably rewritten for Windows and Linux by John Morrison.

davidangel/bolo

This project is an attempted revitalization of the now-abandoned "Orona" project, which rewrote Bolo for play in modern browsers.

Playing Bolo

This is a browser-based implementation of Bolo. To play:

  1. Build the client bundle:

    npm run build
  2. Start a local server (see "Running a Bolo server" below).

  3. Open your browser and navigate to http://localhost:8124/.

Controls

  • Arrow Keys - Move tank
  • Space - Fire
  • R - Chat
  • Mouse - Send little green man on missions, select items to harvest/build/deploy

Running a Bolo server

Prerequisites

  • [Node.js] 14 or higher
  • [git]

Quick start (Node.js)

  1. Clone the repository:

    git clone http://github.com/davidangel/bolo.git
    cd bolo
  2. Install dependencies:

    npm install
  3. Copy and edit the configuration:

    cp config.json.sample config.json
    # Edit config.json with your settings
  4. Build the client:

    npm run build
  5. Start the server:

    npm run server

The server will start on port 8124 by default. Open http://localhost:8124/ in your browser to play.

Configuration notes

The server reads its settings from config.json. In addition to the basic general.base, general.maxgames, and web.port values, the sample config includes two security-related options:

  • web.allowedOrigins - Allowed browser origins for WebSocket upgrades. Supports exact origins like http://localhost:8124, wildcard subdomains like https://*.example.com, or * if you intentionally want to allow any origin.
  • web.rateLimit.create - Per-IP limit for requests to /create, configured with windowMs and maxRequests.
  • web.rateLimit.websocket - Per-IP limit for WebSocket upgrade attempts, also configured with windowMs and maxRequests.

Rate limiting uses X-Forwarded-For when that header is present, otherwise it falls back to the socket remote address. If you run Bolo behind a reverse proxy or load balancer, make sure only trusted infrastructure can set X-Forwarded-For, or strip/rewrite that header at the edge so clients cannot spoof their source IPs.

Example:

{
   "general": {
      "base": "https://play.example.com",
      "maxgames": 10,
      "gameTimeout": 900
   },
   "web": {
      "port": 8124,
      "allowedOrigins": ["https://play.example.com", "https://*.example.com"],
      "rateLimit": {
         "create": { "windowMs": 60000, "maxRequests": 20 },
         "websocket": { "windowMs": 60000, "maxRequests": 60 }
      }
   }
}

Docker

Alternatively, run the server using Docker:

docker-compose up -d

Configure the server using environment variables:

  • PORT - Server port (default: 8124)
  • BASE_URL - Public URL of the server
  • MAXGAMES - Maximum number of games (default: 5)
  • ALLOWED_ORIGINS - Comma-separated origins allowed for WebSocket upgrades (default: same as BASE_URL)

License

The source code of Bolo/Orona is distributed with the GNU GPL version 2, as inherited from WinBolo. Much of the game logic was written with WinBolo as a reference, thus becoming a derived work of it. Though the GNU GPL version 2 is a fine license either way. You can find a copy of the license in the COPYING file.

Some files, or parts of files, are subject to other licenses, where indicated in the files themselves. A short overview of those parts follows.

All the graphic and sound files are from:

  • Bolo, © 1993 Stuart Cheshire.

For the browser client, Bolo also bundles:

  • [Sizzle], © 2010 The Dojo Foundation, licensed MIT, BSD and GPL.
  • Components that are part of [Villain].

About

Bolo, a game of tank warfare, rewritten for modern browsers.

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • TypeScript 95.8%
  • CSS 2.1%
  • JavaScript 1.3%
  • Other 0.8%