| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This bot can join a Discord server and then will start taking secure backups .
The following environment variables need to be set:
For enabling a S3-compatible storage backend use the following environment variables to configure:
The main goal is to never write anything to disk/storage that contains message content or has structural data like channel names/id or server names/ids. To further guarantee integrity of each message, the bot will sign each message with its own ED25519 key. That key is the only sensitive key used by the bot.
Each message gets encrypted with the PGP/GPG public key passed to the bot via the environment variables (see Configuration). The message will be represented in other stored files only by the hash of the ciphertext.
The bot will sign the hash of the ciphertext with its ED25519 key. That signature will be written out-of-bounds to the manifest file (see Manifest format)
The ED25519 key is considered sensitive
Leakage of that key will allow to tamper with the messages by replacing the ciphertext with the attackers ciphertext.
Each directory file is encrypted with the PGP/GPG public key.
To not have any linkable data on disk, all server and channel id's used by the Manifest and Directory files are SHA256 hashes of those IDs. The only way to re-create the relations between servers, Channels and messages is to either know and hash the IDs, or by consulting the Directory file
The storage is seperated into:
In S3 mode only the manifest files will be briefly on disk. Everything else will directly go to S3. The S3 structure is noted in the file format definitions.
Each message is stored in its own encrypted file. The filename is the SHA256 hash of the files contents with the extension .msg. The encrypted message file does not bear any markers towards the server or channel it originated from.
Messages will have the following key in S3: messages/<SHA256-MESSAGE-HASH>
The file contains the following message properties: All properties are from the time of grabbing the msg the first time.
{
"author": {
"id": "<Discord ID of the User>",
"name": "<Name of the User on that Server>",
"global_name": "<Global name of the user>"
},
"server": {
"id": "<Discord ID of the Server>",
"name": "<Name of the Server>"
},
"channel": {
"id": "<Discord ID of the Channel>",
"name": "<Name of the Channel>"
},
"category": "<Name of the Category>",
"parent": "<Name of the Channels parent (mainly for threads)>",
"content": "<Message text content>",
"created_at": "<Message creation time on Discord in ISO8601 format>",
"attachments": [
{
"type": "<Content type of the attachment (eg. image/jpg)",
"origin_name": "<Orginal filename>",
"content": "<Base64 encoded content of the file>"
}
]
}Notes:
The manifest files contain the list a list of all messages per server and channel (threads are considered separate channels). They are simple CSV files with the following format per row:
The filename format is <SHA256-hash-of-Server-ID>-<SHA256-hash-of-Channel-ID>.manifest Manifests will have the following key in S3: manifests/<SHA256-hash-of-Server-ID>-<SHA256-hash-of-Channel-ID>
Each manifest and directory will be signed by the bot after a backup run. This way any tamper with the manifest or directory can be detected by verifying the seal against the manifest/directory content. The seal file only contains the ED25519 signature against the hashed content of the manifest/directory.
The filename format is:
The S3 key format is:
Contains the last discord message id, backed up in the channel. This is the only file that would contain a reference back to Discord.
The filename format is <SHA256-hash-of-Server-ID>-<SHA256-hash-of-Channel-ID>.loc The S3 key format is: locations/<SHA256-hash-of-Server-ID>-<SHA256-hash-of-Channel-ID>
The Bot will create a directory file per run, which contains a JSON structure for all servers, channels and threads it had access to during that run. The directory file is named <Run timestamp in ISO8601>.dir and is GPG encrypted.
The S3 key format is: directories/<Run timestamp in ISO8601>
The reason to have a directory file per run, is because the bot is not able to decrypt any data it has encrypted using the PGP public keys provided. The directory has to be encrypted to not leak the server structure, channel and thread names.
Format of the directory file:
[
{
"server_id": "<Discord ID of the Server>",
"server_id_hashed": "<SHA256 hash of server_id>",
"server_name": "<Name of the Server>",
"channels": [
{
"channel_id": "<Discord ID of the Channel>",
"channel_id_hashed": "<SHA256 hash of channel_id>",
"channel_name": "<Name of the Channel>",
"threads": [
{
"thread_id": "<Discord ID of the thread>",
"thread_id_hashed": "<SHA256 hash of thread_id>",
"thread_name": "<Name of the thread>"
}
]
}
]
}
]
NOTE: This process is how to do it manually. There will be a restore tool in the future.
With the manifest it is possible to reconstruct the channel conversations based on date and time.
Reconstruction should follow these steps:
| Back | FazBrowse Home | New Git URL |