GithubHelp home page GithubHelp logo

isabella232 / conch-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joyent/conch-api

0.0 0.0 0.0 32 MB

Datacenter build and management service

License: Mozilla Public License 2.0

Shell 0.23% Perl 95.30% Makefile 0.14% PLpgSQL 4.27% Dockerfile 0.06%

conch-api's Introduction

NOTICE

The Conch API has reached its end of life. So long and thanks for all the fish.

Conch API Server

Conch helps you build and manage datacenters.

Conch's goal is to provide an end-to-end solution for full datacenter resource lifecycle: from design to initial power-on to end-of-life for all components of all devices.

Conch is open source, licensed under MPL2.

More documentation can be found here.

This repository only encompasses the API server. Repositories for other parts of the Conch ecosystem can be found here (some repositories may be private which will require you to request access):

Caveat Emptor

The API is in a constant state of flux. Contact the development team before attempting to use it directly. The conch shell and the Web UI are our current stable interfaces.

Installation

Operating System Support

We currently support Docker/Ubuntu. Being a Perl app, the API should run nearly anywhere but the code is only actively tested on macOS and Docker/Ubuntu.

Perl Support

The API is only certified to run against Perl 5.26.

Setup

Below is a list of useful Make commands that can be used to build and run the project. All of these should be run in the top level directory.

  • make run -- Build the project and run it
  • make test -- Run tests
  • make migrate-db -- Run database migrations

Needed Packages

Configuration

Copy conch.conf.dist to conch.conf, modifying for any local parameters, including database connectivity information.

Starting Conch

  • make run

Creating Local Credentials

First, you need to get a login token into the local database. We can do this by leveraging the knowledge that an encrypted password entry of '' will match against all supplied inputs:

$ psql -U conch conch --command="insert into user_account (name, password, email) values ('me', '', '[email protected]')"

Now, we use this email and password to generate a login token:

make run curl -i -H'Content-Type: application/json' --url http://127.0.0.1:5001/login -d '{"email":"[email protected]","password":"anything"}'

You will see output like this:

{"jwt_token":"eyJInR5cCI6Iwhargarbl.eyJl9pZCI6ImM1MGYwhargarbl.WV3uJEvg0bqInI9pEtl04ZZ8ECN4yQOSmehello"}

Save that token somewhere, such as in an environment variable or a file, for use in future API calls. You will include it in the "Authorization" header, for example:

curl -i --url https://staging.conch.joyent.us/user/me --header "Authorization: Bearer eyJInR5cCI6Iwhargarbl.eyJl9pZCI6ImM1MGYwhargarbl.WV3uJEvg0bqInI9pEtl04ZZ8ECN4yQOSmehello"

Docker

Compose

The most simple way to get going with the Conch API is to use Docker Compose.

Build

First, build the image locally using docker/builder.sh

First Run

Copy conch.conf.dist to conch.conf, modifying for any local parameters. Specifically search for 'docker' in the comments. Ignore the database parameters.

# Edit compose file for desired release
docker-compose up -d postgres # initialize the postgres database
docker-compose run --rm web bin/conch-db all --username conch --email [email protected] --password kaewee3hipheem8BaiHoo6waed7pha
docker-compose up -d

Upgrading

docker-compose down
# Edit compose file for desired release
docker-compose pull
docker-compose up -d postgres
docker-compose run --rm web bin/conch-db migrate
docker-compose up -d

Licensing

Copyright Joyent, Inc.

This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://www.mozilla.org/en-US/MPL/2.0/.

conch-api's People

Contributors

dustinryerson avatar jemershaw avatar karenetheridge avatar perigrin avatar sungo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.