Table of Contents generated with DocToc
- Install API Umbrella (or follow the Developer Setup)
- Install Meteor.js
- Clone Apinf
- Run
npm install - Type
meteorin the project directory
- Run API-umbrella container http://api-umbrella.readthedocs.io/en/latest/getting-started.html#running-with-docker
- Obtaining API Key and Authentication token. You can obtain the Authentication Token and API Key from the API Umbrella platform by following instructions in the Getting Started and API Umbrella Admin API documentation.
- Run APInf container
docker run -p 8080:80 -e MONGO_URL=mongodb://localhost:27017/your_db -e MAIL_URL=smtp://some.mailserver.com:25 -e ROOT_URL=http://YOUR_SITE_DOMAIN apinf/platform:latest - Configure APInf
Register a new admin account. The first user will become Admin.
- Signup to the APInf http://YOUR_SITE_DOMAIN/sign-up
- Login to the APInf web admin http://YOUR_SITE_DOMAIN/sign-in
- Fill APInf settings http://YOUR_SITE_DOMAIN/settings
- Create "docker-compose.yml" file on your server and copy content from docker-compose.yml.
- In the same folder create file "docker/api-umbrella/config/api-umbrella.yml" based on example "docker/api-umbrella/config/api-umbrella.yml.example". ATTENTION: replace "example.com" on YOUR_SITE_DOMAIN for keys "ssl_cert" and "ssl_cert_key".
- Create file "docker/apinf/env" based on example "docker/apinf/env.example".
- Create file "docker/ssl/env" based on example "docker/ssl/env.example".
- Run
docker-compose up -d. The first launch of will be slow because (take couple of minutes) of the DH parameter computation and configure Let's Encrypt certificate. - Visit https://YOUR_SITE_DOMAIN:3002/signup/ and fill form for get API Key.
- Visit https://YOUR_SITE_DOMAIN:3002/admin/ and click on 'My Account' link for find Admin API Token.
- Visit https://YOUR_SITE_DOMAIN/sign-up and create new account.
- Fill data in "Project Branding: APINF Configuration Wizard".
- Fill data in "Settings for API Umbrella: APINF Configuration Wizard".
- Host: "https://YOUR_SITE_DOMAIN:3002"
- API Key: from step #6
- Auth Token: from step #7
- Base URL: "https://YOUR_SITE_DOMAIN:3002/api-umbrella/"
- Elasticsearch: "http://elasticsearch.docker:9200"
- Add API backend https://YOUR_SITE_DOMAIN/api/new
The mail object contains a username and password for the Mailgun service. You will need to register with Mailgun. Once registered, you can use your 'sandbox' domain credentials in a development environment or a custom domain in production:
- Default SMTP Login
- Default Password
For up-to-date instructions, refer to the Mailgun Help Center
Elasticsearch takes a host value that contains the host and port of the API Umbrella ElasticSearch instance. In a standard API Umbrella deployment, this will be the same as the API Umbrella base URL, with port number 14002. Note: Elastic REST API may be exposed via HTTP instead of HTTPS, so double check the protocol.
The Github configuration takes two values, a Client ID and Secret key. You can obtain these values by setting up a Github application from your Github user account.
Review the Docker installation instructions for your Operating System:
Optionally add your user to the docker group.
You will also need to install Docker Compose.
Install Docker Compose on Ubuntu Linux with the following command:
$ sudo apt install docker-compose
API Umbrella configuration should be stored in
[project-root]/docker/api-umbrella/config/api-umbrella.yml
You can create api-umbrella.yml based on the example:
[project-root]/docker/api-umbrella/config/api-umbrella.yml.example
- Run application containers (in first time it will build image):
$ docker-compose up
- Add
apinf.devandapi-umbrella.devhosts entry to/etc/hostsfile so you can visit them from your browser.
$ docker-machine ip
=> 127.0.0.1
Then add the IP to your /etc/hosts:
127.0.0.1 apinf.dev api-umbrella.dev
Now you can work with your app from browser by visit http://apinf.dev:3000
- Login to the API Umbrella web admin https://api-umbrella.dev/admin/login
- Signup to the APInf http://apinf.dev:3000/sign-up
- Login to the APInf web admin http://apinf.dev:3000/sign-in
- Fill API Umbrella settings http://apinf.dev:3000/settings :
- Host: https://api-umbrella.dev
- API Key: Get from step.
- Auth Token: Get from My account page
- Base URL: https://api-umbrella.dev
- Elasticsearch Host: http://api-umbrella.dev:14002
This can be accomplished by grabbing the container ID with a docker ps, then passing that ID into the docker exec command:
$ docker ps
CONTAINER ID IMAGE
ce9de67fdcbe apinf/platform:latest
$ docker exec -it ce9de67fdcbe /bin/bash
root@ce9de67fdcbe:/#
Add alias to bash:
alias apinf_web='docker exec -it `docker ps | grep web | sed "s/ .*//"` /bin/bash'
To build packages for the current APInf version:
$ docker build -t apinf/platform:INSERT_VERSION_HERE .
$ docker tag apinf/platform:INSERT_VERSION_HERE apinf/platform:latest
To publish the new images to our Docker Hub repository:
$ docker push apinf/platform:INSERT_VERSION_HERE
$ docker push apinf/platform:latest