Skip to content

Commit

Permalink
Merge pull request #2 from mbari-org/feature/oni
Browse files Browse the repository at this point in the history
Feature/oni
  • Loading branch information
hohonuuli authored Aug 13, 2024
2 parents e72d670 + 1f2d1d6 commit 76b52fe
Show file tree
Hide file tree
Showing 49 changed files with 1,333 additions and 1,113 deletions.
16 changes: 12 additions & 4 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
version = "3.0.7"
version = "3.8.2"
runner.dialect = scala3


align.preset = most
docstrings.style = Asterisk
includeNoParensInSelectChains = true
maxColumn = 100
indent.main = 4
indent.callSite = 4
# Recommended, to not penalize `match` statements
# indent.matchSite = 0
maxColumn = 120
newlines.alwaysBeforeElseAfterCurlyIf = true

rewrite.rules = [
PreferCurlyFors,
RedundantParens,
SortModifiers,
SortImports
Imports
]

rewrite.scala3.convertToNewSyntax = false
rewrite.imports.expand = false
rewrite.imports.sort = original
rewrite.scala3.convertToNewSyntax = true
# rewrite.scala3.insertEndMarkerMinLines = 5
rewrite.scala3.removeOptionalBraces = yes


2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Test / fork := true
ThisBuild / licenses := Seq(("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")))
ThisBuild / organization := "org.mbari"
ThisBuild / organizationName := "MBARI"
ThisBuild / scalaVersion := "3.3.2"
ThisBuild / scalaVersion := "3.3.3"
ThisBuild / startYear := Some(2021)
// ThisBuild / version := "0.0.1"
ThisBuild / versionScheme := Some("semver-spec")
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ else
sbt 'Docker / publish'
fi

