See the Demo and learn more about the project.
Work in progress!
This repository contains:
- Mangrove Review Standard
- Mangrove Original Services Terms of Use
- Mangrove Original Server implementation as Lambda using Rocket
- Reviewer Lambda accessing PostgreSQL database
- File Hoster Lambda accessing an S3 bucket
- Mangrove Original UI implementation
- Client using Vue.js
- Mangrove Client JS Library for interacting with Mangrove Servers
- Mangrove Aggregator a probabilistic model to help with making sense of reviews
Both servers need to be up for the UI to work.
yarn
and Rust compiler is needed:
Nightly compiler version is used:
rustup default nightly
Run the UI:
cd ui
yarn install
yarn dev
cd ..
Server relies on a Postgres database running and set up with PostGIS and Diesel:
cargo install diesel_cli --features "postgres" --no-default-features
cd servers/reviewer
diesel setup
You may also need to install libssl-dev
(i.e. sudo apt install libssl-dev
).
Build and run the server.
cargo run
See the API docs here.
cd servers/file_hoster
cargo run
/upload
:PUT
a file to store it on the server, get SHA256 hash of the file if successful./
:GET
a file with given base64url encoded SHA256 hash from/<hash>
.
Deployment can be done using AWS CloudFormation using the Serverless Application Model. The required CloudFormation template is already set up in aws-template.yaml.
Requirements:
- Docker
- AWS CLI
- An existing S3 bucket
libpq
Lambda Layer
Adjust the name of S3 buckets in the scripts below and run:
./servers/file_hoster/deploy.sh
./servers/reviewer/deploy.sh
Run the script
in .gitlab-ci.yml
making sure to use your own S3 bucket.
Deploying the Reviewer Lambda to AWS requires a Lambda Layer containing libpq
.
We host a base docker image with this layer included on Docker Hub.
To deploy your own layer, follow these instructions based on: https://github.com/DrLuke/postgres-libpq-aws-lambda-layer
git clone git@github.com:DrLuke/postgres-libpq-aws-lambda-layer.git
cd postgres-libpq-aws-lambda-layer
# Updating the submodule does not work after cloning, so just add it.
git submodule add git://git.postgresql.org/git/postgresql.git postgresql
cd postgresql
# Use the same version as one running on AWS RDS.
git checkout tags/REL_11_5
# Install missing requirements.
sudo apt install bison flex
./configure --without-readline
make
make check
cd ..
./build_layer.sh
Then deploy with
aws lambda publish-layer-version \
--layer-name postgres-libpq \
--zip-file fileb://aws-libpg-layer.zip \
--compatible-runtimes provided