Skip to content

Commit

Permalink
Added support for alternative update servers. (#6645)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 authored Sep 9, 2024
1 parent 5063147 commit 4891243
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default defineConfig({
{ text: 'Stats', link: '/stats.md' },
{text: 'Skins', link: '/skins.md' },
{text: 'Demo', link: '/demo.md' },
{text: 'CLI', link: '/cli.md'},
]
},
{
Expand Down
9 changes: 9 additions & 0 deletions settings.json.docker
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
8 changes: 8 additions & 0 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@
"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?
*/
Expand Down
1 change: 1 addition & 0 deletions src/node/utils/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ exports.ttl = {
RefreshToken: 1 * 24 * 60 * 60, // 1 day in seconds
}

exports.updateServer = "https://static.etherpad.org"


/*
Expand Down
2 changes: 1 addition & 1 deletion src/node/utils/UpdateCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const loadEtherpadInformations = () => {
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) => {
infos = await resp.data;
if (infos === undefined || infos === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/static/js/pluginfw/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const getAvailablePlugins = (maxCacheAge: number|false) => {
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>>) => {
availablePlugins = pluginsLoaded.data;
cacheTimestamp = nowTimestamp;
Expand Down

0 comments on commit 4891243

Please sign in to comment.