Skip to content

Commit

Permalink
explorers use the same endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Oct 26, 2021
1 parent 72563d8 commit 98e8b6b
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion app/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 1 addition & 2 deletions app/templating/AssetHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 0 additions & 1 deletion app/templating/Environment.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion app/views/board/bits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ object bits {

def explorerConfig(implicit ctx: Context) = Json.obj(
"endpoint" -> explorerEndpoint,
"endpoint3" -> explorer3Endpoint,
"tablebaseEndpoint" -> tablebaseEndpoint,
"showRatings" -> ctx.pref.showRatings
)
Expand Down
1 change: 0 additions & 1 deletion conf/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ streamer {
}
explorer {
endpoint = "https://explorer.lichess.ovh"
endpoint3 = "https://explorer.lichess.ovh"
internal_endpoint = "https://explorer.lichess.ovh"
tablebase = {
endpoint = "https://tablebase.lichess.ovh"
Expand Down
1 change: 0 additions & 1 deletion ui/analyse/src/explorer/explorerCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export default class ExplorerCtrl {

private baseXhrOpening = () => ({
endpoint: this.opts.endpoint,
endpoint3: this.opts.endpoint3,
config: this.config.data,
});

Expand Down
7 changes: 4 additions & 3 deletions ui/analyse/src/explorer/explorerXhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { sync } from 'common/sync';

interface OpeningXhrOpts {
endpoint: string;
endpoint3: string;
db: ExplorerDb;
rootFen: Fen;
play: string[];
Expand All @@ -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(','));
Expand Down
1 change: 0 additions & 1 deletion ui/analyse/src/explorer/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export interface PlayerOpts {

export interface ExplorerOpts {
endpoint: string;
endpoint3: string;
tablebaseEndpoint: string;
showRatings: boolean;
}
Expand Down

0 comments on commit 98e8b6b

Please sign in to comment.