diff --git a/docs/assets/logo.png b/docs/assets/logo.png deleted file mode 100644 index 4def7c1..0000000 Binary files a/docs/assets/logo.png and /dev/null differ diff --git a/docs/assets/logo.svg b/docs/assets/logo.svg new file mode 100644 index 0000000..1f379b2 --- /dev/null +++ b/docs/assets/logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/docs/bots/index.md b/docs/bots/index.md new file mode 100644 index 0000000..86d0fb8 --- /dev/null +++ b/docs/bots/index.md @@ -0,0 +1,3 @@ +# Bots + +## [Setup](setup) diff --git a/docs/setup/bots.md b/docs/bots/setup.md similarity index 90% rename from docs/setup/bots.md rename to docs/bots/setup.md index e9639a8..1c49e7a 100644 --- a/docs/setup/bots.md +++ b/docs/bots/setup.md @@ -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. @@ -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. -**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 @@ -33,18 +33,18 @@ Replace `your token here` with your copied token. Inside the client option you can specify the api endpoint: ```js -const { Client } = require("discord.js"); +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", - }, -}); + api: 'https://api.fosscord.com', + cdn: 'https://cdn.fosscord.com', + invite: 'https://fosscord.com/invite' + } +}) -client.login("your token here"); +client.login('your token here') ``` ### Discord.py diff --git a/docs/index.md b/docs/index.md index 7e9975f..00b3bca 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,7 @@ # Home +Just wanna get to setup instructions? Click [here](server/setup.md)! + ### What is Fosscord? Fosscord is a free open source self-hostable discord compatible chat, voice and video platform. diff --git a/docs/server/configuration.md b/docs/server/configuration.md new file mode 100644 index 0000000..4739353 --- /dev/null +++ b/docs/server/configuration.md @@ -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 | + diff --git a/docs/server/database.md b/docs/server/database.md new file mode 100644 index 0000000..1a9eaa5 --- /dev/null +++ b/docs/server/database.md @@ -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 | \ No newline at end of file diff --git a/docs/server/env.md b/docs/server/env.md new file mode 100644 index 0000000..1afea89 --- /dev/null +++ b/docs/server/env.md @@ -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 | diff --git a/docs/setup/hosting.md b/docs/server/hosting.md similarity index 100% rename from docs/setup/hosting.md rename to docs/server/hosting.md diff --git a/docs/server/index.md b/docs/server/index.md new file mode 100644 index 0000000..72efb9a --- /dev/null +++ b/docs/server/index.md @@ -0,0 +1,6 @@ +# Server + +## [Setup](setup.md) +## [Configuration](configuration.md) +## [Environment Variables](env.md) +## [Reverse Proxy/SSL](ssl.md) \ No newline at end of file diff --git a/docs/server/setup.md b/docs/server/setup.md new file mode 100644 index 0000000..6cb8843 --- /dev/null +++ b/docs/server/setup.md @@ -0,0 +1,64 @@ +# Setup + + + +### 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) \ No newline at end of file diff --git a/docs/server/ssl.md b/docs/server/ssl.md new file mode 100644 index 0000000..fec8cd2 --- /dev/null +++ b/docs/server/ssl.md @@ -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) \ No newline at end of file diff --git a/docs/server/systemd.md b/docs/server/systemd.md new file mode 100644 index 0000000..01d1b50 --- /dev/null +++ b/docs/server/systemd.md @@ -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= + +[Service] +User= +WorkingDirectory= +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`` \ No newline at end of file diff --git a/docs/setup/HTTPS.md b/docs/setup/HTTPS.md deleted file mode 100644 index a333328..0000000 --- a/docs/setup/HTTPS.md +++ /dev/null @@ -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 diff --git a/docs/setup/MARIADB.md b/docs/setup/MARIADB.md deleted file mode 100644 index fd61c06..0000000 --- a/docs/setup/MARIADB.md +++ /dev/null @@ -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 diff --git a/docs/setup/POSTGRESQL.md b/docs/setup/POSTGRESQL.md deleted file mode 100644 index 3f01938..0000000 --- a/docs/setup/POSTGRESQL.md +++ /dev/null @@ -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 diff --git a/docs/setup/SQLITE.md b/docs/setup/SQLITE.md deleted file mode 100644 index fbc3b89..0000000 --- a/docs/setup/SQLITE.md +++ /dev/null @@ -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** -
-Names of the table you can edit (it's really big) -
-1. applications
-2. attachments
-3. audit_logs
-4. bans
-5. channels
-6. config
-7. connected_accounts
-8. emojis
-9. guilds
-10. invites
-11. member_roles
-12. members
-13. message_channel_mentions
-14. message_role_mentions
-15. message_stickers
-16. message_user_mentions
-17. messages
-18. migrations
-19. query-result-cache
-20. rate_limits
-21. read_states
-22. recipients
-23. relationship
-24. roles
-25. sessions
-26. sqlite_sequence
-27. sticker_packs
-28. stickers
-29. team_members
-30. teams
-31. templates
-32. users
-33. voice_states
-34. webhooks
- -
- -# 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 diff --git a/docs/setup/SYSTEMD.md b/docs/setup/SYSTEMD.md deleted file mode 100644 index a266ea1..0000000 --- a/docs/setup/SYSTEMD.md +++ /dev/null @@ -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= - -[Service] -User=root -WorkingDirectory= -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 diff --git a/docs/setup/index.md b/docs/setup/index.md deleted file mode 100644 index 7899943..0000000 --- a/docs/setup/index.md +++ /dev/null @@ -1,17 +0,0 @@ -# Setup - -## [Bots](bots/) - -## [Server](server/) - -## [Hosting](hosting/) - -## [Reverse Proxy/HTTPS (NGINX)](HTTPS/) - -## Database Setups - -## [MariaDB](MARIADB/) - -## [SQLite](SQLITE/) - -## [PostgreSQL](POSTGRESQL/) diff --git a/docs/setup/server.md b/docs/setup/server.md deleted file mode 100644 index fe81506..0000000 --- a/docs/setup/server.md +++ /dev/null @@ -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 | \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 8a5feb6..932c877 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,8 +8,8 @@ plugins: - render_swagger theme: name: material - logo: assets/logo.png - favicon: assets/logo.png + logo: assets/logo.svg + favicon: assets/logo.svg font: Open Sans palette: - scheme: default