rearrange documentation into folder

This commit is contained in:
Cadence Ember 2023-09-19 15:55:05 +12:00
parent 807ab899be
commit b31b7c794c
4 changed files with 69 additions and 10 deletions

View file

@ -1,14 +1,14 @@
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "sim" (
"discord_id" TEXT NOT NULL UNIQUE,
"discord_id" TEXT NOT NULL,
"sim_name" TEXT NOT NULL UNIQUE,
"localpart" TEXT NOT NULL UNIQUE,
"mxid" TEXT NOT NULL UNIQUE,
"localpart" TEXT NOT NULL,
"mxid" TEXT NOT NULL,
PRIMARY KEY("discord_id")
);
CREATE TABLE IF NOT EXISTS "webhook" (
"channel_id" TEXT NOT NULL UNIQUE,
"webhook_id" TEXT NOT NULL UNIQUE,
"channel_id" TEXT NOT NULL,
"webhook_id" TEXT NOT NULL,
"webhook_token" TEXT NOT NULL,
PRIMARY KEY("channel_id")
);
@ -63,4 +63,10 @@ CREATE TABLE IF NOT EXISTS "lottie" (
"mxc" TEXT NOT NULL,
PRIMARY KEY("id")
) WITHOUT ROWID;
CREATE TABLE IF NOT EXISTS "emoji" (
"emoji_id" TEXT NOT NULL,
"animated" INTEGER NOT NULL,
"mxc_url" TEXT NOT NULL,
PRIMARY KEY("emoji_id")
) WITHOUT ROWID;
COMMIT;

View file

@ -157,7 +157,11 @@ Can use custom transaction ID (?) to send the original timestamps to Matrix. See
2. Create or replace state event for the bridged pack. (Can just use key "ooye" and display name "Discord", or something, for this pack.)
3. The emojis may now be sent by Matrix users!
TOSPEC: m2d emoji uploads??
```
pragma case_sensitive_like = 1;
insert into emoji select replace(substr(discord_url, 35), ".gif", "") as emoji_id, 1 as animated, mxc_url from file where discord_url like 'https://cdn.discordapp.com/emojis/%.gif';
insert into emoji select replace(substr(discord_url, 35), ".png", "") as emoji_id, 0 as animated, mxc_url from file where discord_url like 'https://cdn.discordapp.com/emojis/%.png';
```
# Various considerations
@ -171,10 +175,6 @@ TOSPEC: m2d emoji uploads??
- Sims will already be registered, registration will fail, all events from those sims will fail.
### sim_member table
- Sims won't be invited because they are already joined, all events from those sims will fail.
### guild_space table
- channelToKState will fail, so channel data differences won't be calculated, so channel/thread creation and sync will fail.
@ -195,6 +195,10 @@ TOSPEC: m2d emoji uploads??
- Some duplicate webhooks may be created.
### sim_member table
- Some sims will try to re-join the room, which is slow the first time.
## Creating and notifying about new threads:
Discord's gateway events when a thread is created off a message:

View file

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,49 @@
# Simplified Homeserver Setup
Full instructions are located around here: https://matrix-org.github.io/synapse/v1.37/setup/installation.html
These instructions are for a quick setup you can use for local development of OOYE, if you don't have administrator access to an existing homeserver.
## Windows prerequisites
Enter an Ubuntu WSL. LOL
## Install Synapse
We'll install from the prebuilt packages provided by matrix.org. If you're not on Debian/Ubuntu then you can find more package names [in the official docs.](https://matrix-org.github.io/synapse/v1.37/setup/installation.html#prebuilt-packages)
```
sudo apt install -y lsb-release wget apt-transport-https
sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/matrix-org.list
sudo apt update
sudo apt install matrix-synapse-py3
```
After the final command finishes downloading, it will interactively prompt you for the homeserver's name for federation. Just enter `localhost`.
If you want to change this later, you can do so with `sudo dpkg-reconfigure matrix-synapse-py3`.
## Not installing additional features
We're going to stick with SQLite, which isn't as efficient as Postgres, but significantly eases setup. For this small test, SQLite should do just fine.
We don't need TLS certificates for localhost.
## Start it on Linux
```
sudo systemctl start matrix-synapse
```
## Start it on Windows
Trying to start it with systemctl doesn't seem to like me, so I'll do it this way:
```
sudo /opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/ --generate-keys
sudo /opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/
```
## Notes
If you see `Config is missing macaroon_secret_key`, you can ignore this. The real log messages are in `/var/log/matrix-synapse/*.log`.