explorers use the same endpoint

pull/10033/head
Thibault Duplessis 2021-10-26 08:59:45 +02:00
parent 72563d8113
commit 98e8b6bacd
8 changed files with 5 additions and 11 deletions

View File

@ -94,7 +94,6 @@ final class Env(
) {
val explorerEndpoint = config.get[String]("explorer.endpoint")
val explorer3Endpoint = config.get[String]("explorer.endpoint3")
val tablebaseEndpoint = config.get[String]("explorer.tablebase.endpoint")
val appVersionDate = config.getOptional[String]("app.version.date")

View File

@ -84,8 +84,7 @@ trait AssetHelper { self: I18nHelper with SecurityHelper =>
}
ContentSecurityPolicy(
defaultSrc = List("'self'", assets),
connectSrc =
"'self'" :: assets :: sockets ::: env.explorerEndpoint :: env.tablebaseEndpoint :: env.explorer3Endpoint :: Nil,
connectSrc = "'self'" :: assets :: sockets ::: env.explorerEndpoint :: env.tablebaseEndpoint :: Nil,
styleSrc = List("'self'", "'unsafe-inline'", assets),
frameSrc = List("'self'", assets, "https://www.youtube.com", "https://player.twitch.tv"),
workerSrc = List("'self'", assets),

View File

@ -40,7 +40,6 @@ object Environment
def apiVersion = lila.api.Mobile.Api.currentVersion
def explorerEndpoint = env.explorerEndpoint
def explorer3Endpoint = env.explorer3Endpoint
def tablebaseEndpoint = env.tablebaseEndpoint
def isChatPanicEnabled = env.chat.panic.enabled

View File

@ -44,7 +44,6 @@ object bits {
def explorerConfig(implicit ctx: Context) = Json.obj(
"endpoint" -> explorerEndpoint,
"endpoint3" -> explorer3Endpoint,
"tablebaseEndpoint" -> tablebaseEndpoint,
"showRatings" -> ctx.pref.showRatings
)

View File

@ -324,7 +324,6 @@ streamer {
}
explorer {
endpoint = "https://explorer.lichess.ovh"
endpoint3 = "https://explorer.lichess.ovh"
internal_endpoint = "http://explorer.lichess.ovh"
tablebase = {
endpoint = "https://tablebase.lichess.ovh"

View File

@ -77,7 +77,6 @@ export default class ExplorerCtrl {
private baseXhrOpening = () => ({
endpoint: this.opts.endpoint,
endpoint3: this.opts.endpoint3,
config: this.config.data,
});

View File

@ -6,7 +6,6 @@ import { sync } from 'common/sync';
interface OpeningXhrOpts {
endpoint: string;
endpoint3: string;
db: ExplorerDb;
rootFen: Fen;
play: string[];
@ -21,8 +20,10 @@ export async function opening(
processData: (data: ExplorerData) => void
): Promise<CancellableStream> {
const conf = opts.config;
const endpoint = opts.db == 'player' ? opts.endpoint3 : opts.endpoint;
const url = new URL(opts.db === 'lichess' ? '/lichess' : opts.db == 'player' ? '/personal' : '/master', endpoint);
const url = new URL(
opts.db === 'lichess' ? '/lichess' : opts.db == 'player' ? '/personal' : '/master',
opts.endpoint
);
const params = url.searchParams;
params.set('fen', opts.rootFen);
params.set('play', opts.play.join(','));

View File

@ -14,7 +14,6 @@ export interface PlayerOpts {
export interface ExplorerOpts {
endpoint: string;
endpoint3: string;
tablebaseEndpoint: string;
showRatings: boolean;
}