mirror of
https://github.com/spacebarchat/docs.git
synced 2024-11-21 17:52:31 +01:00
prettier
This commit is contained in:
parent
6536f2e1fe
commit
779dc55dd8
10
.prettierrc
10
.prettierrc
@ -1,3 +1,11 @@
|
||||
{
|
||||
"tabWidth": 4
|
||||
"trailingComma": "all",
|
||||
"tabWidth": 4,
|
||||
"semi": true,
|
||||
"arrowParens": "always",
|
||||
"bracketSameLine": false,
|
||||
"bracketSpacing": true,
|
||||
"quoteProps": "as-needed",
|
||||
"useTabs": true,
|
||||
"singleQuote": false
|
||||
}
|
||||
|
14
.vscode/settings.json
vendored
14
.vscode/settings.json
vendored
@ -1,9 +1,9 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"Fosscord",
|
||||
"landingpage",
|
||||
"Middlewares",
|
||||
"Roadmap",
|
||||
"screenshare"
|
||||
]
|
||||
"cSpell.words": [
|
||||
"Fosscord",
|
||||
"landingpage",
|
||||
"Middlewares",
|
||||
"Roadmap",
|
||||
"screenshare"
|
||||
]
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
.md-typeset__table {
|
||||
min-width: 100%;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.md-typeset table:not([class]) {
|
||||
display: table;
|
||||
display: table;
|
||||
}
|
||||
|
@ -1,65 +1,65 @@
|
||||
(() => {
|
||||
const NUM_COLUMNS = 3;
|
||||
const NUM_COLUMNS = 3;
|
||||
|
||||
// Grab it from the above markdown table and parse it. Simply don't have multiple tables in the page lol
|
||||
const rights =
|
||||
// grab the table data elements
|
||||
[...document.querySelectorAll("td")]
|
||||
.map((x) => x.innerText) // get their content
|
||||
.map((x, i) =>
|
||||
x.indexOf("<<") == 2 // if this column is the `value` column
|
||||
? x.split(" ").reverse()[0] // get the value we shift by
|
||||
: x
|
||||
); // otherwise dont do anything
|
||||
const mount = document.getElementById("rights-container");
|
||||
const outputMount = document.getElementById("rights-output");
|
||||
var calculated = 0n;
|
||||
// Grab it from the above markdown table and parse it. Simply don't have multiple tables in the page lol
|
||||
const rights =
|
||||
// grab the table data elements
|
||||
[...document.querySelectorAll("td")]
|
||||
.map((x) => x.innerText) // get their content
|
||||
.map((x, i) =>
|
||||
x.indexOf("<<") == 2 // if this column is the `value` column
|
||||
? x.split(" ").reverse()[0] // get the value we shift by
|
||||
: x,
|
||||
); // otherwise dont do anything
|
||||
const mount = document.getElementById("rights-container");
|
||||
const outputMount = document.getElementById("rights-output");
|
||||
var calculated = 0n;
|
||||
|
||||
for (var i = 0; i < rights.length; i += NUM_COLUMNS) {
|
||||
const name = rights[i];
|
||||
const shift = rights[i + 1];
|
||||
const desc = rights[i + 2];
|
||||
for (var i = 0; i < rights.length; i += NUM_COLUMNS) {
|
||||
const name = rights[i];
|
||||
const shift = rights[i + 1];
|
||||
const desc = rights[i + 2];
|
||||
|
||||
const div = document.createElement("div");
|
||||
const input = document.createElement("input");
|
||||
input.setAttribute("type", "checkbox");
|
||||
input.setAttribute("id", shift);
|
||||
const label = document.createElement("label");
|
||||
label.setAttribute("for", label.id);
|
||||
label.innerText = name.toUpperCase();
|
||||
const div = document.createElement("div");
|
||||
const input = document.createElement("input");
|
||||
input.setAttribute("type", "checkbox");
|
||||
input.setAttribute("id", shift);
|
||||
const label = document.createElement("label");
|
||||
label.setAttribute("for", label.id);
|
||||
label.innerText = name.toUpperCase();
|
||||
|
||||
div.appendChild(input);
|
||||
div.appendChild(label);
|
||||
div.appendChild(input);
|
||||
div.appendChild(label);
|
||||
|
||||
mount.append(div);
|
||||
mount.append(div);
|
||||
|
||||
input.addEventListener("click", (event) => {
|
||||
const value = 1n << BigInt(event.target.getAttribute("id"));
|
||||
input.addEventListener("click", (event) => {
|
||||
const value = 1n << BigInt(event.target.getAttribute("id"));
|
||||
|
||||
// bit messy, oh well
|
||||
if (value == 1n) {
|
||||
if (event.target.checked) {
|
||||
for (var elem of mount.children) {
|
||||
elem.children[0].setAttribute("disabled", true);
|
||||
}
|
||||
event.target.removeAttribute("disabled");
|
||||
// bit messy, oh well
|
||||
if (value == 1n) {
|
||||
if (event.target.checked) {
|
||||
for (var elem of mount.children) {
|
||||
elem.children[0].setAttribute("disabled", true);
|
||||
}
|
||||
event.target.removeAttribute("disabled");
|
||||
|
||||
outputMount.innerText = "1";
|
||||
return;
|
||||
} else {
|
||||
for (var elem of mount.children) {
|
||||
elem.children[0].removeAttribute("disabled");
|
||||
}
|
||||
outputMount.innerText = calculated;
|
||||
return;
|
||||
}
|
||||
}
|
||||
outputMount.innerText = "1";
|
||||
return;
|
||||
} else {
|
||||
for (var elem of mount.children) {
|
||||
elem.children[0].removeAttribute("disabled");
|
||||
}
|
||||
outputMount.innerText = calculated;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
calculated = event.target.checked
|
||||
? calculated + value
|
||||
: calculated - value;
|
||||
calculated = event.target.checked
|
||||
? calculated + value
|
||||
: calculated - value;
|
||||
|
||||
outputMount.innerText = calculated;
|
||||
});
|
||||
}
|
||||
outputMount.innerText = calculated;
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@ -3,10 +3,11 @@
|
||||
!!! info "[Have you read the Code of Conduct?](conduct.md)"
|
||||
|
||||
## Notable Technologies
|
||||
* Typescript
|
||||
* [Typeorm](https://www.npmjs.com/package/typeorm)
|
||||
* [WS](https://www.npmjs.com/package/ws)
|
||||
* [Express](https://www.npmjs.com/package/express)
|
||||
|
||||
- Typescript
|
||||
- [Typeorm](https://www.npmjs.com/package/typeorm)
|
||||
- [WS](https://www.npmjs.com/package/ws)
|
||||
- [Express](https://www.npmjs.com/package/express)
|
||||
|
||||
## Structure
|
||||
|
||||
@ -27,4 +28,4 @@ The API is a HTTP REST server which does the bulk of the database reads/writes.
|
||||
|
||||
## Documentation
|
||||
|
||||
Unfortunately writing documentation is quite annoying. There's tons of comments in the codebase tho, so don't worry :)
|
||||
Unfortunately writing documentation is quite annoying. There's tons of comments in the codebase tho, so don't worry :)
|
||||
|
96
docs/faq.md
96
docs/faq.md
@ -2,86 +2,86 @@
|
||||
|
||||
??? info "Voice/Video when???"
|
||||
|
||||
Currently there is no voice or video support in any Fosscord instance.
|
||||
This is a very difficult feature to get working, especially given that
|
||||
we must implement it the exact same way as Discord.com for client compatibility.
|
||||
[We would be incredibly thankful for any assistance.](/contributing)
|
||||
Currently there is no voice or video support in any Fosscord instance.
|
||||
This is a very difficult feature to get working, especially given that
|
||||
we must implement it the exact same way as Discord.com for client compatibility.
|
||||
[We would be incredibly thankful for any assistance.](/contributing)
|
||||
|
||||
??? info "Free Nitro???"
|
||||
|
||||
Please do not use Discord trademarks to refer to anything regarding Fosscord.
|
||||
As an instance owner, you can grant yourself or others *premium* features which may be used to determine your abilities
|
||||
*client-side*. However, Fosscord-server currently does not have any distinction between premium and free users.
|
||||
All users can access all features, given they have the [right](security/rights.md) to do so.
|
||||
Please do not use Discord trademarks to refer to anything regarding Fosscord.
|
||||
As an instance owner, you can grant yourself or others *premium* features which may be used to determine your abilities
|
||||
*client-side*. However, Fosscord-server currently does not have any distinction between premium and free users.
|
||||
All users can access all features, given they have the [right](security/rights.md) to do so.
|
||||
|
||||
You cannot give yourself premium features on Discord.com using a Fosscord instance.
|
||||
You cannot give yourself premium features on Discord.com using a Fosscord instance.
|
||||
|
||||
??? info "Can I log in with my Discord account?"
|
||||
|
||||
No. Fosscord and Discord are entirely separate services, with their own separate databases
|
||||
and authentication. Fosscord cannot access any private data from Discord.com.
|
||||
As always, you should not provide login credentials for Discord.com, or any other service,
|
||||
to others.
|
||||
No. Fosscord and Discord are entirely separate services, with their own separate databases
|
||||
and authentication. Fosscord cannot access any private data from Discord.com.
|
||||
As always, you should not provide login credentials for Discord.com, or any other service,
|
||||
to others.
|
||||
|
||||
??? info "Does Fosscord use the same servers as Discord?"
|
||||
|
||||
No. Discord servers, as in the bare-metal running the service, are completely inaccessible
|
||||
to people, outside of course the Discord.com service provided. It is impossible for us to use their
|
||||
infrastructure. Fosscord is hosted entirely by you, the instance owner (or whoever is the owner of your instance).
|
||||
No. Discord servers, as in the bare-metal running the service, are completely inaccessible
|
||||
to people, outside of course the Discord.com service provided. It is impossible for us to use their
|
||||
infrastructure. Fosscord is hosted entirely by you, the instance owner (or whoever is the owner of your instance).
|
||||
|
||||
If you mean Discord 'server' as in a *guild*, also no. Fosscord is not a proxy for
|
||||
Discord guilds. Fosscord does not create Discord.com accounts, or ask for your own, at any time
|
||||
(outside of a Discord.com account connection for your Fosscord user, which is still not us asking for your credentials).
|
||||
If Fosscord was to try this, Discord's automated spam filters would surely block your instance.
|
||||
If you mean Discord 'server' as in a *guild*, also no. Fosscord is not a proxy for
|
||||
Discord guilds. Fosscord does not create Discord.com accounts, or ask for your own, at any time
|
||||
(outside of a Discord.com account connection for your Fosscord user, which is still not us asking for your credentials).
|
||||
If Fosscord was to try this, Discord's automated spam filters would surely block your instance.
|
||||
|
||||
Lastly, you can simply view [our codebase](https://github.com/fosscord/fosscord-server).
|
||||
A simple proxy would not need to be this complex or large.
|
||||
We implement the entire Discord.com API, Gateway, among others.
|
||||
None of this would be necessary if we were simply abusing Discord.com.
|
||||
Lastly, you can simply view [our codebase](https://github.com/fosscord/fosscord-server).
|
||||
A simple proxy would not need to be this complex or large.
|
||||
We implement the entire Discord.com API, Gateway, among others.
|
||||
None of this would be necessary if we were simply abusing Discord.com.
|
||||
|
||||
??? info "Do you use Discord.com code?"
|
||||
|
||||
Absolutely not. If a potential contributor makes any indication of being a Discord employee,
|
||||
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.
|
||||
Absolutely not. If a potential contributor makes any indication of being a Discord employee,
|
||||
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.
|
||||
|
||||
??? 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 achieve our goals. 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.
|
||||
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 achieve our goals. 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](Test%20Client/index.md)
|
||||
You can read more about the test client [here](Test%20Client/index.md)
|
||||
|
||||
??? info "Is this illegal?"
|
||||
|
||||
The person writing this does not believe it to be illegal, no.
|
||||
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.
|
||||
The person writing this does not believe it to be illegal, no.
|
||||
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?"
|
||||
|
||||
Personally, it's because it's fun. But if you ask 'Officially':
|
||||
Personally, it's because it's fun. But if you ask 'Officially':
|
||||
|
||||
1. We love free, open source software.
|
||||
2. There are many existing bots, applications, users, features, and ideas surrounding Discord.com.
|
||||
3. Fosscord allows these users and developers to maintain a familiar ecosystem with minimal friction.
|
||||
4. Reimplementing allows us to extend the Discord protocol in ways Discord.com may not deem feasible, economical, whateverical.
|
||||
5. This includes privacy features, such as end to end encryption for example.
|
||||
6. The reverse engineering effort by our team may be useful to outside developers looking to understand how similar services work.
|
||||
7. The Discord protocol despite it's API complexity is quite simple and linear, which makes this project more feasible.
|
||||
1. We love free, open source software.
|
||||
2. There are many existing bots, applications, users, features, and ideas surrounding Discord.com.
|
||||
3. Fosscord allows these users and developers to maintain a familiar ecosystem with minimal friction.
|
||||
4. Reimplementing allows us to extend the Discord protocol in ways Discord.com may not deem feasible, economical, whateverical.
|
||||
5. This includes privacy features, such as end to end encryption for example.
|
||||
6. The reverse engineering effort by our team may be useful to outside developers looking to understand how similar services work.
|
||||
7. The Discord protocol despite it's API complexity is quite simple and linear, which makes this project more feasible.
|
||||
|
||||
??? info "Editing the database is annoying, is there a graphical interface for this?"
|
||||
|
||||
Currently no, there is no graphical interface for managing your Fosscord instance.
|
||||
An admin dashboard is planned, but we currently have higher priorities right now.
|
||||
Currently no, there is no graphical interface for managing your Fosscord instance.
|
||||
An admin dashboard is planned, but we currently have higher priorities right now.
|
||||
|
||||
??? info "When will this feature be available?"
|
||||
|
||||
We do not provide ETAs. Users tend to take them as deadlines, and for a small team of <5 maintainers
|
||||
who do not get payment for their work, this is unreasonable.
|
||||
We do not provide ETAs. Users tend to take them as deadlines, and for a small team of <5 maintainers
|
||||
who do not get payment for their work, this is unreasonable.
|
||||
|
||||
??? info "It's pretty funny how you have a Discord.com guild for support."
|
||||
|
||||
We know. Also that's not a question.
|
||||
We know. Also that's not a question.
|
||||
|
@ -18,12 +18,12 @@ the endpoints used.
|
||||
const { Client } = require("discord.js");
|
||||
|
||||
const client = new Client({
|
||||
http: {
|
||||
version: 9,
|
||||
api: "https://api.fosscord.com",
|
||||
cdn: "https://cdn.fosscord.com",
|
||||
invite: "https://fosscord.com/invite",
|
||||
},
|
||||
http: {
|
||||
version: 9,
|
||||
api: "https://api.fosscord.com",
|
||||
cdn: "https://cdn.fosscord.com",
|
||||
invite: "https://fosscord.com/invite",
|
||||
},
|
||||
});
|
||||
|
||||
client.login("your token here");
|
||||
|
@ -3,30 +3,33 @@
|
||||
There are 3 options, all of which require the Fosscord server have [erlpack](https://npmjs.com/package/@yukikaze-bot/erlpack) installed.
|
||||
|
||||
1. The simpler one is to set the `DISCORD_WEBAPP_ENDPOINT` environment variable on the machine running the client
|
||||
to the Fosscord web app URL. This assumes the Fosscord instance has the [test client](../server/Test%20Client/index.md) enabled.
|
||||
to the Fosscord web app URL. This assumes the Fosscord instance has the [test client](../server/Test%20Client/index.md) enabled.
|
||||
|
||||
1. You may edit your desktop client's `settings.json` file at
|
||||
`%appdata%/discord/settings.json`,
|
||||
adding the following line
|
||||
`%appdata%/discord/settings.json`, 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"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
|
||||
This also assumes the Fosscord instance has enabled the test client.
|
||||
|
||||
1. 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.
|
||||
and simply set it to use your desired Fosscord instance.
|
||||
|
Loading…
Reference in New Issue
Block a user