feat(route): Start on support for generic discourse forums. (#13063)

* Start on support for generic discourse forums.

* Add doc.

* Update doc.

* Add exception.

* Update doc.

* Update bbs.md

* test: add discourse config

* docs: fix typo

* fix: guard condition

---------
This commit is contained in:
Andvari
2023-08-23 21:19:45 +08:00
committed by GitHub
parent 8e4f814ea6
commit 657c67ec37
8 changed files with 74 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ const calculateValue = () => {
const email_config = {};
const discuz_cookies = {};
const medium_cookies = {};
const discourse_config = {};
for (const name in envs) {
if (name.startsWith('BILIBILI_COOKIE_')) {
@@ -27,6 +28,9 @@ const calculateValue = () => {
} else if (name.startsWith('MEDIUM_COOKIE_')) {
const username = name.slice(14).toLowerCase();
medium_cookies[username] = envs[name];
} else if (name.startsWith('DISCOURSE_CONFIG_')) {
const id = name.slice('DISCOURSE_CONFIG_'.length);
discourse_config[id] = JSON.parse(envs[name]);
}
}
@@ -136,6 +140,9 @@ const calculateValue = () => {
discord: {
authorization: envs.DISCORD_AUTHORIZATION,
},
discourse: {
config: discourse_config,
},
discuz: {
cookies: discuz_cookies,
},