mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-06 10:52:31 +01:00
Add instance route
This commit is contained in:
parent
ecb1f0f748
commit
39aebb2cfc
@ -11,6 +11,7 @@ export const NO_AUTHORIZATION_ROUTES = [
|
||||
"/experiments",
|
||||
"/-/readyz",
|
||||
"/-/healthz",
|
||||
"/policies/instance/",
|
||||
/\/guilds\/\d+\/widget\.(json|png)/
|
||||
];
|
||||
|
||||
|
16
api/src/routes/policies/instance/domains.ts
Normal file
16
api/src/routes/policies/instance/domains.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
import { Config } from "@fosscord/util";
|
||||
import { config } from "dotenv"
|
||||
const router = Router();
|
||||
const { cdn } = Config.get();
|
||||
|
||||
const IdentityForm = {
|
||||
cdn: cdn.endpointPublic || process.env.CDN || "http://localhost:3001",
|
||||
}
|
||||
|
||||
router.get("/",route({}), async (req: Request, res: Response) => {
|
||||
res.json(IdentityForm)
|
||||
});
|
||||
|
||||
export default router;
|
11
api/src/routes/policies/instance/limits.ts
Normal file
11
api/src/routes/policies/instance/limits.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
import { Config } from "@fosscord/util";
|
||||
const router = Router();
|
||||
const { limits } = Config.get();
|
||||
|
||||
router.get("/",route({}), async (req: Request, res: Response) => {
|
||||
res.json(limits)
|
||||
});
|
||||
|
||||
export default router;
|
12
api/src/routes/policies/instance/meta.ts
Normal file
12
api/src/routes/policies/instance/meta.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
import { Config } from "@fosscord/util";
|
||||
|
||||
const router = Router();
|
||||
const { general } = Config.get();
|
||||
|
||||
router.get("/",route({}), async (req: Request, res: Response) => {
|
||||
res.json(general)
|
||||
});
|
||||
|
||||
export default router;
|
@ -49,6 +49,9 @@ export interface ConfigValue {
|
||||
endpointPrivate: string | null;
|
||||
};
|
||||
general: {
|
||||
instanceName: string;
|
||||
instanceDescription: string | null;
|
||||
frontPage: string | null;
|
||||
instanceId: string;
|
||||
};
|
||||
limits: {
|
||||
@ -180,7 +183,10 @@ export const DefaultConfigOptions: ConfigValue = {
|
||||
endpointPublic: null,
|
||||
},
|
||||
general: {
|
||||
instanceName: "Fosscord Instance",
|
||||
instanceDescription: "This is a Fosscord instance made in pre-relase days",
|
||||
instanceId: Snowflake.generate(),
|
||||
frontPage: null
|
||||
},
|
||||
limits: {
|
||||
user: {
|
||||
|
Loading…
Reference in New Issue
Block a user