2022-05-02 15:12:46 +00:00
|
|
|
|
export const config = {
|
2022-05-04 13:04:44 +00:00
|
|
|
|
database: { // MONGODB IS THE BEST DATABASE
|
2022-05-29 18:12:54 +00:00
|
|
|
|
url: '您的mongodb链接',
|
2022-05-02 15:12:46 +00:00
|
|
|
|
},
|
|
|
|
|
server: {
|
2022-07-04 17:35:51 +00:00
|
|
|
|
port: 30,
|
2022-05-29 18:12:54 +00:00
|
|
|
|
skinDomain: [ "assets.lama.icu", 'textures.minecraft.net' ],
|
2022-05-11 02:26:07 +00:00
|
|
|
|
serverName: "老色批世界树",
|
|
|
|
|
advanced: { // 详情可见 -> https://github.com/yushijinhun/authlib-injector/wiki/Yggdrasil-%E6%9C%8D%E5%8A%A1%E7%AB%AF%E6%8A%80%E6%9C%AF%E8%A7%84%E8%8C%83#meta-%E4%B8%AD%E7%9A%84%E5%85%83%E6%95%B0%E6%8D%AE
|
|
|
|
|
links: {
|
|
|
|
|
homepage: "",
|
|
|
|
|
register: ""
|
|
|
|
|
},
|
|
|
|
|
"feature.non_email_login": false,
|
2022-05-29 18:12:54 +00:00
|
|
|
|
"feature.legojang_namespace": false,
|
2022-05-11 02:26:07 +00:00
|
|
|
|
"feature.enable_mojang_anti_features": false,
|
|
|
|
|
"feature.enable_profile_key": false
|
|
|
|
|
}
|
2022-05-02 15:12:46 +00:00
|
|
|
|
},
|
2022-05-29 18:12:54 +00:00
|
|
|
|
storage: {
|
|
|
|
|
endpoint: "",
|
|
|
|
|
bucket: "",
|
|
|
|
|
key: "",
|
2022-07-02 12:35:20 +00:00
|
|
|
|
secret: "",
|
|
|
|
|
extra: { // these configs will pass to s3client directly
|
|
|
|
|
region: 'us-ashburn-02',
|
|
|
|
|
forcePathStyle: true,
|
|
|
|
|
signatureVersion: 'v4',
|
|
|
|
|
}
|
2022-05-29 18:12:54 +00:00
|
|
|
|
|
|
|
|
|
},
|
2022-05-04 13:04:44 +00:00
|
|
|
|
signing: { // 签名材质信息使用
|
2022-05-11 02:26:07 +00:00
|
|
|
|
public: 'public.pem',
|
|
|
|
|
private: 'private.key'
|
2022-05-03 10:57:20 +00:00
|
|
|
|
},
|
|
|
|
|
custom: {
|
2022-05-14 05:52:32 +00:00
|
|
|
|
override: { // 使用这个来覆写一个路径的处理器,使用function而不是箭头函数可以用this访问fastify server
|
2022-05-04 13:04:44 +00:00
|
|
|
|
preHandler: {
|
|
|
|
|
/*
|
|
|
|
|
"/example/route": async function(req, rep) {}
|
|
|
|
|
*/
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handler: {
|
|
|
|
|
/*
|
|
|
|
|
"/example/route": async function(req, rep) {}
|
|
|
|
|
*/
|
|
|
|
|
}
|
2022-05-03 10:57:20 +00:00
|
|
|
|
},
|
2022-05-04 13:04:44 +00:00
|
|
|
|
preHooks: (fastify) => {}, // 在这里添加自定义hook
|
|
|
|
|
preRouting: (fastify) => {}, // 在这里添加自定义路由
|
2022-05-14 05:52:32 +00:00
|
|
|
|
postRouting: (fastify) => {}, // 我也不知道你在这里写了有啥用...
|
2022-05-14 16:29:52 +00:00
|
|
|
|
},
|
|
|
|
|
telegram: {
|
2022-05-29 18:12:54 +00:00
|
|
|
|
disable: undefined, // 设置为任意非null、undefined、false、0、""等值(可以设置为true就禁用了),则禁用telegram功能
|
|
|
|
|
token: '你的telegrambot的apitoken',
|
2022-05-02 15:12:46 +00:00
|
|
|
|
}
|
2022-05-03 10:57:20 +00:00
|
|
|
|
}
|
2022-05-04 13:04:44 +00:00
|
|
|
|
|
|
|
|
|
export function getOverrideHandler(route) {
|
|
|
|
|
return config.custom.override.handler[route]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getOverridePreHandler(route) {
|
|
|
|
|
return config.custom.override.preHandler[route]
|
|
|
|
|
}
|