From 58930fed8c2a9c0121275174ade2dd3190574ed6 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 20 Jun 2014 20:20:58 -0400 Subject: [PATCH] Removal of fabric file installation support, this should be its own separate project --- README.rst | 21 ---- contrib/fabfile.tar.gz | Bin 7855 -> 0 bytes docs/intro/installation.rst | 85 -------------- docs/releases/1.0.rst | 10 +- fabfile/__init__.py | 72 ------------ fabfile/conf.py | 60 ---------- fabfile/databases/__init__.py | 54 --------- fabfile/databases/mysql.py | 36 ------ fabfile/django/__init__.py | 34 ------ fabfile/literals.py | 72 ------------ fabfile/mayan_edms/__init__.py | 50 --------- fabfile/mayan_edms/upgrades/__init__.py | 0 fabfile/mayan_edms/upgrades/v0_12_2.py | 14 --- fabfile/platforms/__init__.py | 103 ----------------- fabfile/platforms/debian.py | 50 --------- fabfile/platforms/fedora.py | 62 ----------- fabfile/platforms/linux.py | 33 ------ fabfile/platforms/ubuntu.py | 5 - fabfile/server_config.py | 141 ------------------------ fabfile/templates/apache_site | 20 ---- fabfile/templates/selinux.config | 10 -- fabfile/templates/settings_local.py | 10 -- fabfile/webservers/__init__.py | 55 --------- fabfile/webservers/apache.py | 50 --------- 24 files changed, 7 insertions(+), 1040 deletions(-) delete mode 100644 contrib/fabfile.tar.gz delete mode 100644 fabfile/__init__.py delete mode 100644 fabfile/conf.py delete mode 100644 fabfile/databases/__init__.py delete mode 100644 fabfile/databases/mysql.py delete mode 100644 fabfile/django/__init__.py delete mode 100644 fabfile/literals.py delete mode 100644 fabfile/mayan_edms/__init__.py delete mode 100644 fabfile/mayan_edms/upgrades/__init__.py delete mode 100644 fabfile/mayan_edms/upgrades/v0_12_2.py delete mode 100644 fabfile/platforms/__init__.py delete mode 100644 fabfile/platforms/debian.py delete mode 100644 fabfile/platforms/fedora.py delete mode 100644 fabfile/platforms/linux.py delete mode 100644 fabfile/platforms/ubuntu.py delete mode 100644 fabfile/server_config.py delete mode 100644 fabfile/templates/apache_site delete mode 100644 fabfile/templates/selinux.config delete mode 100644 fabfile/templates/settings_local.py delete mode 100644 fabfile/webservers/__init__.py delete mode 100644 fabfile/webservers/apache.py diff --git a/README.rst b/README.rst index 7f7538b27b..96d75c79e2 100644 --- a/README.rst +++ b/README.rst @@ -19,27 +19,6 @@ text parsing and OCR capabilities. `Mailing list (via Google Groups)`_ -Quick install -------------- - -To bootstrap **Mayan EDMS** via the fabfile without having to clone -the entire repository, run the following command, replacing the part that -reads: with your current MySQL root password or the MySQL root password -you plan to assign to it, during the MySQL installation when executing the fabfile. - -- Debian or Ubuntu: - - cd /tmp && sudo apt-get install -y fabric wget tar gzip && wget - https://github.com/mayan-edms/mayan-edms/raw/master/contrib/fabfile.tar.gz - -O - \| tar -xvzf - && echo “database\_manager\_admin\_password=” > ~/.fabricrc && fab -H localhost install - -- Fedora: - - cd /tmp && sudo yum install -y fabric wget tar gzip && wget - https://github.com/mayan-edms/mayan-edms/raw/master/contrib/fabfile.tar.gz - -O - \| tar -xvzf - && echo “database\_manager\_admin\_password=” > ~/.fabricrc && fab -H localhost install License ------- diff --git a/contrib/fabfile.tar.gz b/contrib/fabfile.tar.gz deleted file mode 100644 index 14a64eb873247c4b7766a8cb29918dc2d64096ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7855 zcmV;g9#G*QiwFRyE&@>i1MEHhQ`<rw zj4X|f7FqI1GQ{uRzQ6stduF83hp|b3y{lzX72}znp6;3cnop0d(b)BPdyW24E+s(b^PV)!0{os_8q(Axi z_xi&RuRnALAJ`Ey=A*eE&y5OXp0|(RwFa0Oa_7p5Df3OcJLvT>)8>90M3i~bKJJ~j zFmueEAham+Q>S~}`$V9(uI~i5685~^e%(JN;E?l?BeIX%uRE%5nRo_2G0d>~#Bs*6Hc+tTlL7%2i_?g^lRS z3V8`FMcI<*!_$LI~_@{_hyzShin`>faR40`9k zK29^Qhwp#w|NRstWV(p{;Tf29_Eu)iCMpXuIs>eB$UD**kW2D+JzGFhe4eDt<`zeAg&oW$J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- a/docs/intro/installation.rst +++ b/docs/intro/installation.rst @@ -2,82 +2,6 @@ Installation ============ -Automatic install using included fabfile ----------------------------------------- -A Fabric_ file is included to help users not very familiar with Ubuntu_, -Python_ and Django_ install **Mayan EDMS**, or for system administrators -looking to automate the install whether in a local or remote system. - -To bootstrap **Mayan EDMS** via the fabfile without having to clone the -entire repository, run the following command, replacing the part that -reads: with your current MySQL root password -or the MySQL root password you plan to assign to it, during the MySQL -installation when executing the fabfile. - -* Debian or Ubuntu:: - - $ cd /tmp && sudo apt-get install -y fabric wget tar gzip && wget https://github.com/mayan-edms/mayan-edms/raw/master/contrib/fabfile.tar.gz -O - | tar -xvzf - && echo "database_manager_admin_password=" > ~/.fabricrc && fab -H localhost install - -* Fedora:: - - $ cd /tmp && sudo yum install -y fabric wget tar gzip && wget https://github.com/mayan-edms/mayan-edms/raw/master/contrib/fabfile.tar.gz -O - | tar -xvzf - && echo "database_manager_admin_password=" > ~/.fabricrc && fab -H localhost install - - -The ``fabfile`` also supports deploying to more than one server whether -the they same configuration or not, via a ``server_config.json`` file. -The fabfile also supports YAML server configuration -files but requires installing ``pyyaml`` via ``pip``, ``python-yaml`` -via ``apt`` (Debian_, Ubuntu_) or ``PyYAML`` via ``yum`` (Fedora_) - -A sample ``server_config.yaml`` would be as follows:: - - debian_server: - host: 192.168.1.1 - database_manager_admin_password: my_debian_mysql_pa$$word - drop_database: True - os: debian - ubuntu_server: - host: 192.168.1.2 - database_manager_admin_password: my_ubuntu_mysql_pa$$word - drop_database: True - os: ubuntu - database_username: mayan_release_12 - database_name: mayan_release_12 - all_servers: [debian_server, ubuntu_server] - -To install **Mayan EDMS** to these servers the ``fabfile`` should be called in the following manner:: - - $ fab servers:debian_server install - -or:: - - $ fab servers:ubuntu_server,debian_server install - -or:: - - $ fab servers:all_servers install - - -Configuration options for the ``fabfile``: - -* ``host`` Hostname or address of the host to which to install **Mayan EDMS**. Required setting. -* ``os`` Operating system of the target host. Options: ubuntu, debian, fedora. default: ubuntu -* ``install_path`` Installation path. Default: /usr/share -* ``virtualenv_name`` Name of the directory that will house the virtualenv under the ``install_path``. Default: mayan -* ``repository_name`` Name of the directory where the repository will be clone under the ``virtualenv_name`` directory. Default: mayan -* ``database_manager`` Database manager to use. Options: mysql. Default: mysql -* ``database_username`` Username that will be created and used to access the database. Default: mayan -* ``database_password`` Password of the database user account. Default: random autogenerated password -* ``database_host`` Address of the database manager host. Default: 127.0.0.1 -* ``drop_database`` Weather or not to drop the database when uninstalling **Mayan EDMS** via the fabfile. Default: False -* ``database_manager_admin_password`` Administrator password of the database manager, only used to create the **Mayan EDMS** database and user. Required setting. -* ``database_name`` Name of the **Mayan EDMS** database. Default: mayan -* ``webserver`` Web server that will be install and configure to server **Mayan EDMS**. Options: apache. Default: apache - - -Only the options: ``host``, ``os`` and ``database_manager_admin_password`` should be required for most installations. - - Local or managed Ubuntu or Debian server ---------------------------------------- @@ -215,14 +139,6 @@ SaaS provied Appsembler_ has started providing a "1-click install" cloud offering of **Mayan EDMS**. Go to their website and click on apps to start your trial period of **Mayan EDMS** on the cloud. - -DjangoZoom ----------- -For instructions on how to deploy **Mayan EDMS** on DjangoZoom, watch the screencast: - -"Deploying Mayan EDMS on DjangoZoom.net" available on Youtube_ - - Webfaction ---------- @@ -353,5 +269,4 @@ To install **Mayan EDMS** on Webfaction_, follow these steps: .. _virtualenv: http://www.virtualenv.org/en/latest/index.html .. _`Reducing mod_wsgi Memory Consumption`: http://docs.webfaction.com/software/mod-wsgi.html#mod-wsgi-reducing-memory-consumption .. _Fedora: http://fedoraproject.org/ -.. _Fabric: http://docs.fabfile.org/ .. _Appsembler: http://appsembler.com/ diff --git a/docs/releases/1.0.rst b/docs/releases/1.0.rst index 7d60909789..6eb76630a5 100644 --- a/docs/releases/1.0.rst +++ b/docs/releases/1.0.rst @@ -20,10 +20,11 @@ The growth and reach of the project has necessitaded for a while the move of the project to its own organization in Github. This move has finally been done, the new URL of the project is: https://github.com/mayan-edms/mayan-edms -Django 1.4.13 +Django 1.5 ~~~~~~~~~~~~~ -This release updates the required version of Django to 1.4.13, bringing with it -not only new features, but also a lot of security updates. +This release updates the required version of Django to 1.5, bringing with it +not only new features, but also a lot of security updates, a new project +directory structure and new deployment methods. Translation updates ~~~~~~~~~~~~~~~~~~~ @@ -69,6 +70,9 @@ Deletion of detached signatures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Detached signatures can now be deleted, if accidentally added to the wrong document. +Removal of fabric based installations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Upgrading from a previous version ================================= diff --git a/fabfile/__init__.py b/fabfile/__init__.py deleted file mode 100644 index 056e6126e4..0000000000 --- a/fabfile/__init__.py +++ /dev/null @@ -1,72 +0,0 @@ -import sys - -from fabric.api import task, env -from fabric.colors import white - -import databases as database -import platforms as platform -import webservers as webserver -import django -import mayan_edms -from conf import print_supported_configs -from server_config import servers - -print(white('\n\n ######## ', bold=True)) -print(white(' ######## ', bold=True)) -print(white(' ### ### ', bold=True)) -print(white(' ##### ##### ', bold=True)) -print(white(' ############## ', bold=True)) -print(white(' ####### ####### ', bold=True)) -print(white(' ################## ', bold=True)) -print(white(' ######### ######### ', bold=True)) -print(white(' ###################### ', bold=True)) -print(white(' ########### ########### ', bold=True)) -print(white(' ########################## ', bold=True)) -print(white('############# #############', bold=True)) - -print(white('\nMayan EDMS Fabric installation file\n\n', bold=True)) - -print_supported_configs() - - -@task -def install(): - """ - Perform a complete install of Mayan EDMS on a host - """ - platform.install_dependencies() - platform.install_mayan() - platform.install_database_manager() - database.create_database() - database.create_user() - django.database_config() - django.syncdb() - django.collectstatic() - platform.fix_permissions() - platform.install_webserver() - webserver.install_site() - webserver.restart() - platform.post_install() - -''' -# Disabled until properly implemented -@task -def upgrade(): - """ - Perform a Mayan EDMS installation upgrade - """ - mayan_edms.upgrade() -''' - -@task -def uninstall(): - """ - Perform a complete removal of Mayan EDMS from a host - """ - platform.delete_mayan() - webserver.remove_site() - webserver.restart() - - if env.drop_database: - database.drop_database() - database.drop_user() diff --git a/fabfile/conf.py b/fabfile/conf.py deleted file mode 100644 index 16e380234d..0000000000 --- a/fabfile/conf.py +++ /dev/null @@ -1,60 +0,0 @@ -import os -import string -import random - -from fabric.api import env -from fabric.colors import green - -from literals import (DEFAULT_INSTALL_PATH, DEFAULT_VIRTUALENV_NAME, - DEFAULT_REPOSITORY_NAME, DEFAULT_OS, OS_CHOICES, - DEFAULT_DATABASE_MANAGER, DB_CHOICES, DEFAULT_DATABASE_NAME, - DEFAULT_WEBSERVER, WEB_CHOICES, DEFAULT_DATABASE_USERNAME, - DJANGO_DB_DRIVERS, DEFAULT_DATABASE_HOST, DEFAULT_PASSWORD_LENGTH) -from server_config import reduce_env - - -def password_generator(): - # http://snipplr.com/view/63223/python-password-generator/ - chars = string.ascii_letters + string.digits - return ''.join(random.choice(chars) for x in range(DEFAULT_PASSWORD_LENGTH)) - - -@reduce_env -def setup_environment(): - env['os'] = getattr(env, 'os', DEFAULT_OS) - env['os_name'] = OS_CHOICES[env.os] - - env['install_path'] = getattr(env, 'install_path', DEFAULT_INSTALL_PATH[env.os]) - env['virtualenv_name'] = getattr(env, 'virtualenv_name', DEFAULT_VIRTUALENV_NAME[env.os]) - env['repository_name'] = getattr(env, 'repository_name', DEFAULT_REPOSITORY_NAME[env.os]) - env['virtualenv_path'] = os.path.join(env.install_path, env.virtualenv_name) - env['repository_path'] = os.path.join(env.virtualenv_path, env.repository_name) - - env['database_manager'] = getattr(env, 'database_manager', DEFAULT_DATABASE_MANAGER) - env['database_manager_name'] = DB_CHOICES[env.database_manager] - env['database_username'] = getattr(env, 'database_username', DEFAULT_DATABASE_USERNAME) - env['database_password'] = getattr(env, 'database_password', password_generator()) - env['database_host'] = getattr(env, 'database_host', DEFAULT_DATABASE_HOST) - env['drop_database'] = getattr(env, 'drop_database', False) - - if not getattr(env, 'database_manager_admin_password', None): - print('Must set the database_manager_admin_password entry in the fabric settings file (~/.fabricrc by default)') - exit(1) - - env['database_name'] = getattr(env, 'database_name', DEFAULT_DATABASE_NAME) - - env['webserver'] = getattr(env, 'webserver', DEFAULT_WEBSERVER) - env['webserver_name'] = WEB_CHOICES[env.webserver] - - env['django_database_driver'] = DJANGO_DB_DRIVERS[env.database_manager] - - -def print_supported_configs(): - print('Supported operating systems (os=): %s, default=\'%s\'' % (dict(OS_CHOICES).keys(), green(DEFAULT_OS))) - print('Supported database managers (database_manager=): %s, default=\'%s\'' % (dict(DB_CHOICES).keys(), green(DEFAULT_DATABASE_MANAGER))) - print('Supported webservers (webserver=): %s, default=\'%s\'' % (dict(WEB_CHOICES).keys(), green(DEFAULT_WEBSERVER))) - print('\n') - - - - diff --git a/fabfile/databases/__init__.py b/fabfile/databases/__init__.py deleted file mode 100644 index a9a319dfba..0000000000 --- a/fabfile/databases/__init__.py +++ /dev/null @@ -1,54 +0,0 @@ -from fabric.api import env, task -from fabric.colors import green - -from ..conf import setup_environment -from ..literals import DB_MYSQL -import mysql - - -@task -def create_database(): - """ - Create the Mayan EDMS database - """ - setup_environment() - print(green('Creating Mayan EDMS database', bold=True)) - - if env.database_manager == DB_MYSQL: - mysql.create_database() - - -@task -def create_user(): - """ - Create the Mayan EDMS user - """ - setup_environment() - print(green('Creating Mayan EDMS user', bold=True)) - - if env.database_manager == DB_MYSQL: - mysql.create_user() - - -@task -def drop_database(): - """ - Drop Mayan EDMS's database - """ - setup_environment() - print(green('Droping Mayan EDMS database', bold=True)) - - if env.database_manager == DB_MYSQL: - mysql.drop_database() - - -@task -def drop_user(): - """ - Drop Mayan EDMS's user - """ - setup_environment() - print(green('Droping Mayan EDMS user', bold=True)) - - if env.database_manager == DB_MYSQL: - mysql.drop_user() diff --git a/fabfile/databases/mysql.py b/fabfile/databases/mysql.py deleted file mode 100644 index 8c9cf90260..0000000000 --- a/fabfile/databases/mysql.py +++ /dev/null @@ -1,36 +0,0 @@ -from fabric.api import run, env, task, settings -from fabric.colors import green - - -def create_database(): - """ - Create the MySQL Mayan EDMS database - """ - run('echo "CREATE DATABASE %(database_name)s;" | mysql -u root --password=%(database_manager_admin_password)s' % env) - - -def create_user(): - """ - Create the MySQL Mayan EDMS user - """ - run('echo "CREATE USER \'%(database_username)s\'@\'%(database_host)s\' IDENTIFIED BY \'%(database_password)s\';" | mysql -u root --password=%(database_manager_admin_password)s' % env) - run('echo "GRANT ALL PRIVILEGES ON %(database_name)s.* TO \'%(database_username)s\'@\'%(database_host)s\' WITH GRANT OPTION;" | mysql -u root --password=%(database_manager_admin_password)s' % env) - - print(green('Password used for Mayan EDMS database account: %s' % env.database_password, bold=True)) - - -def drop_database(): - """ - Drop MySQL's Mayan EDMS's database - """ - with settings(warn_only=True): - run('echo "DROP DATABASE %(database_name)s;" | mysql -u root --password=%(database_manager_admin_password)s' % env) - - -def drop_user(): - """ - Drop MySQL's Mayan EDMS's user - """ - with settings(warn_only=True): - run('echo "DROP USER \'%(database_username)s\'@\'%(database_host)s\';" | mysql -u root --password=%(database_manager_admin_password)s' % env) - diff --git a/fabfile/django/__init__.py b/fabfile/django/__init__.py deleted file mode 100644 index 9ce0309435..0000000000 --- a/fabfile/django/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -import os - -from fabric.api import env, task, cd, sudo -from fabric.contrib.files import upload_template - -from ..conf import setup_environment - - -@task -def syncdb(): - """ - Perform Django's syncdb command - """ - setup_environment() - with cd(env.virtualenv_path): - sudo('source bin/activate; %(repository_name)s/manage.py syncdb --noinput; %(repository_name)s/manage.py migrate' % (env)) - -@task -def database_config(): - """ - Create a settings_local.py file tailored to the database manager selected - """ - setup_environment() - upload_template(filename=os.path.join('fabfile', 'templates', 'settings_local.py'), destination=env.repository_path, context=env, use_sudo=True) - - -@task -def collectstatic(): - """ - Perform Django's collectstatic command - """ - setup_environment() - with cd(env.virtualenv_path): - sudo('source bin/activate; %(repository_name)s/manage.py collectstatic --noinput' % (env)) diff --git a/fabfile/literals.py b/fabfile/literals.py deleted file mode 100644 index 55e8e8899b..0000000000 --- a/fabfile/literals.py +++ /dev/null @@ -1,72 +0,0 @@ -OS_UBUNTU = 'ubuntu' -OS_REDHAT = 'redhat' -OS_CENTOS = 'centos' -OS_FEDORA = 'fedora' -OS_WINDOWS = 'windows' -OS_FREEBSD = 'freebds' -OS_DEBIAN = 'debian' - -OS_CHOICES = { - OS_UBUNTU: 'Ubuntu', - OS_FEDORA: 'Fedora', - OS_DEBIAN: 'Debian', - #OS_REDHAT: 'RedHat', - #OS_CENTOS: 'CentOS', - #OS_WINDOWS: 'MS Windows', - #OS_FREEBSD: 'FreeBSD', -} - -DEFAULT_INSTALL_PATH = { - OS_UBUNTU: '/usr/share', - OS_FEDORA: '/usr/share', - OS_DEBIAN: '/usr/share', -} - -DEFAULT_VIRTUALENV_NAME = { - OS_UBUNTU: 'mayan', - OS_FEDORA: 'mayan', - OS_DEBIAN: 'mayan', -} - -DEFAULT_REPOSITORY_NAME = { - OS_UBUNTU: 'mayan', - OS_FEDORA: 'mayan', - OS_DEBIAN: 'mayan', -} - -DB_MYSQL = 'mysql' -DB_PGSQL = 'pgsql' -DB_SQLITE = 'sqlite' -DB_ORACLE = 'oracle' - -DB_CHOICES = { - DB_MYSQL: 'MySQL', - #DB_PGSQL: 'PostgreSQL', - #DB_SQLITE: 'SQLite', - #DB_ORACLE: 'ORACLE' -} - -DJANGO_DB_DRIVERS = { - DB_MYSQL: 'mysql', - DB_PGSQL: 'postgresql_psycopg2', - DB_SQLITE: 'sqlite3', - DB_ORACLE: 'oracle', -} - -WEB_APACHE = 'apache' -WEB_NGINX = 'nginx' - -WEB_CHOICES = { - WEB_APACHE: 'Apache', - #WEB_NGINX: 'Nginx', -} - -DEFAULT_OS = OS_UBUNTU -DEFAULT_DATABASE_MANAGER = DB_MYSQL -DEFAULT_DATABASE_NAME = 'mayan' -DEFAULT_WEBSERVER = WEB_APACHE -DEFAULT_DATABASE_USERNAME = 'mayan' -DEFAULT_DATABASE_HOST = '127.0.0.1' -DEFAULT_PASSWORD_LENGTH = 10 - -FABFILE_MARKER = 'fabfile_install' diff --git a/fabfile/mayan_edms/__init__.py b/fabfile/mayan_edms/__init__.py deleted file mode 100644 index a2d36150e4..0000000000 --- a/fabfile/mayan_edms/__init__.py +++ /dev/null @@ -1,50 +0,0 @@ -from distutils.version import LooseVersion -import importlib - -from fabric.api import env, task, cd, sudo, settings -from fabric.colors import green, red - -from ..conf import setup_environment - - -@task -def upgrade(): - """ - Upgrade a Mayan EDMS installation, but doing incremental upgrades - """ - setup_environment() - print(green('Upgrading Mayan EDMS database', bold=True)) - - with settings(warn_only=True): - with cd(env.virtualenv_path): - version = sudo('source bin/activate; python -c "import os;os.environ[\'DJANGO_SETTINGS_MODULE\']=\'mayan.settings\';from django.core.management import setup_environ;import settings;setup_environ(settings);import main;print main.__version__"') - - if version.failed: - print(red('Unable to determined the current version.', bold=True)) - exit() - - current_verision = 'v%s' % version - print(green('Current version: %s' % version, bold=True)) - - with settings(warn_only=True): - with cd(env.repository_name): - tags = sudo('git tag').split('\r\n') - - if tags.failed: - print(red('Upgrading is only support on git based installations.', bold=True)) - exit() - - tags.sort(key=LooseVersion) - - latest_version = tags[-1] - print(green('Latest version: %s' % latest_version, bold=True)) - - upgrade_steps = tags.index(latest_version) - tags.index(current_verision) - if not upgrade_steps: - print(green('Already in the latest version, no need to upgrade.', bold=True)) - exit() - else: - print(green('Upgrade steps needed until latest version: %d' % (), bold=True)) - version_module_name = current_verision.replace('.', '_') - module = importlib.import_module('fabfile.mayan_edms.upgrades.%s' % version_module_name) - module.upgrade() diff --git a/fabfile/mayan_edms/upgrades/__init__.py b/fabfile/mayan_edms/upgrades/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fabfile/mayan_edms/upgrades/v0_12_2.py b/fabfile/mayan_edms/upgrades/v0_12_2.py deleted file mode 100644 index b6586f1c3d..0000000000 --- a/fabfile/mayan_edms/upgrades/v0_12_2.py +++ /dev/null @@ -1,14 +0,0 @@ -from fabric.api import env, task, cd, sudo, settings -from fabric.colors import green, red - -from ..conf import setup_environment - - -@task -def upgrade(): - """ - Upgrade a Mayan EDMS installation from version v0.12.2 to v0.12.3 - """ - setup_environment() - print(green('Upgrading Mayan EDMS database from version 0.12.2 to 0.12.3', bold=True)) - #TODO: upgrade steps diff --git a/fabfile/platforms/__init__.py b/fabfile/platforms/__init__.py deleted file mode 100644 index 971d2c480c..0000000000 --- a/fabfile/platforms/__init__.py +++ /dev/null @@ -1,103 +0,0 @@ -from fabric.api import run, sudo, cd, env, task -from fabric.colors import green - -from ..literals import OS_UBUNTU, OS_FEDORA, OS_DEBIAN -from ..conf import setup_environment -import linux, ubuntu, fedora, debian - - -@task -def install_dependencies(): - """ - Install OS dependencies - """ - setup_environment() - print(green('Installing dependencies for %s' % env.os_name, bold=True)) - - if env.os in [OS_UBUNTU, OS_DEBIAN]: - debian.install_dependencies() - elif env.os == OS_FEDORA: - fedora.install_dependencies() - - -@task -def install_mayan(): - """ - Install Mayan EDMS - """ - setup_environment() - print(green('Installing Mayan EDMS from git repository', bold=True)) - - if env.os in [OS_UBUNTU, OS_FEDORA, OS_DEBIAN]: - linux.install_mayan() - - -@task -def install_database_manager(): - """ - Install the selected database manager - """ - setup_environment() - print(green('Installing database manager: %s' % env.database_manager_name, bold=True)) - - if env.os in [OS_UBUNTU, OS_DEBIAN]: - debian.install_database_manager() - elif env.os == OS_FEDORA: - fedora.install_database_manager() - - -@task -def fix_permissions(): - """ - Fix installation files' permissions - """ - setup_environment() - print(green('Fixing installation files\' permissions', bold=True)) - - if env.os in [OS_UBUNTU, OS_DEBIAN]: - debian.fix_permissions() - elif env.os == OS_FEDORA: - fedora.fix_permissions() - - -@task -def install_webserver(): - """ - Installing the OS packages for the webserver - """ - setup_environment() - print(green('Installing webserver: %s' % env.webserver_name, bold=True)) - - if env.os in [OS_UBUNTU, OS_DEBIAN]: - debian.install_webserver() - elif env.os == OS_FEDORA: - fedora.install_webserver() - - -@task -def delete_mayan(): - """ - Delete Mayan EDMS from the OS - """ - setup_environment() - print(green('Deleting Mayan EDMS files', bold=True)) - - if env.os in [OS_UBUNTU, OS_FEDORA, OS_DEBIAN]: - linux.delete_mayan() - - -@task -def post_install(): - """ - Perform post install operations - """ - setup_environment() - if env.os == OS_UBUNTU: - ubuntu.post_install() - linux.post_install() - elif env.os == OS_FEDORA: - fedora.post_install() - linux.post_install() - elif env.os == OS_DEBIAN: - debian.post_install() - linux.post_install() diff --git a/fabfile/platforms/debian.py b/fabfile/platforms/debian.py deleted file mode 100644 index 64df1bc608..0000000000 --- a/fabfile/platforms/debian.py +++ /dev/null @@ -1,50 +0,0 @@ -from fabric.api import run, sudo, cd, env, task, settings - -from ..literals import DB_MYSQL, WEB_APACHE - - -def install_dependencies(): - """ - Install Debian dependencies - """ - sudo('apt-get install -y git-core gcc tesseract-ocr unpaper python-virtualenv ghostscript libjpeg-dev libpng-dev poppler-utils python-dev') - - -def install_database_manager(): - """ - Install the database manager on an Ubuntu system - """ - - if env.database_manager == DB_MYSQL: - sudo('apt-get install -y mysql-server libmysqlclient-dev') - - with cd(env.virtualenv_path): - sudo('source bin/activate; pip install MySQL-python') - - -def install_webserver(): - """ - Installing the Debian packages for the webserver - """ - - if env.webserver == WEB_APACHE: - sudo('apt-get install -y apache2 libapache2-mod-wsgi') - - with settings(warn_only=True): - # Get rid of Apache's default site - sudo('a2dissite default') - - -def fix_permissions(): - """ - Fix installation files' permissions on a Debian system - """ - sudo('chmod 770 %s -R' % env.virtualenv_path) - sudo('chgrp www-data %s -R' % env.virtualenv_path) - - -def post_install(): - """ - Post install operations on a Debian system - """ - pass diff --git a/fabfile/platforms/fedora.py b/fabfile/platforms/fedora.py deleted file mode 100644 index 4bc8bdd3fb..0000000000 --- a/fabfile/platforms/fedora.py +++ /dev/null @@ -1,62 +0,0 @@ -import os - -from fabric.api import run, sudo, cd, env, task, settings -from fabric.operations import put, reboot - -from ..literals import DB_MYSQL, WEB_APACHE - - -def install_dependencies(): - """ - Install Fedora dependencies - """ - sudo('yum install -y git gcc tesseract unpaper python-virtualenv ghostscript libjpeg-turbo-devel libpng-devel poppler-utils') - - -def install_database_manager(): - """ - Install the database manager on a Fedora system - """ - - if env.database_manager == DB_MYSQL: - sudo('yum install -y mysql-server mysql-devel') - sudo('systemctl enable mysqld.service') - sudo('systemctl start mysqld.service') - sudo('mysql_secure_installation') - - with cd(env.virtualenv_path): - sudo('source bin/activate; pip install MySQL-python') - - -def install_webserver(): - """ - Installing the Fedora packages for the webserver - """ - - if env.webserver == WEB_APACHE: - sudo('yum install -y httpd mod_wsgi') - sudo('systemctl enable httpd.service') - sudo('systemctl start httpd.service') - - with settings(warn_only=True): - # Get rid of Apache's default site - sudo('rm /etc/httpd/conf.d/welcome.conf') - - # Disable SELinux as it blocks mod_wsgi's file access - # TODO: implement a proper solution is implemented - put(local_path=os.path.join('fabfile', 'templates', 'selinux.config'), remote_path='/etc/selinux/config', use_sudo=True) - - -def fix_permissions(): - """ - Fix installation files' permissions on a Fedora system - """ - sudo('chmod 770 %s -R' % env.virtualenv_path) - sudo('chgrp apache %s -R' % env.virtualenv_path) - - -def post_install(): - """ - Post install operations on a Fedora system - """ - reboot() diff --git a/fabfile/platforms/linux.py b/fabfile/platforms/linux.py deleted file mode 100644 index 0b9f82bf81..0000000000 --- a/fabfile/platforms/linux.py +++ /dev/null @@ -1,33 +0,0 @@ -import os - -from fabric.api import run, sudo, cd, env, task, settings - -from ..literals import FABFILE_MARKER - - -def delete_mayan(): - """ - Delete Mayan EDMS files from an Linux system - """ - sudo('rm %(virtualenv_path)s -Rf' % env) - - -def install_mayan(): - """ - Install Mayan EDMS on an Linux system - """ - with cd(env.install_path): - sudo('virtualenv --no-site-packages %(virtualenv_name)s' % env) - - with cd(env.virtualenv_path): - sudo('git clone git://github.com/rosarior/mayan.git %(repository_name)s' % env) - sudo('source bin/activate; pip install --upgrade distribute') - sudo('source bin/activate; pip install -r %(repository_name)s/requirements/production.txt' % env) - - -def post_install(): - """ - Post install process on a Linux systems - """ - fabfile_marker = os.path.join(env.repository_path, FABFILE_MARKER) - sudo('touch %s' % fabfile_marker) diff --git a/fabfile/platforms/ubuntu.py b/fabfile/platforms/ubuntu.py deleted file mode 100644 index 501785f545..0000000000 --- a/fabfile/platforms/ubuntu.py +++ /dev/null @@ -1,5 +0,0 @@ -def post_install(): - """ - Post install operations on an Ubuntu system - """ - pass diff --git a/fabfile/server_config.py b/fabfile/server_config.py deleted file mode 100644 index 29228e4a74..0000000000 --- a/fabfile/server_config.py +++ /dev/null @@ -1,141 +0,0 @@ -"""Fabric server config management fabfile. -If you need additional configuration, setup ~/.fabricrc file: - - user = your_remote_server_username - -To get specific command help type: - fab -d command_name - -""" -# From http://fueledbylemons.com/blog/2011/04/09/server-configs-and-fabric/ - - -import os - -from fabric.api import env, task -from fabric.utils import puts -from fabric import colors -import fabric.network -import fabric.state - - -YAML_AVAILABLE = True -try: - import yaml -except ImportError: - YAML_AVAILABLE = False - - -JSON_AVAILABLE = True -try: - import simplejson as json -except ImportError: - try: - import json - except ImportError: - JSON_AVAILABLE = False - -################################ -# ENVIRONMENTS # -################################ - -def _load_config(**kwargs): - """Find and parse server config file. - - If `config` keyword argument wasn't set look for default - 'server_config.yaml' or 'server_config.json' file. - - """ - config, ext = os.path.splitext(kwargs.get('config', - 'server_config.yaml' if os.path.exists('server_config.yaml') else 'server_config.json')) - - if not os.path.exists(config + ext): - print colors.red('Error. "%s" file not found.' % (config + ext)) - return {} - if YAML_AVAILABLE and ext == '.yaml': - loader = yaml - elif JSON_AVAILABLE and ext =='.json': - loader = json - else: - print colors.red('Parser package not available') - return {} - # Open file and deserialize settings. - with open(config + ext) as config_file: - return loader.load(config_file) - -@task -def servers(*args, **kwargs): - """Set destination servers or server groups by comma delimited list of names""" - # Load config - servers = _load_config(**kwargs) - # If no arguments were recieved, print a message with a list of available configs. - if not args: - print 'No server name given. Available configs:' - for key in servers: - print colors.green('\t%s' % key) - - # Create `group` - a dictionary, containing copies of configs for selected servers. Server hosts - # are used as dictionary keys, which allows us to connect current command destination host with - # the correct config. This is important, because somewhere along the way fabric messes up the - # hosts order, so simple list index incrementation won't suffice. - env.group = {} - # For each given server name - for name in args: - # Recursive function call to retrieve all server records. If `name` is a group(e.g. `all`) - # - get it's members, iterate through them and create `group` - # record. Else, get fields from `name` server record. - # If requested server is not in the settings dictionary output error message and list all - # available servers. - _build_group(name, servers) - - - # Copy server hosts from `env.group` keys - this gives us a complete list of unique hosts to - # operate on. No host is added twice, so we can safely add overlaping groups. Each added host is - # guaranteed to have a config record in `env.group`. - env.hosts = env.group.keys() - -def _build_group(name, servers): - """Recursively walk through servers dictionary and search for all server records.""" - # We're going to reference server a lot, so we'd better store it. - server = servers.get(name, None) - # If `name` exists in servers dictionary we - if server: - # check whether it's a group by looking for `members` - if isinstance(server, list): - if fabric.state.output['debug']: - puts("%s is a group, getting members" % name) - for item in server: - # and call this function for each of them. - _build_group(item, servers) - # When, finally, we dig through to the standalone server records, we retrieve - # configs and store them in `env.group` - else: - if fabric.state.output['debug']: - puts("%s is a server, filling up env.group" % name) - env.group[server['host']] = server - else: - print colors.red('Error. "%s" config not found. Run `fab servers` to list all available configs' % name) - -def reduce_env(task): - """ - Copies server config settings from `env.group` dictionary to env variable. - - This way, tasks have easier access to server-specific variables: - `env.owner` instead of `env.group[env.host]['owner']` - - """ - def task_with_setup(*args, **kwargs): - # If `s:server` was run before the current command - then we should copy values to - # `env`. Otherwise, hosts were passed through command line with `fab -H host1,host2 - # command` and we skip. - if env.get("group", None): - for key,val in env.group[env.host].items(): - setattr(env, key, val) - if fabric.state.output['debug']: - puts("[env] %s : %s" % (key, val)) - - task(*args, **kwargs) - # Don't keep host connections open, disconnect from each host after each task. - # Function will be available in fabric 1.0 release. - # fabric.network.disconnect_all() - return task_with_setup diff --git a/fabfile/templates/apache_site b/fabfile/templates/apache_site deleted file mode 100644 index 6df729225e..0000000000 --- a/fabfile/templates/apache_site +++ /dev/null @@ -1,20 +0,0 @@ - - # Uncomment if libapache2-mod-xsendfile is installed - # XSendFile On - # XSendFileAllowAbove On - - WSGIScriptAlias / %(repository_path)s/wsgi/dispatch.wsgi - - - Order deny,allow - Allow from all - - #ErrorLog /var/log/apache2/mayan_error.log - LogLevel warn - #CustomLog /var/log/apache2/mayan_access.log combined - - Alias /mayan-static "%(repository_path)s/static/" - - SetHandler None - - diff --git a/fabfile/templates/selinux.config b/fabfile/templates/selinux.config deleted file mode 100644 index 2f8cc2e2c4..0000000000 --- a/fabfile/templates/selinux.config +++ /dev/null @@ -1,10 +0,0 @@ -# This file controls the state of SELinux on the system. -# SELINUX= can take one of these three values: -# enforcing - SELinux security policy is enforced. -# permissive - SELinux prints warnings instead of enforcing. -# disabled - No SELinux policy is loaded. -SELINUX=disabled -# SELINUXTYPE= can take one of these two values: -# targeted - Only targeted network daemons are protected. -# strict - Full SELinux protection. -SELINUXTYPE=targeted diff --git a/fabfile/templates/settings_local.py b/fabfile/templates/settings_local.py deleted file mode 100644 index 633f25e6c8..0000000000 --- a/fabfile/templates/settings_local.py +++ /dev/null @@ -1,10 +0,0 @@ -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.%(django_database_driver)s', - 'NAME': '%(database_name)s', - 'USER': '%(database_username)s', - 'PASSWORD': '%(database_password)s', - 'HOST': '%(database_host)s', - 'PORT': '', - } -} diff --git a/fabfile/webservers/__init__.py b/fabfile/webservers/__init__.py deleted file mode 100644 index d6084a6fbe..0000000000 --- a/fabfile/webservers/__init__.py +++ /dev/null @@ -1,55 +0,0 @@ -from fabric.api import run, sudo, cd, env, task -from fabric.colors import green - -from ..conf import setup_environment -from ..literals import WEB_APACHE - -import apache - - -@task -def install_site(): - """ - Install Mayan EDMS site in the webserver configuration files - """ - setup_environment() - print(green('Adding Mayan EDMS\'s site files to: %s' % env.webserver_name, bold=True)) - - if env.webserver == WEB_APACHE: - apache.install_site() - - -@task -def remove_site(): - """ - Install Mayan EDMS's site file from the webserver's configuration - """ - setup_environment() - print(green('Removing Mayan EDMS\'s site file from %s configuration' % env.webserver_name, bold=True)) - - if env.webserver == WEB_APACHE: - apache.remove_site() - - -@task -def restart(): - """ - Restart the webserver - """ - setup_environment() - print(green('Restarting the web server: %s' % env.webserver_name, bold=True)) - - if env.webserver == WEB_APACHE: - apache.restart() - - -@task -def reload(): - """ - Reload webserver configuration files - """ - setup_environment() - print(green('Reloading the web server configuration files', bold=True)) - - if env.webserver == WEB_APACHE: - apache.reload() diff --git a/fabfile/webservers/apache.py b/fabfile/webservers/apache.py deleted file mode 100644 index 39c93f00a3..0000000000 --- a/fabfile/webservers/apache.py +++ /dev/null @@ -1,50 +0,0 @@ -import os - -from fabric.api import run, sudo, cd, env, task, settings -from fabric.contrib.files import upload_template - -from ..literals import OS_UBUNTU, OS_FEDORA, OS_DEBIAN - - -def install_site(): - """ - Install Mayan EDMS's site file in Apache configuration - """ - # TODO: configurable site name - if env.os in [OS_UBUNTU, OS_DEBIAN]: - upload_template(filename=os.path.join('fabfile', 'templates', 'apache_site'), destination='/etc/apache2/sites-available/mayan.conf', context=env, use_sudo=True) - sudo('a2ensite mayan') - elif env.os == OS_FEDORA: - upload_template(filename=os.path.join('fabfile', 'templates', 'apache_site'), destination='/etc/httpd/conf.d/mayan.conf', context=env, use_sudo=True) - - -def remove_site(): - """ - Install Mayan EDMS's site file from Apache's configuration - """ - if env.os in [OS_UBUNTU, OS_DEBIAN]: - with settings(warn_only=True): - sudo('a2dissite mayan') - elif env.os == OS_FEDORA: - with settings(warn_only=True): - sudo('rm /etc/httpd/conf.d/mayan.conf') - - -def restart(): - """ - Restart Apache - """ - if env.os in [OS_UBUNTU, OS_DEBIAN]: - sudo('/etc/init.d/apache2 restart') - elif env.os == OS_FEDORA: - sudo('systemctl restart httpd.service') - - -def reload(): - """ - Reload Apache configuration files - """ - if env.os in [OS_UBUNTU, OS_DEBIAN]: - sudo('/etc/init.d/apache2 reload') - elif env.os == OS_FEDORA: - sudo('systemctl reload httpd.service')