Skip to content

mtmosier/SFIWikiBot

Repository files navigation

Starfighter: Infinity WikiBot

Introduction

This is a bot designed to import game data from Starfighter: Infinity and use it to update the Starfighter: Infinity Wiki. Item pages, ship pages, planet pages, and various pages which interact with these are set up to be maintained by the bot by default. (More complete list here.)

In addition to being able to update game information on the wiki, the bot also includes a web interface which will allow you to filter and customize the display of item and ship information. I find this interface useful for setting up new pages for the bot to maintain, or to aid in debugging possible issues with the data being written to the wiki.

Who should be running the wiki site update scripts?

Please note it's not really helpful to have multiple people running the default version of the bot site update in parallel. If the wiki appears out of date and you believe running the bot can fix it please consider joining Discord and coordinating with us in the #wiki-discussion channel.

If you decide to go ahead with wiki site updates you will require an account on the wiki set up with a bot password.

Quick Start (Docker)

If you already have Docker all you need to do is run these commands to launch the appropriate containers.

To launch a container running the website ui for data filtering and display:

docker run -dit -p 8080:80 mtmosier/sfiwikibot_website

The container will automatically download and cache the game data upon launch. It can take a couple of minutes before it responds to requests. After initialization is complete connect to the instance at:

http://localhost:8080/

If you instead want to update the game data stats on the live wiki, try doing:

docker run \
    -e "botUsername=exampleBotUsername" \
    -e "botPassword=abc123" \
    mtmosier/sfiwikibot_siteupdate

In order to get a bot username and password visit the wiki Bot Passwords page. This container is set up to be run as a one-off. When run it will go through a full site update and then exit out. In my experience a site update takes about an hour and a half.

Note: Before running the site update please think about whether you should be running it. (Read this)

Manual Installation

Requirements

Python 3.5+ is required to run the bot.

A list of external modules needed can be found in requirements.txt. These can be installed via:

cd SFIWikiBot
pip3 install --trusted-host pypi.python.org -r requirements.txt

Library Install

The main portion of the code installs as a module.

cd SFIWikiBot
python3 setup.py install

Configuration

By default the settings file will be looked for at /etc/sfWikiBot/settings.ini, followed by your current working directory. It's suggested that you take the included settings.ini.minExample, (or settings.ini.example if you prefer) edit as needed, and copy it to /etc/sfWikiBot/settings.ini.

Note that the botUsername and botPassword settings are only needed if performing wiki site updates. (Learn More)

Usage

Wiki Site Update

When you run the update script the latest exported game data will be downloaded from the Ben Olding Games website, which will be used to update the Starfighter: Infinity Wiki. (Learn More)

Make sure the update script is marked as executable:

cd SFIWikiBot
chmod +x scripts/updateWikiContent.sh

After that just run the update script:

scripts/updateWikiContent.sh

The goal should be to run the update shortly after Ben exports the game data, which generally happens within a couple of hours of a new version being pushed to Steam.

As there's no harm in running the update when there are no changes to make, it's easiest to just automate the site update using a cron entry.%$

echo "0 */6 * * * *    /path/to/SFIWikiBot/scripts/updateWikiContent.sh" >> ~/.crontab
crontab ~/.crontab

Executing the above (after updating the file path) will add a cron job running the Wiki update script every 6 hours.

Item / Ship Data Filtering Website

The website portion of this software is provided via Passenger.

If you do not have Passenger installed you'll need to do that first. As there a multiple OS/Web server options I won't try to cover them all myself. I would suggest following the "Deploy to production" section of the Passenger documentation.

Pages Maintained

About

A bot designed to keep the Starfighter: Infinity Wiki up to date with game data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published