django-orchestra/README.md

139 lines
6.0 KiB
Markdown
Raw Normal View History

2014-05-08 16:59:35 +00:00
![](orchestra/static/orchestra/icons/Emblem-important.png) **This project is in early development stage**
Django Orchestra
================
Orchestra is a Django-based framework for building web hosting control panels.
* [Documentation](http://django-orchestra.readthedocs.org/)
* [Install and upgrade](INSTALL.md)
* [Roadmap](ROADMAP.md)
Motivation
----------
There are a lot of widely used open source hosting control panels, however, none of them seems apropiate when you already have an existing service infrastructure or simply you want your services to run on a particular architecture.
The goal of this project is to provide the tools for easily build a fully featured control panel that is not tied to any particular service architecture.
Overview
--------
Django-orchestra is mostly a bunch of [plugable applications](orchestra/apps) providing common functionalities, like service management, resource monitoring or billing.
The admin interface relies on [Django Admin](https://docs.djangoproject.com/en/dev/ref/contrib/admin/), but enhaced with [Django Admin Tools](https://bitbucket.org/izi/django-admin-tools) and [Django Fluent Dashboard](https://github.com/edoburu/django-fluent-dashboard). [Django REST Framework](http://www.django-rest-framework.org/) is used for the REST API, with it you can build your client-side custom user interface.
Every app is [reusable](https://docs.djangoproject.com/en/dev/intro/reusable-apps/), this means that you can add any Orchestra application into your Django project `INSTALLED_APPS` strigh away.
However, Orchestra also provides glue, tools and patterns that you may find very convinient to use. Checkout the [documentation](http://django-orchestra.readthedocs.org/) if you want to know more.
2014-10-18 12:29:14 +00:00
![](docs/images/index-screenshot.png)
2014-05-08 16:59:35 +00:00
2015-05-01 18:15:35 +00:00
Fast Deployment Setup
---------------------
2015-05-04 10:48:09 +00:00
To only run the web interface follow these steps:
2015-05-01 18:15:35 +00:00
```bash
2015-05-04 10:48:09 +00:00
# Create and activate a Python virtualenv
2015-05-03 20:08:32 +00:00
python3 -mvenv env-django-orchestra
2015-05-01 18:15:35 +00:00
source env-django-orchestra/bin/activate
2015-05-03 20:10:31 +00:00
# Install Orchestra and its dependencies
2015-05-03 20:08:32 +00:00
pip3 install django-orchestra==dev \
--allow-external django-orchestra \
--allow-unverified django-orchestra
sudo apt-get install python3.4-dev libxml2-dev libxslt1-dev libcrack2-dev
pip3 install -r \
https://raw.githubusercontent.com/glic3rinu/django-orchestra/master/requirements.txt
2015-05-03 21:34:23 +00:00
# Create an new Orchestra site
2015-05-03 20:08:32 +00:00
orchestra-admin startproject panel
2015-05-01 18:15:35 +00:00
python3 panel/manage.py migrate accounts
python3 panel/manage.py migrate
python3 panel/manage.py runserver
```
None of the services will work but you can see the web interface on http://localhost:8000/admin
2014-05-08 16:59:35 +00:00
Development and Testing Setup
-----------------------------
If you are planing to do some development or perhaps just checking out this project, you may want to consider doing it under the following setup
1. Create a basic [LXC](http://linuxcontainers.org/) container, start it and get inside.
```bash
wget -O /tmp/create.sh \
2015-04-29 21:39:51 +00:00
https://raw.github.com/glic3rinu/django-orchestra/master/scripts/container/create.sh
2014-10-04 17:40:13 +00:00
sudo bash /tmp/create.sh
2014-05-08 16:59:35 +00:00
sudo lxc-start -n orchestra
# root/root
2014-05-08 16:59:35 +00:00
```
2. Deploy Django-orchestra development environment **inside the container**
2014-05-08 16:59:35 +00:00
```bash
# Make sure your container is connected to the Internet
# Probably you will have to configure the NAT first:
# sudo iptables -t nat -A POSTROUTING -s `container_ip` -j MASQUERADE
2014-05-08 16:59:35 +00:00
wget -O /tmp/deploy.sh \
2015-04-29 21:39:51 +00:00
https://raw.github.com/glic3rinu/django-orchestra/master/scripts/container/deploy.sh
2014-05-08 16:59:35 +00:00
cd /tmp/ # Moving away from /root before running deploy.sh
2014-10-04 17:40:13 +00:00
bash /tmp/deploy.sh
2014-05-08 16:59:35 +00:00
```
Django-orchestra source code should be now under `~orchestra/django-orchestra` and an Orchestra instance called _panel_ under `~orchestra/panel`
3. Nginx should be serving on port 80, but Django's development server can be used as well:
```bash
su - orchestra
cd panel
python manage.py runserver 0.0.0.0:8888
```
4. A convenient practice can be mounting `~orchestra` on your host machine so you can code with your favourite IDE, sshfs can be used for that
```bash
# On your host
mkdir ~<user>/orchestra
sshfs orchestra@<container-ip>: ~<user>/orchestra
```
2015-04-30 09:51:55 +00:00
5. To upgrade to current master just re-run the deploy script
2014-05-08 16:59:35 +00:00
```bash
sudo ~orchestra/django-orchestra/scripts/container/deploy.sh
```
License
-------
2014-11-16 14:45:59 +00:00
Copyright (c) 2014 - Marc Aymerich and individual contributors.
2014-11-13 17:47:45 +00:00
All Rights Reserved.
Django-orchestra is licensed under The BSD License (3 Clause, also known as
the new BSD license). The license is an OSI approved Open Source
license and is GPL-compatible(1).
The license text can also be found here:
http://www.opensource.org/licenses/BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
2014-11-16 14:45:59 +00:00
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
2014-11-16 14:47:11 +00:00
* Neither the name of Marc Aymerich, nor the
2014-11-16 14:45:59 +00:00
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
2014-11-13 17:47:45 +00:00
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Ask Solem OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.