mirror of
https://github.com/spacebarchat/docs.git
synced 2024-11-22 18:22:31 +01:00
commit
7521e2a690
Binary file not shown.
Before Width: | Height: | Size: 62 KiB |
10
docs/assets/logo.svg
Normal file
10
docs/assets/logo.svg
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<svg width="1148" height="1148" viewBox="0 0 1148 1148" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="1148" height="1148" rx="340" fill="url(#paint0_linear_6_79)"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M285 283L862 283.003C862.022 322.978 857.961 362.849 849.881 401.987C803.291 627.415 627.023 804.889 403.157 851.801C364.29 859.935 324.697 864.023 285 864V283ZM403.157 630.815V742.76C557.555 683.015 679.971 558.361 737.447 401.983H403.157V507.046H560.653C517.925 554.691 467.668 594.894 411.915 626.03C409.017 627.648 406.097 629.243 403.157 630.815Z" fill="white"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_6_79" x1="574" y1="0" x2="574" y2="1148" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#FF5F00"/>
|
||||||
|
<stop offset="1" stop-color="#FF3D00"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 812 B |
3
docs/bots/index.md
Normal file
3
docs/bots/index.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Bots
|
||||||
|
|
||||||
|
## [Setup](setup)
|
@ -1,4 +1,4 @@
|
|||||||
# Bots
|
# Setup
|
||||||
|
|
||||||
Fosscord is backwards compatible to discord, which means you can reuse your existing discord bot library and only need to change the api endpoints.
|
Fosscord is backwards compatible to discord, which means you can reuse your existing discord bot library and only need to change the api endpoints.
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ Currently the developer portal is not fully implemented yet, and Fosscord's bot
|
|||||||
|
|
||||||
**Done**: You now can use this copied token to login with your bot libary or authorize any api request by putting it inside the authorization header.
|
**Done**: You now can use this copied token to login with your bot libary or authorize any api request by putting it inside the authorization header.
|
||||||
|
|
||||||
**Notice**: Currently you can but don't need to prefix the token with "`Bot `".
|
**Notice**: Currently you can but don't need to prefix the token with "`Bot`".
|
||||||
|
|
||||||
## Libraries
|
## Libraries
|
||||||
|
|
||||||
@ -33,18 +33,18 @@ Replace `your token here` with your copied token.
|
|||||||
Inside the client option you can specify the api endpoint:
|
Inside the client option you can specify the api endpoint:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { Client } = require("discord.js");
|
const { Client } = require('discord.js')
|
||||||
|
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
http: {
|
http: {
|
||||||
version: 9,
|
version: 9,
|
||||||
api: "https://api.fosscord.com",
|
api: 'https://api.fosscord.com',
|
||||||
cdn: "https://cdn.fosscord.com",
|
cdn: 'https://cdn.fosscord.com',
|
||||||
invite: "https://fosscord.com/invite",
|
invite: 'https://fosscord.com/invite'
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
client.login("your token here");
|
client.login('your token here')
|
||||||
```
|
```
|
||||||
|
|
||||||
### Discord.py
|
### Discord.py
|
@ -1,5 +1,7 @@
|
|||||||
# Home
|
# Home
|
||||||
|
|
||||||
|
Just wanna get to setup instructions? Click [here](server/setup.md)!
|
||||||
|
|
||||||
### What is Fosscord?
|
### What is Fosscord?
|
||||||
|
|
||||||
Fosscord is a free open source self-hostable discord compatible chat, voice and video platform.
|
Fosscord is a free open source self-hostable discord compatible chat, voice and video platform.
|
||||||
|
64
docs/server/configuration.md
Normal file
64
docs/server/configuration.md
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# Configuration
|
||||||
|
|
||||||
|
The configuration of Fosscord is located inside the database, under the ``config`` table. Some configuration is also done via [environment variables](env.md)
|
||||||
|
|
||||||
|
## Editing
|
||||||
|
|
||||||
|
In order to edit your configuration, you will need to manually open your database with special tools.
|
||||||
|
|
||||||
|
### Tools
|
||||||
|
|
||||||
|
#### Sqlite
|
||||||
|
- [DBeaver](https://dbeaver.io)
|
||||||
|
- [SqliteBrowser](https://sqlitebrowser.org)
|
||||||
|
|
||||||
|
#### PostgreSQL
|
||||||
|
- [DBeaver](https://dbeaver.io)
|
||||||
|
- [pgAdmin](https://www.pgadmin.org)
|
||||||
|
|
||||||
|
#### MySQL/Mariadb
|
||||||
|
- [DBeaver](https://dbeaver.io)
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
This list may be incomplete.
|
||||||
|
|
||||||
|
| Name | Type | Default | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| gateway_endpointClient | string | null | The gateway endpoint that gets delivered to the client |
|
||||||
|
| gateway_endpointPrivate | string | null | The gateway endpoint that is used internally to communicate between gateway servers |
|
||||||
|
| gateway_endpointPublic | string | null | The gateway endpoint that is publicly used by bots |
|
||||||
|
| cdn_endpointPublic | string | "/" | The cdn endpoint that is served in message attachments |
|
||||||
|
| cdn_endpointClient | string | null | The cdn endpoint that is used by clients |
|
||||||
|
| cdn_endpointPrivate | string | "http://localhost:3001" | The cdn endpoint that is used internally to upload images from the api to the cdn. |
|
||||||
|
| general_instanceId | string | _auto generated_ | Unique identifier for the Fosscord instance |
|
||||||
|
| limits_user_maxGuilds | number | 100 | Maximum number of guilds the user is allowed to create and join |
|
||||||
|
| limits_user_maxUsername | number | 32 | Maximum number of characters for a username |
|
||||||
|
| limits_user_maxFriends | number | 1000 | Maximum number of friends a user can have |
|
||||||
|
| limits_guild_maxRoles | number | 250 | Maximum number of roles a guild can have |
|
||||||
|
| limits_guild_maxEmojis | number | 50 | Maximum number of custom emojis a guild can have |
|
||||||
|
| limits_guild_maxMembers | number | 250000 | Maximum number of members a guild can have |
|
||||||
|
| limits_guild_maxChannels | number | 50 | Maximum number of channels a guild can have |
|
||||||
|
| limits_guild_maxChannelsInCategory | number | 50 | Maximum number of channels a category can contain |
|
||||||
|
| limits_guild_hideOfflineMember | number | 1000 | Amount of members when a guild is considered large and offline members are hidden |
|
||||||
|
| limits_message_maxCharacters | number | 2000 | Maximum length of characters a message can have |
|
||||||
|
| limits_message_maxTTSCharacters | number | 200 | Maximum length of characters a text to speech message can have |
|
||||||
|
| limits_message_maxReactions | number | 20 | Maximum number of reactions a message can have |
|
||||||
|
| limits_message_maxAttachmentSize | number | 8388608 | Maximum size a message attachment can have in bytes |
|
||||||
|
| limits_message_maxBulkDelete | number | 100 | Maximum amount of messages that can be deleted per bulk delete command |
|
||||||
|
| limits_channel_maxPins | number | 50 | Maximum amount of pinned messages a channel can have |
|
||||||
|
| limits_channel_maxTopic | number | 1024 | Maximum amount of characters a channel topic description can have |
|
||||||
|
| limits_channel_maxWebhooks | number | 10 | Maximum amount of webhooks a channel can have |
|
||||||
|
| limits_rate_disabled | boolean | false | Check to enable rate limits |
|
||||||
|
| limits*rate* | | _TODO_ | |
|
||||||
|
| security_autoUpdate | boolean | true | Check if updates should automatically be searched for and non destructively be installed |
|
||||||
|
| security_requestSignature | string | _auto generated_ | Request signature that is used internally to sign requests |
|
||||||
|
| security_jwtSecret | string | _auto generated_ | JSON web token secret to sign and verify jwt tokens |
|
||||||
|
| security_forwardedFor | string | null | Header name that is used to retrieve the real ip of a request e.g. X-Forwarded-For or CF-Connecting-IP |
|
||||||
|
| security_captcha_enabled | boolean | false | Check to enable captchas |
|
||||||
|
| security_captcha_service | string | null | Captcha provider, one of: "recaptcha", "hcaptcha" |
|
||||||
|
| security_captcha_sitekey | string | null | Captcha provider site key |
|
||||||
|
| security_captcha_secret | string | null | Captcha provider secret to check if the user supplied captcha result is correct |
|
||||||
|
| security_ipdataApiKey | string | _public key_ | IPdata.co api key to check if a register ip address is using proxies |
|
||||||
|
| login_requireCaptcha | boolean | false | Check to require captchas to login |
|
||||||
|
|
23
docs/server/database.md
Normal file
23
docs/server/database.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Database
|
||||||
|
|
||||||
|
By default, Fosscord uses Sqlite as its database. But doing this in a production environment is highly discouraged for performance reasons.
|
||||||
|
|
||||||
|
You can change the database Fosscord uses by editing the ``DATABASE`` environment variable. This is further explained [here](env.md)
|
||||||
|
|
||||||
|
## Connection URL
|
||||||
|
|
||||||
|
The connection URL you need to specify looks like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
[type]://[username]:[password]@[address]/[dbname]
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace the variables marked with ``[]`` with the following:
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| [type] | The type of database to use, either ``mariadb`` or ``postgres`` |
|
||||||
|
| [username] | The name of a user with access to the database |
|
||||||
|
| [password] | The password for the user |
|
||||||
|
| [address] | The network address the database is located at, most likely ``localhost`` |
|
||||||
|
| [dbname] | The name of the database to use |
|
16
docs/server/env.md
Normal file
16
docs/server/env.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Environment Variables
|
||||||
|
|
||||||
|
Some configuration is done via environment variables. If you can't find what you're looking for here, try [database configuration](configuration.md)
|
||||||
|
|
||||||
|
## Editing
|
||||||
|
|
||||||
|
In order to edit environment variables, just create a file called ``.env`` in ``bundle/``. In there, you can declare variables in the format ``VARIABLE=value``.
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
This list may be incomplete.
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| THREADS | Amount of threads/workers to use |
|
||||||
|
| DATABASE | Connection URL of the database |
|
6
docs/server/index.md
Normal file
6
docs/server/index.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Server
|
||||||
|
|
||||||
|
## [Setup](setup.md)
|
||||||
|
## [Configuration](configuration.md)
|
||||||
|
## [Environment Variables](env.md)
|
||||||
|
## [Reverse Proxy/SSL](ssl.md)
|
64
docs/server/setup.md
Normal file
64
docs/server/setup.md
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# Setup
|
||||||
|
|
||||||
|
<!-- ### [Download](https://github.com/fosscord/fosscord-server/releases)
|
||||||
|
|
||||||
|
This is the stable fosscord-server release.
|
||||||
|
|
||||||
|
Download the server release from [GitHub](https://github.com/fosscord/fosscord-server/releases) for your operating system. (Size ~80mb)
|
||||||
|
|
||||||
|
Double click the file to start the server. (The first time it takes longer as it needs to setup the server)
|
||||||
|
|
||||||
|
You can now access it on [http://localhost:3001](http://localhost:3001). -->
|
||||||
|
|
||||||
|
### With Terminal
|
||||||
|
|
||||||
|
This is the latest bleeding edge version of fosscord-server, which may have bugs.
|
||||||
|
|
||||||
|
#### Requirements
|
||||||
|
|
||||||
|
- [NodeJS](https://nodejs.org) v14+
|
||||||
|
- [Python](https://python.org) 3
|
||||||
|
- (Only on Linux) ``gcc`` and ``g++`` or alternatively on debian-based distros ``build-essential``
|
||||||
|
- (Only on Windows) [Visual Studio](https://visualstudio.microsoft.com/) with the C++ package
|
||||||
|
|
||||||
|
#### Setup
|
||||||
|
|
||||||
|
Open a shell/terminal and execute these commands:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/fosscord/fosscord-server
|
||||||
|
cd fosscord-server
|
||||||
|
cd bundle
|
||||||
|
npm run setup
|
||||||
|
npm run start:bundle
|
||||||
|
```
|
||||||
|
|
||||||
|
You can now access Fosscord on [http://localhost:3001](http://localhost:3001)
|
||||||
|
|
||||||
|
#### Updating
|
||||||
|
|
||||||
|
To update Fosscord, execute these commands:
|
||||||
|
|
||||||
|
!!! warning "This reverts any edited files"
|
||||||
|
|
||||||
|
```
|
||||||
|
git reset --hard HEAD
|
||||||
|
git pull
|
||||||
|
npm run setup
|
||||||
|
npm run start:bundle
|
||||||
|
```
|
||||||
|
|
||||||
|
### With Docker
|
||||||
|
|
||||||
|
!!! failure "Not Supported Currently"
|
||||||
|
Avoid using Docker build until further notice. The current build is faulty and will not build correctly. Instead, install using the terminal in the section "With Terminal".
|
||||||
|
|
||||||
|
Optionally, if you want to use Docker:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/fosscord/fosscord-server
|
||||||
|
cd fosscord-server
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
You can now access Fosscord on [http://localhost:3001](http://localhost:3001)
|
29
docs/server/ssl.md
Normal file
29
docs/server/ssl.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Reverse Proxy/SSL
|
||||||
|
|
||||||
|
If you're running a production instance of Fosscord, it is **strongly** recommended to use SSL (better known as https), which you can achieve by using a reverse proxy.
|
||||||
|
|
||||||
|
A reverse proxy not only gives your instance SSL support, but also allows you to run it alongside other web services behind the same port!
|
||||||
|
|
||||||
|
## Proxies
|
||||||
|
|
||||||
|
There are multiple reverse proxies you can use, the most popular being [Nginx](https://nginx.org) and [Traefik](https://traefik.io/traefik/).
|
||||||
|
|
||||||
|
Another popular solution that allows easy management via a webinterface and is based on Nginx is [NginxProxyManager](https://nginxproxymanager.com/).
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
Choose your preferred reverse proxy, and install it using the respective setup instructions.
|
||||||
|
|
||||||
|
Then, configure it to forward traffic from your domain (or a subdomain) to the port your Fosscord instance runs on (3001 by default).
|
||||||
|
|
||||||
|
To be able to use SSL, you will need an SSL certificate. If you're using NginxProxyManager, you just need to enable SSL support and your proxy will automatically generate and set up certificates for you. Otherwise, you will need to set up [Certbot](https://certbot.eff.org).
|
||||||
|
|
||||||
|
## Guides
|
||||||
|
|
||||||
|
[Nginx](https://www.nginx.com/resources/wiki/start/topics/tutorials/install/)
|
||||||
|
|
||||||
|
[NginxProxyManager](https://nginxproxymanager.com/guide/#quick-setup)
|
||||||
|
|
||||||
|
[Traefik](https://doc.traefik.io/traefik/getting-started/install-traefik/)
|
||||||
|
|
||||||
|
[Certbot](https://certbot.eff.org/instructions)
|
21
docs/server/systemd.md
Normal file
21
docs/server/systemd.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Systemd Service
|
||||||
|
|
||||||
|
If you want to run Fosscord as a systemd service, simply put this in ``/etc/systemd/system/fosscord.service``:
|
||||||
|
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
Description=<your description>
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=<your user>
|
||||||
|
WorkingDirectory=<fosscord bundle directory>
|
||||||
|
ExecStart=npm run start:bundle
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, execute ``sudo systemctl start fosscord`` from your terminal.
|
||||||
|
|
||||||
|
If you want to automatically run Fosscord on boot, execute ``sudo systemctl enable fosscord``
|
@ -1,143 +0,0 @@
|
|||||||
# Reverse Proxy/HTTPS (NGINX)
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
### Apache2 is currently not supported.
|
|
||||||
|
|
||||||
A reverse proxy is when you take a web server, for our example, NGINX and you ue it to redirect traffic on port 80/443 to port 3001, but to
|
|
||||||
your browser, it still appears as port 80/443
|
|
||||||
|
|
||||||
A reverse proxy is the most efficient way to setup HTTPS on your instance.
|
|
||||||
|
|
||||||
To do this, you need a basic understanding of setting up a web server.
|
|
||||||
|
|
||||||
### Without HTTPS
|
|
||||||
|
|
||||||
```
|
|
||||||
limit_req_zone $binary_remote_addr zone=registerzone:10m rate=1r/m;
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
|
|
||||||
server_name fosscord.your.website;
|
|
||||||
location / {
|
|
||||||
proxy_pass http://127.0.0.1:3001;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_pass_request_headers on;
|
|
||||||
add_header Last-Modified $date_gmt;
|
|
||||||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
|
||||||
proxy_no_cache 1;
|
|
||||||
proxy_cache_bypass 1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
|
|
||||||
// everything below this is safe to remove if you want to
|
|
||||||
location = /api/v9/auth/register {
|
|
||||||
limit_req zone=registerzone;
|
|
||||||
proxy_pass http://127.0.0.1:3001;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_pass_request_headers on;
|
|
||||||
add_header Last-Modified $date_gmt;
|
|
||||||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
|
||||||
proxy_no_cache 1;
|
|
||||||
proxy_cache_bypass 1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
You can now use your website on port 80.
|
|
||||||
|
|
||||||
|
|
||||||
### Using HTTPS
|
|
||||||
|
|
||||||
Using the existing HTTP config, run this command
|
|
||||||
|
|
||||||
Generate your certificates with certbot.
|
|
||||||
|
|
||||||
``sudo certbot --nginx -d fosscord.your.website``
|
|
||||||
|
|
||||||
If you want your certificates to renew, run ``crontab -e`` and paste this in: ``0 12 * * * /usr/bin/certbot renew --quiet``. Then you should be all set!
|
|
||||||
|
|
||||||
If done correctly, you should have your website up and running with SSL. ``server_name`` is important because certbot will use it to sign the certificates.
|
|
||||||
|
|
||||||
An example of a correctly configured NGINX setup (using SSL):
|
|
||||||
|
|
||||||
!!! failure "THIS IS JUST AN EXAMPLE"
|
|
||||||
Do not use this, use the command above, if you use it correctly, you should have a working instance with HTTPS.
|
|
||||||
|
|
||||||
```
|
|
||||||
limit_req_zone $binary_remote_addr zone=registerzone:10m rate=1r/m;
|
|
||||||
server {
|
|
||||||
server_name fosscord.your.website;
|
|
||||||
location / {
|
|
||||||
proxy_pass http://127.0.0.1:3001;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_pass_request_headers on;
|
|
||||||
add_header Last-Modified $date_gmt;
|
|
||||||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
|
||||||
proxy_no_cache 1;
|
|
||||||
proxy_cache_bypass 1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
|
|
||||||
// same thing here
|
|
||||||
location = /api/v9/auth/register {
|
|
||||||
limit_req zone=registerzone;
|
|
||||||
proxy_pass http://127.0.0.1:3001;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_pass_request_headers on;
|
|
||||||
add_header Last-Modified $date_gmt;
|
|
||||||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
|
||||||
proxy_no_cache 1;
|
|
||||||
proxy_cache_bypass 1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
|
|
||||||
listen 443 ssl; # managed by Certbot
|
|
||||||
ssl_certificate /yourcerts/website.crt; # managed by certbot
|
|
||||||
ssl_certificate_key /yourcerts/privatekey.pem; # managed by Certbot
|
|
||||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
||||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
||||||
|
|
||||||
}
|
|
||||||
server {
|
|
||||||
if ($host = fosscord.your.website) {
|
|
||||||
return 301 https://$host$request_uri;
|
|
||||||
} # managed by Certbot
|
|
||||||
|
|
||||||
|
|
||||||
server_name fosscord.your.website;
|
|
||||||
listen 80;
|
|
||||||
return 404; # managed by Certbot
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### With Apache2
|
|
||||||
|
|
||||||
!!! failure "Not supported"
|
|
||||||
Avoid using Apache2, since I've tried it and it just led to an infinite loading screen for me.
|
|
||||||
|
|
||||||
You can find how to use Apache2 reverse proxy on the internet. If you find out how to set it up correctly, please send a pull request to the repository [here](https://github.com/fosscord/fosscord-docs/)
|
|
||||||
|
|
||||||
// by AToska21
|
|
@ -1,41 +0,0 @@
|
|||||||
# Using MariaDB/MySQL
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
### Explaination
|
|
||||||
|
|
||||||
A database server is a kind of server that hosts so called databases with "tables" in them. MariaDB is a way of hosting
|
|
||||||
them. It is much more efficient than SQLite, because it isn't just a file which can be easily hacked and amplified.
|
|
||||||
|
|
||||||
To do this, you need a basix understanding of linux and SQL.
|
|
||||||
|
|
||||||
### Setting up MariaDB/MySQL
|
|
||||||
|
|
||||||
This section presumes you know how to login into MariaDB. If you don't, search it up.
|
|
||||||
|
|
||||||
Go into MariaDB and type these:
|
|
||||||
```
|
|
||||||
CREATE DATABASE fosscord;
|
|
||||||
CREATE USER 'fosscord'@'localhost' IDENTIFIED BY 'password1';
|
|
||||||
GRANT ALL PRIVILEGES ON fosscord.* TO 'fosscord'@'localhost' IDENTIFIED BY 'password1' WITH GRANT OPTION;
|
|
||||||
FLUSH PRIVILEGES;
|
|
||||||
```
|
|
||||||
After that, go to your fosscord directory, and open (if it's not created, create it) a file named ".env" WITH THE DOT.
|
|
||||||
The file should contain this:
|
|
||||||
```
|
|
||||||
THREADS=1
|
|
||||||
DATABASE=mariadb://[youruser]:[yourpassword]@localhost/[yourdatabase]
|
|
||||||
```
|
|
||||||
|
|
||||||
So for us that would be:
|
|
||||||
```
|
|
||||||
THREADS=1
|
|
||||||
DATABASE=mariadb://fosscord:password1@localhost/fosscord
|
|
||||||
```
|
|
||||||
If you set it up correctly, you should be able to run ``systemctl start fosscord`` or ``npm run start:bundle`` if you didn't setup systemd
|
|
||||||
(which you should do, checkout the "Setup" section) and, your fosscord works! It may say "TABLE NOT SETUP" or something. Ignore these, because
|
|
||||||
they are just there because the database is uninitialized.
|
|
||||||
|
|
||||||
If you get an error that says ``DriverPackageNotInstalledError: Mysql package has not been found installed.``, run ``npm install mysql --save``.
|
|
||||||
|
|
||||||
// by AToska21
|
|
@ -1,64 +0,0 @@
|
|||||||
## PostgreSQL Setup with terminal
|
|
||||||
|
|
||||||
1. Lets setup our database. We will be using postgresql for this setup.
|
|
||||||
```
|
|
||||||
su postgres -c psql
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Now that postgresql is installed lets setup a new user and a database:
|
|
||||||
```
|
|
||||||
CREATE USER fosscord WITH CREATEDB PASSWORD 'your.password';
|
|
||||||
create database fosscord with owner fosscord;
|
|
||||||
```
|
|
||||||
Note: Change the 'your.password' with the password you would like to keep for your database. You will need this password for accessing your DB.
|
|
||||||
|
|
||||||
3. We will now create a env file to configure fosscord server to use the custom DB instead of the default one.
|
|
||||||
```
|
|
||||||
nano .env
|
|
||||||
```
|
|
||||||
4. Paste the following in the env file that was just created:
|
|
||||||
```
|
|
||||||
DATABASE=postgres://fosscord:Beastcord@localhost/fosscord
|
|
||||||
THREADS=1
|
|
||||||
```
|
|
||||||
After pasting the above lines do ctrl + x followed by Y then press the Enter key on your keyboard to save the file. (Windows)
|
|
||||||
|
|
||||||
If the output is working fine then you are good to go. If not you have done some mistakes go up and look what mistake you have done and fix it to proceed.
|
|
||||||
|
|
||||||
## How to setup Captcha in your instance?
|
|
||||||
|
|
||||||
To setup captcha for your server you will have to open your database. To view your DB we suggest you use [DBeaver](https://dbeaver.io/download/).
|
|
||||||
Follow these steps to reach your config file
|
|
||||||
|
|
||||||
1. Connect DBeaver to your database. After connecting you will see something like this ![image](https://user-images.githubusercontent.com/84021897/148377042-1884dd4e-a0f4-4c3f-aaa3-c144b6737244.png)
|
|
||||||
|
|
||||||
2. Open the database folder by clicking the small arrow located to the left side of the folder name, then proceed to schemas followed by public then tables.
|
|
||||||
3. You will now see a list of tables. Among them is a table named config. Open that and you will see ![image](https://user-images.githubusercontent.com/84021897/148377619-8e3d16da-87f1-4991-b0b7-d6fb8badf6e1.png)
|
|
||||||
|
|
||||||
Make sure to click the data folder to edit the config.
|
|
||||||
4. You will now have to edit the following rows in the database
|
|
||||||
|
|
||||||
| **Service Name** | **Value** | **Description** |
|
|
||||||
|--------------------------|---------------------------|-------------------------------------------------------|
|
|
||||||
| register_requireCaptcha | true | Enables captcha when you register |
|
|
||||||
| security_captcha_enabled | true | Enables Captcha if set to true |
|
|
||||||
| security_captcha_sitekey | "sitekey" | The site key which can be accessed from the site only |
|
|
||||||
| security_captcha_service | "hcaptcha" or "reacptcha" | If you are using hcaptcha put "hcaptcha" |
|
|
||||||
| security_captcha_secret | "secret" | Will be provided by the service you register to |
|
|
||||||
| login_requireCaptcha | true | Enables Captcha when you login |
|
|
||||||
|
|
||||||
5. Save the file and restart your server.
|
|
||||||
|
|
||||||
## How to setup CDN to enable uploading attachments
|
|
||||||
|
|
||||||
1. Open your DB
|
|
||||||
2. Go to your config
|
|
||||||
3. Edit the rows as follows:
|
|
||||||
|
|
||||||
| **Service Name** | **Value** | **Example for servers with SSL** | **Example for servers without SSL** |
|
|
||||||
|------------------------|------------------------------|----------------------------------|-------------------------------------|
|
|
||||||
| cdn_endpointPublic | "http(s)://your.domain.name" | "https://your.domain.name" | "http://your.domain.name" |
|
|
||||||
| gateway_endpointPublic | "ws(s)://your.domain.name" | "wss://your.domain.name" | "ws://your.domain.name" |
|
|
||||||
|
|
||||||
// made by GamerZ14
|
|
||||||
// adapted by AToska21
|
|
@ -1,137 +0,0 @@
|
|||||||
# 1. How to use SQLite database
|
|
||||||
database.db is a file that makes your fosscord instance customizable. Fosscord curently uses SQLite Database to store it's data, you can allways change it.
|
|
||||||
|
|
||||||
I will be found in `#/bundle/database.db` where `# is the dir name example fosscord-server`
|
|
||||||
For example this path for git cloned fosscord-server will be `fosscord-server/bundle/database.db`
|
|
||||||
|
|
||||||
# Basic stuff that will be included in this Documentation page
|
|
||||||
| Number | Description |
|
|
||||||
|---|---|
|
|
||||||
| 1. | What is database.db/it's path |
|
|
||||||
| 2. | What will we be discussing today? |
|
|
||||||
| 3. | The number of tables you can edit |
|
|
||||||
| 4. | Description of each editable table's |
|
|
||||||
| 5. | What each sub tables do? |
|
|
||||||
| 6. | Other Fun Tricks with database.db (Coming Soon) |
|
|
||||||
|
|
||||||
# 2. What will be discussing today?
|
|
||||||
We will be discussing how to edit `database.db` file which is a database used for your fosscord client/server, it's used to save people's data and also allows you to edit your instance in many ways!, you can edit your info, edit passwords, emails, usernames you can give badges... etc, we will be discussing to how to edit them and do it correctly so you don't get too many errors..., let's get a explanation on the tables.
|
|
||||||
|
|
||||||
# 3. The number of tables you can edit
|
|
||||||
|
|
||||||
Number of total tables you can edit (this does not include the sub tables, sub tables are tables inside tables): `35-34`
|
|
||||||
|
|
||||||
**Names of the tables you can edit**
|
|
||||||
<details>
|
|
||||||
<summary>Names of the table you can edit (it's really big)</summary>
|
|
||||||
<br>
|
|
||||||
1. applications<br/>
|
|
||||||
2. attachments<br/>
|
|
||||||
3. audit_logs<br/>
|
|
||||||
4. bans<br/>
|
|
||||||
5. channels<br/>
|
|
||||||
6. config<br/>
|
|
||||||
7. connected_accounts<br/>
|
|
||||||
8. emojis<br/>
|
|
||||||
9. guilds<br/>
|
|
||||||
10. invites<br/>
|
|
||||||
11. member_roles<br/>
|
|
||||||
12. members<br/>
|
|
||||||
13. message_channel_mentions<br/>
|
|
||||||
14. message_role_mentions<br/>
|
|
||||||
15. message_stickers<br/>
|
|
||||||
16. message_user_mentions<br/>
|
|
||||||
17. messages<br/>
|
|
||||||
18. migrations<br/>
|
|
||||||
19. query-result-cache<br/>
|
|
||||||
20. rate_limits<br/>
|
|
||||||
21. read_states<br/>
|
|
||||||
22. recipients<br/>
|
|
||||||
23. relationship<br/>
|
|
||||||
24. roles<br/>
|
|
||||||
25. sessions<br/>
|
|
||||||
26. sqlite_sequence<br/>
|
|
||||||
27. sticker_packs<br/>
|
|
||||||
28. stickers<br/>
|
|
||||||
29. team_members<br/>
|
|
||||||
30. teams<br/>
|
|
||||||
31. templates<br/>
|
|
||||||
32. users<br/>
|
|
||||||
33. voice_states<br/>
|
|
||||||
34. webhooks<br/>
|
|
||||||
</summary>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
# 4. What does each table do?
|
|
||||||
`applications`: Bot Applications, TOS applications, RPC applications ETC
|
|
||||||
|
|
||||||
`attachments`: attachments are photos and videos you send on your fosscord instance
|
|
||||||
|
|
||||||
`audit_logs`: this are logs where the logs of bans, deleting channels, creating channels, making roles,updating roles.. ETC
|
|
||||||
|
|
||||||
`bans`: bans are the users that are banned from a server.
|
|
||||||
|
|
||||||
`channel`: channel's created on your fosscord instance
|
|
||||||
|
|
||||||
`config`: config table is the most important table of all the DB, that's where the real **magic** happens, it has all the things to update instance name, instance description, config's,URL's ETC
|
|
||||||
|
|
||||||
`connected_accounts`: this us the list of the accounts that are online on your instances
|
|
||||||
|
|
||||||
`emojis`: this are emojis that are stored on your instance
|
|
||||||
|
|
||||||
`guilds`: this are guilds that are made/on your instances
|
|
||||||
|
|
||||||
`invites`: this are invites created on your instance
|
|
||||||
|
|
||||||
`member_roles`: the roles that are made on your fosscord instance
|
|
||||||
|
|
||||||
`members`: list's members that are in your instance but it also has server is which the members are in
|
|
||||||
|
|
||||||
`message_role_mentions`: roles mentioned in a message
|
|
||||||
|
|
||||||
`message_channel_mentions`: channels mentioned in a message
|
|
||||||
|
|
||||||
`message_stickers`: stickers that are sent or made
|
|
||||||
|
|
||||||
`message_user_mentions`: user mention that is sent using a message `example: @OmxproYT#7508`
|
|
||||||
|
|
||||||
`messages`: messages sent on your fosscord instance
|
|
||||||
|
|
||||||
`migrations`: migrations that happened on your instance
|
|
||||||
|
|
||||||
`query-result-cache`: result cache of query, it makes searching faster
|
|
||||||
|
|
||||||
`rate_limits`: rate limits that are placed on a account
|
|
||||||
|
|
||||||
`read_states`: read states of messages (I think not sure)
|
|
||||||
|
|
||||||
`recipients`: recipients of your instances
|
|
||||||
|
|
||||||
`relationships`: (really don't know what this means I really don't know if this is even important)
|
|
||||||
|
|
||||||
`roles`: roles made on your instances
|
|
||||||
|
|
||||||
`sessions`: sessions that are online OR sessions that are made on your instance
|
|
||||||
|
|
||||||
`sqlite_sequenses`: sequences on sqlite DB
|
|
||||||
|
|
||||||
`sticker_packs`: sticker packs made on your fosscord instances (you can make more)
|
|
||||||
|
|
||||||
`stickers`: stickers that are on your instance
|
|
||||||
|
|
||||||
`team_members`: team members of teams
|
|
||||||
|
|
||||||
`teams`: team's made on your instance
|
|
||||||
|
|
||||||
`templates`: server templates made on your instance
|
|
||||||
|
|
||||||
`users`: user accounts made on your fosscord instances
|
|
||||||
|
|
||||||
`voice_states`: states of Voice Chat
|
|
||||||
|
|
||||||
`webhooks`: webhooks made on your fosscord instances
|
|
||||||
|
|
||||||
You can edit this with a program called DBeaver.
|
|
||||||
|
|
||||||
// made my omxpro
|
|
||||||
// adapted by AToska21
|
|
@ -1,41 +0,0 @@
|
|||||||
# Using systemd
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
### Explaination
|
|
||||||
|
|
||||||
A systemd service, otherwise known as a daemon, is when you use the incuded systemd/systemctl package with your distro
|
|
||||||
to make the computer run your program on it's own, without you having to use screen or anything else.
|
|
||||||
|
|
||||||
To do this, you need a medium understanding of linux.
|
|
||||||
|
|
||||||
### Using systemd (Debian based distros, Arch Linux etc.)
|
|
||||||
Whatever you call it.
|
|
||||||
|
|
||||||
!!! failure "THIS IS JUST AN EXAMPLE"
|
|
||||||
Only use this config as a base. DO NOT USE ROOT.
|
|
||||||
|
|
||||||
The directory this file should go in is ``/etc/systemd/system/fosscord.service`` or whatever your system uses.
|
|
||||||
|
|
||||||
```
|
|
||||||
[Unit]
|
|
||||||
Description=<your description here>
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=root
|
|
||||||
WorkingDirectory=<fosscord directory>
|
|
||||||
ExecStart=npm run start:bundle
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
```
|
|
||||||
If you set it up correctly, you should be able to run ``systemctl enable --now fosscord`` and, your fosscord works! (and will start everytime your system boots!)
|
|
||||||
|
|
||||||
### Distros without "systemd"
|
|
||||||
|
|
||||||
!!! failure "Not supported"
|
|
||||||
I haven't had any experience with Gentoo or any other distros. Sorry guys. There are ways in other linux distros to install systemctl/systemd. I would highly reccomend it.
|
|
||||||
If there is enough demand, I will figure out how sysvinit works.
|
|
||||||
|
|
||||||
// by AToska21
|
|
@ -1,17 +0,0 @@
|
|||||||
# Setup
|
|
||||||
|
|
||||||
## [Bots](bots/)
|
|
||||||
|
|
||||||
## [Server](server/)
|
|
||||||
|
|
||||||
## [Hosting](hosting/)
|
|
||||||
|
|
||||||
## [Reverse Proxy/HTTPS (NGINX)](HTTPS/)
|
|
||||||
|
|
||||||
## Database Setups
|
|
||||||
|
|
||||||
## [MariaDB](MARIADB/)
|
|
||||||
|
|
||||||
## [SQLite](SQLITE/)
|
|
||||||
|
|
||||||
## [PostgreSQL](POSTGRESQL/)
|
|
@ -1,100 +0,0 @@
|
|||||||
# Server
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
### [Download](https://github.com/fosscord/fosscord-server/releases)
|
|
||||||
|
|
||||||
This is the stable fosscord-server release.
|
|
||||||
|
|
||||||
Download the server release from [GitHub](https://github.com/fosscord/fosscord-server/releases) for your operating system. (Size ~80mb)
|
|
||||||
|
|
||||||
Double click the file to start the server. (The first time it takes longer as it needs to setup the server)
|
|
||||||
|
|
||||||
You can now access it on [http://localhost:3001](http://localhost:3001).
|
|
||||||
|
|
||||||
### With terminal
|
|
||||||
|
|
||||||
This is the latest bleeding edge version of fosscord-server, which may have bugs.
|
|
||||||
|
|
||||||
You need to install git from [git-scm.com](https://git-scm.com/downloads) or your package manager.
|
|
||||||
|
|
||||||
You need to install nodejs version 14 or higher from [nodejs.org](https://nodejs.org/) or your package manager.
|
|
||||||
|
|
||||||
Now you can clone and start the server by executing this in the terminal/shell:
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://github.com/fosscord/fosscord-server
|
|
||||||
cd fosscord-server
|
|
||||||
cd bundle
|
|
||||||
npm run setup
|
|
||||||
npm run start:bundle
|
|
||||||
```
|
|
||||||
|
|
||||||
You can now access it on [http://localhost:3001](http://localhost:3001)
|
|
||||||
|
|
||||||
To update it run (notice will discard all changed files):
|
|
||||||
|
|
||||||
```
|
|
||||||
git reset --hard HEAD
|
|
||||||
git pull
|
|
||||||
npm run setup
|
|
||||||
npm run start:bundle
|
|
||||||
```
|
|
||||||
|
|
||||||
### With Docker
|
|
||||||
|
|
||||||
!!! failure "Not Supported Currently"
|
|
||||||
Avoid using Docker build until further notice. The current build is faulty and will not build correctly. Instead, install using the terminal in the section "With Terminal".
|
|
||||||
|
|
||||||
Optionally if you want to use Docker:
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://github.com/fosscord/fosscord-server
|
|
||||||
cd fosscord-server
|
|
||||||
docker-compose up
|
|
||||||
```
|
|
||||||
|
|
||||||
You can now access it on [http://localhost:3001](http://localhost:3001)
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
For an always up to date version of the currently available configuration options use [Config.ts](https://github.com/fosscord/fosscord-server/blob/master/util/src/entities/Config.ts#L40).
|
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
|
||||||
|------------------------------------|---------|-------------------------|--------------------------------------------------------------------------------------------------------|
|
|
||||||
| gateway_endpointClient | string | null | The gateway endpoint that gets delivered to the client |
|
|
||||||
| gateway_endpointPrivate | string | null | The gateway endpoint that is used internally to communicate between gateway servers |
|
|
||||||
| gateway_endpointPublic | string | null | The gateway endpoint that is publicly used by bots |
|
|
||||||
| cdn_endpointPublic | string | "/" | The cdn endpoint that is served in message attachments |
|
|
||||||
| cdn_endpointClient | string | null | The cdn endpoint that is used by clients |
|
|
||||||
| cdn_endpointPrivate | string | "http://localhost:3001" | The cdn endpoint that is used internally to upload images from the api to the cdn. |
|
|
||||||
| general_instanceId | string | _auto generated_ | Unique identifier for the Fosscord instance |
|
|
||||||
| limits_user_maxGuilds | number | 100 | Maximum number of guilds the user is allowed to create and join |
|
|
||||||
| limits_user_maxUsername | number | 32 | Maximum number of characters for a username |
|
|
||||||
| limits_user_maxFriends | number | 1000 | Maximum number of friends a user can have |
|
|
||||||
| limits_guild_maxRoles | number | 250 | Maximum number of roles a guild can have |
|
|
||||||
| limits_guild_maxEmojis | number | 50 | Maximum number of custom emojis a guild can have |
|
|
||||||
| limits_guild_maxMembers | number | 250000 | Maximum number of members a guild can have |
|
|
||||||
| limits_guild_maxChannels | number | 50 | Maximum number of channels a guild can have |
|
|
||||||
| limits_guild_maxChannelsInCategory | number | 50 | Maximum number of channels a category can contain |
|
|
||||||
| limits_guild_hideOfflineMember | number | 1000 | Amount of members when a guild is considered large and offline members are hidden |
|
|
||||||
| limits_message_maxCharacters | number | 2000 | Maximum length of characters a message can have |
|
|
||||||
| limits_message_maxTTSCharacters | number | 200 | Maximum length of characters a text to speech message can have |
|
|
||||||
| limits_message_maxReactions | number | 20 | Maximum number of reactions a message can have |
|
|
||||||
| limits_message_maxAttachmentSize | number | 8388608 | Maximum size a message attachment can have in bytes |
|
|
||||||
| limits_message_maxBulkDelete | number | 100 | Maximum amount of messages that can be deleted per bulk delete command |
|
|
||||||
| limits_channel_maxPins | number | 50 | Maximum amount of pinned messages a channel can have |
|
|
||||||
| limits_channel_maxTopic | number | 1024 | Maximum amount of characters a channel topic description can have |
|
|
||||||
| limits_channel_maxWebhooks | number | 10 | Maximum amount of webhooks a channel can have |
|
|
||||||
| limits_rate_disabled | boolean | false | Check to enable rate limits |
|
|
||||||
| limits_rate_ | | _TODO_ | |
|
|
||||||
| security_autoUpdate | boolean | true | Check if updates should automatically be searched for and non destructively be installed |
|
|
||||||
| security_requestSignature | string | _auto generated_ | Request signature that is used internally to sign requests |
|
|
||||||
| security_jwtSecret | string | _auto generated_ | JSON web token secret to sign and verify jwt tokens |
|
|
||||||
| security_forwardedFor | string | null | Header name that is used to retrieve the real ip of a request e.g. X-Forwarded-For or CF-Connecting-IP |
|
|
||||||
| security_captcha_enabled | boolean | false | Check to enable captchas |
|
|
||||||
| security_captcha_service | string | null | Captcha provider, one of: "recaptcha", "hcaptcha" |
|
|
||||||
| security_captcha_sitekey | string | null | Captcha provider site key |
|
|
||||||
| security_captcha_secret | string | null | Captcha provider secret to check if the user supplied captcha result is correct |
|
|
||||||
| security_ipdataApiKey | string | _public key_ | IPdata.co api key to check if a register ip address is using proxies |
|
|
||||||
| login_requireCaptcha | boolean | false | Check to require captchas to login |
|
|
@ -8,8 +8,8 @@ plugins:
|
|||||||
- render_swagger
|
- render_swagger
|
||||||
theme:
|
theme:
|
||||||
name: material
|
name: material
|
||||||
logo: assets/logo.png
|
logo: assets/logo.svg
|
||||||
favicon: assets/logo.png
|
favicon: assets/logo.svg
|
||||||
font: Open Sans
|
font: Open Sans
|
||||||
palette:
|
palette:
|
||||||
- scheme: default
|
- scheme: default
|
||||||
|
Loading…
Reference in New Issue
Block a user