documentation revamp

This commit is contained in:
slatinsky 2023-08-02 01:26:08 +02:00
parent 60975dca5e
commit c1259e69cb
3 changed files with 153 additions and 90 deletions

238
README.md
View file

@ -1,59 +1,28 @@
![](docs/screenshot.png)
# DiscordChatExporter-frontend (DCEF)
View your JSON [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter) exports as if you were using Discord interface. Also supports other exporters like [Roachbones/discordless](https://github.com/Roachbones/discordless) exporting in the same JSON format as DiscordChatExporter.
## Why JSON exports are better than HTML exports?
- better-suited for long-term preservation
- contain more information than HTML exports
- readable by third-party applications like this one or [chat-analytics](https://github.com/mlomb/chat-analytics), not just browsers
- smaller in size
Browse your [Discord chat exports](https://github.com/Tyrrrz/DiscordChatExporter) in a familiar discord like user interface. [Try a demo in your browser :)](https://dcef.slada.sk/).
This project aims to provide you with better experience than what you get by just opening HTML exports in your browser. In one place and with many more features, like search, message deduplication, etc. And it will get even better in the future :).
> Want to chat? Join [Tyrrrz's discord server](https://discord.gg/2SUWKFnHSm). I usually hang out in `#dce-frontend` channel
## Features
- View JSON exports in Discord like interface
- Message deduplication - merge multiple JSON exports and view them as one
- Lazy loaded virtual list - load only messages you need to see
- Forums and threads support
- Search with filters and autocomplete
- Load assets locally or from Discord servers
- Private messages or guild exports are supported
- Discord Markdown rendering
- Right click message and select "Open in discord" to view message in Discord
- Windows and Linux support
## Downloads
[Windows (stable binary release)](https://github.com/slatinsky/DiscordChatExporter-frontend/releases)
### System requirements
- You need 1.5+ GB of free RAM for the mongodb database to work correctly
- The browser viewer has almost no requirements, but it's recommended to have at least 1 GB of free RAM
- Chromium based browsers and Firefox are supported, but most of the testing was done on Chromium.
- Small viewports (mobile phones) are not supported yet
Note: Discord servers are known internally as guilds
[Linux (docker image)](https://hub.docker.com/r/slada/dcef)
## Quick start (Windows)
Using prebuilt binaries is the easiest way to use this tool on Windows.
if you don't have any exports yet, you can try out the viewer with example exports included in the release. Just skip step 3.
1. Download the latest release from [releases page](https://github.com/slatinsky/DiscordChatExporter-frontend/releases)
2. Extract the archive
3. Move your [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter) exports to `/exports/` folder ([supported exports](#supported-exports)). Folder structure inside this folder doesn't matter, script will find everything it needs.
3. Move your [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter) JSON exports to `/exports/` folder ([supported exports](#supported-exports)).
4. Run `dcef.exe`
**Important:** files in exports folder may exceed Windows path length limit of 260 characters. If you have any issues with loading your assets you can choose one of the following solutions:
- move your exports to a folder with shorter path
- or run `registry_tweaks/change_260_character_path_limit_to_32767.reg` to increase the limit to 32767 characters (requires admin privileges) and restart your computer
## Quick start (Linux)
### Beta builds (Windows)
If you want to try out the latest features, you can use [beta builds](https://github.com/slatinsky/DiscordChatExporter-frontend/actions/workflows/windows-build.yml). They are automatically built from the latest commit on `master` branch or from pull requests.
## Docker (cross-platform)
**Info**: Tested on Ubuntu 22.04 and WSL2 on Windows 10. **Not** tested on arm based systems like Raspberry Pi or Apple M1.
This verion is the best way to [host the viewer on a server](docs/Server-hosting.md) for others to use.
Docker version is the best way to [host the viewer on a server](docs/Server-hosting.md) for others to use.
1. pull the image from docker hub
@ -69,95 +38,178 @@ cd /path/to/your/exports
3. Run the container
```bash
docker run --volume "$(pwd):/dcef/exports" --volume dcef_cache:/dcef/cache --rm --name dcef -p 21011:21011 -it slada/dcef:main
docker run --restart=always --volume "$(pwd):/dcef/exports" --volume dcef_cache:/dcef/cache --rm --name dcef -p 21011:21011 -it slada/dcef:main
```
4. Open `http://127.0.0.1:21011/` in your browser
**Note:** arm based systems like Raspberry Pi or Apple M1 are not officially supported. Pull requests are welcome :)
<details><summary>Build docker image from source code</summary>
<p>
You need docker and git installed. Tested on non-snap version of docker on Ubuntu 22.04.
1. Build image
## Other ways to run DCEF
<details><summary><b>Windows beta builds</b></summary>
If you want to try out the latest features, you can use [beta builds](https://github.com/slatinsky/DiscordChatExporter-frontend/actions/workflows/windows-build.yml). They are automatically built from the latest commit on `main` branch. You need to be logged in to Github account to download them.
</details>
<details><summary><b>Build docker image from source code</b></summary>
You need docker and git installed. Then run:
```bash
git clone https://github.com/slatinsky/DiscordChatExporter-frontend
cd DiscordChatExporter-frontend
docker build -t dcef .
```
Then use the same instructions as for the docker hub version, but replace `slada/dcef:main` with `dcef` in step 3.
</p>
Then use the same instructions as for the Linux docker version, but replace in commands `slada/dcef:main` with `dcef`.
</details>
<details><summary>Debugging containers</summary>
<p>
To debug a running container, run `docker exec -it $(docker ps | grep 'dcef' | awk '{ print $1 }') sh`. This will open a shell inside the container.
## Upgrade guide
To remove volume `dcef_cache` with temporary files, run `docker volume rm dcef_cache`
<details><summary><b>Upgrade windows binary release</b></summary>
</p>
</details>
## Upgrade guide (Windows)
Want to upgrade from previous version? Follow these steps:
1. Download the latest release from [releases page](https://github.com/slatinsky/DiscordChatExporter-frontend/releases).
2. Delete everything (except `exports` folder) in your discordchatexporter-frontend folder.
3. Move everything (except `exports` folder) from the new release to your discordchatexporter-frontend folder.
Info: since release 1.10.0, exports folder was changed from `/static/input/` to `/exports/`.
</details>
<details><summary><b>Upgrade docker image</b></summary>
## Upgrade guide (Docker)
Stop the container and clear the cache volume by running `docker volume rm dcef_cache`. Then pull the latest version from git (`git pull`) and build the image again using linux instructions.
<a name="supported-exports"></a>
## Which exports are supported?
Exports are done by [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter).
- JSON export format (`--format Json`) is required
- Including assets (`--media --reuse-media`) is highly recommended, but not required
- Skipping markdown prerendering (`--markdown false`) is highly recommended, but not required
- Don't forget to export **threads and forums**, because they **are not included in the main export** (see examples below for a guide on how to export them)
<details><summary>CLI examples</summary>
<p>
Export all accessible channels from guild:
```
DiscordChatExporter.Cli.exe exportguild --token DISCORD_TOKEN -g GUILD_ID --media --reuse-media --markdown false --format Json --output OUTPUT_FOLDER_PATH
```
Export all dms (sadly, exporting dms can't be done without selfboting):
```
DiscordChatExporter.Cli.exe exportdm --token DISCORD_TOKEN --media --reuse-media --markdown false --format Json --output OUTPUT_FOLDER_PATH
```
Export channel/thread/forum posts:
```
DiscordChatExporter.Cli export --token DISCORD_TOKEN --media --reuse-media --markdown false --output OUTPUT_FOLDER_PATH --format Json --channel CHANNEL_OR_THREAD_ID_OR_FORUM_POST_ID_1 CHANNEL_OR_THREAD_ID_OR_FORUM_POST_ID_2 CHANNEL_OR_THREAD_ID_OR_FORUM_POST_ID_3 CHANNEL_OR_THREAD_ID_OR_FORUM_POST_ID_4
```bash
cd path/to/your/exports/
docker rm dcef --force
docker image rm slada/dcef:main
docker pull slada/dcef:main
docker run --restart=always --volume "$(pwd):/dcef/exports" --volume dcef_cache:/dcef/cache --rm --name dcef -p 21011:21011 -it slada/dcef:main
```
</details>
## Uninstall
<details><summary><b>Windows (binary release)</b></summary>
DCEF does not create any files outside of its folder, so you can just delete the folder to uninstall it.
Move your `exports` folder somewhere else if you want to keep your exports.
</details>
<details><summary><b>Linux (docker)</b></summary>
1. kill and delete the container
```bash
docker rm dcef --force
```
2. remove the volume
```bash
docker volume rm dcef_cache
```
3. remove the image
```bash
docker image rm slada/dcef:main
```
</p>
</details>
[Helper script to export archived threads in a channel](docs/Exporting-threads.md)
<a name="supported-exports"></a>
## How to export data from Discord to view it in DCEF?
[Helper script to export forum posts in a channel](docs/Exporting-threads.md)
JSON exports are created using [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter).
### Settings for GUI version of DiscordChatExporter
Make sure that export format is set to `JSON`. Optionally, you can enable `Download assets` option to download images, videos and other types of assets.
<details><summary><b>Partial export using GUI version of DiscordChatExporter</b></summary>
Make sure that export format is set to `JSON` and `Format markdown` is disabled. Optionally, you should also enable `Download assets`+`Reuse assets` option to download images, videos and other types of assets.
![](docs/dce-export-more.png)
**NOTE**: You can't export threads and forums using GUI version of DCE. You need to use CLI version for that.
## Development
</details>
<details><summary><b>Full guild export using CLI version of DiscordChatExporter</b></summary>
> - JSON export format (`--format Json`) is required
> - Downloading assets (`--media --reuse-media`) is highly recommended, but not required
> - Skipping markdown prerendering (`--markdown false`) is highly recommended, but not required
Export all accessible channels in a guild (**without threads and forum posts**):
```bash
DiscordChatExporter.Cli.exe exportguild --token DISCORD_TOKEN -g GUILD_ID --media --reuse-media --markdown false --format Json --output OUTPUT_FOLDER_PATH
```
Export threads/forum posts (you can pass multiple thread/forum post ids):
```bash
DiscordChatExporter.Cli export --token DISCORD_TOKEN --media --reuse-media --markdown false --output OUTPUT_FOLDER_PATH --format Json --channel THREAD_ID_OR_FORUM_POST_ID_1 THREAD_ID_OR_FORUM_POST_ID_2 THREAD_ID_OR_FORUM_POST_ID_3 THREAD_ID_OR_FORUM_POST_ID_4
```
Don't want to manually right click all threads/forums post and copy their ids? These helper scripts can help you:
[Helper script to export archived threads in a channel](docs/Exporting-threads.md)
[Helper script to export forum posts in a channel](docs/Exporting-threads.md)
</details>
<details><summary><b>Export private messages using CLI version of DiscordChatExporter</b></summary>
Export all dms (sadly, exporting dms can't be done without selfboting):
```bash
DiscordChatExporter.Cli.exe exportdm --token DISCORD_TOKEN --media --reuse-media --markdown false --format Json --output OUTPUT_FOLDER_PATH
```
</details>
## FAQ
<details><summary><b>Some assets are not showing on Windows</b></summary>
Files in `/exports/` folder may exceed Windows path length limit of 260 characters. If you have any issues with loading your assets you can choose one of the following solutions:
- move DCEF to a folder with shorter path
- or run `registry_tweaks/change_260_character_path_limit_to_32767.reg` to increase the limit to 32767 characters (requires admin privileges) and restart your computer. To revert this change, run `registry_tweaks/restore_260_character_path_limit.reg` and restart your computer.
</details>
<details><summary><b>DCEF hangs and prints `Slow SessionWorkflow loop` to the console</b></summary>
`Slow SessionWorkflow loop` messages are completely normal - if you see them, you know that data is pushed to mongodb database and the process is not stuck. Just be patient and wait for the process to finish. If you have a lot of exports, it may take a while.
DCEF is not just an simple viewer. This process enriches your exports with additional data and stores them in a database for search and other features to work.
</details>
<details><summary><b>DCEF won't run on M1 mac</b></summary>
[This pull request](https://github.com/slatinsky/DiscordChatExporter-frontend/pull/30) may help you
</details>
## For developers
[Architecture choices](docs/Architecture.md)
@ -174,6 +226,11 @@ Make sure that export format is set to `JSON`. Optionally, you can enable `Downl
And for other technologies used in this project - sveltekit, docker, nodejs, nvm, pyinstaller, nginx, mongodb
## Related projects
- [Roachbones/discordless](https://github.com/Roachbones/discordless) - real time man-in-the-middle exporter
- [mlomb/chat-analytics](https://github.com/mlomb/chat-analytics) - analytics for your Discord chats.
## License
GNU GENERAL PUBLIC LICENSE. See [LICENSE](LICENSE) for more details.
@ -183,6 +240,7 @@ DiscordChatExporter-frontend is not affiliated with Discord. Discord is a regist
## Contributing
Feel free to open issues and pull requests.
### Short guide, how to contribute
- Fork the repository
- Create a new branch

View file

@ -1,3 +1,8 @@
# Supporting other exporters
Any exporter exporting in the same format as [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter) does, should work with this viewer. One of them is [Roachbones/discordless](https://github.com/Roachbones/discordless) - real time man-in-the-middle exporter.
## For developers
Are you creating a new discord exporter and want to view the exported data with this viewer? Just convert the data from your format to the same format as DiscordChatExporter uses :).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Before After
Before After