Merge branch 'master' into refactor/dev/connections
This commit is contained in:
commit
218f71b82c
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@ -1 +1 @@
|
|||||||
open_collective: fosscord
|
open_collective: spacebar
|
||||||
|
10
.github/ISSUE_TEMPLATE/config.yml
vendored
10
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,11 +1,11 @@
|
|||||||
blank_issues_enabled: true
|
blank_issues_enabled: true
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Fosscord Documentation
|
- name: Spacebar Documentation
|
||||||
url: https://docs.fosscord.com/
|
url: https://docs.spacebar.chat/
|
||||||
about: Need documentation and examples for the Fosscord? Head over to Fosscord's official documentation.
|
about: Need documentation and examples for the Spacebar? Head over to Spacebar's official documentation.
|
||||||
- name: Discord's Developer Documentation
|
- name: Discord's Developer Documentation
|
||||||
url: https://discord.com/developers/docs/intro
|
url: https://discord.com/developers/docs/intro
|
||||||
about: Need help with the Discord resources? Head here instead of asking on Fosscord!
|
about: Need help with the Discord resources? Head here instead of asking on Spacebar!
|
||||||
- name: Fosscord' Official Discord server
|
- name: Spacebar' Official Discord server
|
||||||
url: https://discord.com/invite/Ms5Ev7S6bF
|
url: https://discord.com/invite/Ms5Ev7S6bF
|
||||||
about: Need help with the server? Talk with us in our official server.
|
about: Need help with the server? Talk with us in our official server.
|
||||||
|
18
README.md
18
README.md
@ -1,28 +1,28 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img width="100" src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Icon-Rounded-Subtract.svg" />
|
<img width="100" src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/png/Spacebar__Icon-Rounded-Subtract.png" />
|
||||||
</p>
|
</p>
|
||||||
<h1 align="center">Fosscord Server</h1>
|
<h1 align="center">Spacebar Server</h1>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://discord.gg/ZrnGQP6p3d">
|
<a href="https://discord.gg/ZrnGQP6p3d">
|
||||||
<img src="https://img.shields.io/discord/806142446094385153?color=7489d5&logo=discord&logoColor=ffffff" />
|
<img src="https://img.shields.io/discord/806142446094385153?color=7489d5&logo=discord&logoColor=ffffff" />
|
||||||
</a>
|
</a>
|
||||||
<img src="https://img.shields.io/static/v1?label=Status&message=Development&color=blue">
|
<img src="https://img.shields.io/static/v1?label=Status&message=Development&color=blue">
|
||||||
<a title="Crowdin" target="_blank" href="https://translate.fosscord.com/"><img src="https://badges.crowdin.net/fosscord/localized.svg"></a>
|
<a title="Crowdin" target="_blank" href="https://translate.spacebar.chat/"><img src="https://badges.crowdin.net/spacebar/localized.svg"></a>
|
||||||
<a href="https://opencollective.com/fosscord">
|
<a href="https://opencollective.com/spacebar">
|
||||||
<img src="https://opencollective.com/fosscord/tiers/badge.svg">
|
<img src="https://opencollective.com/spacebar/tiers/badge.svg">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## [About](https://fosscord.com)
|
## [About](https://spacebar.chat)
|
||||||
|
|
||||||
This repository contains:
|
This repository contains:
|
||||||
|
|
||||||
- [Fosscord HTTP API Server](/src/api)
|
- [Spacebar HTTP API Server](/src/api)
|
||||||
- [WebSocket Gateway Server](/src/gateway)
|
- [WebSocket Gateway Server](/src/gateway)
|
||||||
- [HTTP CDN Server](/src/cdn)
|
- [HTTP CDN Server](/src/cdn)
|
||||||
- [Utility and Database Models](/src/util)
|
- [Utility and Database Models](/src/util)
|
||||||
|
|
||||||
## [Contributing](https://docs.fosscord.com/contributing/)
|
## [Contributing](https://docs.spacebar.chat/contributing/)
|
||||||
|
|
||||||
## [Setup](https://docs.fosscord.com/setup/server/)
|
## [Setup](https://docs.spacebar.chat/setup/server/)
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div style="background-color: #202225;">
|
<div style="background-color: #202225;">
|
||||||
<img
|
<img
|
||||||
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg"
|
src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
|
||||||
alt="Branding"
|
alt="Branding"
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -86,7 +86,7 @@
|
|||||||
color: white;
|
color: white;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 15px 19px;
|
padding: 15px 19px;
|
||||||
background-color: #ff5f00;
|
background-color: #0185ff;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
"
|
"
|
||||||
>Verify Login</a
|
>Verify Login</a
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div style="background-color: #202225;">
|
<div style="background-color: #202225;">
|
||||||
<img
|
<img
|
||||||
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg"
|
src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
|
||||||
alt="Branding"
|
alt="Branding"
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div style="background-color: #202225;">
|
<div style="background-color: #202225;">
|
||||||
<img
|
<img
|
||||||
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg"
|
src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
|
||||||
alt="Branding"
|
alt="Branding"
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div style="background-color: #202225;">
|
<div style="background-color: #202225;">
|
||||||
<img
|
<img
|
||||||
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg"
|
src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
|
||||||
alt="Branding"
|
alt="Branding"
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div style="background-color: #202225;">
|
<div style="background-color: #202225;">
|
||||||
<img
|
<img
|
||||||
src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Orange.svg"
|
src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg"
|
||||||
alt="Branding"
|
alt="Branding"
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
h3.title-jXR8lp.marginBottom8-AtZOdT.base-1x0h_U.size24-RIRrxO::after {
|
h3.title-jXR8lp.marginBottom8-AtZOdT.base-1x0h_U.size24-RIRrxO::after {
|
||||||
margin-top: -32px;
|
margin-top: -32px;
|
||||||
content: "Welcome to Fosscord!";
|
content: "Welcome to Spacebar!";
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ h3.title-jXR8lp.marginBottom8-AtZOdT.base-1x0h_U.size24-RIRrxO::after {
|
|||||||
/* Logo in top left when bg removed */
|
/* Logo in top left when bg removed */
|
||||||
#app-mount > div.app-1q1i1E > div > a {
|
#app-mount > div.app-1q1i1E > div > a {
|
||||||
/* replace me: original dimensions: 130x36 */
|
/* replace me: original dimensions: 130x36 */
|
||||||
background: url(https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Gradient.svg);
|
background: url(https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg);
|
||||||
width: 130px;
|
width: 130px;
|
||||||
height: 23px;
|
height: 23px;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
> foreignObject
|
> foreignObject
|
||||||
> div
|
> div
|
||||||
> div {
|
> div {
|
||||||
background-image: url(https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Icon-Rounded-Subtract.svg);
|
background-image: url(https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Icon-Rounded-Subtract.svg);
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
65
assets/public/index.html
Normal file
65
assets/public/index.html
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Spacebar Server</title>
|
||||||
|
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'Montserrat', sans-serif;
|
||||||
|
background-color: rgb(10, 10, 10);
|
||||||
|
color: white;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0 40px 0 40px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wordmark {
|
||||||
|
width: min(500px, 50%);
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a, a:visited {
|
||||||
|
color: #0185ff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<img alt="Spacebar Logo"
|
||||||
|
id="wordmark"
|
||||||
|
src="https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/svg/Spacebar__Logo-Blue.svg" />
|
||||||
|
|
||||||
|
<h1>Welcome!</h1>
|
||||||
|
<p>If you're viewing this page, that means you've successfully set up your very own Spacebar instance!</p>
|
||||||
|
<p>For information on how to configure your shiny new setup, you should visit <a href="https://docs.spacebar.chat">our documentation</a></p>
|
||||||
|
<p>For information on how to connect and use your instance, <a href="https://docs.spacebar.chat/setup/clients">click here</a></p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
7769
assets/schemas.json
7769
assets/schemas.json
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
|||||||
If you want to use it, throw it into the `preload-plugins` folder.
|
If you want to use it, throw it into the `preload-plugins` folder.
|
||||||
TODO: Make it so this file is not required for webrtc.
|
TODO: Make it so this file is not required for webrtc.
|
||||||
|
|
||||||
Do note that webrtc, as of 17/12/2022, is not implemented yet in fosscord/fosscord-server.
|
Do note that webrtc, as of 17/12/2022, is not implemented yet in spacebarchat/server.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(this.webpackChunkdiscord_app = this.webpackChunkdiscord_app || []).push([
|
(this.webpackChunkdiscord_app = this.webpackChunkdiscord_app || []).push([
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# This is an example nginx config for Fosscord.
|
# This is an example nginx config for Spacebar.
|
||||||
|
|
||||||
server {
|
server {
|
||||||
# Change server_name
|
# Change server_name
|
||||||
server_name fosscord.example.com;
|
server_name spacebar.example.com;
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "fosscord-server",
|
"name": "spacebar-server",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "fosscord-server",
|
"name": "spacebar-server",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
|
20
package.json
20
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "fosscord-server",
|
"name": "spacebar-server",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A Fosscord server written in Node.js",
|
"description": "A Spacebar server written in Node.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"postinstall": "npx patch-package",
|
"postinstall": "npx patch-package",
|
||||||
@ -26,17 +26,17 @@
|
|||||||
"types": "src/bundle/index.ts",
|
"types": "src/bundle/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/fosscord/fosscord-server.git"
|
"url": "git+https://github.com/spacebarchat/server.git"
|
||||||
},
|
},
|
||||||
"author": "Fosscord",
|
"author": "Spacebar",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/fosscord/fosscord-server/issues"
|
"url": "https://github.com/spacebarchat/server/issues"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"#*": "./dist/*/index.js"
|
"#*": "./dist/*/index.js"
|
||||||
},
|
},
|
||||||
"homepage": "https://fosscord.com",
|
"homepage": "https://spacebar.chat",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/amqplib": "^0.8.2",
|
"@types/amqplib": "^0.8.2",
|
||||||
"@types/bcrypt": "^5.0.0",
|
"@types/bcrypt": "^5.0.0",
|
||||||
@ -109,10 +109,10 @@
|
|||||||
"ws": "^8.9.0"
|
"ws": "^8.9.0"
|
||||||
},
|
},
|
||||||
"_moduleAliases": {
|
"_moduleAliases": {
|
||||||
"@fosscord/api": "dist/api",
|
"@spacebar/api": "dist/api",
|
||||||
"@fosscord/cdn": "dist/cdn",
|
"@spacebar/cdn": "dist/cdn",
|
||||||
"@fosscord/gateway": "dist/gateway",
|
"@spacebar/gateway": "dist/gateway",
|
||||||
"@fosscord/util": "dist/util"
|
"@spacebar/util": "dist/util"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"erlpack": "^0.1.4",
|
"erlpack": "^0.1.4",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -23,9 +23,11 @@
|
|||||||
To find which file the changelog is stored in your client, simply grep for the changelog text given by the client,
|
To find which file the changelog is stored in your client, simply grep for the changelog text given by the client,
|
||||||
and update the `CHANGELOG_SCRIPT` variable to use that instead.
|
and update the `CHANGELOG_SCRIPT` variable to use that instead.
|
||||||
|
|
||||||
This grabs the new changelog from `fosscord-server/assets/changelog.txt`
|
This grabs the new changelog from `spacebarchat/server/assets/changelog.txt`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
const fetch = require("node-fetch");
|
const fetch = require("node-fetch");
|
||||||
const fs = require("fs/promises");
|
const fs = require("fs/promises");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
@ -5,13 +5,15 @@
|
|||||||
Does not prepend is file contains @fc-license-skip
|
Does not prepend is file contains @fc-license-skip
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
const Path = require("path");
|
const Path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const walk = require("./util/walk");
|
const walk = require("./util/walk");
|
||||||
|
|
||||||
const FOSSCORD_SOURCE_DIR = Path.join(__dirname, "..", "src");
|
const SPACEBAR_SOURCE_DIR = Path.join(__dirname, "..", "src");
|
||||||
const FOSSCORD_SCRIPTS_DIR = Path.join(__dirname);
|
const SPACEBAR_SCRIPTS_DIR = Path.join(__dirname);
|
||||||
const FOSSCORD_LICENSE_PREAMBLE = fs
|
const SPACEBAR_LICENSE_PREAMBLE = fs
|
||||||
.readFileSync(Path.join(__dirname, "util", "licensePreamble.txt"))
|
.readFileSync(Path.join(__dirname, "util", "licensePreamble.txt"))
|
||||||
.toString()
|
.toString()
|
||||||
.split("\r") // remove windows bs
|
.split("\r") // remove windows bs
|
||||||
@ -37,7 +39,7 @@ const addToDir = (dir) => {
|
|||||||
const preamble =
|
const preamble =
|
||||||
commentStrings[0] +
|
commentStrings[0] +
|
||||||
"\n" +
|
"\n" +
|
||||||
FOSSCORD_LICENSE_PREAMBLE +
|
SPACEBAR_LICENSE_PREAMBLE +
|
||||||
"\n" +
|
"\n" +
|
||||||
commentStrings[1];
|
commentStrings[1];
|
||||||
|
|
||||||
@ -56,5 +58,5 @@ const addToDir = (dir) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
addToDir(FOSSCORD_SOURCE_DIR);
|
addToDir(SPACEBAR_SOURCE_DIR);
|
||||||
addToDir(FOSSCORD_SCRIPTS_DIR);
|
addToDir(SPACEBAR_SCRIPTS_DIR);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,6 +16,8 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
require("module-alias/register");
|
require("module-alias/register");
|
||||||
const getRouteDescriptions = require("./util/getRouteDescriptions");
|
const getRouteDescriptions = require("./util/getRouteDescriptions");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
@ -27,7 +29,31 @@ require("missing-native-js-functions");
|
|||||||
|
|
||||||
const openapiPath = path.join(__dirname, "..", "assets", "openapi.json");
|
const openapiPath = path.join(__dirname, "..", "assets", "openapi.json");
|
||||||
const SchemaPath = path.join(__dirname, "..", "assets", "schemas.json");
|
const SchemaPath = path.join(__dirname, "..", "assets", "schemas.json");
|
||||||
const schemas = JSON.parse(fs.readFileSync(SchemaPath, { encoding: "utf8" }));
|
let schemas = JSON.parse(fs.readFileSync(SchemaPath, { encoding: "utf8" }));
|
||||||
|
|
||||||
|
for (var schema in schemas) {
|
||||||
|
const part = schemas[schema];
|
||||||
|
for (var key in part.properties) {
|
||||||
|
if (part.properties[key].anyOf) {
|
||||||
|
const nullIndex = part.properties[key].anyOf.findIndex(
|
||||||
|
(x) => x.type == "null",
|
||||||
|
);
|
||||||
|
if (nullIndex != -1) {
|
||||||
|
part.properties[key].nullable = true;
|
||||||
|
part.properties[key].anyOf.splice(nullIndex, 1);
|
||||||
|
|
||||||
|
if (part.properties[key].anyOf.length == 1) {
|
||||||
|
Object.assign(
|
||||||
|
part.properties[key],
|
||||||
|
part.properties[key].anyOf[0],
|
||||||
|
);
|
||||||
|
delete part.properties[key].anyOf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const specification = JSON.parse(
|
const specification = JSON.parse(
|
||||||
fs.readFileSync(openapiPath, { encoding: "utf8" }),
|
fs.readFileSync(openapiPath, { encoding: "utf8" }),
|
||||||
);
|
);
|
||||||
@ -109,7 +135,7 @@ function apiRoutes() {
|
|||||||
return x.test(path);
|
return x.test(path);
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
obj.security = [{ bearer: true }];
|
obj.security = [{ bearer: [] }];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (route.body) {
|
if (route.body) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -20,6 +20,8 @@
|
|||||||
Calculates a discord.com-like rights value.
|
Calculates a discord.com-like rights value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
require("module-alias/register");
|
require("module-alias/register");
|
||||||
const { Rights } = require("..");
|
const { Rights } = require("..");
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,9 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Regenerates the `fosscord-server/assets/schemas.json` file, used for API/Gateway input validation.
|
Regenerates the `spacebarchat/server/assets/schemas.json` file, used for API/Gateway input validation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const TJS = require("typescript-json-schema");
|
const TJS = require("typescript-json-schema");
|
||||||
@ -91,9 +93,9 @@ function main() {
|
|||||||
if (!part) continue;
|
if (!part) continue;
|
||||||
|
|
||||||
// this is a hack. want some want to check if its a @column, instead
|
// this is a hack. want some want to check if its a @column, instead
|
||||||
if (part.properties)
|
if (part.properties) {
|
||||||
Object.keys(part.properties)
|
for (let key in part.properties) {
|
||||||
.filter((key) =>
|
if (
|
||||||
[
|
[
|
||||||
// BaseClass methods
|
// BaseClass methods
|
||||||
"toJSON",
|
"toJSON",
|
||||||
@ -104,9 +106,31 @@ function main() {
|
|||||||
"recover",
|
"recover",
|
||||||
"reload",
|
"reload",
|
||||||
"assign",
|
"assign",
|
||||||
].includes(key),
|
].includes(key)
|
||||||
)
|
) {
|
||||||
.forEach((key) => delete part.properties[key]);
|
delete part.properties[key];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (part.properties[key].anyOf) {
|
||||||
|
// const nullIndex = part.properties[key].anyOf.findIndex(
|
||||||
|
// (x) => x.type == "null",
|
||||||
|
// );
|
||||||
|
// if (nullIndex != -1) {
|
||||||
|
// part.properties[key].nullable = true;
|
||||||
|
// part.properties[key].anyOf.splice(nullIndex, 1);
|
||||||
|
|
||||||
|
// if (part.properties[key].anyOf.length == 1) {
|
||||||
|
// Object.assign(
|
||||||
|
// part.properties[key],
|
||||||
|
// part.properties[key].anyOf[0],
|
||||||
|
// );
|
||||||
|
// delete part.properties[key].anyOf;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
definitions = { ...definitions, [name]: { ...part } };
|
definitions = { ...definitions, [name]: { ...part } };
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,13 +16,15 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
const register = require("./src/register");
|
const register = require("./src/register");
|
||||||
const login = require("./src/login/index");
|
const login = require("./src/login/index");
|
||||||
const config = require("./config.json");
|
const config = require("./config.json");
|
||||||
const figlet = require("figlet");
|
const figlet = require("figlet");
|
||||||
const sendMessage = require("./src/message/send");
|
const sendMessage = require("./src/message/send");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
figlet("Fosscord Stress Test :)", function (err, data) {
|
figlet("Spacebar Stress Test :)", function (err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log("Something went wrong...");
|
console.log("Something went wrong...");
|
||||||
console.dir(err);
|
console.dir(err);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,6 +16,8 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
const fetch = require("node-fetch");
|
const fetch = require("node-fetch");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
var config = require("../../config.json");
|
var config = require("../../config.json");
|
||||||
@ -36,7 +38,7 @@ async function generate() {
|
|||||||
var body = {
|
var body = {
|
||||||
fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw",
|
fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw",
|
||||||
email: mail,
|
email: mail,
|
||||||
username: "Fosscord Stress Test",
|
username: "Spacebar Stress Test",
|
||||||
password: password,
|
password: password,
|
||||||
invite: config.invite,
|
invite: config.invite,
|
||||||
consent: true,
|
consent: true,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -25,6 +25,8 @@
|
|||||||
it doesn't break the below, thus we're left with this :sob:
|
it doesn't break the below, thus we're left with this :sob:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
require("module-alias/register");
|
require("module-alias/register");
|
||||||
require("dotenv").config();
|
require("dotenv").config();
|
||||||
const { initDatabase } = require("..");
|
const { initDatabase } = require("..");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -27,7 +27,7 @@ import {
|
|||||||
WebAuthn,
|
WebAuthn,
|
||||||
ConnectionConfig,
|
ConnectionConfig,
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { Server, ServerOptions } from "lambert-server";
|
import { Server, ServerOptions } from "lambert-server";
|
||||||
import "missing-native-js-functions";
|
import "missing-native-js-functions";
|
||||||
@ -41,21 +41,29 @@ import { initRateLimits } from "./middlewares/RateLimit";
|
|||||||
import { initTranslation } from "./middlewares/Translation";
|
import { initTranslation } from "./middlewares/Translation";
|
||||||
import { initInstance } from "./util/handlers/Instance";
|
import { initInstance } from "./util/handlers/Instance";
|
||||||
|
|
||||||
export type FosscordServerOptions = ServerOptions;
|
const PUBLIC_ASSETS_FOLDER = path.join(
|
||||||
|
__dirname,
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"assets",
|
||||||
|
"public",
|
||||||
|
);
|
||||||
|
|
||||||
|
export type SpacebarServerOptions = ServerOptions;
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||||
namespace Express {
|
namespace Express {
|
||||||
interface Request {
|
interface Request {
|
||||||
server: FosscordServer;
|
server: SpacebarServer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FosscordServer extends Server {
|
export class SpacebarServer extends Server {
|
||||||
public declare options: FosscordServerOptions;
|
public declare options: SpacebarServerOptions;
|
||||||
|
|
||||||
constructor(opts?: Partial<FosscordServerOptions>) {
|
constructor(opts?: Partial<SpacebarServerOptions>) {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
super({ ...opts, errorHandler: false, jsonBody: false });
|
super({ ...opts, errorHandler: false, jsonBody: false });
|
||||||
@ -129,6 +137,10 @@ export class FosscordServer extends Server {
|
|||||||
app.use("/api/v9", api);
|
app.use("/api/v9", api);
|
||||||
app.use("/api", api); // allow unversioned requests
|
app.use("/api", api); // allow unversioned requests
|
||||||
|
|
||||||
|
app.get("/", (req, res) =>
|
||||||
|
res.sendFile(path.join(PUBLIC_ASSETS_FOLDER, "index.html")),
|
||||||
|
);
|
||||||
|
|
||||||
this.app.use(ErrorHandler);
|
this.app.use(ErrorHandler);
|
||||||
|
|
||||||
Sentry.errorHandler(this.app);
|
Sentry.errorHandler(this.app);
|
||||||
|
4
src/api/global.d.ts
vendored
4
src/api/global.d.ts
vendored
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,7 +16,7 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { checkToken, Config, Rights } from "@fosscord/util";
|
import { checkToken, Config, Rights } from "@spacebar/util";
|
||||||
import * as Sentry from "@sentry/node";
|
import * as Sentry from "@sentry/node";
|
||||||
import { NextFunction, Request, Response } from "express";
|
import { NextFunction, Request, Response } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
import { NextFunction, Request, Response } from "express";
|
import { NextFunction, Request, Response } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { ApiError, FieldError } from "@fosscord/util";
|
import { ApiError, FieldError } from "@spacebar/util";
|
||||||
const EntityNotFoundErrorRegex = /"(\w+)"/;
|
const EntityNotFoundErrorRegex = /"(\w+)"/;
|
||||||
|
|
||||||
export function ErrorHandler(
|
export function ErrorHandler(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,8 +16,8 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getIpAdress } from "@fosscord/api";
|
import { getIpAdress } from "@spacebar/api";
|
||||||
import { Config, getRights, listenEvent } from "@fosscord/util";
|
import { Config, getRights, listenEvent } from "@spacebar/util";
|
||||||
import { NextFunction, Request, Response, Router } from "express";
|
import { NextFunction, Request, Response, Router } from "express";
|
||||||
import { API_PREFIX_TRAILING_SLASH } from "./Authentication";
|
import { API_PREFIX_TRAILING_SLASH } from "./Authentication";
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ import { API_PREFIX_TRAILING_SLASH } from "./Authentication";
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
? bucket limit? Max actions/sec per bucket?
|
? bucket limit? Max actions/sec per bucket?
|
||||||
(ANSWER: a small fosscord instance might not need a complex rate limiting system)
|
(ANSWER: a small spacebar instance might not need a complex rate limiting system)
|
||||||
TODO: delay database requests to include multiple queries
|
TODO: delay database requests to include multiple queries
|
||||||
TODO: different for methods (GET/POST)
|
TODO: different for methods (GET/POST)
|
||||||
> IP addresses that make too many invalid HTTP requests are automatically and temporarily restricted from accessing the Discord API. Currently, this limit is 10,000 per 10 minutes. An invalid request is one that results in 401, 403, or 429 statuses.
|
> IP addresses that make too many invalid HTTP requests are automatically and temporarily restricted from accessing the Discord API. Currently, this limit is 10,000 per 10 minutes. An invalid request is one that results in 401, 403, or 429 statuses.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { getDatabase } from "@fosscord/util";
|
import { getDatabase } from "@spacebar/util";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { getDatabase } from "@fosscord/util";
|
import { getDatabase } from "@spacebar/util";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Application,
|
Application,
|
||||||
generateToken,
|
generateToken,
|
||||||
@ -25,7 +25,7 @@ import {
|
|||||||
BotModifySchema,
|
BotModifySchema,
|
||||||
handleFile,
|
handleFile,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { verifyToken } from "node-2fa";
|
import { verifyToken } from "node-2fa";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,12 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Application,
|
Application,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
ApplicationModifySchema,
|
ApplicationModifySchema,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { verifyToken } from "node-2fa";
|
import { verifyToken } from "node-2fa";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,13 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Application,
|
Application,
|
||||||
ApplicationCreateSchema,
|
ApplicationCreateSchema,
|
||||||
trimSpecial,
|
trimSpecial,
|
||||||
User,
|
User,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
|
@ -1,11 +1,29 @@
|
|||||||
import { getIpAdress, route, verifyCaptcha } from "@fosscord/api";
|
/*
|
||||||
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Config,
|
Config,
|
||||||
Email,
|
Email,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
ForgotPasswordSchema,
|
ForgotPasswordSchema,
|
||||||
User,
|
User,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,8 +16,8 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { route, random } from "@fosscord/api";
|
import { route, random } from "@spacebar/api";
|
||||||
import { Config, ValidRegistrationToken } from "@fosscord/util";
|
import { Config, ValidRegistrationToken } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Request, Response } from "express";
|
import { Router, Request, Response } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { getIpAdress, IPAnalysis } from "@fosscord/api";
|
import { getIpAdress, IPAnalysis } from "@spacebar/api";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,7 +16,7 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getIpAdress, route, verifyCaptcha } from "@fosscord/api";
|
import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
adjustEmail,
|
adjustEmail,
|
||||||
Config,
|
Config,
|
||||||
@ -26,7 +26,7 @@ import {
|
|||||||
LoginSchema,
|
LoginSchema,
|
||||||
User,
|
User,
|
||||||
WebAuthn,
|
WebAuthn,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,7 +16,7 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Request, Response } from "express";
|
import { Router, Request, Response } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { BackupCode, generateToken, User, TotpSchema } from "@fosscord/util";
|
import { BackupCode, generateToken, User, TotpSchema } from "@spacebar/util";
|
||||||
import { verifyToken } from "node-2fa";
|
import { verifyToken } from "node-2fa";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
@ -63,7 +63,7 @@ router.post(
|
|||||||
|
|
||||||
return res.json({
|
return res.json({
|
||||||
token: await generateToken(user.id),
|
token: await generateToken(user.id),
|
||||||
user_settings: user.settings,
|
settings: { ...user.settings, index: undefined },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,7 +16,7 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
generateToken,
|
generateToken,
|
||||||
SecurityKey,
|
SecurityKey,
|
||||||
@ -24,7 +24,7 @@ import {
|
|||||||
verifyWebAuthnToken,
|
verifyWebAuthnToken,
|
||||||
WebAuthn,
|
WebAuthn,
|
||||||
WebAuthnTotpSchema,
|
WebAuthnTotpSchema,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { ExpectedAssertionResult } from "fido2-lib";
|
import { ExpectedAssertionResult } from "fido2-lib";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -26,14 +26,14 @@ import {
|
|||||||
adjustEmail,
|
adjustEmail,
|
||||||
RegisterSchema,
|
RegisterSchema,
|
||||||
ValidRegistrationToken,
|
ValidRegistrationToken,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import {
|
import {
|
||||||
route,
|
route,
|
||||||
getIpAdress,
|
getIpAdress,
|
||||||
IPAnalysis,
|
IPAnalysis,
|
||||||
isProxy,
|
isProxy,
|
||||||
verifyCaptcha,
|
verifyCaptcha,
|
||||||
} from "@fosscord/api";
|
} from "@spacebar/api";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { MoreThan } from "typeorm";
|
import { MoreThan } from "typeorm";
|
||||||
@ -52,7 +52,7 @@ router.post(
|
|||||||
// They're a one time use token that bypasses registration limits ( rates, disabled reg, etc )
|
// They're a one time use token that bypasses registration limits ( rates, disabled reg, etc )
|
||||||
let regTokenUsed = false;
|
let regTokenUsed = false;
|
||||||
if (req.get("Referrer") && req.get("Referrer")?.includes("token=")) {
|
if (req.get("Referrer") && req.get("Referrer")?.includes("token=")) {
|
||||||
// eg theyre on https://staging.fosscord.com/register?token=whatever
|
// eg theyre on https://staging.spacebar.chat/register?token=whatever
|
||||||
const token = req.get("Referrer")?.split("token=")[1].split("&")[0];
|
const token = req.get("Referrer")?.split("token=")[1].split("&")[0];
|
||||||
if (token) {
|
if (token) {
|
||||||
const regToken = await ValidRegistrationToken.findOneOrFail({
|
const regToken = await ValidRegistrationToken.findOneOrFail({
|
||||||
|
@ -1,4 +1,22 @@
|
|||||||
import { route } from "@fosscord/api";
|
/*
|
||||||
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
checkToken,
|
checkToken,
|
||||||
Config,
|
Config,
|
||||||
@ -7,7 +25,7 @@ import {
|
|||||||
generateToken,
|
generateToken,
|
||||||
PasswordResetSchema,
|
PasswordResetSchema,
|
||||||
User,
|
User,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,14 +16,14 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getIpAdress, route, verifyCaptcha } from "@fosscord/api";
|
import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
checkToken,
|
checkToken,
|
||||||
Config,
|
Config,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
generateToken,
|
generateToken,
|
||||||
User,
|
User,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,8 +16,8 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Email, User } from "@fosscord/util";
|
import { Email, User } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Request, Response } from "express";
|
import { Router, Request, Response } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { FieldErrors, User, BackupCodesChallengeSchema } from "@fosscord/util";
|
import { FieldErrors, User, BackupCodesChallengeSchema } from "@spacebar/util";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -25,9 +25,9 @@ import {
|
|||||||
Recipient,
|
Recipient,
|
||||||
handleFile,
|
handleFile,
|
||||||
ChannelModifySchema,
|
ChannelModifySchema,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
// TODO: delete channel
|
// TODO: delete channel
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
import { Router, Request, Response } from "express";
|
import { Router, Request, Response } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { random } from "@fosscord/api";
|
import { random } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Channel,
|
Channel,
|
||||||
Invite,
|
Invite,
|
||||||
@ -28,7 +28,7 @@ import {
|
|||||||
User,
|
User,
|
||||||
Guild,
|
Guild,
|
||||||
PublicInviteRelation,
|
PublicInviteRelation,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { isTextChannel } from "./messages";
|
import { isTextChannel } from "./messages";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -21,9 +21,9 @@ import {
|
|||||||
getPermission,
|
getPermission,
|
||||||
MessageAckEvent,
|
MessageAckEvent,
|
||||||
ReadState,
|
ReadState,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -20,7 +20,7 @@ import {
|
|||||||
Attachment,
|
Attachment,
|
||||||
Channel,
|
Channel,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
FosscordApiErrors,
|
SpacebarApiErrors,
|
||||||
getPermission,
|
getPermission,
|
||||||
getRights,
|
getRights,
|
||||||
Message,
|
Message,
|
||||||
@ -31,11 +31,11 @@ import {
|
|||||||
uploadFile,
|
uploadFile,
|
||||||
MessageCreateSchema,
|
MessageCreateSchema,
|
||||||
MessageEditSchema,
|
MessageEditSchema,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import multer from "multer";
|
import multer from "multer";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { handleMessage, postHandleMessage } from "@fosscord/api";
|
import { handleMessage, postHandleMessage } from "@spacebar/api";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
@ -163,14 +163,14 @@ router.put(
|
|||||||
const snowflake = Snowflake.deconstruct(message_id);
|
const snowflake = Snowflake.deconstruct(message_id);
|
||||||
if (Date.now() < snowflake.timestamp) {
|
if (Date.now() < snowflake.timestamp) {
|
||||||
// message is in the future
|
// message is in the future
|
||||||
throw FosscordApiErrors.CANNOT_BACKFILL_TO_THE_FUTURE;
|
throw SpacebarApiErrors.CANNOT_BACKFILL_TO_THE_FUTURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const exists = await Message.findOne({
|
const exists = await Message.findOne({
|
||||||
where: { id: message_id, channel_id: channel_id },
|
where: { id: message_id, channel_id: channel_id },
|
||||||
});
|
});
|
||||||
if (exists) {
|
if (exists) {
|
||||||
throw FosscordApiErrors.CANNOT_REPLACE_BY_BACKFILL;
|
throw SpacebarApiErrors.CANNOT_REPLACE_BY_BACKFILL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.file) {
|
if (req.file) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -30,8 +30,8 @@ import {
|
|||||||
PartialEmoji,
|
PartialEmoji,
|
||||||
PublicUserProjection,
|
PublicUserProjection,
|
||||||
User,
|
User,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { In } from "typeorm";
|
import { In } from "typeorm";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -25,9 +25,9 @@ import {
|
|||||||
getRights,
|
getRights,
|
||||||
MessageDeleteBulkEvent,
|
MessageDeleteBulkEvent,
|
||||||
Message,
|
Message,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -36,9 +36,9 @@ import {
|
|||||||
Rights,
|
Rights,
|
||||||
Reaction,
|
Reaction,
|
||||||
User,
|
User,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { handleMessage, postHandleMessage, route } from "@fosscord/api";
|
import { handleMessage, postHandleMessage, route } from "@spacebar/api";
|
||||||
import multer from "multer";
|
import multer from "multer";
|
||||||
import { FindManyOptions, FindOperator, LessThan, MoreThan } from "typeorm";
|
import { FindManyOptions, FindOperator, LessThan, MoreThan } from "typeorm";
|
||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
@ -146,7 +146,7 @@ router.get("/", async (req: Request, res: Response) => {
|
|||||||
x.author = User.create({
|
x.author = User.create({
|
||||||
id: "4",
|
id: "4",
|
||||||
discriminator: "0000",
|
discriminator: "0000",
|
||||||
username: "Fosscord Ghost",
|
username: "Spacebar Ghost",
|
||||||
public_flags: 0,
|
public_flags: 0,
|
||||||
});
|
});
|
||||||
x.attachments?.forEach((y: Attachment) => {
|
x.attachments?.forEach((y: Attachment) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -24,11 +24,11 @@ import {
|
|||||||
Member,
|
Member,
|
||||||
Role,
|
Role,
|
||||||
ChannelPermissionOverwriteSchema,
|
ChannelPermissionOverwriteSchema,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
// TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel)
|
// TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -24,9 +24,9 @@ import {
|
|||||||
Message,
|
Message,
|
||||||
MessageUpdateEvent,
|
MessageUpdateEvent,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Router, Request, Response } from "express";
|
import { Router, Request, Response } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { isTextChannel } from "./messages";
|
import { isTextChannel } from "./messages";
|
||||||
import { FindManyOptions, Between, Not, FindOperator } from "typeorm";
|
import { FindManyOptions, Between, Not, FindOperator } from "typeorm";
|
||||||
import {
|
import {
|
||||||
@ -28,7 +28,7 @@ import {
|
|||||||
Message,
|
Message,
|
||||||
MessageDeleteBulkEvent,
|
MessageDeleteBulkEvent,
|
||||||
PurgeSchema,
|
PurgeSchema,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -27,8 +27,8 @@ import {
|
|||||||
PublicUserProjection,
|
PublicUserProjection,
|
||||||
Recipient,
|
Recipient,
|
||||||
User,
|
User,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,8 +16,8 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Channel, emitEvent, Member, TypingStartEvent } from "@fosscord/util";
|
import { Channel, emitEvent, Member, TypingStartEvent } from "@spacebar/util";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Router, Request, Response } from "express";
|
import { Router, Request, Response } from "express";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Channel,
|
Channel,
|
||||||
Config,
|
Config,
|
||||||
@ -27,10 +27,10 @@ import {
|
|||||||
Webhook,
|
Webhook,
|
||||||
WebhookCreateSchema,
|
WebhookCreateSchema,
|
||||||
WebhookType,
|
WebhookType,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { isTextChannel } from "./messages/index";
|
import { isTextChannel } from "./messages/index";
|
||||||
import { DiscordApiErrors } from "@fosscord/util";
|
import { DiscordApiErrors } from "@spacebar/util";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
@ -63,7 +63,7 @@ router.post(
|
|||||||
|
|
||||||
// TODO: move this
|
// TODO: move this
|
||||||
if (name === "clyde") throw new HTTPError("Invalid name", 400);
|
if (name === "clyde") throw new HTTPError("Invalid name", 400);
|
||||||
if (name === "Fosscord Ghost") throw new HTTPError("Invalid name", 400);
|
if (name === "Spacebar Ghost") throw new HTTPError("Invalid name", 400);
|
||||||
|
|
||||||
if (avatar) avatar = await handleFile(`/avatars/${channel_id}`, avatar);
|
if (avatar) avatar = await handleFile(`/avatars/${channel_id}`, avatar);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { ConnectionStore, FieldErrors } from "../../../../util";
|
import { ConnectionStore, FieldErrors } from "../../../../util";
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
ConnectionCallbackSchema,
|
ConnectionCallbackSchema,
|
||||||
ConnectionStore,
|
ConnectionStore,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,10 +16,10 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Guild, Config } from "@fosscord/util";
|
import { Guild, Config } from "@spacebar/util";
|
||||||
|
|
||||||
import { Router, Request, Response } from "express";
|
import { Router, Request, Response } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Like } from "typeorm";
|
import { Like } from "typeorm";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,9 +16,9 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Categories } from "@fosscord/util";
|
import { Categories } from "@spacebar/util";
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { FieldErrors, Release } from "@fosscord/util";
|
import { FieldErrors, Release } from "@spacebar/util";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,23 +16,12 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Config } from "@fosscord/util";
|
import { Config } from "@spacebar/util";
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route, RouteOptions } from "@fosscord/api";
|
import { route, RouteOptions } from "@spacebar/api";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
export interface GatewayBotResponse {
|
|
||||||
url: string;
|
|
||||||
shards: number;
|
|
||||||
session_start_limit: {
|
|
||||||
total: number;
|
|
||||||
remaining: number;
|
|
||||||
reset_after: number;
|
|
||||||
max_concurrency: number;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const options: RouteOptions = {
|
const options: RouteOptions = {
|
||||||
test: {
|
test: {
|
||||||
response: {
|
response: {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,16 +16,12 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Config } from "@fosscord/util";
|
import { Config } from "@spacebar/util";
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route, RouteOptions } from "@fosscord/api";
|
import { route, RouteOptions } from "@spacebar/api";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
export interface GatewayResponse {
|
|
||||||
url: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const options: RouteOptions = {
|
const options: RouteOptions = {
|
||||||
test: {
|
test: {
|
||||||
response: {
|
response: {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -19,7 +19,7 @@
|
|||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import ProxyAgent from "proxy-agent";
|
import ProxyAgent from "proxy-agent";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { getGifApiKey, parseGifResult } from "./trending";
|
import { getGifApiKey, parseGifResult } from "./trending";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -19,7 +19,7 @@
|
|||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import ProxyAgent from "proxy-agent";
|
import ProxyAgent from "proxy-agent";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { getGifApiKey, parseGifResult } from "./trending";
|
import { getGifApiKey, parseGifResult } from "./trending";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -19,8 +19,8 @@
|
|||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import ProxyAgent from "proxy-agent";
|
import ProxyAgent from "proxy-agent";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Config } from "@fosscord/util";
|
import { Config } from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -16,10 +16,10 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Guild, Config } from "@fosscord/util";
|
import { Guild, Config } from "@spacebar/util";
|
||||||
|
|
||||||
import { Router, Request, Response } from "express";
|
import { Router, Request, Response } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Like } from "typeorm";
|
import { Like } from "typeorm";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Router, Response, Request } from "express";
|
import { Router, Response, Request } from "express";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
//TODO: implement audit logs
|
//TODO: implement audit logs
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -27,9 +27,9 @@ import {
|
|||||||
Member,
|
Member,
|
||||||
BanRegistrySchema,
|
BanRegistrySchema,
|
||||||
BanModeratorSchema,
|
BanModeratorSchema,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { getIpAdress, route } from "@fosscord/api";
|
import { getIpAdress, route } from "@spacebar/api";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
Copyright (C) 2023 Fosscord and Fosscord Contributors
|
Copyright (C) 2023 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as published
|
it under the terms of the GNU Affero General Public License as published
|
||||||
@ -23,9 +23,9 @@ import {
|
|||||||
emitEvent,
|
emitEvent,
|
||||||
ChannelModifySchema,
|
ChannelModifySchema,
|
||||||
ChannelReorderSchema,
|
ChannelReorderSchema,
|
||||||
} from "@fosscord/util";
|
} from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { route } from "@fosscord/api";
|
import { route } from "@spacebar/api";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user