Skip to content

Commit

Permalink
Merge pull request #1068 from SpongePowered/staging
Browse files Browse the repository at this point in the history
2.0.0-M2.9
  • Loading branch information
Katrix authored Sep 14, 2022
2 parents 9b4eeae + 9e3ec06 commit 7a610a9
Show file tree
Hide file tree
Showing 9 changed files with 807 additions and 593 deletions.
6 changes: 3 additions & 3 deletions ore/conf/ore-default-settings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ sponge {
# Sponsors from high to low donation amounts
sponsors = [
{
"name": "MC Server Hosting",
"image": "images/sponsors/mcserverhosting.png",
"link": "https://mcserverhosting.net/?ref=sponge"
"name": "Apex Hosting",
"image": "images/sponsors/apexhosting.png",
"link": "https://apexminecrafthosting.com/"
},
{
"name": "CreeperHost",
Expand Down
Binary file added ore/public/images/sponsors/apexhosting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed ore/public/images/sponsors/mcserverhosting.png
Binary file not shown.
1,323 changes: 758 additions & 565 deletions oreClient/yarn.lock

Large diffs are not rendered by default.

29 changes: 26 additions & 3 deletions orePlayCommon/app/db/impl/access/OrganizationBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package db.impl.access

import scala.language.higherKinds

import scala.concurrent.duration._

import ore.OreConfig
import ore.auth.SpongeAuthApi
import ore.auth.{AuthUser, SpongeAuthApi}
import ore.data.user.notification.NotificationType
import ore.db.access.ModelView
import ore.db.impl.OrePostgresDriver.api._
Expand All @@ -18,11 +20,12 @@ import util.syntax._

import cats.Parallel
import cats.data.{EitherT, NonEmptyList}
import cats.effect.Sync
import cats.effect.{Sync, Timer}
import cats.syntax.all._
import cats.tagless.autoFunctorK
import com.typesafe.scalalogging
import slick.lifted.TableQuery
import zio.Schedule

@autoFunctorK
trait OrganizationBase[+F[_]] {
Expand Down Expand Up @@ -60,7 +63,8 @@ object OrganizationBase {
config: OreConfig,
auth: SpongeAuthApi[F],
F: Sync[F],
par: Parallel[F]
par: Parallel[F],
timer: Timer[F]
) extends OrganizationBase[F] {

private val Logger = scalalogging.Logger("Organizations")
Expand Down Expand Up @@ -88,12 +92,31 @@ object OrganizationBase {
val dummyEmail = name.replaceAll("[^a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]", "") + '@' + config.ore.orgs.dummyEmailDomain
val spongeResult = EitherT.right[List[String]](logging) *> EitherT(auth.createDummyUser(name, dummyEmail))

def waitTilUserExists(authUser: AuthUser, sleepDur: FiniteDuration, sleptTime: FiniteDuration): F[Boolean] = {
val hasUser = ModelView.now(User).get(authUser.id).isDefined

//Do a quick check first if the user is already present
hasUser.flatMap {
case true => F.pure(true)
case false =>
if (sleptTime > 20.seconds) F.pure(false)
else timer.sleep(sleepDur) *> waitTilUserExists(authUser, sleepDur * 2, sleptTime + sleepDur * 2)
}
}

// Check for error
spongeResult
.leftMap { err =>
MDCLogger.debug("<FAILURE> " + err)
err
}
.flatMap { spongeUser =>
EitherT.right[List[String]](waitTilUserExists(spongeUser, 50.millis, 0.millis)).flatMap {
case true => EitherT.rightT[F, List[String]](spongeUser)
// Exit early if we never got the user
case false => EitherT.leftT[F, AuthUser](List("Timed out while waiting for SSO sync"))
}
}
.semiflatMap { spongeUser =>
MDCLogger.debug("<SUCCESS> " + spongeUser)
// Next we will create the Organization on Ore itself. This contains a
Expand Down
2 changes: 1 addition & 1 deletion project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object Settings {
val scalaVer = "2.13.6"

val commonSettings = Seq(
version := "2.0.0-M2.8",
version := "2.0.0-M2.9",
scalaVersion := scalaVer,
scalacOptions ++= Seq(
"-deprecation",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.7.1
30 changes: 15 additions & 15 deletions project/frontendDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ object NPMDeps {
val lodash = "lodash" -> "4.17.21"
val queryString = "query-string" -> "7.1.1"

val fontAwesome = "@fortawesome/fontawesome-svg-core" -> "1.3.0"
val fontAwesomeSolid = "@fortawesome/free-solid-svg-icons" -> "6.0.0"
val fontAwesomeRegular = "@fortawesome/free-regular-svg-icons" -> "6.0.0"
val fontAwesomeBrands = "@fortawesome/free-brands-svg-icons" -> "6.0.0"
val fontAwesome = "@fortawesome/fontawesome-svg-core" -> "6.1.1"
val fontAwesomeSolid = "@fortawesome/free-solid-svg-icons" -> "6.1.1"
val fontAwesomeRegular = "@fortawesome/free-regular-svg-icons" -> "6.1.1"
val fontAwesomeBrands = "@fortawesome/free-brands-svg-icons" -> "6.1.1"

val babel = "@babel/core" -> "7.17.2"
val babelLoader = "babel-loader" -> "8.2.3"
val babelPresetEnv = "@babel/preset-env" -> "7.16.11"
val babel = "@babel/core" -> "7.18.9"
val babelLoader = "babel-loader" -> "8.2.5"
val babelPresetEnv = "@babel/preset-env" -> "7.18.9"

val webpack = "4.46.0"
val webpackDevServer = "3.11.3"
Expand All @@ -33,17 +33,17 @@ object NPMDeps {
val postCssLoader = "postcss-loader" -> "4.3.0"
val miniCssExtractor = "mini-css-extract-plugin" -> "1.6.2"
val optimizeCssAssets = "optimize-css-assets-webpack-plugin" -> "6.0.1"
val autoprefixer = "autoprefixer" -> "10.4.2"
val sass = "sass" -> "1.49.7"
val autoprefixer = "autoprefixer" -> "10.4.7"
val sass = "sass" -> "1.53.0"
}

object WebjarsDeps {

val jQuery = "org.webjars.npm" % "jquery" % "2.2.4"
val fontAwesome = "org.webjars" % "font-awesome" % "6.0.0"
val filesize = "org.webjars.npm" % "filesize" % "8.0.7"
val moment = "org.webjars.npm" % "moment" % "2.29.1"
val clipboard = "org.webjars.npm" % "clipboard" % "2.0.10"
val chartJs = "org.webjars.npm" % "chart.js" % "3.7.1"
val swaggerUI = "org.webjars" % "swagger-ui" % "4.5.0"
val fontAwesome = "org.webjars" % "font-awesome" % "6.1.1"
val filesize = "org.webjars.npm" % "filesize" % "9.0.1"
val moment = "org.webjars.npm" % "moment" % "2.29.4"
val clipboard = "org.webjars.npm" % "clipboard" % "2.0.11"
val chartJs = "org.webjars.npm" % "chart.js" % "3.8.0"
val swaggerUI = "org.webjars" % "swagger-ui" % "4.11.1"
}
8 changes: 3 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ evictionWarningOptions in update := EvictionWarningOptions.default
.withWarnDirectEvictions(false)
.withWarnScalaVersionEviction(false)

resolvers += "Typesafe repository".at("https://repo.typesafe.com/typesafe/releases/")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.16")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.2")
addSbtPlugin("com.iheart" %% "sbt-play-swagger" % "0.10.6-PLAY2.8")
addSbtPlugin("com.iheart" %% "sbt-play-swagger" % "0.10.7-PLAY2.8")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0")
addSbtPlugin("ch.epfl.scala" % "sbt-web-scalajs-bundler" % "0.20.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

0 comments on commit 7a610a9

Please sign in to comment.