You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HF 986e0b5d76 add default z value for canvas screenshots 4 months ago
src add default z value for canvas screenshots 4 months ago
.gitignore initial commit 2 years ago autojoin rooms with pp_admin, update packages, update MarkdownParser 1 year ago finish canvas link parsing 2 years ago
ecosystem.yml localhost -> 4 months ago
index.js parse basic markdown for sending images 2 years ago
package-lock.json npm remove canvas install sharp and updates 4 months ago
package.json npm remove canvas install sharp and updates 4 months ago
ppfun-registration.yaml localhost -> 4 months ago

ppfun-bridge Matrix Application Service

Sends chat messages from ppfun to matrix and vice versa.

Uses the matrix Application Service API and admin-API (ApiWebsocket and ./adminapi, so admin-access and set APISOCKET_KEY is required).

It is supposed to run on the same server as matrix-synapse.

The Application Service communicaties with matrix via HTTP and listens itself on the port 8009.


Install dependencies

npm install

Edit ppfun-registration.yaml keys hs_key and as_key into some random strings and move the file somewhere where both the ppfun-bridge and matrix-synapse can access it. Don't change the pp_ aliases, because they are hardcoded in the module and bridge.

Edit your homeserver.yml matrix-synapse config file and add a path to the ppfun-registration.yml like this:

  - /etc/matrix-synapse/ppfun-registration.yaml

Edit ecosystem.yml and set the path to the ppfun-registration.yml as REGISTRATION_YAML. Set the pixelplanet APISOCKET_KEY and APISOCKET_URL (like HOMESERVER_URL should be the local url to matrix-synapse like http://localhost:8008 and HOMESERVER_DOMAIN its base_url / server_name like MEDIA_URL is the http[s] url from which the matrix server is reachable from the outside, which is usually the base_url, it is needed to send links

Now you can start the brige with pm2:

pm2 start ecosystem.yml

and stop it with

pm2 stop ppfun-bridge

and watch its logs with

pm2 log ppfun-bridge

Room Creation

The bridge automatically creates matrix rooms for all public pixelplanet channels available and makes the '' user admin. Some things are hardcoded in src/ppfunMatrixBridge.js, check it out if there are problems. And the URL where to fetch chunks from pixelplanet is hardcoded in src/pixelplanet/loadChunk.js.