remove PDF export. Could be done by an external service using lichess PGN export
parent
788eedc10f
commit
6b865130af
|
@ -4,9 +4,6 @@
|
||||||
[submodule "public/vendor/tagmanager"]
|
[submodule "public/vendor/tagmanager"]
|
||||||
path = public/vendor/tagmanager
|
path = public/vendor/tagmanager
|
||||||
url = https://github.com/max-favilli/tagmanager
|
url = https://github.com/max-favilli/tagmanager
|
||||||
[submodule "submodules/pdfexporter"]
|
|
||||||
path = submodules/pdfexporter
|
|
||||||
url = https://github.com/ornicar/lichessPDFExporter
|
|
||||||
[submodule "ui/chessli"]
|
[submodule "ui/chessli"]
|
||||||
path = ui/chessli
|
path = ui/chessli
|
||||||
url = https://github.com/ornicar/chess.js
|
url = https://github.com/ornicar/chess.js
|
||||||
|
|
|
@ -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(
|
private val PngRateLimitGlobal = new lila.memo.RateLimit(
|
||||||
credits = 60,
|
credits = 60,
|
||||||
duration = 1 minute,
|
duration = 1 minute,
|
||||||
|
|
|
@ -73,9 +73,6 @@ atom = atom.some) {
|
||||||
@if(game.isPgnImport) {
|
@if(game.isPgnImport) {
|
||||||
<a data-icon="x" class="text" rel="nofollow" href="@routes.Export.pgn(game.id)?as=imported">@trans.downloadImported()</a>
|
<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)) {
|
@if(false && lila.game.Game.visualisableVariants(game.variant)) {
|
||||||
<a data-icon="=" class="text" target="_blank" href="@routes.Export.visualizer(game.id)">Generate images</a>
|
<a data-icon="=" class="text" target="_blank" href="@routes.Export.visualizer(game.id)">Generate images</a>
|
||||||
}
|
}
|
||||||
|
|
|
@ -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" 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>
|
</p>
|
||||||
<div class="pgn">@Html(nl2br(escapeHtml(pgn)))</div>
|
<div class="pgn">@Html(nl2br(escapeHtml(pgn)))</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -386,7 +386,6 @@ game {
|
||||||
}
|
}
|
||||||
net.base_url = ${net.base_url}
|
net.base_url = ${net.base_url}
|
||||||
uci_memo.ttl = 2 minutes
|
uci_memo.ttl = 2 minutes
|
||||||
pdf.exec_path = "submodules/pdfexporter"
|
|
||||||
png {
|
png {
|
||||||
url = "http://homer.lichess.org:8080/board.png"
|
url = "http://homer.lichess.org:8080/board.png"
|
||||||
size = 512
|
size = 512
|
||||||
|
|
|
@ -262,7 +262,6 @@ POST /team/:id/close controllers.Team.close(id: String)
|
||||||
POST /$gameId<\w{8}>/request-analysis controllers.Analyse.requestAnalysis(gameId: 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/$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/export/png/$gameId<\w{8}>.png controllers.Export.png(gameId: String)
|
||||||
GET /game/visualizer/$gameId<\w{8}> controllers.Export.visualizer(gameId: String)
|
GET /game/visualizer/$gameId<\w{8}> controllers.Export.visualizer(gameId: String)
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@ final class Env(
|
||||||
val JsPathCompiled = config getString "js_path.compiled"
|
val JsPathCompiled = config getString "js_path.compiled"
|
||||||
val UciMemoTtl = config duration "uci_memo.ttl"
|
val UciMemoTtl = config duration "uci_memo.ttl"
|
||||||
val netBaseUrl = config getString "net.base_url"
|
val netBaseUrl = config getString "net.base_url"
|
||||||
val PdfExecPath = config getString "pdf.exec_path"
|
|
||||||
val PngUrl = config getString "png.url"
|
val PngUrl = config getString "png.url"
|
||||||
val PngSize = config getInt "png.size"
|
val PngSize = config getInt "png.size"
|
||||||
}
|
}
|
||||||
|
@ -39,8 +38,6 @@ final class Env(
|
||||||
|
|
||||||
lazy val playTime = new PlayTime(gameColl)
|
lazy val playTime = new PlayTime(gameColl)
|
||||||
|
|
||||||
lazy val pdfExport = PdfExport(PdfExecPath) _
|
|
||||||
|
|
||||||
lazy val pngExport = new PngExport(PngUrl, PngSize)
|
lazy val pngExport = new PngExport(PngUrl, PngSize)
|
||||||
|
|
||||||
lazy val divider = new Divider
|
lazy val divider = new Divider
|
||||||
|
|
|
@ -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
|
|
Loading…
Reference in New Issue