Skip to content

Commit

Permalink
Fix #223
Browse files Browse the repository at this point in the history
Signed-off-by: Walker Crouse <walkercrouse@hotmail.com>
  • Loading branch information
windy1 committed Feb 15, 2017
1 parent 7c3b1c1 commit a9ddb9f
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 11 deletions.
12 changes: 9 additions & 3 deletions app/db/impl/access/ProjectBase.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package db.impl.access

import java.nio.file.Files
import java.nio.file.{Files, NoSuchFileException}
import java.nio.file.Files._

import com.google.common.base.Preconditions._
Expand All @@ -11,6 +11,7 @@ import models.project.{Channel, Project, Version}
import ore.project.io.ProjectFiles
import ore.{OreConfig, OreEnv}
import org.apache.commons.io.FileUtils
import play.api.Logger
import util.StringUtils._

class ProjectBase(override val service: ModelService,
Expand Down Expand Up @@ -150,8 +151,13 @@ class ProjectBase(override val service: ModelService,
this.deleteChannel(channel)

val projectDir = this.fileManager.getProjectDir(proj.ownerName, project.name)
Files.delete(projectDir.resolve(version.fileName))
Files.delete(projectDir.resolve(version.signatureFileName))
try {
Files.delete(projectDir.resolve(version.fileName))
Files.delete(projectDir.resolve(version.signatureFileName))
} catch {
case _: NoSuchFileException =>
Logger.warn("a version was deleted but it's files were missing, did deletion fail before?")
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/db/impl/schema.scala
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class SessionTable(tag: Tag) extends ModelTable[DbSession](tag, "user_sessions")

}

class SignOnTable(tag: Tag) extends ModelTable[SignOn](tag, "sign_ons") {
class SignOnTable(tag: Tag) extends ModelTable[SignOn](tag, "user_sign_ons") {

def nonce = column[String]("nonce")
def isCompleted = column[Boolean]("is_completed")
Expand Down
5 changes: 4 additions & 1 deletion app/views/bootstrap/layout.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@
<script type="text/javascript" src="@routes.Assets.at("bootstrap/js/bootstrap.min.js")"></script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/filesize.min.js")"></script>
<script type="text/javascript" src="@routes.Assets.at("highlight/highlight.pack.js")"></script>
<script>var caching = @config.ore.getBoolean("caching").get;</script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/main.js")"></script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/svg.js")"></script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/spongie.js")"></script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/offline.js")"></script>
@if(config.ore.getBoolean("caching").get) {
<script type="text/javascript" src="@routes.Assets.at("javascripts/offline.js")"></script>
}
@if(request != null) {
<script>csrf = '@play.filters.csrf.CSRF.getToken.get.value'</script>
}
Expand Down
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "ore"

version := "1.2.2"
version := "1.2.3"

lazy val `ore` = (project in file(".")).enablePlugins(PlayScala)

Expand All @@ -22,8 +22,8 @@ resolvers ++= Seq(
libraryDependencies ++= Seq(
"org.spongepowered" % "play-discourse" % "1.0.0-SNAPSHOT",
"org.spongepowered" % "plugin-meta" % "0.2",
"com.typesafe.play" %% "play-slick" % "2.0.0",
"com.typesafe.play" %% "play-slick-evolutions" % "2.0.0",
"com.typesafe.play" %% "play-slick" % "2.0.2",
"com.typesafe.play" %% "play-slick-evolutions" % "2.0.2",
"org.postgresql" % "postgresql" % "9.4.1212.jre7",
"com.github.tminglei" %% "slick-pg" % "0.12.0",
"org.apache.commons" % "commons-io" % "1.3.2",
Expand All @@ -32,5 +32,5 @@ libraryDependencies ++= Seq(
"org.bouncycastle" % "bcprov-jdk15on" % "1.56",
"org.bouncycastle" % "bcpkix-jdk15on" % "1.56",
"org.bouncycastle" % "bcpg-jdk15on" % "1.56",
"javax.mail" % "mail" % "1.4.7"
"javax.mail" % "mail" % "1.4.7"
)
1 change: 1 addition & 0 deletions conf/application.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ security {
requirePgp = true
keyChangeCooldown = 259200000
unsafeDownload.maxAge = 600000 # 10 minutes
caching = true

api {
url = "http://localhost:8000"
Expand Down
7 changes: 7 additions & 0 deletions conf/evolutions/default/69.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# --- !Ups

alter table project_version_download_warnings drop constraint project_version_download_warnings_version_id_fkey;
alter table project_version_download_warnings
add foreign key (version_id) references project_versions on delete cascade;

# --- !Downs
1 change: 1 addition & 0 deletions conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@
<logger name="UserSync" level="INFO" />
<logger name="Organizations" level="INFO" />
<logger name="SSO" level="INFO" />
<!--<logger name="slick" level="DEBUG" />-->

</configuration>
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ logLevel := Level.Warn

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.9")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.12")

addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.4.2")
2 changes: 1 addition & 1 deletion public/javascripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ $(function() {
* ==================================================
*/

if ('serviceWorker' in navigator) {
if ('serviceWorker' in navigator && caching) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js', {scope: '/'});
});
Expand Down

0 comments on commit a9ddb9f

Please sign in to comment.