Added support for alternative update servers. (#6645)

This commit is contained in:
SamTV12345 2024-09-09 20:47:45 +02:00 committed by GitHub
parent 50631475f9
commit 4891243c27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 21 additions and 2 deletions

View file

@ -32,6 +32,7 @@ export default defineConfig({
{ text: 'Stats', link: '/stats.md' }, { text: 'Stats', link: '/stats.md' },
{text: 'Skins', link: '/skins.md' }, {text: 'Skins', link: '/skins.md' },
{text: 'Demo', link: '/demo.md' }, {text: 'Demo', link: '/demo.md' },
{text: 'CLI', link: '/cli.md'},
] ]
}, },
{ {

View file

@ -194,6 +194,15 @@
}, },
*/ */
/*
* Enables the use of a different server. We have a different one that syncs changes from the original server.
* It is hosted on GitHub and should not be blocked by many firewalls.
* https://etherpad.org/ep_infos
*/
"updateServer": "https://etherpad.org/ep_infos",
/* /*
* The type of the database. * The type of the database.
* *

View file

@ -271,6 +271,14 @@
"pageDown": true "pageDown": true
}, },
/*
* Enables the use of a different server. We have a different one that syncs changes from the original server.
* It is hosted on GitHub and should not be blocked by many firewalls.
* https://etherpad.org/ep_infos
*/
"updateServer": "https://etherpad.org/ep_infos",
/* /*
* Should we suppress errors from being visible in the default Pad Text? * Should we suppress errors from being visible in the default Pad Text?
*/ */

View file

@ -107,6 +107,7 @@ exports.ttl = {
RefreshToken: 1 * 24 * 60 * 60, // 1 day in seconds RefreshToken: 1 * 24 * 60 * 60, // 1 day in seconds
} }
exports.updateServer = "https://static.etherpad.org"
/* /*

View file

@ -20,7 +20,7 @@ const loadEtherpadInformations = () => {
return infos; return infos;
} }
return axios.get('https://static.etherpad.org/info.json', {headers: headers}) return axios.get(`${settings.updateServer}/info.json`, {headers: headers})
.then(async (resp: any) => { .then(async (resp: any) => {
infos = await resp.data; infos = await resp.data;
if (infos === undefined || infos === null) { if (infos === undefined || infos === null) {

View file

@ -171,7 +171,7 @@ export const getAvailablePlugins = (maxCacheAge: number|false) => {
return resolve(availablePlugins); return resolve(availablePlugins);
} }
await axios.get('https://static.etherpad.org/plugins.json', {headers}) await axios.get(`${settings.updateServer}/plugins.json`, {headers})
.then((pluginsLoaded:AxiosResponse<MapArrayType<PackageInfo>>) => { .then((pluginsLoaded:AxiosResponse<MapArrayType<PackageInfo>>) => {
availablePlugins = pluginsLoaded.data; availablePlugins = pluginsLoaded.data;
cacheTimestamp = nowTimestamp; cacheTimestamp = nowTimestamp;