1
0
mirror of https://github.com/spacebarchat/docs.git synced 2024-11-22 02:02:32 +01:00

Remove test client ( and related ) docs

This commit is contained in:
Madeline 2023-03-01 18:53:14 +11:00
parent 5f23ca3a0b
commit 6f1772281d
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47
9 changed files with 0 additions and 158 deletions

View File

@ -60,20 +60,9 @@
or to have access to leaked Discord.com code, we take measures in line with our [Code of Conduct](/contributing/conduct.md) or to have access to leaked Discord.com code, we take measures in line with our [Code of Conduct](/contributing/conduct.md)
to ensure the Fosscord codebase is free of any proprietary code. We want absolutely nothing to do with it. to ensure the Fosscord codebase is free of any proprietary code. We want absolutely nothing to do with it.
??? info "What about the test client? That's just the Discord.com one!"
Yes, this is true. However, this is purely for testing and development purposes.
Fosscord is first and foremost a *backend* server implementation, and we simply use Discord.com's client
to verify our work as correct. Efforts are being made to move away from this with our own client, but as you may have guessed,
building a Discord-compatible client is difficult.
You can read more about the test client [here](setup/server/Test%20Client/index.md)
??? info "Is this illegal?" ??? info "Is this illegal?"
The Fosscord maintainers do not believe it to be, no. See: [Oracle v. Google](https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America,_Inc.). The Fosscord maintainers do not believe it to be, no. See: [Oracle v. Google](https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America,_Inc.).
The only aspect of Fosscord that is not entirely written by us is the test client which we simply proxy from Discord.com,
and we take measures to show that the client is purely for development and research purposes.
??? info "Why are you doing this, anyway?" ??? info "Why are you doing this, anyway?"

View File

