Developing Otoroshi

If you want to play with Otoroshis code, here are some tips

The tools

You will need

  • git
  • JDK >= 11
  • SBT >= 1.7+
  • Node 18+ & yarn 1.x

Clone the repository

git clone https://github.com/MAIF/otoroshi.git

or fork otoroshi and clone your own repository.

Run otoroshi in dev mode

to run otoroshi in dev mode, you’ll need to run two separate process to serve the javascript UI and the server part.

Javascript side

just go to <repo>/otoroshi/javascript and install the dependencies with

yarn install
# or
npm install

then run the dev server with

yarn start
# or
npm run start

Server side

setup SBT opts with

export SBT_OPTS="-Xmx2G -Xss6M"

then just go to <repo>/otoroshi and run the sbt console with

sbt

then in the sbt console run the following command

~reStart
# to pass jvm args, you can use: ~reStart --- -Dotoroshi.storage=memory ...

you can now access your otoroshi instance at http://otoroshi.oto.tools:9999

Test otoroshi

to run otoroshi test just go to <repo>/otoroshi and run the main test suite with

sbt 'testOnly OtoroshiTests'

Create a release

just go to <repo>/otoroshi/javascript and then build the UI

yarn install
yarn build

then go to <repo>/otoroshi and build the otoroshi distribution

sbt ';clean;compile;dist;assembly'

the otoroshi build is waiting for you in <repo>/otoroshi/target/scala-2.12/otoroshi.jar or <repo>/otoroshi/target/universal/otoroshi-1.x.x.zip

Build the documentation

from the root of your repository run

sh ./scripts/doc.sh all

The documentation is located at manual/target/paradox/site/main/

Format the sources

from the root of your repository run

sh ./scripts/fmt.sh