Skip to content

Commit

Permalink
Prepare for release 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-exini committed May 5, 2015
2 parents 4970ba0 + 09be57c commit 76c5698
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 103 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
![](./docs/logo_white_framed.png "Slicebox") Slicebox
=====================================================

[![Build Status](https://travis-ci.org/KarlSjostrand/slicebox.svg?branch=develop)](https://travis-ci.org/KarlSjostrand/slicebox.svg?branch=develop) [![Join the chat at https://gitter.im/KarlSjostrand/slicebox](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/KarlSjostrand/slicebox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Service | Status | Description
------- | ------ | -----------
Travis | [![Build Status](https://travis-ci.org/KarlSjostrand/slicebox.svg?branch=master)](https://travis-ci.org/KarlSjostrand/slicebox.svg?branch=develop) | Tests
Bintray | [ ![Download](https://api.bintray.com/packages/karlsjostrand/slicebox/universal/images/download.svg) ](https://bintray.com/karlsjostrand/slicebox/universal/_latestVersion) | Latest Version on Bintray
Gitter | [![Join the chat at https://gitter.im/KarlSjostrand/slicebox](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/KarlSjostrand/slicebox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | Chatroom


Slicebox is a microservice for safe sharing and easy access to medical images. The goal of the project is to facilitate research and collaboration between hospitals and universities. The service makes it easy to send images from the hosptial's PACS (image archive) to collaborators on the outside. Anonymization is handled automatically, releaving the hospital staff of the burden of making sure patient information does not leave the hospital network.

Expand All @@ -21,9 +26,9 @@ Images can now be exported from PACS to the local slicebox instance easily. Expo
Installation
------------

* Download a zipped distribution of slicebox from the [dist/](./dist) folder.
* Download a zipped distribution of slicebox from [Bintray](https://bintray.com/karlsjostrand/slicebox/universal/_latestVersion).
* Unzip onto a suitable server computer. Any computer which is always on and which has a fixed (local or public) IP address will do.
* Configure the service by editing the [conf/slicebox.conf](./src/main/resources/slicebox.conf) and [conf/http.conf](./src/main/resources/http.conf). The former contains the administrator username and password while the latter specifies hostname and port of the service.
* Configure the service by editing [conf/slicebox.conf](./src/main/resources/application.conf). In particular, the administrator (superuser) username and password can be configured as well as the hostname and port of the service.
* The `bin` folder contains start scripts for Windows and Linux/Unix/Mac OS. Make sure the service is started on server startup.

Integration with Applications
Expand Down
14 changes: 5 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import de.heikoseeberger.sbtheader.license.Apache2_0

name := "slicebox"

version := "0.1"
version := "0.2"

organization := "se.nimsa"

Expand All @@ -19,14 +19,12 @@ import de.heikoseeberger.sbtheader.license.Apache2_0
packageDescription in Universal := "Slicebox is a service for sharing medical image data with collaborators while protecting patient information"

mappings in Universal <+= (packageBin in Compile, sourceDirectory ) map { (_, src) =>
val sliceboxConf = src / "main" / "resources" / "slicebox.conf"
sliceboxConf -> "conf/slicebox.conf"
val httpConf = src / "main" / "resources" / "application.conf"
httpConf -> "conf/slicebox.conf"
}

mappings in Universal <+= (packageBin in Compile, sourceDirectory ) map { (_, src) =>
val httpConf = src / "main" / "resources" / "http.conf"
httpConf -> "conf/http.conf"
}
bashScriptExtraDefines += """addJava "-Dconfig.file=${app_home}/../conf/slicebox.conf" """
batScriptExtraDefines += """set _JAVA_OPTS=%_JAVA_OPTS% -Dconfig.file=%SLICEBOX_HOME%\\conf\\slicebox.conf"""

val licenceYear = "2015"
val licencedTo = "Karl Sjöstrand"
Expand Down Expand Up @@ -76,8 +74,6 @@ import de.heikoseeberger.sbtheader.license.Apache2_0

lazy val slicebox = (project in file(".")).enablePlugins(SbtWeb, JavaServerAppPackaging, GitBranchPrompt)

GitPlugin.autoImport.git.baseVersion := "1.0.0"

updateOptions := updateOptions.value.withCachedResolution(true)

WebKeys.packagePrefix in Assets := "public/"
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0")

addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0-RC1")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0")

addSbtPlugin("de.heikoseeberger" % "sbt-header" % "1.5.0")

Expand Down
Binary file removed src/main/public/images/Thumbs.db
Binary file not shown.
Binary file removed src/main/public/images/favicons/Thumbs.db
Binary file not shown.
2 changes: 0 additions & 2 deletions src/main/resources/.gitignore

This file was deleted.

44 changes: 0 additions & 44 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

akka {
loglevel = DEBUG
stdout-loglevel = INFO
Expand Down Expand Up @@ -103,24 +64,19 @@ spray {
}

http {

host = "localhost"
port = 5000

include "http.conf"

host = ${?HOST}
port = ${?PORT}
}

slicebox {

storage = "storage"

superuser {
user = "admin"
password = "admin"
}

include "slicebox.conf"
}
16 changes: 0 additions & 16 deletions src/main/resources/http.conf

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<logger name="org.dcm4che3" level="ERROR" />
<logger name="se.nimsa.sbx" level="WARN" />

<root level="WARN">
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
20 changes: 0 additions & 20 deletions src/main/resources/slicebox.conf

This file was deleted.

10 changes: 5 additions & 5 deletions src/main/scala/se/nimsa/sbx/app/UserServiceActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ class UserServiceActor(dbProps: DbProps, superUser: String, superPassword: Strin

def addSuperUser() =
db.withSession { implicit session =>
dao.userByName(superUser)
.getOrElse {
dao.listUsers.filter(_.role == UserRole.SUPERUSER).foreach(superUser => dao.removeUser(superUser.id))
dao.insert(ApiUser(-1, superUser, UserRole.SUPERUSER).withPassword(superPassword))
}
val superUsers = dao.listUsers.filter(_.role == UserRole.SUPERUSER)
if (superUsers.isEmpty || superUsers(0).user != superUser || !superUsers(0).passwordMatches(superPassword)) {
superUsers.foreach(superUser => dao.removeUser(superUser.id))
dao.insert(ApiUser(-1, superUser, UserRole.SUPERUSER).withPassword(superPassword))
}
}

def generateNewTokens(user: ApiUser, numberOfTokens: Int): List[AuthToken] = {
Expand Down
6 changes: 4 additions & 2 deletions src/main/scala/se/nimsa/sbx/box/BoxServiceActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ class BoxServiceActor(dbProps: DbProps, storage: Path, apiBaseURL: String) exten
boxDao.updateInbox(remoteBoxId, transactionId, sequenceNumber, totalImageCount)
}

if (sequenceNumber == totalImageCount)
SbxLog.info("Box", s"Receiving ${totalImageCount} images from box ${boxById(remoteBoxId)} completed.")
if (sequenceNumber == totalImageCount) {
val boxName = boxById(remoteBoxId).map(_.name).getOrElse(remoteBoxId.toString)
SbxLog.info("Box", s"Receiving ${totalImageCount} images from box $boxName completed.")
}
}

def updatePollBoxesOnlineStatus(): Unit = {
Expand Down

0 comments on commit 76c5698

Please sign in to comment.