@ -1,67 +0,0 @@
## Using your Discord.com desktop client with a Fosscord instance
=== "Environment Variables"
This assumes your Fosscord instance has the [Test Client](../server/Test%20Client/) enabled, and [erlpack](https://npmjs.com/package/@yukikaze-bot/erlpack) installed.
Set the `DISCORD_WEBAPP_ENDPOINT` environment variable on the machine running the client to the Fosscord web app URL, for example `https://staging.fosscord.com`.
On Windows:
1. Open the start menu and search for "Environment variables"
2. Click "Environment Variables" at the bottom of this new window, titled "System Properties"
3. Add a new user variable
4. Set the name to `DISCORD_WEBAPP_ENDPOINT`, and the value to your instance URL.
On Linux, you can:
* run `DISCORD_WEBAPP_ENDPOINT=instance url discord` on the CLI
* edit the `discord.desktop` file to include the above
* add `EXPORT DISCORD_WEBAPP_ENDPOINT=url` to your bash/zsh/etc profile (`~/.bashrc` for example)
* and probably lots more
=== "settings.json"
This assumes your Fosscord instance has the [Test Client](../server/Test%20Client/) enabled, and [erlpack](https://npmjs.com/package/@yukikaze-bot/erlpack) installed.
You may edit your desktop client's `settings.json` file at
`%appdata%/discord/settings.json` on Windows and typically
`~/.config/discord/settings.json` on Linux,
adding the following line
```json
"WEBAPP_ENDPOINT" : "https://your_fosscord_instance_url"
```
such that it looks like this, as an example
```json
{
"IS_MAXIMIZED": true,
"IS_MINIMIZED": false,
"WINDOW_BOUNDS": {
"x": 335,
"y": 86,
"width": 940,
"height": 600
},
"BACKGROUND_COLOR": "#202225",
"WEBAPP_ENDPOINT": "https://your_fosscord_instance_url"
}
```
=== "Webcord"
This assumes your Fosscord instance has the [Test Client](../server/Test%20Client/) enabled.
Webcord does not currently allow specifcying custom instance URLs.
The available instances with Webcord are [https://app.freecord.ir](Freecord) and
[staging.fosscord.com](https://staging.fosscord.com).
1. Download and install [Webcord](https://github.com/SpacingBat3/WebCord)
2. In the top bar, "File" -> "Settings"
3. Scroll down to "Discord Instance" and select a Fosscord instance you would like to use
=== "Host the proxy yourself"
If an instance does not have the test client enabled, you can [host the proxy yourself](https://github.com/fosscord/Discord-Client-Proxy), and simply set it to use your desired Fosscord instance.

View File

@ -1,22 +0,0 @@
# Test Client
!!! warning "The test client included with fosscord-server is deprecated and will be removed in favour of [Discord-Client-Proxy](http://github.com/fosscord/Discord-Client-Proxy) in the future"
The test client is a proxy to the Discord.com client used for development purposes.
You can enable the test client by setting the [`client_useTestClient` config](../configuration/index.md) value in your database.
## How it works
By editing the `GLOBAL_ENV` variable used by the client, we can trick it into sending requests to the API/Gateway/CDN/etc to us,
instead of Discord.com. We simply proxy it from Discord.com otherwise.
## Updating
To update the client version served, edit the 4 `<script>` tags in the `<body>` of `assets/client_test/index.html`,
with ones used by a client version you wish to use.
To get the latest client scripts, simply download the HTML served by [https://discord.com/app](https://discord.com/app) (through `wget https://discord.com/app`, for example)
Do not replace the `assets/client_test/index.html` file with a fresh one from Discord.com, as there are additional changes made to the file by the Fosscord team.
## [Theming](theming.md)
## [Plugins](plugins.md)

View File

@ -1,17 +0,0 @@
There is no plugin API available to use with the test client currently.
You cannot install BetterDiscord, Powercord/Replugged, or other client mod plugins without heavy modification at this time.
However, you _can_ install [Vencord](https://github.com/Vendicated/Vencord)
quite easily with only slight modifications to the [user script](https://github.com/Vendicated/Vencord#installing-on-browser).
For instances you control, simply find and replace all mentions of `GM_xmlhttpRequest` with `new XMLHttpRequest`, and `unsafeWindow` with `window`.
Throw the edited file into the `assets/preload-plugins` directory, restart the server, and you now have Vencord installed instance-wide!
If you want to install Vencord on instances you do not control, do not perform any of the above steps, and simply modify
the `@match` line at the top to include the instance(s). For [staging.fosscord.com](https://staging.fosscord.com):
```js
// @match *://*.staging.fosscord.com/*
```
You may now install the modified user script in your favourite user script browser extension, such as [Tampermonkey](https://www.tampermonkey.net/)

View File

@ -1,10 +0,0 @@
# Theming
'Theming' here refers to the theming of the [test client](index.md).
Fosscord can inject additional CSS into the client to allow you to change quite a lot about it's appearence.
There's three different CSS files injected into the client, in `/assets/public`, including `fosscord-login.css`, `fosscord.css`, and `user.css`.
Fosscord developers may make changes to `fosscord.css` occasionally, so it's best to not touch this.
`user.css` and `fosscord.css` are applied to all routes in the client, while `fosscord-login.css` is only applied to the login/register routes.
You can essentially throw any BetterDiscord/Replugged CSS theme into the `user.css` file and, given it was designed for the same client version, it'll work.

View File

@ -19,5 +19,3 @@ in the `fosscord-server` folder, with the format `NAME=VALUE` with each on new l
| STORAGE_PROVIDER | "s3" or "file" | CDN storage provider | | STORAGE_PROVIDER | "s3" or "file" | CDN storage provider |
| STORAGE_BUCKET | string | S3 bucket name | | STORAGE_BUCKET | string | S3 bucket name |
| STORAGE_REGION | string | S3 storage region | | STORAGE_REGION | string | S3 storage region |
| ONLY_CACHE_JS | any | If set, [`npm run generate:client`](../npmScripts.md#generateclient) will only cache JS files. |
| CLIENT_PATCH_INSTANCE_NAME | string | If set, [`npm run generate:client`](../npmScripts.md#generateclient) will use this as instance name. |

View File

@ -21,10 +21,8 @@ Arrays are represented by \_[number] in a config key. For example, multiple `gui
| key | default | type | description | | key | default | type | description |
| -------------------------------------------------- | -------------------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------- | | -------------------------------------------------- | -------------------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------- |
| gateway_endpointClient | null | string | Injected into index.html if available |
| gateway_endpointPrivate | null | string | Used for internal communication with gateway | | gateway_endpointPrivate | null | string | Used for internal communication with gateway |
| gateway_endpointPublic | null | string | Publicly announced gateway endpoint | | gateway_endpointPublic | null | string | Publicly announced gateway endpoint |
| cdn_endpointClient | null | string | See gateway_endpointClient |
| cdn_endpointPrivate | http://localhost:3001 | string | See gateway_endpointPrivate | | cdn_endpointPrivate | http://localhost:3001 | string | See gateway_endpointPrivate |
| cdn_endpointPublic | http://localhost:3001 | string | See gateway_endpointPublic | | cdn_endpointPublic | http://localhost:3001 | string | See gateway_endpointPublic |
| cdn_resizeHeightMax | 1000 | number | Maximum image resize height for embeds. | | cdn_resizeHeightMax | 1000 | number | Maximum image resize height for embeds. |
@ -135,7 +133,6 @@ Arrays are represented by \_[number] in a config key. For example, multiple `gui
| templates_allowTemplateCreation | true | boolean | Whether new guild templates can be created | | templates_allowTemplateCreation | true | boolean | Whether new guild templates can be created |
| templates_allowDiscordTemplates | true | boolean | Whether guild templates from Discord.com can be fetched | | templates_allowDiscordTemplates | true | boolean | Whether guild templates from Discord.com can be fetched |
| [templates_allowRaws](/concepts/guildTemplates.md) | true | boolean | Whether raw guild templates are allowed | | [templates_allowRaws](/concepts/guildTemplates.md) | true | boolean | Whether raw guild templates are allowed |
| client_useTestClient | false | boolean | Whether the Discord.com test client is enabled |
| sentry_enabled | false | boolean | Whether server-side Sentry analytics is enabled | | sentry_enabled | false | boolean | Whether server-side Sentry analytics is enabled |
| sentry_endpoint | Fosscord sentry endpoint | string | Sentry endpoint | | sentry_endpoint | Fosscord sentry endpoint | string | Sentry endpoint |
| sentry_traceSampleRate | 1 | number | Sentry sample rate (1 means all requests) | | sentry_traceSampleRate | 1 | number | Sentry sample rate (1 means all requests) |

View File

@ -51,7 +51,6 @@ If you set up your server remotely, you can use `curl http://localhost:3001/api/
Well, now you can configure Fosscord to your liking! Well, now you can configure Fosscord to your liking!
- [Skip to test client configuration](Test%20Client/index.md)
- [Skip to server configuration](configuration) - [Skip to server configuration](configuration)
- [Skip to reverse proxy / SSL](reverseProxy.md) - [Skip to reverse proxy / SSL](reverseProxy.md)
- [Skip to security](security) - [Skip to security](security)

View File

@ -23,36 +23,11 @@ Starts the bundled server. API, Gateway, and CDN run under the same process when
Starts the respective component. Starts the respective component.
## `generate:client`
Downloads a (mostly) complete discord.com web client and runs some basic patches:
- Replaces all mentions of "Server" -> "Guild"
- Replaces "Discord" -> "Fosscord"
- "Nitro" -> "Premium"
- Replaces the Discord logo home button with a Fosscord logo
- Prevents `localStorage` deletion (for [plugins](Test%20Client/plugins.md))
- Adds `fast-identify` support
Running this script will, at the time of writing, download roughly ~5000 assets.
To only download JS files (~700 assets), set the [`ONLY_CACHE_JS` environment variable](configuration/env.md)
### fast-identify
Essentially, it's a small mod to the fast-connect script Discord clients already use,
which sends a small `IDENTIFY` payload to the server, which speeds up how fast we receive `READY`.
Without the client patch however, the `READY` payload received will just be ignored by the client,
and it'll attempt to re-auth after a few seconds.
## `generate:rights` ## `generate:rights`
Generates a Discord.com-like rights value for use as a default right. Generates a Discord.com-like rights value for use as a default right.
Also displays the 'all rights' value, which `1` is a placeholder for. Also displays the 'all rights' value, which `1` is a placeholder for.
## `generate:changelog`
Injects the changelog at `fosscord-server/assets/changelog.txt` into the Discord.com client.
## `generate:schema` ## `generate:schema`
Recreates the `fosscord-server/assets/schema.json` file, which is used for API and Gateway request validation. Recreates the `fosscord-server/assets/schema.json` file, which is used for API and Gateway request validation.