Skip to content

Latest commit

 

History

History
169 lines (115 loc) · 3.96 KB

setup.md

File metadata and controls

169 lines (115 loc) · 3.96 KB

Setup | crAPI

Docker

You'll need to have Docker installed and running on your host system.

Using prebuilt images

You can use prebuilt images generated by our CI workflow.

Start crAPI

  • To use the latest stable version.

    • Linux Machine
    curl -o docker-compose.yml https://raw.githubusercontent.com/OWASP/crAPI/main/deploy/docker/docker-compose.yml
    
    docker-compose pull 
    
    docker-compose -f docker-compose.yml --compatibility up -d
    
    • Windows Machine
    curl.exe -o docker-compose.yml https://raw.githubusercontent.com/OWASP/crAPI/main/deploy/docker/docker-compose.yml
    
    docker-compose pull
    
    docker-compose -f docker-compose.yml --compatibility up -d
    
  • To use the latest development version

    • Linux Machine
    curl -o docker-compose.yml https://raw.githubusercontent.com/OWASP/crAPI/develop/deploy/docker/docker-compose.yml
    
    VERSION=develop docker-compose pull
    
    VERSION=develop docker-compose -f docker-compose.yml --compatibility up -d
    
    • Windows Machine
    curl.exe -o docker-compose.yml https://raw.githubusercontent.com/OWASP/crAPI/develop/deploy/docker/docker-compose.yml
    
    set "VERSION=develop"
    
    docker-compose pull
     
    docker-compose -f docker-compose.yml --compatibility up -d
    

Note: All emails are sent to mailhog service by default and can be checked on http://localhost:8025 You can change the smtp configuration if required however all emails with domain example.com will still go to mailhog.

Build it yourself

  1. Clone crAPI repository

    • Linux Machine
        $ git clone [REPOSITORY-URL]
    
    • Windows Machine
        $ git clone [REPOSITORY-URL] --config core.autocrlf=input
    
  2. Build all docker images

    • Linux Machine
    $ deploy/docker/build-all.sh
    
    • Windows Machine
    $ call "%cd%\deploy\docker\build-all.bat"
    
  3. Start crAPI

    $ docker-compose -f deploy/docker/docker-compose.yml --compatibility up -d
    
  4. Visit http://localhost:8888

Note: All emails are sent to mailhog service by default and can be checked on http://localhost:8025 You can change the smtp configuration if required however all emails with domain example.com will still go to mailhog.

Kubernetes

Using Helm Charts

  1. Clone the repo

    git clone [REPOSITORY-URL]
    
  2. Install the helm chart

    cd deploy/helm
    
    helm install --namespace crapi crapi . --values values.yaml
    
  3. If using minikube, create a tunnel to initialize the LoadBalancers

    minikube tunnel --alsologtostderr
    
  4. Access crAPI

    crAPI should be available on the <LOADBALANCER_IP>:8888 Mailhog on <LOADBALANCER_IP>:8025

    Or for minikube run the following command to get the URL

    crAPI URL:
    $ echo "http://$(minikube ip):30080"
    
    Mailhog URL:
    echo "http://$(minikube ip):30025"
    

Vagrant

This option allows you to run crAPI within a virtual machine, thus isolated from your system. You'll need to have Vagrant and, for example VirtualBox installed.

  1. Clone crAPI repository
    $ git clone [REPOSITORY-URL]
    
  2. Start crAPI Virtual Machine
    $ cd deploy/vagrant && vagrant up
    
  3. Visit http://192.168.33.20

Note: All emails are sent to mailhog service by default and can be checked on http://192.168.33.20:8025 You can change the smtp configuration if required however all emails with domain example.com will still go to mailhog.

Once you're done playing with crAPI, you can remove it completely from your system running the following command from the repository root directory

$ cd deploy/vagrant && vagrant destroy