Skip to content
develop
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Riff


A Microservice for URL shortening and sharing.

Release Candidate

Table of Contents

Introduction

License: AGPL v3 CircleCI Slack

TODO: Replace with introduction

Features

TODO: Description of features

  • Include a list of
  • all the many beautiful
  • web server features

Requirements

The application can be run locally or in a docker container, the requirements for each setup are listed below.

EGO

A running instance of EGO is required to generate the Authorization tokens and to provide the verification key.

EGO can be cloned and run locally if no public server is available.

Local

Docker

Quick Start

Make sure the JWT Verification Key URL is configured, then you can run the server in a docker container or on your local machine.

Configure JWT Verification Key

Update application.yml. Set auth.jwt.publicKeyUrl to the URL to fetch the JWT verification key. The application will not start if it can't set the verification key for the JWTConverter.

The default value in the application.yml file is set to connect to EGO running locally on its default port 8081.

Setup Database

  1. Install Postgres
  2. Create a Database: riff with user postgres and empty password

Database Migrations with Flyway

Database migrations and versioning is managed by flyway.

  1. Download the flyway cli client here: flyway-commandline
  2. Unpack the client in a directory of your choosing
  3. Execute the flyway client pointing it to the configuration and migration directories in this repository.

Get current version information:

./flyway -configFiles=<path_to_riff>/riff/src/main/resources/flyway/conf/flyway.conf -locations=filesystem:<path_to_riff>/riff/src/main/resources/flyway/sql info

Run outstanding migrations:

./flyway -configFiles=<path_to_riff>/riff/src/main/resources/flyway/conf/flyway.conf -locations=filesystem:<path_to_riff>/riff/src/main/resources/flyway/sql migrate

To see the migration naming convention, click here.

Run Local

$ mvn spring-boot:run

Application will run by default on port 1234

Configure the port by changing server.port in application.yml

Run Docker

First build the image:

$ docker-compose build

When ready, run it:

$ docker-compose up

Application will run by default on port 1234

Configure the port by changing services.api.ports in docker-compose.yml. Port 1234 was used by default so the value is easy to identify and change in the configuration file.

Testing

TODO: Additional instructions for testing the application.

API

TODO: API Reference with examples, or a link to a wiki or other documentation source.

Acknowledgements

TODO: Show folks some love.