diff --git a/lbrynet/lbrynet_daemon/LBRYDaemon.py b/lbrynet/lbrynet_daemon/LBRYDaemon.py
index 922f3be27..84ca4478b 100644
--- a/lbrynet/lbrynet_daemon/LBRYDaemon.py
+++ b/lbrynet/lbrynet_daemon/LBRYDaemon.py
@@ -1120,6 +1120,10 @@ class LBRYDaemonCommandHandler(object):
class LBRYindex(resource.Resource):
+ def __init__(self, ui_dir):
+ resource.Resource.__init__(self)
+ self.ui_dir = ui_dir
+
isLeaf = False
def _delayed_render(self, request, results):
@@ -1136,7 +1140,7 @@ class LBRYindex(resource.Resource):
log.info(r)
return "
" + ''.join(r) + ""
- return static.File("./dist/index.html").render_GET(request)
+ return static.File(os.path.join(self.ui_dir, "index.html")).render_GET(request)
class LBRYFileRender(resource.Resource):
@@ -1202,4 +1206,4 @@ class LBRYDaemonWeb(resource.Resource):
d.addCallbacks(lambda results: self._delayed_render(request, results),
lambda err: self._delayed_render(request, json.dumps({'message': err.getTraceback(), 'code': BAD_REQUEST})))
- return server.NOT_DONE_YET
+ return server.NOT_DONE_YET
\ No newline at end of file
diff --git a/lbrynet/lbrynet_daemon/LBRYDaemonControl.py b/lbrynet/lbrynet_daemon/LBRYDaemonControl.py
index 89b678f68..ce6540d0c 100644
--- a/lbrynet/lbrynet_daemon/LBRYDaemonControl.py
+++ b/lbrynet/lbrynet_daemon/LBRYDaemonControl.py
@@ -1,5 +1,12 @@
import argparse
import logging
+import tempfile
+import os
+import shutil
+
+from StringIO import StringIO
+from zipfile import ZipFile
+from urllib import urlopen
from twisted.web import server, static
from twisted.internet import reactor, defer
@@ -38,18 +45,26 @@ def start():
log.info("Starting lbrynet-daemon from command line")
+ tmpdir = tempfile.mkdtemp()
+ url = urlopen("https://rawgit.com/lbryio/lbry-web-ui/master/dist.zip")
+ z = ZipFile(StringIO(url.read()))
+ z.extractall(tmpdir)
+
+
args = parser.parse_args()
daemon = LBRYDaemon()
daemon.setup(args.wallet, args.update)
- root = LBRYindex()
- root.putChild("css", static.File("./css"))
- root.putChild("font", static.File("./font"))
- root.putChild("img", static.File("./img"))
- root.putChild("js", static.File("./js"))
+ root = LBRYindex(tmpdir)
+ root.putChild("css", static.File(os.path.join(tmpdir, "css")))
+ root.putChild("font", static.File(os.path.join(tmpdir, "font")))
+ root.putChild("img", static.File(os.path.join(tmpdir, "img")))
+ root.putChild("js", static.File(os.path.join(tmpdir, "js")))
root.putChild(API_ADDRESS, daemon)
root.putChild("webapi", LBRYDaemonWeb())
root.putChild("view", LBRYFileRender())
reactor.listenTCP(API_PORT, server.Site(root), interface=API_INTERFACE)
reactor.run()
+
+ shutil.rmtree(tmpdir)
\ No newline at end of file