From 5dc57868b63d928ec83b64d80adf21a832574d0a Mon Sep 17 00:00:00 2001 From: emerson Date: Sun, 2 Jul 2023 15:46:09 +0000 Subject: [PATCH] organize repo --- .gitignore | 4 ---- README.md | 10 +++++----- certs/.gitkeep | 0 config.example.json | 4 ++-- configs/.gitkeep | 0 5 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 certs/.gitkeep create mode 100644 configs/.gitkeep diff --git a/.gitignore b/.gitignore index 1c88e47..2d39cbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,3 @@ node_modules/ lib/ -config*.json -!config.example.json -reflection.key -reflection.pem .env/ \ No newline at end of file diff --git a/README.md b/README.md index f8698b2..1563e9e 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,21 @@ ReflectionIRCd is an IRCd that bridges Matrix, allowing you to use an IRC client - Standalone: Uses the Client-Server API, so you can use it with any homeserver ## Running -Copy `config.example.json` to `config.json`, and edit the values: +Add a JSON file to `configs/`, and copy and edit the values from `config.example.json`: * `serverName` is the name of the IRC server * `port` is the listening port of the server -* `certFile` and `keyFile` are the SSL cert and key for Reflection to use. If you don't have one, self-signed is okay as long as your IRC client can handle it +* `certFile` and `keyFile` are the SSL cert and key for Reflection to use. If you don't have one, self-signed is okay as long as your IRC client can handle it. Store them in the `certs/` directory so they don't get in version control. * `lazyLoadLimit` is the limit for "lazy load" mode. In lazy load mode, only room members with PL > 0 are shown right away, everyone else is joined once they send an event to the room. This prevents clients crashing or lagging on large rooms. * `syncTimeout` is the number of milliseconds to ask the homeserver to hold the sync open. `15000` seems to be the de-facto number. * `lagWarningLimit` is the number of milliseconds that will trigger a "Sync is lagging" message to warn of a lagging homeserver. If you run your own HS, setting it to 2000 more than `syncTimeout` will help you diagnose issues. Larger servers like matrix.org often have a 5-10 second lag time, so increase this to prevent your screen filling with lag warnings. * `mxid` is the MXID of your Matrix user * `homeserver` is the URL of your homeserver. You get this value in Element by going to Settings > Help and About > Advanced -* `accessToken` is the access token to use. You get this value underneath the homserver URL in Element. +* `accessToken` is the access token to use. You get this value underneath the homeserver URL in Element. * `saslPassword` is the SASL password to use when connecting to Reflection -If you're running multiple instances, use multiple config files, i.e. `config-matrix.json` or `config-aria.json`. +If you're running multiple instances, use multiple config files, i.e. `matrix.json` or `aria.json`. -Then `npm ci`, `npm run build`, and `node reflection.js config.json` (replace `config.json` if you named your config differently). You'll see a message about starting initial sync, and then "Synced to network!". Once it's synced, you can connect with your client, specifying the SASL password you put in the config (SASL username doesn't matter). +Then `npm ci`, `npm run build`, and `node reflection.js configs/matrix.json` (replace `matrix.json` if you named your config differently). You'll see a message about starting initial sync, and then "Synced to network!". Once it's synced, you can connect with your client, specifying the SASL password you put in the config (SASL username doesn't matter). ## Known issues diff --git a/certs/.gitkeep b/certs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config.example.json b/config.example.json index 2d89cc1..e658295 100644 --- a/config.example.json +++ b/config.example.json @@ -1,8 +1,8 @@ { "serverName": "testing.", "port": 6697, - "certFile": "reflection.pem", - "keyFile": "reflection.key", + "certFile": "certs/reflection.pem", + "keyFile": "certs/reflection.key", "lazyLoadLimit": 500, "syncTimeout": 15000, "lagWarningLimit": 20000, diff --git a/configs/.gitkeep b/configs/.gitkeep new file mode 100644 index 0000000..e69de29