remove PDF export. Could be done by an external service using lichess PGN export

pull/2389/head
Thibault Duplessis 2016-11-09 16:22:54 +01:00
parent 788eedc10f
commit 6b865130af
9 changed files with 0 additions and 47 deletions

3
.gitmodules vendored
View File

@ -4,9 +4,6 @@
[submodule "public/vendor/tagmanager"]
path = public/vendor/tagmanager
url = https://github.com/max-favilli/tagmanager
[submodule "submodules/pdfexporter"]
path = submodules/pdfexporter
url = https://github.com/ornicar/lichessPDFExporter
[submodule "ui/chessli"]
path = ui/chessli
url = https://github.com/ornicar/chess.js

View File

@ -43,25 +43,6 @@ object Export extends LilaController {
})
}
private val PdfRateLimitGlobal = new lila.memo.RateLimit(
credits = 20,
duration = 1 minute,
name = "export PDF global",
key = "export.pdf.global")
def pdf(id: String) = Open { implicit ctx =>
OnlyHumans {
PdfRateLimitGlobal("-", msg = HTTPRequest lastRemoteAddress ctx.req) {
lila.mon.export.pdf()
OptionResult(GameRepo game id) { game =>
Ok.chunked(Enumerator.outputStream(env.pdfExport(game.id))).withHeaders(
CONTENT_TYPE -> "application/pdf",
CACHE_CONTROL -> "max-age=7200")
}
}
}
}
private val PngRateLimitGlobal = new lila.memo.RateLimit(
credits = 60,
duration = 1 minute,

View File

@ -73,9 +73,6 @@ atom = atom.some) {
@if(game.isPgnImport) {
<a data-icon="x" class="text" rel="nofollow" href="@routes.Export.pgn(game.id)?as=imported">@trans.downloadImported()</a>
}
@if(false) {
<a data-icon="x" class="text" target="_blank" rel="nofollow" href="@cdnUrl(routes.Export.pdf(game.id).url)">@trans.printFriendlyPDF()</a>
}
@if(false && lila.game.Game.visualisableVariants(game.variant)) {
<a data-icon="=" class="text" target="_blank" href="@routes.Export.visualizer(game.id)">Generate images</a>
}

View File

@ -84,8 +84,6 @@ chessground = true) {
/
<a data-icon="x" rel="nofollow" href="@routes.Export.pgn(game.id)?as=imported"> @trans.downloadImported()</a>
}
/
<a data-icon="x" target="_blank" rel="nofollow" href="@cdnUrl(routes.Export.pdf(game.id).url)"> @trans.printFriendlyPDF()</a>
</p>
<div class="pgn">@Html(nl2br(escapeHtml(pgn)))</div>
</div>

View File

@ -386,7 +386,6 @@ game {
}
net.base_url = ${net.base_url}
uci_memo.ttl = 2 minutes
pdf.exec_path = "submodules/pdfexporter"
png {
url = "http://homer.lichess.org:8080/board.png"
size = 512

View File

@ -262,7 +262,6 @@ POST /team/:id/close controllers.Team.close(id: String)
POST /$gameId<\w{8}>/request-analysis controllers.Analyse.requestAnalysis(gameId: String)
GET /game/export/$gameId<\w{8}>.pgn controllers.Export.pgn(gameId: String)
GET /game/export/pdf/$gameId<\w{8}>.pdf controllers.Export.pdf(gameId: String)
GET /game/export/png/$gameId<\w{8}>.png controllers.Export.png(gameId: String)
GET /game/visualizer/$gameId<\w{8}> controllers.Export.visualizer(gameId: String)

View File

@ -29,7 +29,6 @@ final class Env(
val JsPathCompiled = config getString "js_path.compiled"
val UciMemoTtl = config duration "uci_memo.ttl"
val netBaseUrl = config getString "net.base_url"
val PdfExecPath = config getString "pdf.exec_path"
val PngUrl = config getString "png.url"
val PngSize = config getInt "png.size"
}
@ -39,8 +38,6 @@ final class Env(
lazy val playTime = new PlayTime(gameColl)
lazy val pdfExport = PdfExport(PdfExecPath) _
lazy val pngExport = new PngExport(PngUrl, PngSize)
lazy val divider = new Divider

View File

@ -1,14 +0,0 @@
package lila.game
import java.io.{ File, OutputStream }
import scala.sys.process._
object PdfExport {
private val logger = ProcessLogger(_ => (), _ => ())
def apply(execPath: String)(id: String)(out: OutputStream) {
val exec = Process(Seq("php", "main.php", id), new File(execPath))
exec #> out ! logger
}
}

@ -1 +0,0 @@
Subproject commit e8de1dddd5ba0371cd6310d22f9c80a7574ec161