# -t mbari/raziel:latest \
# docker buildx build -t mbari/raziel:latest \
16 changes: 8 additions & 8 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ object Dependencies {

lazy val auth0 = "com.auth0" % "java-jwt" % "4.4.0"

private val circeVersion = "0.14.6"
private val circeVersion = "0.14.9"
lazy val circeCore = "io.circe" %% "circe-core" % circeVersion
lazy val circeGeneric = "io.circe" %% "circe-generic" % circeVersion
lazy val circeParser = "io.circe" %% "circe-parser" % circeVersion

lazy val jansi = "org.fusesource.jansi" % "jansi" % "2.4.1"
lazy val jasypt = "org.jasypt" % "jasypt" % "1.9.3"
lazy val logback = "ch.qos.logback" % "logback-classic" % "1.5.0"
lazy val logback = "ch.qos.logback" % "logback-classic" % "1.5.6"
lazy val methanol = "com.github.mizosoft.methanol" % "methanol" % "1.7.0"
lazy val munit = "org.scalameta" %% "munit" % "1.0.0-M11"
lazy val picocli = "info.picocli" % "picocli" % "4.7.5"
lazy val munit = "org.scalameta" %% "munit" % "1.0.0"
lazy val picocli = "info.picocli" % "picocli" % "4.7.6"

lazy val slf4jVersion = "2.0.12"
lazy val slf4jVersion = "2.0.13"
lazy val slf4jApi = "org.slf4j" % "slf4j-api" % slf4jVersion
lazy val slf4jJul = "org.slf4j" % "jul-to-slf4j" % slf4jVersion

private val tapirVersion = "1.9.10"
private val tapirVersion = "1.10.15"
lazy val tapirStubServer = "com.softwaremill.sttp.tapir" %% "tapir-sttp-stub-server" % tapirVersion
lazy val tapirSwagger = "com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-bundle" % tapirVersion
lazy val tapirCirce = "com.softwaremill.sttp.tapir" %% "tapir-json-circe" % tapirVersion
lazy val tapirCirceClient = "com.softwaremill.sttp.client3" %% "circe" % "3.9.3"
lazy val tapirCirceClient = "com.softwaremill.sttp.client3" %% "circe" % "3.9.7"
lazy val tapirVertx = "com.softwaremill.sttp.tapir" %% "tapir-vertx-server" % tapirVersion


lazy val typesafeConfig = "com.typesafe" % "config" % "1.4.3"
lazy val zio = "dev.zio" %% "zio" % "2.0.21"
lazy val zio = "dev.zio" %% "zio" % "2.1.6"
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.8
sbt.version=1.10.1
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.5")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.5.0")
addSbtPlugin("org.planet42" % "laika-sbt" % "0.18.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("org.planet42" % "laika-sbt" % "0.19.5")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
78 changes: 78 additions & 0 deletions src/docs/_docs/deployment/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Configuration

Raziel is a configuration server, the keeper of secrets. It can be used to lookup the configuration of a M3/VARS installation. This requires that Raziel is configured with enough information to access the M3/VARS installation. The following is a list of configuration options:

## Environment Variables

The following environment variables are used to configure Raziel:

### [Raziel](https://github.com/mbari-org/raziel)

- `RAZIEL_HTTP_CONTEXT` - The context path for the HTTP server. Default is `/`.
- `RAZIEL_HTTP_PORT` - The port for the HTTP server. Default is `8080`.
- `RAZIEL_JWT_EXPIRATION` - The expiration time for the JWT token. Default is `180 days`.
- `RAZIEL_JWT_ISSUER` - The issuer for the JWT token. Default is `http://www.mbari.org`.
- `RAZIEL_JWT_SIGNING_SECRET` - The secret used to sign the JWT token. Default is `DEFAULT`.
- `RAZIEL_MASTER_KEY` - The master key used for access. Default is `DEFAULT`.


### [Annosaurus](https://github.com/mbari-org/annosaurus)

- `ANNOSAURUS_URL` - The URL for the Annosaurus service. Default is `http://localhost:8082/anno/v1`.
- `ANNOSAURUS_INTERNAL_URL` - The internal URL for the Annosaurus service. Default is `http://localhost:8082/anno/v1`. This is used for internal communication between services and may be different that the ANNOSAURUS_URL in a docker context.
- `ANNOSAURUS_TIMEOUT` - The timeout for the Annosaurus service. Default is `10 seconds`.
- `ANNOSAURUS_SECRET` - The secret for the Annosaurus service. Default is `secret`.

### [Beholder](https://github.com/mbari-org/beholder)

- `BEHOLDER_URL` - The URL for the Beholder service. Default is `http://localhost:8088`.
- `BEHOLDER_INTERNAL_URL` - The internal URL for the Beholder service. Default is `http://localhost:8088`. This is used for internal communication between services and may be different that the BEHOLDER_URL in a docker context.
- `BEHOLDER_TIMEOUT` - The timeout for the Beholder service. Default is `10 seconds`.
- `BEHOLDER_SECRET` - The secret for the Beholder service. Default is `secret`.

### [Charybdis](https://github.com/mbari-org/charybdis)

- `CHARYBDIS_URL` - The URL for the Charybdis service. Default is `http://localhost:8086`.
- `CHARYBDIS_INTERNAL_URL` - The internal URL for the Charybdis service. Default is `http://localhost:8086`. This is used for internal communication between services and may be different that the CHARYBDIS_URL in a docker context.
- `CHARYBDIS_TIMEOUT` - The timeout for the Charybdis service. Default is `10 seconds`.

### [Oni](https://github.com/mbari-org/oni)

Note that Oni is a modern replacement for the legacy VARS KB and User services. The VARS KB and User services are still supported for backwards compatibility. If Oni is used, the VARS KB and User services should not be configured.

- `ONI_URL` - The URL for the Oni service. No default is configured. Example:`http://localhost:8083`.
- `ONI_INTERNAL_URL` - The internal URL for the Oni service. Default is `http://localhost:8083`. This is used for internal communication between services and may be different that the ONI_URL in a docker context.
- `ONI_TIMEOUT` - The timeout for the Oni service. Default is `10 seconds`.
- `ONI_SECRET` - The secret for the Oni service. Default is `secret`.

### [Panoptes](https://github.com/mbari-org/panoptes)

- `PANOPTES_URL` - The URL for the Panoptes service. Default is `http://localhost:8085/panoptes/v1`.
- `PANOPTES_INTERNAL_URL` - The internal URL for the Panoptes service. Default is `http://localhost:8085/panoptes/v1`. This is used for internal communication between services and may be different that the PANOPTES_URL in a docker context.
- `PANOPTES_TIMEOUT` - The timeout for the Panoptes service. Default is `10 seconds`.
- `PANOPTES_SECRET` - The secret for the Panoptes service. Default is `secret`.

### [Vampire Squid](https://github.com/mbari-org/vampire-squid)

- `VAMPIRE_SQUID_URL` - The URL for the Vampire Squid service. Default is `http://localhost:8084/vam/v1`.
- `VAMPIRE_SQUID_INTERNAL_URL` - The internal URL for the Vampire Squid service. Default is `http://localhost:8084/vam/v1`. This is used for internal communication between services and may be different that the VAMPIRE_SQUID_URL in a docker context.
- `VAMPIRE_SQUID_TIMEOUT` - The timeout for the Vampire Squid service. Default is `10 seconds`.
- `VAMPIRE_SQUID_SECRET` - The secret for the Vampire Squid service. Default is `secret`.

### [VARS KB Server](https://github.com/mbari-org/vars-kb-server)

The VARS KB Server is a legacy service. It is still supported for backwards compatibility. If Oni is used, the VARS KB and User services should not be configured.

- `VARS_KB_SERVER_URL` - The URL for the VARS KB server. No default is configured. Example: `http://localhost:8083/kb/v1`.
- `VARS_KB_SERVER_INTERNAL_URL` - The internal URL for the VARS KB server. Default is `http://localhost:8083/kb/v1`. This is used for internal communication between services and may be different that the VARS_KB_SERVER_URL in a docker context.
- `VARS_KB_SERVER_TIMEOUT` - The timeout for the VARS KB server. Default is `10 seconds`.
- `VARS_KB_SERVER_SECRET` - The secret for the VARS KB server. Default is `secret`.

### [VARS User Server](https://github.com/mbari-org/vars-user-server)

The VARS User Server is a legacy service. It is still supported for backwards compatibility. If Oni is used, the VARS KB and User services should not be configured.

- `VARS_USER_SERVER_URL` - The URL for the VARS User server. No default is configured. Example `http://localhost:8087/users/v1`.
- `VARS_USER_SERVER_INTERNAL_URL` - The internal URL for the VARS User server. Default is `http://localhost:8087/users/v1`. This is used for internal communication between services and may be different that the VARS_USER_SERVER_URL in a docker context.
- `VARS_USER_SERVER_TIMEOUT` - The timeout for the VARS User server. Default is `10 seconds`.
- `VARS_USER_SERVER_SECRET` - The secret for the VARS User server
16 changes: 14 additions & 2 deletions src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ charybdis {
timeout = ${?CHARYBDIS_TIMEOUT}
}

oni {
# url = "http://tbd.shore.mbari.org:8080/oni/v1"
url = "FAIL"
url = ${?ONI_URL}
internal.url = ${oni.url}
internal.url = ${?ONI_INTERNAL_URL}
timeout = "10 seconds"
timeout = ${?ONI_TIMEOUT}
secret = "secret"
secret = ${?ONI_SECRET}
}

panoptes {
# url = "http://singularity.shore.mbari.org:8080/panoptes/v1"
url = "http://localhost:8085/panoptes/v1"
Expand All @@ -81,7 +93,7 @@ vampire.squid {

vars.kb.server {
# url = "http://m3.shore.mbari.org/kb/v1"
url = "http://localhost:8083/kb/v1"
url = "FAIL"
url = ${?VARS_KB_SERVER_URL}
internal.url = ${vars.kb.server.url}
internal.url = ${?VARS_KB_SERVER_INTERNAL_URL}
Expand All @@ -91,7 +103,7 @@ vars.kb.server {

vars.user.server {
# url = "http://m3.shore.mbari.org/accounts/v1"
url = "http://localhost:8087/users/v1"
url = "FAIL"
url = ${?VARS_USER_SERVER_URL}
internal.url = ${vars.user.server.url}
internal.url = ${?VARS_USER_SERVER_INTERNAL_URL}
Expand Down
Loading

0 comments on commit 76b52fe

Please sign in to comment.