HF 986e0b5d76 add default z value for canvas screenshots 2023-06-05 02:06:01 +02:00
src add default z value for canvas screenshots 2023-06-05 02:06:01 +02:00
.gitignore initial commit 2022-01-13 11:55:02 +01:00 autojoin rooms with pp_admin, update packages, update MarkdownParser 2022-07-22 01:31:53 +02:00 finish canvas link parsing 2022-01-16 14:56:46 +01:00
ecosystem.yml localhost -> 2023-05-30 19:46:40 +02:00
index.js parse basic markdown for sending images 2022-03-16 20:51:26 +01:00
package-lock.json npm remove canvas install sharp and updates 2023-05-30 14:54:24 +02:00
package.json npm remove canvas install sharp and updates 2023-05-30 14:54:24 +02:00
ppfun-registration.yaml localhost -> 2023-05-30 19:46:40 +02:00

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.