galbd / AstrBot plugin
Connect GalShelf to the galbd QQ bot (the GalBirthday plugin for AstrBot): prerequisites, supported versions, setup, permissions, verification and troubleshooting, then where to get the files.
- Desktop appAvailable in 0.2.8
- WebsiteAvailable
On this page
galbd is the GalBirthday plugin for the AstrBot QQ bot, used in QQ groups for birthdays, daily recommendations and shared records. GalShelf's companion bridge adds a small local interface to that plugin so the desktop app can sync your records with galbd, and so group members can link their own QQ.
- Group members don't install anything on the bot. In the desktop app, enter the group number and your QQ number and follow Link your QQ.
- Bot operators install the bridge once on the computer that runs AstrBot. The rest of this page is for them. Read it all before downloading anything.
Prerequisites#
- A running AstrBot instance with the GalBirthday plugin (
astrbot_plugin_galbirthday) installed and working. - QQ connected to AstrBot through the aiocqhttp (OneBot v11) adapter, for example with NapCat. The bridge only accepts QQ events from the
aiocqhttpplatform; other adapters are not supported. - Python on the bot computer, to run the installer.
- The GalShelf desktop app and bridge files from the same release. Never mix bridge files from different release packages.
- Only for members joining from other computers: a domain you control with a valid HTTPS certificate and a reverse proxy (see Remote members).
Supported versions#
| Component | Supported |
|---|---|
| GalBirthday plugin | 4.x: at least 4.0.0 and below 5.0.0. Tested with 4.0.0. |
| Bridge protocol | Major version 1 |
| GalShelf desktop app | The version paired with the bridge in the same release (0.2.7 at the time of this update) |
| AstrBot | No separate minimum is recorded. Compatibility is checked against the plugin version and the capabilities it reports. |
The installer refuses a plugin outside 4.x and changes nothing. The desktop app checks the protocol and capabilities (library.read, sessions.read, private.owner) on every connection, so an incompatible update shows up as "not connected" instead of writing bad data.
Set up the bridge#
Run these commands from the folder that contains GalShelf's integration folder.
Check first. This verifies the plugin version, the plugin interfaces the bridge needs and the file digests, without changing anything:
python integration/install_bridge.py --checkInstall. The installer backs up the plugin files it touches to
integration/backup/<time>/, adds clearly marked hooks and the filecore/client_bridge.py, and does not replace the plugin. Running it again doesn't add duplicate hooks, and a failure restores what it wrote.python integration/install_bridge.pyIf you run several AstrBot instances, or the plugin is not under
~/.astrbot_launcher/instances/, name the exact plugin folder:--plugin "<full path to astrbot_plugin_galbirthday>".- Reload only GalBirthday from the AstrBot management page. The installer never restarts or reloads anything itself, and you don't need to restart AstrBot or NapCat.
- Connect the desktop app on the same computer: open the galbd / QQ connection in settings and connect. The plugin creates a local pairing file when it loads, and the app reads it automatically, so you don't copy any keys by hand.
Permissions and security#
- The bridge listens only on
127.0.0.1:18766. It is not reachable from other computers unless you set up the reverse proxy below. - The pairing key is stored in
galshelf-bridge.jsonin the plugin's data folder. On Windows it is readable only by the current user and SYSTEM; elsewhere it is set to0600. Never send this file or its key to anyone. - The local administrator key can't be used through the proxy. Remote members get their own credential only after proving their QQ in the group.
- Requests from web pages are refused, so a website can't act as your client.
- For group verification the bot must be a member of the group, able to look up group members and to @mention people there.
- Don't expose the AstrBot management panel, NapCat ports or the pairing file through the proxy.
Remote members#
Members on other computers can link their QQ only after you open the service. In the plugin's data folder (next to galshelf-bridge.json), create galshelf-remote.json:
{
"public_url": "https://galbd.example.org",
"allowed_groups": ["<group number>"]
}
Use your own HTTPS domain; the example won't work. The bot must be in every listed group. Without this file remote verification is off and no codes are sent. Reload the plugin after changing it.
Then configure an HTTPS reverse proxy on the bot computer that forwards only /v1/ to http://127.0.0.1:18766, replaces (rather than appends to) X-Forwarded-For and X-Forwarded-Proto, sets X-Forwarded-Host to your domain and limits request bodies to 1 MB. A full Nginx example is in docs/QQ_BINDING.md of the release.
Link your QQ (members)#
- In the desktop app, enter the service address, the group number and your QQ number, and ask for a code.
- The bot @mentions you in that group with a 6-digit code (valid for 5 minutes, 5 attempts).
- From the same QQ, reply in the group:
/gal关联 <code>. - Enter the same code in the desktop app.
One QQ can be linked to one desktop app, and the credential lasts 90 days. Unlink in the app, or send /gal解除关联 in the group if you lost the device. To use the website with your galbd records, choose Authorise browser under the QQ link in the desktop app and enter the 8-character code on the website.
Verify the connection#
python integration/install_bridge.py --checkreports the plugin version and whether the hooks are in place.python integration/check_release.pycompares the installed plugin hooks, bridge files and release manifest;--skip-installedchecks only the package. It reads no credentials and changes nothing.- The AstrBot log shows
[GalBirthday] Companion bridge … started on loopback port 18766after the reload. - In the desktop app the galbd connection shows as connected and compatible.
- If you also run the GalShelf website against this bot, its
/healthz?deep=1reports whether the bridge is ready.
Troubleshooting#
| Problem | What to do |
|---|---|
| The app says galbd is not connected | Make sure the bridge is installed and only GalBirthday was reloaded after installing. Check the AstrBot log for the bridge start line. |
| The connection stopped after updating the plugin in AstrBot | A plugin update can overwrite the hooks. Run the installer again; it checks and restores them. |
| "This bridge supports GalBirthday 4.x" | Your plugin is outside 4.x. Nothing was changed. Use a 4.x plugin or wait for a bridge release that supports your version. |
| "Pass --plugin with the exact GalBirthday plugin directory" | Several or no plugin folders were found. Pass --plugin with the exact folder. |
| No verification code arrives in the group | Check the group is listed in galshelf-remote.json, the bot is online and in the group, and you are a member. Requests are rate-limited: QQ and client at least 60 seconds apart and 3 per hour; 12 per hour per address; 30 per hour per group. |
| The code is rejected | Codes are valid for 5 minutes with 5 attempts; ask for a new one. |
Roll back or remove#
Restore the backup made by the installer, then reload only GalBirthday:
python integration/install_bridge.py --restore "integration/backup/<time>"
If the plugin was changed after the install, the automatic restore stops rather than overwriting the newer files. Rolling back never deletes personal libraries or play logs; the bridge's receipts stay in the plugin's own database.
Download#
- GalShelf releases are published only at the verified release page https://github.com/Harihi-Works/GalShelf-Dev/releases (external link), the same place the desktop app checks for updates. That public page carries the Windows desktop package.
- The bridge installer (
integration/, withinstall_bridge.py,check_release.pyand the release manifest) is part of the GalShelf suite's source package, which is not published on that public page. Ask the GalShelf maintainer for the bridge package that matches your desktop version. - The GalBirthday plugin itself is not distributed by GalShelf, and no verified download location for it is recorded, so this page doesn't link to one. Use the plugin your bot already runs.
GalShelf never installs or reloads the plugin for you.