Add instance route
This commit is contained in:
parent
7d7a533984
commit
54ebf97e78
@ -11,6 +11,7 @@ export const NO_AUTHORIZATION_ROUTES = [
|
|||||||
"/experiments",
|
"/experiments",
|
||||||
"/-/readyz",
|
"/-/readyz",
|
||||||
"/-/healthz",
|
"/-/healthz",
|
||||||
|
"/policies/instance/",
|
||||||
/\/guilds\/\d+\/widget\.(json|png)/
|
/\/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;
|
endpointPrivate: string | null;
|
||||||
};
|
};
|
||||||
general: {
|
general: {
|
||||||
|
instanceName: string;
|
||||||
|
instanceDescription: string | null;
|
||||||
|
frontPage: string | null;
|
||||||
instanceId: string;
|
instanceId: string;
|
||||||
};
|
};
|
||||||
limits: {
|
limits: {
|
||||||
@ -180,7 +183,10 @@ export const DefaultConfigOptions: ConfigValue = {
|
|||||||
endpointPublic: null,
|
endpointPublic: null,
|
||||||
},
|
},
|
||||||
general: {
|
general: {
|
||||||
|
instanceName: "Fosscord Instance",
|
||||||
|
instanceDescription: "This is a Fosscord instance made in pre-relase days",
|
||||||
instanceId: Snowflake.generate(),
|
instanceId: Snowflake.generate(),
|
||||||
|
frontPage: null
|
||||||
},
|
},
|
||||||
limits: {
|
limits: {
|
||||||
user: {
|
user: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user