Mario Hennenberger
HomeBlogGaming

Poor Man’s Alliance Auth

or: How crontab, PHP and a bit of MySQL replaced a whole Django stack

Anyone who has run an EVE Online corp or alliance knows Alliance Auth. It is the mother of all alliance management systems: SSO login, ESI scopes, structures, moons, timers, Discord, wikis, and a plugin for basically everything. It is extremely powerful, and in true Linux fashion it is also massively over-engineered for what most groups actually use it for.

So I wrote my own. It’s called PMAA, the Poor Man’s Alliance Auth. The name is the point: it is not meant to beat Alliance Auth feature for feature. It is meant to do the things we actually use, on hardware you would not even notice, and to be a lot less pushy about the data it asks members for.

What Alliance Auth needs to run

Going by the official install guide, a “normal” Alliance Auth install is:

  • a supported *nix server with Python 3.12 in a virtualenv
  • MariaDB (the guide uses 11.8)
  • Redis as a service
  • Celery workers plus the Celery beat scheduler
  • Gunicorn as the app server
  • Supervisor to keep all of the above alive
  • nginx or Apache in front of it

Our old install had 17 plugins on top (structures, moonmining, corptools, skillfarm, buyback, wikis, intel tool…). It ran three Gunicorn workers, a threaded Celery worker and beat, all babysat by Supervisor with a memory monitor that restarted anything going over 256 MB. The Python virtualenv alone was 353 MB.

That’s a lot of moving parts to answer questions like “which structure runs out of fuel next week” and “which corp still hasn’t granted their scopes”.

What PMAA needs to run

  • PHP 8.1+ (pdo, openssl, curl)
  • MySQL / MariaDB
  • crontab

That’s it. No worker, no queue broker, no process supervisor, no build step. The only Composer dependency is firebase/php-jwt to verify the EVE SSO tokens (192 KB of vendor code, versus 353 MB of virtualenv). Bootstrap comes from a CDN. If your webhost can run a WordPress and a cronjob, it can run PMAA.

Every background job Celery used to do is now a plain PHP script started by cron: structures and starbases every 6 hours, notifications every 15 minutes, market orders every 20, wallets and member tracking hourly, corp data once a day about an hour after the EVE downtime. It’s around 20 crontab lines. Each one writes to a log, and if a run fails, the next run just catches up.

The less obvious design choices

  • No background worker means no token races. EVE refresh tokens are single use. Early on, a “refresh all tokens every 5 minutes” job raced the sync jobs. Both refreshed the same token, one of them lost, and real members suddenly saw “re-auth needed”. That job is gone. Now a token only gets refreshed by the code that is about to use it, and only when it is within 2 minutes of expiring.
  • Health is a timestamp, not a flag. There is no is_valid column anywhere. Data is “stale” after 12 hours and “error” after 3 days, derived from when it was last fetched. Nothing can get stuck in a wrong state because a flag was never reset.
  • Multiple providers per corp. Every director who grants the structure scopes becomes a data provider for their corp. The sync tries the most recently successful one first and simply skips one that fails, so a single expired token doesn’t blind the whole corp.
  • Features without permission are just ignored. Alliance Auth plugins tend to want everything. PMAA asks for scopes per feature with a one-button “add scope”. If a character didn’t grant something, that feature simply doesn’t show for that character. Nobody is forced to hand over data they don’t want to share.
  • Tokens are encrypted at rest with AES-256-GCM, and the permission levels (public, logged in, member, manager, admin) are computed on every request from the whitelist of alliances, corps and individuals. Nothing is stored on the user that could drift out of date.
  • A tiny framework of its own: a 50-line router, thin PDO models with no ORM, and plain PHP templates. The schema is one idempotent SQL file, and php bin/migrate.php is safe to rerun anytime.

What it does so far

Three lanes, to keep it simple:

  • My Stuff: a single character. Skills and skill queue, clones, assets, wallet, industry jobs, planetary industry (extractor expiry, storage running full), notifications, and a basic EVE mail client to answer mails without logging into the game.
  • My Team / My Alts: everything above rolled up across all your characters. Which PI colony needs attention, which jobs are ready for delivery, with favorites so your mains stay on top.
  • Stuff in Space: structures, starbases (with fuel computed from the fuel bay), moon chunks with “recently fractured” and idle drills, all in one filterable list.

On top of that:

  • Corp compliance on a single page: which corp is missing which scopes, so members can fix their own issues, plus a weekly reminder mail.
  • Corp tools: member list, assets, market orders for multi-character trading, industry, wallet divisions with archived journals, and a mining ledger that keeps history beyond ESI’s own retention.
  • Alerts through EVE mail, email and Discord, for low fuel, moon fractures, wars and scopes that need re-granting.
  • Wars and kills: war tracking from notifications, and public kill stats from zKillboard.
  • Community: a shared moon scan database, a public appraisal tool with a buyback contract helper, and a small CMS with a WYSIWYG editor for docs and FAQs.
  • And as a side project, a standalone POS planner for old-style starbase fits.

In numbers: about 100 routes, 77 tables, 26 cron scripts, built since the end of July 2026.

Should you switch?

If you need the whole Alliance Auth plugin ecosystem, service integrations for Mumble, Teamspeak and whatever else, and a team that knows Django: stay with Alliance Auth. It is the right tool for that.

If you are a smaller group that mostly wants “who is in, what’s in space, what needs fuel, who forgot their scopes”, and you would rather run it on a cheap webhost than maintain a Python stack with Redis and Supervisor, then a few PHP files and a crontab do the job just fine.

PHP, crontab, MySQL. No worker, no broker, no supervisor.

PMAA documentation and changelog

Leave a comment