osrs-data-hub

OSRS Guild Map

Set up ha-osrs-map, a live map and tracker for your guild that reads from the hub.

OSRS Guild Map (ha-osrs-map) is a self-hosted website that shows where every online guild member is, what they carry and wear, their skills and XP history, and what the guild has been up to. It is a fork of group-ironmen, reworked for guilds.

It reads every player from the hub. Players don't pair anything with the map; they only pair RuneLite with the hub, as usual. The map has no accounts of its own either: people log in with Discord, and the hub says who is a member and who is an admin.

RuneLite plugin ──pair/events──▶ osrs-data-hub ◀──GET /api/v1/snapshot (every 5 s)── map backend ──▶ site
                                        ▲                                                   │
                                        └──── /xp, /events, /locations, /leaderboards ◀─────┘ (cached)
  • The live map shows every online player in their own colour, with pings for loot, level-ups and deaths.
  • Player profiles show vitals, gear, inventory, skills, XP gains, sessions and carried value.
  • Trails follow up to eight players at once over 24 hours, 7 days, or one play session of the player you're watching, and the time you pick applies to every trail shown. Each player's events are marked along the way. Teleports are drawn as arcs, and Replay plays the routes back on a timeline.
  • The Clan page lists who's online and where, the top XP gainers, the biggest drops and the event feed.
  • The Admin page, for the hub's admins, hides or deletes players and shows how the hub connection is doing.

What you need

  • A running hub, version 2.1 or newer, and an admin on it who can create an integration key. Nobody can log in to the map against an older hub.
  • A Discord application for the login. It can be the one the hub uses, with one more redirect.
  • A machine with Docker and the Compose plugin. The map runs three containers: frontend, backend and PostgreSQL.

Set it up

Create an integration key on the hub

On the hub, open Admin → Integrations → Create integration key. Name it "Guild map" and give it these categories:

CategoriesUsed for
activity, location_livethe map and the player list
stats, equipment, inventoryprofiles and graphs
events, location_historythe Clan page, map pings and trails

Copy the key; it is shown once.

It has to be an integration key

A personal key from API keys can read the players, but the hub doesn't tell it who is a member, so nobody can log in to a map that runs on one. The backend logs an error at start-up when the key is a personal one.

Get the compose files

git clone https://github.com/RedFirebreak/ha-osrs-map.git
cd ha-osrs-map
cp .env.example .env

Point it at your hub

In .env, set the hub URL (without /api/v1) and the key, and a database password (PG_PASSWORD).

.env
HUB_BASE_URL=https://hub.example.com
HUB_API_KEY=ohub_xxxxxxxxxx_xxxxxxxx

Add the Discord login

In the Discord Developer Portal, open your application's OAuth2 page and add https://<your map>/login/discord as a redirect. The map only asks for the identify scope. Then set:

.env
DISCORD_CLIENT_ID=…
DISCORD_CLIENT_SECRET=…
DISCORD_REDIRECT_URI=https://<your map>/login/discord

The backend refuses to start without the hub settings and these three.

Start it

docker compose up -d

The site listens on http://localhost:4000. Put it behind your reverse proxy with HTTPS. Only the frontend needs to be reachable.

Plain HTTP

On plain http://localhost also set COOKIE_SECURE=false, or the browser drops the login cookie.

Log in and test the connection

Log in with Discord as an admin of the hub. There is no first admin to create: whoever the hub calls an admin gets the Admin page. Open Admin → Test connection. It checks the key and shows how many accounts it can read.

Who can log in

Discord only says who someone is. The backend then asks the hub whether that Discord account is a member, and an admin (GET /api/v1/members/{discord_id}).

  • A member of the hub gets in. Someone the hub doesn't know is told to sign in to the hub once first, since that is where joining the guild happens.
  • An admin on the hub is an admin on the map.
  • The hub is asked again every 15 minutes for everyone who is logged in. Someone who left the guild or was removed on the hub is logged out of the map within that time. While the hub can't be reached, whoever is logged in stays so.
  • A login lasts three days.

Players choose what the map shows

The map shows exactly what the hub shares with the guild. New accounts share every category with the guild by default. On accounts from before hub 1.2, equipment, inventory and the location trail stay private until the owner shares them, so a player whose items don't show up on the map should change their sharing settings on the hub. A profile tab or trail says "not shared" until they do, and what an owner stops sharing on the hub is dropped from the map.

Optional settings

VariableDefaultPurpose
HUB_POLL_INTERVAL_SECS5How often the backend polls /snapshot (at least 2).
HUB_HISTORY_ENABLEDtrueServe graphs, trails and the events feed from the hub.
HUB_REQUEST_BUDGET80 % of the key's limitHub requests per minute the map allows itself.
SITE_TITLE, SITE_NAMEOSRS Guild MapBranding.
ICONS_BASE_URLhttps://icons.scapekeeper.comWhere browsers load item, skill and slot icons from. Empty turns icons off.

The map's README has the full list, a Kubernetes deployment contract, and a mock hub for trying the map without a real hub.

How it uses the hub

  • The backend polls /snapshot with ETag and since, and does a full refresh every two minutes. The key never leaves the server.
  • Presence comes from the hub's online and last_seen. If the sync stops for five minutes, everyone shows as offline.
  • Graphs, trails, gains, profiles and the events feed are served from a short-lived cache, so the hub sees the same number of requests however many people view the map.
  • Trails come from /locations, drawn the way the hub's via labels each point: a line for a walk, an arc for a teleport. The events along a trail come from /events with from and to.
  • Accounts are matched by hub account id, then by account_hash, then by name. Renames on the hub are followed.

On this page