Skip to content

Commit

Permalink
Docker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Karasiq committed Sep 21, 2020
1 parent 2d66e10 commit 836aa70
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
10 changes: 6 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.typesafe.sbt.packager.docker.Cmd
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
import sbtcrossproject.CrossPlugin.autoImport.{CrossType, crossProject}

val commonSettings = Seq(
organization := "com.github.karasiq",
version := "1.2.5",
Expand Down Expand Up @@ -83,7 +83,10 @@ lazy val dockerSettings = Seq(
val injected = Seq(
Cmd("RUN", "apt update && apt install -y fuse libfuse2 libfuse-dev python3-pip && rm -rf /var/lib/apt/lists/*"), // TODO https://github.com/docker/for-mac/issues/3431
Cmd("RUN", "echo 'user_allow_other' >> /etc/fuse.conf"),
Cmd("RUN", "python3 -m pip install Telethon==1.14.0 cryptg==0.2.post1 Quart==0.12.0 Hypercorn==0.9.5 lz4==3.1.0 pytz>=2020.1")
Cmd(
"RUN",
"python3 -m pip install \"Telethon==1.14.0\" \"cryptg==0.2.post1\" \"Quart==0.12.0\" \"Hypercorn==0.9.5\" \"lz4==3.1.0\" \"pytz>=2020.1\""
)
)
cmds.takeWhile(!_.makeContent.startsWith("USER 1001:0")) ++ injected ++ cmds.dropWhile(!_.makeContent.startsWith("USER 1001:0"))
},
Expand Down Expand Up @@ -487,7 +490,6 @@ lazy val shadowcloud = (project in file("."))
//.enablePlugins(com.github.sbtliquibase.SbtLiquibase)
.aggregate(coreAssembly, `server-api-routes`)


lazy val `larray-bytestring` = project
.settings(
commonSettings,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.karasiq.shadowcloud.console

import akka.actor.ActorSystem

import com.karasiq.common.configs.ConfigImplicits._
import com.karasiq.shadowcloud.ShadowCloud
import com.karasiq.shadowcloud.drive.fuse.SCFuseHelper
import com.typesafe.config.impl.ConfigImpl

import scala.concurrent.Await
import scala.concurrent.duration._
import scala.util.Try
Expand Down Expand Up @@ -37,6 +37,5 @@ object SCConsoleMain extends App {
if (config.optional(_.getBoolean("shadowcloud.drive.fuse.auto-mount")).contains(true)) {
val eventualDone = SCFuseHelper.mount()
eventualDone.foreach(_ actorSystem.log.info("shadowcloud FUSE filesystem mount success"))
eventualDone.failed.foreach(_ => sys.exit(0))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ import org.scalajs.dom.raw.MessageEvent
import rx.Var
import scalaTags.all._

import scala.util.Try

object LogPanel {
def apply(): Tag = {
val lines = Var(Vector.empty[String])
val url = s"ws://${dom.window.location.host}/log"
val proto = if (dom.window.location.protocol == "https:") "wss" else "ws"
val url = s"$proto://${dom.window.location.host}/log"
var ws: WebSocket = null
initWebSocket()

def initWebSocket(): Unit = {
def initWebSocket(): Unit = Try {
ws = new WebSocket(url)
ws.onmessage = { (msg: MessageEvent) =>
ws.onmessage = { (msg: MessageEvent)
lines() = (msg.data.toString +: lines.now).take(200)
}
ws.onclose = { _ =>
dom.window.setTimeout(() => initWebSocket(), 5000)
ws.onclose = { _
dom.window.setTimeout(() initWebSocket(), 5000)
}
}

Expand Down

0 comments on commit 836aa70

Please sign in to comment.