Merge branch 'master' of github.com:fosscord/fosscord-server
This commit is contained in:
commit
e98cdfbce0
@ -44,7 +44,7 @@ const options: RouteOptions = {
|
|||||||
router.get("/", route(options), (req: Request, res: Response) => {
|
router.get("/", route(options), (req: Request, res: Response) => {
|
||||||
const { endpointPublic } = Config.get().gateway;
|
const { endpointPublic } = Config.get().gateway;
|
||||||
res.json({
|
res.json({
|
||||||
url: endpointPublic || process.env.GATEWAY || "ws://localhost:3002",
|
url: endpointPublic || process.env.GATEWAY || "ws://localhost:3001",
|
||||||
shards: 1,
|
shards: 1,
|
||||||
session_start_limit: {
|
session_start_limit: {
|
||||||
total: 1000,
|
total: 1000,
|
||||||
|
@ -37,7 +37,7 @@ const options: RouteOptions = {
|
|||||||
router.get("/", route(options), (req: Request, res: Response) => {
|
router.get("/", route(options), (req: Request, res: Response) => {
|
||||||
const { endpointPublic } = Config.get().gateway;
|
const { endpointPublic } = Config.get().gateway;
|
||||||
res.json({
|
res.json({
|
||||||
url: endpointPublic || process.env.GATEWAY || "ws://localhost:3002",
|
url: endpointPublic || process.env.GATEWAY || "ws://localhost:3001",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ router.get("/", route({}), async (req: Request, res: Response) => {
|
|||||||
gateway:
|
gateway:
|
||||||
gateway.endpointPublic ||
|
gateway.endpointPublic ||
|
||||||
process.env.GATEWAY ||
|
process.env.GATEWAY ||
|
||||||
"ws://localhost:3002",
|
"ws://localhost:3001",
|
||||||
defaultApiVersion: api.defaultVersion ?? 9,
|
defaultApiVersion: api.defaultVersion ?? 9,
|
||||||
apiEndpoint: api.endpointPublic ?? "/api",
|
apiEndpoint: api.endpointPublic ?? "/api",
|
||||||
};
|
};
|
||||||
|
@ -50,7 +50,7 @@ router.post(
|
|||||||
const path = `attachments/${channel_id}/${id}/${filename}`;
|
const path = `attachments/${channel_id}/${id}/${filename}`;
|
||||||
|
|
||||||
const endpoint =
|
const endpoint =
|
||||||
Config.get()?.cdn.endpointPublic || "http://localhost:3003";
|
Config.get()?.cdn.endpointPublic || "http://localhost:3001";
|
||||||
|
|
||||||
await storage.set(path, buffer);
|
await storage.set(path, buffer);
|
||||||
let width;
|
let width;
|
||||||
|
@ -63,7 +63,7 @@ router.post(
|
|||||||
|
|
||||||
const path = `avatars/${user_id}/${hash}`;
|
const path = `avatars/${user_id}/${hash}`;
|
||||||
const endpoint =
|
const endpoint =
|
||||||
Config.get().cdn.endpointPublic || "http://localhost:3003";
|
Config.get().cdn.endpointPublic || "http://localhost:3001";
|
||||||
|
|
||||||
await storage.set(path, buffer);
|
await storage.set(path, buffer);
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ router.post("/", multer.single("file"), async (req: Request, res: Response) => {
|
|||||||
if (ANIMATED_MIME_TYPES.includes(type.mime)) hash = `a_${hash}`; // animated icons have a_ infront of the hash
|
if (ANIMATED_MIME_TYPES.includes(type.mime)) hash = `a_${hash}`; // animated icons have a_ infront of the hash
|
||||||
|
|
||||||
const path = `guilds/${guild_id}/users/${user_id}/avatars/${hash}`;
|
const path = `guilds/${guild_id}/users/${user_id}/avatars/${hash}`;
|
||||||
const endpoint = Config.get().cdn.endpointPublic || "http://localhost:3003";
|
const endpoint = Config.get().cdn.endpointPublic || "http://localhost:3001";
|
||||||
|
|
||||||
await storage.set(path, buffer);
|
await storage.set(path, buffer);
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ router.post(
|
|||||||
|
|
||||||
const path = `role-icons/${role_id}/${hash}.png`;
|
const path = `role-icons/${role_id}/${hash}.png`;
|
||||||
const endpoint =
|
const endpoint =
|
||||||
Config.get().cdn.endpointPublic || "http://localhost:3003";
|
Config.get().cdn.endpointPublic || "http://localhost:3001";
|
||||||
|
|
||||||
await storage.set(path, buffer);
|
await storage.set(path, buffer);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ export async function uploadFile(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${Config.get().cdn.endpointPrivate || "http://localhost:3003"}${path}`,
|
`${Config.get().cdn.endpointPrivate || "http://localhost:3001"}${path}`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
signature: Config.get().security.requestSignature,
|
signature: Config.get().security.requestSignature,
|
||||||
@ -75,7 +75,7 @@ export async function handleFile(
|
|||||||
|
|
||||||
export async function deleteFile(path: string) {
|
export async function deleteFile(path: string) {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${Config.get().cdn.endpointPrivate || "http://localhost:3003"}${path}`,
|
`${Config.get().cdn.endpointPrivate || "http://localhost:3001"}${path}`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
signature: Config.get().security.requestSignature,
|
signature: Config.get().security.requestSignature,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user