Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ tier.
iOS app with push notifications for new tickets.

<details>
<summary><b>All 43 modules</b></summary>
<summary><b>All 44 modules</b></summary>

| Area | Modules |
|---|---|
| **Moderation & safety** | [Moderation](docs/modules/moderation.md) (case log, warnings, auto-actions) · [Auto-moderation](docs/modules/automod.md) (can sync to Discord's native AutoMod) · [Server logging](docs/modules/logging.md) · [Verification](docs/modules/verification.md) (button or Turnstile captcha) · [Ban appeals](docs/modules/appeals.md) · [Tickets / modmail](docs/modules/tickets.md) · [Applications](docs/modules/applications.md) (forms for staff to accept or deny) · [Channel cleanup](docs/modules/channel-cleanup.md) · Honeypot (beta) |
| **Welcome & roles** | [Welcome & leave](docs/modules/welcome.md) · [Welcome channel](docs/modules/welcome-channel.md) · [Introductions](docs/modules/introductions.md) (membership cards) · [Reaction roles & autoroles](docs/modules/roles.md) (emoji, buttons or dropdown) · [Temporary roles](docs/modules/temp-roles.md) (beta) · [Birthdays](docs/modules/birthdays.md) |
| **Engagement** | [Leveling](docs/modules/leveling.md) (image rank cards, public leaderboard) · [Economy](docs/modules/economy.md) (currency and shop, beta) · [Invite tracker](docs/modules/invite-tracker.md) · [Starboard](docs/modules/starboard.md) · [Quote board](docs/modules/quote-board.md) (beta, optional public page) · [Polls](docs/modules/polls.md) · [Giveaways](docs/modules/giveaways.md) · [Events](docs/modules/events.md) (beta) · [Suggestions](docs/modules/suggestions.md) (beta) · [Counting](docs/modules/counting.md) · [Game stats](docs/modules/game-stats.md) (Battlefield, OSRS, RS3) |
| **Automation** | [Custom commands](docs/modules/custom-commands.md) · [Autoresponder](docs/modules/autoresponder.md) · [Auto-react](docs/modules/auto-react.md) · [Auto threads](docs/modules/auto-threads.md) (beta, Discord only) · [Reminders](docs/modules/reminders.md) · [Sticky messages](docs/modules/sticky.md) · [AFK](docs/modules/afk.md) · [Temporary voice channels](docs/modules/temp-voice.md) |
| **Automation** | [Custom commands](docs/modules/custom-commands.md) · [Autoresponder](docs/modules/autoresponder.md) · [Auto-react](docs/modules/auto-react.md) · [Auto threads](docs/modules/auto-threads.md) (beta, Discord only) · [Bridge](docs/modules/bridge.md) (Discord ↔ Fluxer, beta) · [Reminders](docs/modules/reminders.md) · [Sticky messages](docs/modules/sticky.md) · [AFK](docs/modules/afk.md) · [Temporary voice channels](docs/modules/temp-voice.md) |
| **Alerts** | [Twitch](docs/modules/twitch-alerts.md) · [YouTube](docs/modules/youtube-alerts.md) · [Kick](docs/modules/kick-alerts.md) · [RSS / Atom](docs/modules/rss.md) (also Reddit, Mastodon, Bluesky) · [GitHub](docs/modules/github.md) · [Free games](docs/modules/free-games.md) · [App Store Connect](docs/modules/apple-connect.md) (instance operator only) |
| **Insights** | [Server statistics](docs/modules/server-stats.md) (live counter channels) · [Server insights](docs/modules/insights.md) (activity charts, aggregate counts only) |

Expand Down
2 changes: 1 addition & 1 deletion docs/dashboard-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ note.

## What the dashboard shows

- **Sidebar shows only what's turned on.** Instead of listing all 43 modules
- **Sidebar shows only what's turned on.** Instead of listing all 44 modules
with an on/off dot, the sidebar lists just the modules enabled for whichever
server you're looking at, grouped the same way the Dashboard/Overview page
groups them. Turn a module on from Overview and it appears in the sidebar
Expand Down
1 change: 1 addition & 0 deletions docs/fluxer.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ does not register anything with Fluxer for these.
| `/intro create` and the **Create my intro** button | **Introductions** uses `!intro create`, then asks the questions in DM, as on Discord. Sylo answers "Check your DMs" in the channel and removes that message after about 15 seconds. The **Create my intro** button of the prompt message, and **Post** and **Start over** under the preview in DM, are shown as reactions. |
| `/apply start` and the **Applications** panel | **Applications** uses `!apply start <form>` (and `!apply withdraw`), then asks the questions in DM, as on Discord. Choice and role questions are numbered options (at most 10), answered with the numbers. The panel message, the choice between DM and web, **Submit** and **Start over** under the preview, and **Accept** and **Deny** on each application are shown as reactions. Staff give a reason with `!application accept <id> <reason>` or `!application deny <id> <reason>`. A staff thread is not opened. |
| `/balance`, `/daily`, `/pay` and the other **Economy** commands | **Economy** uses chat commands with the same names (`!balance`, `!daily`, `!pay @member 100`, `!eco add @member 500 reason:"Prize"`). The leaderboard is `!economy-leaderboard`; its pages turn with the ⬅️ and ➡️ reactions. The shop is `!shop` (a numbered list that pages the same way), `!buy <name or number>`, `!inventory` and `!collection` (collectibles, with their pictures as embeds; the pages turn with the same reactions; with collections private it is a private reply, so it comes to your DMs); a giveaway entry fee works with the Enter reaction. A robbery result is posted in the channel as on Discord, and the victim gets the same DM. |
| A Discord channel's conversation in a Fluxer channel | The **Bridge** module shares one channel with a Discord channel through webhooks, with a one-time code both servers agree on. It is set up in the dashboard; no chat command is needed. A Discord poll shows on Fluxer as text. See [Bridge](modules/bridge.md). |
| Message menu **Save quote** | Not available. The **Quote board** module saves a quote with `!quote save <message link>`, or `!quote save` as a reply to the message. |
| Threads and auto-threads | Not available yet. The **Auto threads** module does nothing on Fluxer. Lock and lockdown skip the thread permissions. |
| Moving members between voice | Not usable from a bot. **Temporary voice channels** are still created, but the member gets a DM with a link to join, and a channel nobody joins within two minutes is removed. |
Expand Down
3 changes: 2 additions & 1 deletion docs/mobile-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ in there:
| `login` | Whether sign-in is available (false in open mode) |
| `loginProviders` | The configured logins, for example `["discord", "fluxer"]`; empty when `login` is false |
| `platforms` | The platforms the bot runs on, for example `["discord"]` |
| `features` | What this version's app API supports, so the app can hide what an older Sylo lacks. Today: `app-login`, `live-access`, `changelog`, `collectibles`, `welcome-trigger`, `member-search`, `access-levels`, `health`, `app-connect`, `setup-wizard`, `config-history`, `inbox-search`, `config-import`, `duplicate`, `message-templates` and `message-move`, plus `push` and `push-pigeon` when this instance can send notifications. See the list below |
| `features` | What this version's app API supports, so the app can hide what an older Sylo lacks. Today: `app-login`, `live-access`, `changelog`, `collectibles`, `welcome-trigger`, `member-search`, `access-levels`, `health`, `app-connect`, `setup-wizard`, `config-history`, `inbox-search`, `config-import`, `duplicate`, `message-templates`, `message-move` and `bridge`, plus `push` and `push-pigeon` when this instance can send notifications. See the list below |

The feature strings:

Expand All @@ -338,6 +338,7 @@ The feature strings:
- `duplicate`: the `duplicate` routes for reminders, embed messages, reaction-role sets, custom commands and shop items.
- `message-templates`: the built-in message templates and the raw message JSON import and export.
- `message-move`: when the channel of a posted **embed message**, the **Welcome channel** message or a **role panel** changes and is published, the server posts a fresh message in the new channel, stores it and then deletes the old one, so the app must not unpublish first. Other bot posts (verification, honeypot traps, applications and so on) are not covered. A publish that loses a race with another publish of the same embed message answers `409` with the current record.
- `bridge`: the [Bridge module](modules/bridge.md): `GET /api/v2/guilds/:id/modules/bridge/config` (the links, waiting requests and channels of the server; View level, with `owner` saying whether the caller may change anything) and, for the server owner only (Edit access is not enough: a `403` otherwise), `POST` to `…/modules/bridge/request` (a code for another server), `…/modules/bridge/accept` (use a code), `…/modules/bridge/requests/:id/cancel`, and `…/modules/bridge/links/:id/options`, `…/pause`, `…/resume` and `…/unlink`. Every answer carries the fresh `overview`.
- `app-connect`: [adding the other login](#adding-the-other-login). Only where sign-in is on and both Discord and Fluxer logins are set up.
- `push`, `push-pigeon`: this instance can send notifications to signed-in apps.

Expand Down
1 change: 1 addition & 0 deletions docs/modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ platform gaps (native AutoMod rules, threads, moving members between voice).
| [Quote board](quote-board.md) | Save memorable messages (message menu or `/quote save`), show them with `/quote`, optional public page (beta) | off | — |
| [Introductions](introductions.md) | Members answer a few questions in DM and Sylo posts a membership card in the introductions channel (beta) | off | Server Members |
| [Applications](applications.md) | Forms members fill in, in DM or on the web, for staff to accept or deny, with requirements, roles and messages (beta) | off | Server Members |
| [Bridge](bridge.md) | Share one conversation between a Discord channel and a Fluxer channel: a one-time code both servers agree on, webhooks, replies, files, edits and deletes, no pings across (beta) | off | Message Content |
| [Economy](economy.md) | A currency members earn by chatting and in voice, keep in cash or a bank, pay each other and compete for; optional robbing; staff tools (beta) | off | Message Content |
| [AFK](afk.md) | Members mark themselves away; Sylo replies to mentions | off | — |
| [Temporary voice channels](temp-voice.md) | Join-to-create voice hubs controlled with `/voice-*` | off | — |
Expand Down
115 changes: 115 additions & 0 deletions docs/modules/bridge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Bridge (beta)

Share one conversation between a channel on **Discord** and a channel on **Fluxer**. Members on both
sides write as they always do; Sylo shows each message on the other side with the author's name and
picture, and carries replies, files, edits and deletes along.

This is Sylo's own implementation. A bridge needs a Sylo that is connected to both platforms (the hosted
Sylo is) and that is a member of both servers.

**Dashboard:** `/v2/guilds/<id>/m/bridge` - the linked channels, a form to ask for a link, a form to use a
code, what this server shares, and pause, resume and unlink.

## Who can use it: the server owner

**Only the owner of a server can use the bridge** (the Discord server owner, the Fluxer server owner), on
both sides. Administrators, people with **Edit** access to the dashboard and the bot-master roles cannot ask
for a link, use a code, change what a server shares, or pause, resume or unlink a bridge. People with **View**
access see the status of the links on the page, read-only. Ownership is checked again on every action, from
the owner the platform reports for the server.

Sylo records who owns each server when the link is made. **If the owner of either server changes, the link
pauses** (on both sides, with a notice and an audit entry) **until the new owner confirms it**: the new
owner opens the Bridge page and presses **Resume**. If both servers changed owner, both owners have to confirm.
A code that was made by a previous owner is refused. Messages check this as they come, and a check every five
minutes covers a quiet link.

## Linking: both servers agree

A link is never made from one side alone.

1. In the first server, the owner opens the Bridge page, picks a channel and presses
**Get a code**. The code (`XXXX-XXXX-XXXX`) works once and for **15 minutes**. Sylo stores only a hash of
it, so it is shown this one time.
2. They give the code to the owner of the other server. That owner opens the Bridge
page there, pastes the code, picks the channel that should join it and presses **Link the channels**.
3. Sylo makes a webhook in each channel and posts a notice in both: "Bridge on. Messages in this channel are
shared with #chat in Fluxer Home on Fluxer ...".

A link joins a Discord channel to a Fluxer channel, never two on the same platform. A channel is in one link
at a time, and a server has at most 10 links and 5 waiting requests. The Bridge module must be on in both
servers. Wrong codes are rate limited, and a few wrong ones in a row lock the attempts for a while.

**Either side can unlink at any time** (the owner). Both webhooks are deleted, the message map goes, and
both channels are told. If Sylo is removed from a server, the server on the other end loses its webhook and
is told too.

**Pause** stops the bridge from either side. Only the server that paused it can resume it. A link that Sylo
stopped itself (see below) can be resumed by either server once the cause is fixed.

## What crosses

| | |
|---|---|
| Messages | Posted by a webhook in the other channel under the author's display name and picture, with the platform in the name ("Alice [Discord]"). |
| Replies | A reply starts with a short quote of the message it answers, with a link to it on the other side when Sylo knows the copy. |
| Files | Re-uploaded up to **8 MB** each and 8 MB per message (at most 10 files). Larger files, files that cannot be fetched, and every file when a server turns uploads off, cross as a link. |
| Emoji | Unicode emoji as they are. A custom emoji crosses as the custom emoji **with the same name** in the other server, otherwise as `:name:`. |
| Stickers | As a picture link. |
| Embeds | Rich embeds (from bots) with their text made harmless. A link preview is left out: the other platform makes its own. |
| Polls | As text: the question and the answers. Fluxer has no polls and a vote cannot count on both sides, so the vote stays where the poll is. |
| Edits and deletes | Mirrored through a message map that keeps a message for **30 days** (the daily retention job removes older rows). An edit or delete of an older message is not followed. Deleting a copy does not delete the original. |
| Joins | Optional, per server: a line "👋 Zed joined Discord Home" on the other side. Needs the Server Members intent on Discord. |

## Safety rules

- **No ping crosses.** Every copy is sent with allowed mentions set to none, and the text itself is changed:
`@everyone` and `@here` get an invisible character that breaks them, and users, roles and channels become
plain names ("@Bobby", "@moderators", "#rules").
- **No loops or echoes.** A message posted by any Sylo bridge webhook, or by Sylo itself, is never relayed.
A channel is in only one link, so a copy cannot find its way back.
- **Webhook messages never cross**, whatever the options say: they are what bridges post (this one and any other
bridge on the same channels), and relaying them would make two bridges feed each other forever. Bot accounts
whose name already carries a platform tag are skipped too.
- **Bots are off by default.** Each server decides for itself what it sends: **bot messages** (bot accounts), **who
joins** and **copy files** are options of that server's side only, and the other server cannot change them.
System messages (joins, pins, boosts) are never relayed.
- **Age restriction.** An age-restricted channel can only be linked to an age-restricted channel. On Fluxer a
channel counts as age-restricted when its own setting, its category's or the server's says so (what Sylo cannot
read counts as restricted); a Discord server marked age-restricted counts for all its channels. It is checked
when linking, when resuming, and on **every message**: if one of the channels changes, the link stops.
- **Visible notice.** Both channels get a notice while a bridge is on, and when it is paused, stopped or
ended.
- **Rate limits.** Each webhook has its own queue: sends are spaced out, a rate limit from the platform is
waited out, a short outage is retried with growing pauses, and a message that waited more than five
minutes is dropped. A queue holds at most 100 messages; a flooded channel drops the newest and counts it.
One server's queue never slows another's.
- **A failing link stops.** No permission, a webhook Sylo cannot make again, a deleted channel, or five
failed deliveries in a row stop the link. Sylo says so in both channels, the **Health** page shows it as a
problem with the reason, and it is not retried until someone presses **Resume**.
- **Webhooks are Sylo's.** Sylo makes and manages the webhook of each channel and makes a new one if it is
deleted. Its token is stored sealed (AES-256-GCM, keyed from the session secret) and never sent to the
browser. If the session secret changes, the tokens cannot be read and Sylo makes new webhooks (also when it
only wanted to edit a copy). A plain-text token from a development database is sealed the first time its link
is read; accepting plain text at all is removed in a later version.
- **You can only bridge what you can see.** The person who asks for a link, and the one who uses a code, must
be able to view, read and send in their channel themselves (an owner normally can).
- **Deletes always follow.** A copy is removed even if the link is paused or stopped, when the delete comes
before the copy was posted, after a webhook was replaced (Sylo then deletes it as the bot, which needs Manage
Messages), and for a purge of many messages. After an unlink the message map is gone, so copies already
posted stay and a later delete of the original no longer reaches them.
- **File downloads share one budget** (4 files held at a time and 32 MB for the whole Sylo): a file is held from
its download until its copy is sent, and a file that does not fit crosses as a link.
- **A delete that hits a temporary error is tried again** (with growing pauses), and the message map entry stays
until the copy is really gone.

## Needs

- **Manage Webhooks**, View Channel and Send Messages in each bridged channel (the Health page checks them).
- The **Message Content** intent (`INTENT_MESSAGE_CONTENT`, on by default).
- Being the owner of the server that makes the request and of the server that uses the code.

## API

The Sylo app can read and change a bridge through `/api/v2` (`bridge` in the app's feature list). A GET at
View level, everything else for the server owner only (Edit access is not enough). See [mobile-app.md](../mobile-app.md).
Loading
Loading