GithubHelp home page GithubHelp logo

xenobyte / pixelated-platform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sriramnrn/pixelated-platform

0.0 3.0 0.0 223 KB

Server automation recipies for the Pixelated platform

License: GNU Affero General Public License v3.0

Shell 10.32% Puppet 5.83% Makefile 0.14% HTML 0.37% Python 75.65% Gherkin 7.70%

pixelated-platform's Introduction

Pixelated-Platform

Pixelated is in early development stage! Things may not work to their full extent yet

It is the objective of the Pixelated Platform to provide a simple to install and maintain mail server based on the LEAP Platform.

  • The Pixelated Platform holds the installation scripts for the Pixelated components.
  • In this repository, you also find the Pixelated Threat Model (currently in development)

High level Architecture

Pixelated Platform

Highlevel Architecture

Installing the Pixelated Platform

Pixelated is built on top of LEAP, so in order to have a Pixelated Platform, you need to have a LEAP Platform. There are 2 ways of installing the Pixelated Platform:

  • Having an installation of a LEAP provider and adding the Pixelated Platform to it, or
  • Setup your own "Pixelated Provider", which is a LEAP provider with the Pixelated Platform already setup on it

Installing a LEAP provider

Please refer to https://leap.se/en/docs/platform/tutorials/single-node-email for help with setting up a LEAP provider.

For the following we assume that you have the LEAP platform and the configuration for your LEAP node on your local workstation. If you followed the tutorial to the letter you should have the following directories:

  • ~/leap/leap_plaform: the LEAP platform itself
  • ~/leap/example: the configuration for your LEAP provider node

Ideally you have run leap deploy and leap test to set up the node on a server and verify that the installation actually works.

Adding Pixelated to your existing LEAP configuration

We have puppet scripts that takes care of (almost) everything. The scripts will install the pixelated-dispatcher and the pixelated-user-agent.

Add the pixelated-platform files to files/puppet inside your LEAP configuration folder.

The documentation for the installation of the LEAP Platform suggests that you make the configuration folder (~/leap/example is the name they suggest) versioned using Git to make it easier to track and undo ant changes on the configuration. If you followed this suggestion of the tutorial, the easiest way to get the Pixelated platform is to add it as a submodule.

    cd ~/leap/example
    git submodule add https://github.com/pixelated-project/pixelated-platform.git files/puppet

If you haven't added version control to your LEAP configuration, you can simply clone the Pixelated platform files into your node configuration.

    cd ~/leap/example
    git clone https://github.com/pixelated-project/pixelated-platform.git files/puppet

Adding the Pixelated Platform repo to files/puppet will add all the necessary configuration to turn your LEAP Provider into a Pixelated Provider.

Bug Alert: Currently there is a bug with the setup. You have to manually add the "monitor" service to the services section in nodes/node1.json. After the edits the file should look like this:

{
  "ip_address": "XXX.XXX.XXX.XXX",
  "services": [
    "couchdb",
    "mx",
    "soledad",
    "webapp",
    "monitor"
  ],
  "tags": "production"
}

Installing Pixelated on the LEAP provider node

With Pixelated added to the configuration simply re-run the LEAP deployment.

leap deploy
leap test

When this completes Pixelated should be ready and available on port 8080 on your LEAP provider.

Bug Alert: Sometimes the dispatcher does not start automatically. If you get a "connection refused" when trying to access Pixelated, please start the dispatcher manually.

leap ssh node1       # log into LEAP node
/etc/init.d/pixelated-dispatcher-proxy start

How to setup your own Pixelated Platform

If you don't already have a LEAP Provider that you want to turn into a Pixelated Provider, we provide a script that does all the configuration of the LEAP Platform and the Pixelated Platform. All you need to setup your own Pixelated Platform is root access to a debian wheezy box.

Vagrant/VirtualBox

You can try setting up a virtual machine on your computer to try out the Pixelated Platform. For this you'll need vagrant and VirtualBox.

After you have installed both tools, you can clone pixelated-platform repository and use the Vagrantfile provided there by running these commands in a terminal (this is probably the easiest option):

$ git clone https://github.com/pixelated-project/pixelated-platform.git
$ cd pixelated-platform

$ vagrant up

Or, you need a Vagrantfile with the instructions for Vagrant and VirtualBox to set up a Debian Wheezy box. You can create the Vagrantfile manually:

$ mkdir pixelated-platform
$ cd pixelated-platform

$ cat > Vagrantfile <<EOF
Vagrant.configure(2) do |config|
  config.vm.box = "boxcutter/debian77"
  config.vm.network "forwarded_port", guest: 8080, host:8080
  config.vm.network "forwarded_port", guest: 443, host:443
end
EOF 

$ vagrant up

With this you'll have a virtual machine running the necessary version of Debian to proceed with the installation of the LEAP provider and the Pixelated Platform.

Installation

To run the installation, you'll need to ssh into the machine and become root.

If you are using the vagrant/VirtualBox combination mentioned above, run:

vagrant ssh
sudo bash

If you set up your Debian box by another method (using a physical machine, a cloud provider, etc), you'll need to ssh into the box using it's ip.

The only thing left is to execute the bootstrap script convert-to-pixelated.sh:

wget https://raw.githubusercontent.com/pixelated-project/pixelated-platform/master/convert-to-pixelated.sh && chmod +x convert-to-pixelated.sh && ./convert-to-pixelated.sh

This might take quite a while This script will automate the installation of the LEAP Provider and the Pixelated Platform. During the installation, it'll prompt you the information requested when running the leap new . command from Bootstrap the provider section of the LEAP tutorial. Go there for more information about this step.

After the script finishes running, you should have your brand new provider all set up. You can proceed creatting accounts and using them.

To create a mail account on your new provider, open https://localhost/ and sign up. To use the account, open https://localhost:8080/ and log into your new account.

Trouble-shooting

The dispatcher uses Docker to run the user agents for the individual users, i.e. the user agent is not directly visible in the process list because it runs inside a docker container. To view the currently running instances log into the Pixelated provider, using leap ssh node1 for example, and use the Docker commandline

root@node1:~# docker ps
CONTAINER ID        IMAGE                                   COMMAND                CREATED             STATUS              PORTS                      NAMES
070171caaa1d        pixelated/pixelated-user-agent:latest   "/bin/bash -l -c '/u   4 hours ago         Up 3 hours          127.0.0.1:5000->4567/tcp   erik           

In the last column you can see the user name. It is possible to access the log files for this instance as follows:

docker logs <username>

Have fun!

pixelated-platform's People

Contributors

albogabriel avatar bwagnerr avatar ckluente avatar cz8s avatar erikdoe avatar fbernitt avatar lisajunger avatar neissi avatar olabini avatar rafaelzlisboa avatar tiagoferraz avatar varac avatar

Watchers

 avatar  avatar  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.