PubHubs (Public Hubs) is a European community network built on public values: openness, transparency and collective stewardship. It connects people across local hubs (i.e. neighbourhoods, sports clubs, schools, museums, patient organisations, libraries, municipalities) while protecting participants’ data and enabling trustworthy communication.
- Website / info: https://pubhubs.net
- If you want to get involved or test: please contact the team via our website.
This project is in active development and moving through test phases. The repository is a mirror of internal work and may be subject to major changes before a stable release. If you or your organisation want to help test or contribute, contact the team first.
- PubHubs central — Central authentication and identity management (issues pseudonyms to hubs). Implemented in Rust.
- Global client — Web client that navigates between hubs (embeds hub clients via iframe). Implemented in TypeScript + Vue.
- Hub servers — Customised Matrix homeservers (based on Synapse) extended with PubHubs Python modules; by default hubs are not federated inside PubHubs.
- Hub clients — Matrix-based clients embedded in the Global Client with PubHubs-specific features (secured rooms, attribute-based access). Implemented in TypeScript + Vue.
- Identity / attributes — Handled by Yivi (used for login and attribute-based access).
| Path / Name | Type | Purpose | Notes |
|---|---|---|---|
| flake.nix | file | Nix flake with reproducible developer environment and dependencies | Use this to create dev shells. |
| global-client | dir | Global client source (TypeScript + Vue) | Embeds hub clients via iframe. |
| hub-client | dir | Hub client source (TypeScript + Vue) | Matrix client customisations. |
| pubhubs | dir | PubHubs Central (Rust) | Central login & identity platform. |
| pubhubs_hub | dir | Hub server build / Synapse extensions (Python) | Matrix server modules & hub configuration. |
Our main repository is on the Radboud University's GitLab, but external developers can use our GitHub mirror. main is our devemopment branch, while stable is our production branch.
See the Nix flake for the required dependencies and their version. You can use the Nix package manager to install these, or install them manually.
With Nix installed, use the following command to enter a development shell:
# If using Nix:
nix developWe use the the Mask CLI task runner to document and provide shortcuts to the development commands we use. See the Maskfile for all available commands, or run mask run help to see what is available.
On Windows, make sure to run these in Git bash, instead of the normal terminal.
on first use, we need to run some commands to install dependencies and set up some directories:
mask run initnpm installThis will setup all Node modules and install our pre-commit hook that handles formatting before committing.
Now you're ready to start developing.
PubHubs consists of two main components:
-
Pubhubs Central, which manages the global login- ./pubhubs folder contains the backend
- ./global-client folder contains the client
-
The
Hubs, which run the Synapse server and Matrix client- /pubhubs_hub folder contains the synapse server
- /pubhubs_hub/testhub[0-4] folders contain the test hubs
- /hub-client folder contains the hub client
- /pubhubs_hub folder contains the synapse server
To run the local development, you need to run six things locally:
- The Yivi server
mask run yivi - The Garage S3 server,
mask run s3 - The PubHubs central server
mask run servers - The PubHubs central client
mask run client - The Hub server(s)
mask run hub server [0-4] - The Hub client(s)
mask run hub client [0-4]
You can run these all at once in the following way:
mask run all[!INFO] If you want to specify the url to use for Yivi, for example when unable to connect because of network restrictions, you can do the following:
YIVI_HOST=192.168.0.2 mask run all
Alternatively, if you are only making changes to the hub, you can run the hub client against our staging server. To do so, you can run:
mask run hub mainclientThis will run the hub client at port 8001, but to access it you need a url with an access token. You can get this by running:
mask run hub mainclient enterThis will show a QR-code in the terminal, which can be scanned with your Yivi app (see next section). Once registered, you'll get a URL with the access token.
To access the hubs, you have to login using the Yivi app. To do so, the app must be set to developer mode. This can be done by navigating to the more menu and clicking the 'App Id' a couple of times.
After the first login on your local development, there won't be any rooms in the hub yet. To make these, you'll first have to make yourself admin of the hub. To do so, go to the folder of the running hub (ex. ./pubhubs_hub/testhub0) and run the following:
sudo sqlite3 homeserver.db
# Inside sqlite
UPDATE users SET admin = 1; # Note that this will make all the existing users admin, use 'WHERE' to specify
# Afterwards, quit with ctrl + d, or:
quit;If the hub is using PostgreSQL instead of SQLite3, use the following instead:
docker exec -it pubhubs-testhub0 sudo -u postgres psql hub # For testhub0
# Inside psql
UPDATE users SET admin = 1; # Note that this will make all the existing users admin, use 'WHERE' to specify
# Afterwards, quit with:
\qAfter doing this, restart the hub server, or close mask run all and run it again to gain admin access.
- If Yivi cannot communicate with your local development setup, disable your firewall.
- If Yivi still doesn't communicate with your local development, and you are on eduroam, you might have to use a VPN such as Tailscale to connect your development machine and your phone.
- Is you run into CORS issues, disable HTPPS-only in your browser.
- Changelog: CHANGELOG.md