Install - StudioQi/jeto GitHub Wiki

Introduction

Jeto is talking to many services in order to manage domains, permissions, instances, etc.

vagrant-worker

https://github.com/Pheromone/vagrant-worker.git Vagrant-worker is the api that Jeto will talk to in order to send commands to vagrant requires: vagrant optional: lxc, vagrant plugins, virtualbox

htpasswd-api

https://github.com/Pheromone/htpasswd-api.git htpasswd-api is the api that Jeto will talk to in order to configure specific htpasswd files to restrict web access to certain instances requires: nginx

nging-api

https://github.com/Pheromone/nginx-api.git nginx-api (also known as domain-controller) is in charge of configuring proxies between instances and the publicly available nginx requires: nginx

Jeto

https://github.com/Pheromone/jeto.git Jeto is the UI, talking to all the services to configure machines, permissions, domains, etc.

Quickstart

  1. install vagrant: https://www.vagrantup.com/downloads.html
  2. install ansible
sudo apt-get install python-dev python-pip
sudo pip install ansible
  1. clone the project
git clone --recursive https://github.com/Pheromone/jeto-dev.git
  1. refer to the Configuration section to customize the settings
  2. vagrant up

Install

Installation will be done using Vagrant and Ansible, you will have to install it before continuing

sudo apt-get install python-dev
sudo apt-get install python-pip
sudo pip install ansible 

Clone

You will have to get a copy of Jeto and all the dependencies, the simplest is to get jeto-dev using –recursive Put it where you want on the destination server

sudo apt-get install git
cd /home/ubuntu
git clone --recursive https://github.com/Pheromone/jeto-dev.git

in case of problems (ie: `Clone of ‘[email protected]:Pheromone/htpasswd-api.git’ into submodule path ‘projects/htpasswd-api’ failed`)

  • go into the jeto-dev folder
  • edit .gitmodule to match the following
[submodule "projects/jeto"]
        path = projects/jeto
        url = https://github.com/Pheromone/jeto.git
[submodule "projects/vagrant-worker"]
        path = projects/vagrant-worker
        url = https://github.com/Pheromone/vagrant-worker.git
[submodule "projects/htpasswd-api"]
        path = projects/htpasswd-api
        url = https://github.com/Pheromone/htpasswd-api.git
[submodule "projects/nginx-api"]
        path = projects/nginx-api
        url = https://github.com/Pheromone/nginx-api.git
 
  • run `git submodule sync` then `git submodule update`

Configuration

Main configuration

host_vars/jeto.local for example

#enter your main admin user
admin_name: username 
ntp_servers:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
- 3.pool.ntp.org

server_hostname:        "vagrantcontrol.sandbox.pheromone.ca" # ???
nginx_server_hostname:  "vagrantcontrol.sandbox.pheromone.ca" # ???

vagrant_control_user: "vagrant"
vagrant_worker_user: "vagrant"
htpasswd_api_user: "vagrant"

# user to run nginx-api as
nginx_api_user: "root"
# nginx_api_user's home
nginx_api_user_home: "/root"
# where is nginx-api installed
nginx_api_install_dir: "/home/ubuntu/jeto-dev/projects/nginx-api"
nginx_api_socket_path: "/var/run/nginx-api.pid"

# user to run htpasswd-api as
htpasswd_api_user: 'crevette'
# htpasswd_api_user home
htpasswd_api_home: '/home/{{ htpasswd_api_user }}'
# where is htpasswd-api installed
htpasswd_api_install_dir: "/home/ubuntu/jeto-dev/projects/htpasswd-api"

# user to run jeto as
jeto_user: 'crevette'
# htpasswd_api_user home
jeto_home: '/home/{{ jeto_user }}'
# where is htpasswd-api installed
jeto_install_dir: "/home/ubuntu/jeto-dev/projects/jeto"
  
# Google authentication
GOOGLE_CLIENT_ID = '00000000000000000000000.apps.googleusercontent.com'
GOOGLE_CLIENT_SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXX'
GOOGLE_LOGIN_REDIRECT_URI = 'http://mydomain.tld/oauth2callback'
GOOGLE_LIMIT_DOMAIN = None

Variables

jeto

in jeto/defaults/main.yml jeto_server_name

nginx-api

in nginx-api/defaults/main.yml nginx_api_user and nginx_api_home

htpasswd-api

in htpasswd-api/defaults/main.yml htpasswd_api_user

vagrant-worker

in vagrant-worker/defaults/main.yml vagrant_worker_user and vagrant_worker_home

Prepare your computer

  • ensure your admin user can sudo as a user
    • test with `sudo -u yourUser -s` and `sudo -l` I had to add this into /etc/sudoers
      yourUser ALL=(ALL) NOPASSWD: ALL 
              
  • add the destination to your /etc/hosts
    x.x.x.x some.cool.name
        
  • configure ansible inventory
    some.cool.name
        
  • install
    ansible-playbook -i inventory bootstrap.yml
        

Run

service jeto restart
service nginx-api restart
service htpasswd-api restart
python /home/vagrant/vagrant-worker/worker.py high &
python /home/vagrant/vagrant-worker/worker.py low &

Debug

  • LXC can’t mount: make sure you have something similar in your apparmor config
    mount fstype=nfs,
    mount fstype=rcp_bind,
        
⚠️ **GitHub.com Fallback** ⚠️