From 61e1884cd56d4e40f7b36fa9dc00d3b0217d1405 Mon Sep 17 00:00:00 2001 From: Yannick Buron Date: Wed, 18 Feb 2015 17:43:39 +0000 Subject: [PATCH] Rename all submodules to clouder --- README.md | 21 --- .../__init__.py | 0 .../__openerp__.py | 8 +- {saas_ldap => clouder_template_bind}/base.py | 10 +- .../clouder_bind_data.xml | 12 +- .../__init__.py | 0 .../__openerp__.py | 8 +- .../clouder_cas_data.xml | 14 +- {saas_cas => clouder_template_cas}/deploy.py | 18 +-- .../res/ldap.ldif | 0 .../__init__.py | 0 clouder_template_docker/__openerp__.py | 37 ++++++ .../clouder_docker_data.xml | 16 +-- .../docker.py | 16 +-- .../__init__.py | 0 clouder_template_drupal/__openerp__.py | 37 ++++++ .../base.py | 8 +- .../build.py | 20 +-- .../clouder_drupal_data.xml | 60 ++++----- .../deploy.py | 78 ++++++------ .../purge.py | 18 +-- .../res/apache-sslonly.config | 0 .../res/apache.config | 0 .../res/nginx.config | 0 .../res/openerp.config | 0 .../res/openerp.init | 0 .../res/patch/dev_zen_rebuild_registry.patch | 0 .../res/patch/revisioning_postgres.patch | 0 .../res/proxy-sslonly.config | 0 .../res/proxy.config | 0 .../res/wikicompare.script | 0 .../__init__.py | 0 .../__openerp__.py | 6 +- {saas_git => clouder_template_git}/build.py | 12 +- .../clouder_git_data.xml | 42 +++--- {saas_git => clouder_template_git}/deploy.py | 18 +-- .../res/proxy-sslonly.config | 0 .../res/proxy.config | 0 .../__init__.py | 0 .../__openerp__.py | 8 +- .../clouder_ldap_data.xml | 24 ++-- .../deploy.py | 18 +-- .../res/ldap.ldif | 0 .../__init__.py | 0 .../__openerp__.py | 8 +- .../clouder_mysql_data.xml | 18 +-- .../deploy.py | 14 +- .../__init__.py | 0 .../__openerp__.py | 18 +-- {saas_odoo => clouder_template_odoo}/base.py | 10 +- {saas_odoo => clouder_template_odoo}/build.py | 14 +- .../clouder_odoo_data.xml | 120 +++++++++--------- .../deploy.py | 70 +++++----- {saas_odoo => clouder_template_odoo}/purge.py | 18 +-- .../res/http.patch | 0 .../res/openerp.config | 0 .../res/openerp.init | 0 .../res/proxy-sslonly.config | 0 .../res/proxy.config | 0 .../__init__.py | 0 clouder_template_piwik/__openerp__.py | 37 ++++++ .../base.py | 10 +- .../build.py | 16 +-- .../clouder_piwik_data.xml | 38 +++--- .../deploy.py | 36 +++--- .../purge.py | 10 +- .../res/nginx.config | 0 .../res/proxy-sslonly.config | 0 .../res/proxy.config | 0 .../__init__.py | 0 clouder_template_postfix/__openerp__.py | 37 ++++++ .../clouder_postfix_data.xml | 20 +-- .../deploy.py | 10 +- .../res/openerp_mailgate.py | 0 .../__init__.py | 0 clouder_template_postgres/__openerp__.py | 37 ++++++ .../clouder_postgres_data.xml | 22 ++-- .../deploy.py | 10 +- .../__init__.py | 0 clouder_template_proxy/__openerp__.py | 37 ++++++ .../base.py | 12 +- .../clouder_proxy_data.xml | 6 +- .../res/apache-sslonly.config | 0 .../res/apache.config | 0 .../__init__.py | 0 clouder_template_seafile/__openerp__.py | 37 ++++++ .../build.py | 12 +- .../clouder_seafile_data.xml | 44 +++---- .../deploy.py | 26 ++-- .../purge.py | 10 +- .../res/apache-sslonly.config | 0 .../res/apache.config | 0 .../res/nginx.config | 0 .../res/openerp.config | 0 .../res/openerp.init | 0 .../res/proxy-sslonly.config | 0 .../res/proxy.config | 0 .../res/wikicompare.script | 0 .../__init__.py | 0 .../__openerp__.py | 8 +- .../base.py | 12 +- .../clouder_shinken_data.xml | 20 +-- .../container.py | 12 +- .../res/base-shinken-nosave.config | 0 .../res/base-shinken.config | 0 .../res/container-shinken-nosave.config | 0 .../res/container-shinken.config | 0 .../res/control_backup.sh | 0 .../res/general-shinken.config | 0 .../res/server-shinken.config | 0 .../__init__.py | 0 .../__openerp__.py | 8 +- .../build.py | 16 +-- .../clouder_wordpress_data.xml | 42 +++--- .../deploy.py | 36 +++--- .../purge.py | 10 +- .../res/nginx.config | 0 .../res/proxy-sslonly.config | 0 .../res/proxy.config | 0 {saas_users => clouder_users}/__init__.py | 0 {saas_users => clouder_users}/__openerp__.py | 6 +- {saas_users => clouder_users}/deploy.py | 12 +- saas_bind/base.py | 55 -------- saas_mysql/__openerp__.py | 37 ------ saas_piwik/__openerp__.py | 37 ------ saas_postfix/__openerp__.py | 37 ------ saas_postgres/__openerp__.py | 37 ------ saas_proxy/__openerp__.py | 37 ------ saas_seafile/__openerp__.py | 37 ------ saas_shinken/__openerp__.py | 37 ------ 130 files changed, 843 insertions(+), 919 deletions(-) delete mode 100644 README.md rename {saas_bind => clouder_template_bind}/__init__.py (100%) rename {saas_bind => clouder_template_bind}/__openerp__.py (91%) rename {saas_ldap => clouder_template_bind}/base.py (89%) rename saas_bind/saas_bind_data.xml => clouder_template_bind/clouder_bind_data.xml (87%) rename {saas_cas => clouder_template_cas}/__init__.py (100%) rename {saas_ldap => clouder_template_cas}/__openerp__.py (91%) rename saas_cas/saas_cas_data.xml => clouder_template_cas/clouder_cas_data.xml (91%) rename {saas_cas => clouder_template_cas}/deploy.py (87%) rename {saas_cas => clouder_template_cas}/res/ldap.ldif (100%) rename {saas_docker => clouder_template_docker}/__init__.py (100%) create mode 100644 clouder_template_docker/__openerp__.py rename saas_docker/saas_docker_data.xml => clouder_template_docker/clouder_docker_data.xml (82%) rename {saas_docker => clouder_template_docker}/docker.py (86%) rename {saas_drupal => clouder_template_drupal}/__init__.py (100%) create mode 100644 clouder_template_drupal/__openerp__.py rename {saas_drupal => clouder_template_drupal}/base.py (91%) rename {saas_drupal => clouder_template_drupal}/build.py (77%) rename saas_drupal/saas_drupal_data.xml => clouder_template_drupal/clouder_drupal_data.xml (80%) rename {saas_drupal => clouder_template_drupal}/deploy.py (80%) rename {saas_drupal => clouder_template_drupal}/purge.py (84%) rename {saas_drupal => clouder_template_drupal}/res/apache-sslonly.config (100%) rename {saas_drupal => clouder_template_drupal}/res/apache.config (100%) rename {saas_drupal => clouder_template_drupal}/res/nginx.config (100%) rename {saas_drupal => clouder_template_drupal}/res/openerp.config (100%) rename {saas_drupal => clouder_template_drupal}/res/openerp.init (100%) rename {saas_drupal => clouder_template_drupal}/res/patch/dev_zen_rebuild_registry.patch (100%) rename {saas_drupal => clouder_template_drupal}/res/patch/revisioning_postgres.patch (100%) rename {saas_drupal => clouder_template_drupal}/res/proxy-sslonly.config (100%) rename {saas_drupal => clouder_template_drupal}/res/proxy.config (100%) rename {saas_drupal => clouder_template_drupal}/res/wikicompare.script (100%) rename {saas_git => clouder_template_git}/__init__.py (100%) rename {saas_git => clouder_template_git}/__openerp__.py (94%) rename {saas_git => clouder_template_git}/build.py (81%) rename saas_git/saas_git_data.xml => clouder_template_git/clouder_git_data.xml (80%) rename {saas_git => clouder_template_git}/deploy.py (89%) rename {saas_git => clouder_template_git}/res/proxy-sslonly.config (100%) rename {saas_git => clouder_template_git}/res/proxy.config (100%) rename {saas_ldap => clouder_template_ldap}/__init__.py (100%) rename {saas_cas => clouder_template_ldap}/__openerp__.py (91%) rename saas_ldap/saas_ldap_data.xml => clouder_template_ldap/clouder_ldap_data.xml (79%) rename {saas_ldap => clouder_template_ldap}/deploy.py (87%) rename {saas_ldap => clouder_template_ldap}/res/ldap.ldif (100%) rename {saas_mysql => clouder_template_mysql}/__init__.py (100%) rename {saas_docker => clouder_template_mysql}/__openerp__.py (91%) rename saas_mysql/saas_mysql_data.xml => clouder_template_mysql/clouder_mysql_data.xml (82%) rename {saas_mysql => clouder_template_mysql}/deploy.py (84%) rename {saas_odoo => clouder_template_odoo}/__init__.py (100%) rename {saas_odoo => clouder_template_odoo}/__openerp__.py (81%) rename {saas_odoo => clouder_template_odoo}/base.py (93%) rename {saas_odoo => clouder_template_odoo}/build.py (86%) rename saas_odoo/saas_odoo_data.xml => clouder_template_odoo/clouder_odoo_data.xml (77%) rename {saas_odoo => clouder_template_odoo}/deploy.py (89%) rename {saas_odoo => clouder_template_odoo}/purge.py (81%) rename {saas_odoo => clouder_template_odoo}/res/http.patch (100%) rename {saas_odoo => clouder_template_odoo}/res/openerp.config (100%) rename {saas_odoo => clouder_template_odoo}/res/openerp.init (100%) rename {saas_odoo => clouder_template_odoo}/res/proxy-sslonly.config (100%) rename {saas_odoo => clouder_template_odoo}/res/proxy.config (100%) rename {saas_piwik => clouder_template_piwik}/__init__.py (100%) create mode 100644 clouder_template_piwik/__openerp__.py rename {saas_piwik => clouder_template_piwik}/base.py (93%) rename {saas_piwik => clouder_template_piwik}/build.py (80%) rename saas_piwik/saas_piwik_data.xml => clouder_template_piwik/clouder_piwik_data.xml (80%) rename {saas_piwik => clouder_template_piwik}/deploy.py (84%) rename {saas_piwik => clouder_template_piwik}/purge.py (86%) rename {saas_piwik => clouder_template_piwik}/res/nginx.config (100%) rename {saas_piwik => clouder_template_piwik}/res/proxy-sslonly.config (100%) rename {saas_piwik => clouder_template_piwik}/res/proxy.config (100%) rename {saas_postfix => clouder_template_postfix}/__init__.py (100%) create mode 100644 clouder_template_postfix/__openerp__.py rename saas_postfix/saas_postfix_data.xml => clouder_template_postfix/clouder_postfix_data.xml (85%) rename {saas_postfix => clouder_template_postfix}/deploy.py (89%) rename {saas_postfix => clouder_template_postfix}/res/openerp_mailgate.py (100%) rename {saas_postgres => clouder_template_postgres}/__init__.py (100%) mode change 100755 => 100644 create mode 100644 clouder_template_postgres/__openerp__.py rename saas_postgres/saas_postgres_data.xml => clouder_template_postgres/clouder_postgres_data.xml (80%) mode change 100755 => 100644 rename {saas_postgres => clouder_template_postgres}/deploy.py (86%) rename {saas_proxy => clouder_template_proxy}/__init__.py (100%) create mode 100644 clouder_template_proxy/__openerp__.py rename {saas_proxy => clouder_template_proxy}/base.py (92%) rename saas_proxy/saas_proxy_data.xml => clouder_template_proxy/clouder_proxy_data.xml (84%) rename {saas_proxy => clouder_template_proxy}/res/apache-sslonly.config (100%) rename {saas_proxy => clouder_template_proxy}/res/apache.config (100%) rename {saas_seafile => clouder_template_seafile}/__init__.py (100%) create mode 100644 clouder_template_seafile/__openerp__.py rename {saas_seafile => clouder_template_seafile}/build.py (84%) rename saas_seafile/saas_seafile_data.xml => clouder_template_seafile/clouder_seafile_data.xml (78%) rename {saas_seafile => clouder_template_seafile}/deploy.py (85%) rename {saas_seafile => clouder_template_seafile}/purge.py (88%) rename {saas_seafile => clouder_template_seafile}/res/apache-sslonly.config (100%) rename {saas_seafile => clouder_template_seafile}/res/apache.config (100%) rename {saas_seafile => clouder_template_seafile}/res/nginx.config (100%) rename {saas_seafile => clouder_template_seafile}/res/openerp.config (100%) rename {saas_seafile => clouder_template_seafile}/res/openerp.init (100%) rename {saas_seafile => clouder_template_seafile}/res/proxy-sslonly.config (100%) rename {saas_seafile => clouder_template_seafile}/res/proxy.config (100%) rename {saas_seafile => clouder_template_seafile}/res/wikicompare.script (100%) rename {saas_shinken => clouder_template_shinken}/__init__.py (100%) rename {saas_drupal => clouder_template_shinken}/__openerp__.py (89%) rename {saas_shinken => clouder_template_shinken}/base.py (87%) rename saas_shinken/saas_shinken_data.xml => clouder_template_shinken/clouder_shinken_data.xml (80%) rename {saas_shinken => clouder_template_shinken}/container.py (86%) rename {saas_shinken => clouder_template_shinken}/res/base-shinken-nosave.config (100%) rename {saas_shinken => clouder_template_shinken}/res/base-shinken.config (100%) rename {saas_shinken => clouder_template_shinken}/res/container-shinken-nosave.config (100%) rename {saas_shinken => clouder_template_shinken}/res/container-shinken.config (100%) rename {saas_shinken => clouder_template_shinken}/res/control_backup.sh (100%) rename {saas_shinken => clouder_template_shinken}/res/general-shinken.config (100%) rename {saas_shinken => clouder_template_shinken}/res/server-shinken.config (100%) rename {saas_wordpress => clouder_template_wordpress}/__init__.py (100%) rename {saas_wordpress => clouder_template_wordpress}/__openerp__.py (90%) rename {saas_wordpress => clouder_template_wordpress}/build.py (80%) rename saas_wordpress/saas_wordpress_data.xml => clouder_template_wordpress/clouder_wordpress_data.xml (78%) rename {saas_wordpress => clouder_template_wordpress}/deploy.py (84%) rename {saas_wordpress => clouder_template_wordpress}/purge.py (86%) rename {saas_wordpress => clouder_template_wordpress}/res/nginx.config (100%) rename {saas_wordpress => clouder_template_wordpress}/res/proxy-sslonly.config (100%) rename {saas_wordpress => clouder_template_wordpress}/res/proxy.config (100%) rename {saas_users => clouder_users}/__init__.py (100%) rename {saas_users => clouder_users}/__openerp__.py (91%) rename {saas_users => clouder_users}/deploy.py (86%) delete mode 100644 saas_bind/base.py delete mode 100644 saas_mysql/__openerp__.py delete mode 100644 saas_piwik/__openerp__.py delete mode 100644 saas_postfix/__openerp__.py delete mode 100755 saas_postgres/__openerp__.py delete mode 100644 saas_proxy/__openerp__.py delete mode 100644 saas_seafile/__openerp__.py delete mode 100644 saas_shinken/__openerp__.py diff --git a/README.md b/README.md deleted file mode 100644 index e1b2f6c..0000000 --- a/README.md +++ /dev/null @@ -1,21 +0,0 @@ -SaaS -==== - -Use Odoo as an orchestrator to host any kind of application. Based on docker. - -Installation : - --Install an OpenERP 7 on one physical server, and install the saas modules on it. I'll call orchestrator the system user running the OpenERP server. - --Install on the physical machine which will run the container the package docker.io (I use the deb http://get.docker.io/ubuntu docker main repo) - --Add the ssh key of orchestrator system user to the authorized_keys of the root user of the machine for containers - --On the OpenERP, add the server, generate images and start create the subcomponent container for shinken/bind/backup/proxy. - --Then, start creating your own applications and deploy them through the base menu - - -Help for documentation are more than welcome, you can contact me by mail if you need help for the using/installation. - -Join https://launchpad.net/~odoo-vertical-hosting mailing-list for discussions regarding the project. diff --git a/saas_bind/__init__.py b/clouder_template_bind/__init__.py similarity index 100% rename from saas_bind/__init__.py rename to clouder_template_bind/__init__.py diff --git a/saas_bind/__openerp__.py b/clouder_template_bind/__openerp__.py similarity index 91% rename from saas_bind/__openerp__.py rename to clouder_template_bind/__openerp__.py index a71e90b..fc5aeaf 100644 --- a/saas_bind/__openerp__.py +++ b/clouder_template_bind/__openerp__.py @@ -20,18 +20,18 @@ ############################################################################## { - 'name': 'SaaS Bind', + 'name': 'Clouder Bind', 'version': '1.0', 'category': 'Community', - 'depends': ['saas'], + 'depends': ['clouder'], 'author': 'Yannick Buron', 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ - SaaS Bind + Clouder Bind """, 'demo': [], - 'data': ['saas_bind_data.xml'], + 'data': ['clouder_bind_data.xml'], 'installable': True, 'application': True, } diff --git a/saas_ldap/base.py b/clouder_template_bind/base.py similarity index 89% rename from saas_ldap/base.py rename to clouder_template_bind/base.py index 17aa138..bec6ef8 100644 --- a/saas_ldap/base.py +++ b/clouder_template_bind/base.py @@ -25,17 +25,17 @@ from openerp.osv import fields, osv, orm from openerp.tools.translate import _ -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_base_link(osv.osv): - _inherit = 'saas.base.link' +class clouder_base_link(osv.osv): + _inherit = 'clouder.base.link' def deploy_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).deploy_link(cr, uid, vals, context=context) + super(clouder_base_link, self).deploy_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'bind': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) execute.execute(ssh, ['echo "' + vals['base_name'] + ' IN CNAME ' + ('proxy' in vals['base_links'] and vals['base_links']['proxy']['target']['link_server_domain'] or vals['server_domain']) + '." >> ' + vals['domain_configfile']], context) @@ -46,7 +46,7 @@ def deploy_link(self, cr, uid, vals, context={}): sftp.close() def purge_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).purge_link(cr, uid, vals, context=context) + super(clouder_base_link, self).purge_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'bind': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) execute.execute(ssh, ['sed', '-i', '"/' + vals['base_name'] + '\sIN\sCNAME/d"', vals['domain_configfile']], context) diff --git a/saas_bind/saas_bind_data.xml b/clouder_template_bind/clouder_bind_data.xml similarity index 87% rename from saas_bind/saas_bind_data.xml rename to clouder_template_bind/clouder_bind_data.xml index ac87662..066f803 100644 --- a/saas_bind/saas_bind_data.xml +++ b/clouder_template_bind/clouder_bind_data.xml @@ -3,7 +3,7 @@ - + bind bind admin @@ -11,7 +11,7 @@ 53 - + img_bind 1 > /etc/supervisor/conf.d/supervisord USER root ]]> - + /etc/bind - + ssh 22 internet - + bind 53 @@ -64,7 +64,7 @@ USER root - + bind bind 1 diff --git a/saas_cas/__init__.py b/clouder_template_cas/__init__.py similarity index 100% rename from saas_cas/__init__.py rename to clouder_template_cas/__init__.py diff --git a/saas_ldap/__openerp__.py b/clouder_template_cas/__openerp__.py similarity index 91% rename from saas_ldap/__openerp__.py rename to clouder_template_cas/__openerp__.py index de37984..46c510f 100644 --- a/saas_ldap/__openerp__.py +++ b/clouder_template_cas/__openerp__.py @@ -20,18 +20,18 @@ ############################################################################## { - 'name': 'SaaS LDAP', + 'name': 'Clouder CAS', 'version': '1.0', 'category': 'Community', - 'depends': ['saas'], + 'depends': ['clouder'], 'author': 'Yannick Buron', 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ - SaaS LDAP + Clouder CAS """, 'demo': [], - 'data': ['saas_ldap_data.xml'], + 'data': ['clouder_cas_data.xml'], 'installable': True, 'application': True, } diff --git a/saas_cas/saas_cas_data.xml b/clouder_template_cas/clouder_cas_data.xml similarity index 91% rename from saas_cas/saas_cas_data.xml rename to clouder_template_cas/clouder_cas_data.xml index 7e6c121..aee722b 100644 --- a/saas_cas/saas_cas_data.xml +++ b/clouder_template_cas/clouder_cas_data.xml @@ -3,7 +3,7 @@ - + cas cas admin @@ -11,10 +11,10 @@ 389 - + img_cas 1 - + > /etc/apt/sources.list RUN apt-get update @@ -64,17 +64,17 @@ RUN echo "command=/etc/init.d/tomcat6 start" >> /etc/supervisor/conf.d/superviso ]]> - + /opt/idp-cas/cas - + ssh 22 internet - + tomcat 8080 @@ -83,7 +83,7 @@ RUN echo "command=/etc/init.d/tomcat6 start" >> /etc/supervisor/conf.d/superviso - + Cas cas 1 diff --git a/saas_cas/deploy.py b/clouder_template_cas/deploy.py similarity index 87% rename from saas_cas/deploy.py rename to clouder_template_cas/deploy.py index 0d7536e..5e8a103 100644 --- a/saas_cas/deploy.py +++ b/clouder_template_cas/deploy.py @@ -28,7 +28,7 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging @@ -36,18 +36,18 @@ -class saas_container(osv.osv): - _inherit = 'saas.container' +class clouder_container(osv.osv): + _inherit = 'clouder.container' def create_vals(self, cr, uid, vals, context=None): - vals = super(saas_container, self).create_vals(cr, uid, vals, context=context) + vals = super(clouder_container, self).create_vals(cr, uid, vals, context=context) if 'application_id' in vals and vals['application_id']: - application = self.pool.get('saas.application').browse(cr, uid, vals['application_id'], context=context) + application = self.pool.get('clouder.application').browse(cr, uid, vals['application_id'], context=context) if application.type_id.name == 'openldap': if not 'option_ids' in vals: vals['options_ids'] = [] - password_option = self.pool.get('ir.model.data').get_object(cr, uid, 'saas_ldap', 'apptype_openldap_option2').id + password_option = self.pool.get('ir.model.data').get_object(cr, uid, 'clouder_ldap', 'apptype_openldap_option2').id flag = False for option in vals['option_ids']: if option[2]['name'] == password_option: @@ -60,8 +60,8 @@ def create_vals(self, cr, uid, vals, context=None): return vals def deploy_post(self, cr, uid, vals, context): - super(saas_container, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_container, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'openldap': ssh, sftp = execute.connect(vals['container_fullname'], context=context) @@ -74,7 +74,7 @@ def deploy_post(self, cr, uid, vals, context): execute.execute(ssh, ['dpkg-reconfigure', '-f', 'noninteractive', 'slapd'], context) config_file = '/etc/ldap/schema/' + vals['container_options']['domain']['value'] + '.ldif' - sftp.put(modules.get_module_path('saas_ldap') + '/res/ldap.ldif', config_file) + sftp.put(modules.get_module_path('clouder_ldap') + '/res/ldap.ldif', config_file) domain_dc = '' for dc in vals['container_options']['domain']['value'].split('.'): if domain_dc: diff --git a/saas_cas/res/ldap.ldif b/clouder_template_cas/res/ldap.ldif similarity index 100% rename from saas_cas/res/ldap.ldif rename to clouder_template_cas/res/ldap.ldif diff --git a/saas_docker/__init__.py b/clouder_template_docker/__init__.py similarity index 100% rename from saas_docker/__init__.py rename to clouder_template_docker/__init__.py diff --git a/clouder_template_docker/__openerp__.py b/clouder_template_docker/__openerp__.py new file mode 100644 index 0000000..886c601 --- /dev/null +++ b/clouder_template_docker/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Yannick Buron +# Copyright 2013 Yannick Buron +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Clouder Docker', + 'version': '1.0', + 'category': 'Community', + 'depends': ['clouder'], + 'author': 'Yannick Buron', + 'license': 'AGPL-3', + 'website': 'https://github.com/YannickB', + 'description': """ + Clouder Docker + """, + 'demo': [], + 'data': ['clouder_docker_data.xml'], + 'installable': True, + 'application': True, +} diff --git a/saas_docker/saas_docker_data.xml b/clouder_template_docker/clouder_docker_data.xml similarity index 82% rename from saas_docker/saas_docker_data.xml rename to clouder_template_docker/clouder_docker_data.xml index 1e4b9ee..7c3f2cc 100644 --- a/saas_docker/saas_docker_data.xml +++ b/clouder_template_docker/clouder_docker_data.xml @@ -3,29 +3,29 @@ - + docker docker admin admin@localhost - + start_port container - + end_port container - + public_key container - + img_docker 1 True @@ -45,11 +45,11 @@ RUN echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/ ]]> - + /var/lib/docker - + ssh 22 @@ -59,7 +59,7 @@ RUN echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/ - + Docker docker 1 diff --git a/saas_docker/docker.py b/clouder_template_docker/docker.py similarity index 86% rename from saas_docker/docker.py rename to clouder_template_docker/docker.py index 4c9eb54..23087f0 100644 --- a/saas_docker/docker.py +++ b/clouder_template_docker/docker.py @@ -35,11 +35,11 @@ _logger = logging.getLogger(__name__) -class saas_container(osv.osv): - _inherit = 'saas.container' +class clouder_container(osv.osv): + _inherit = 'clouder.container' def write(self, cr, uid, ids, vals, context=None): - res = super(saas_container, self).write(cr, uid, ids, vals, context) + res = super(clouder_container, self).write(cr, uid, ids, vals, context) for container in self.browse(cr, uid, ids, context=context): if 'option_ids' in vals: container_vals = self.get_vals(cr, uid, container.id, context=context) @@ -48,12 +48,12 @@ def write(self, cr, uid, ids, vals, context=None): return res def create_vals(self, cr, uid, vals, context={}): - super(saas_container, self).create_vals(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_container, self).create_vals(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if context['apptype_name'] == 'docker': start_port = '' end_port = '' - type_option_obj = self.pool.get('saas.application.type.option') + type_option_obj = self.pool.get('clouder.application.type.option') if 'option_ids' in vals: _logger.info('test %s', vals['option_ids']) for option in vals['option_ids']: @@ -82,8 +82,8 @@ def create_vals(self, cr, uid, vals, context={}): return vals def deploy_post(self, cr, uid, vals, context): - super(saas_container, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_container, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'docker': if 'public_key' in vals['container_options']: ssh, sftp = execute.connect(vals['container_fullname'], context=context) diff --git a/saas_drupal/__init__.py b/clouder_template_drupal/__init__.py similarity index 100% rename from saas_drupal/__init__.py rename to clouder_template_drupal/__init__.py diff --git a/clouder_template_drupal/__openerp__.py b/clouder_template_drupal/__openerp__.py new file mode 100644 index 0000000..c58dc84 --- /dev/null +++ b/clouder_template_drupal/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Yannick Buron +# Copyright 2013 Yannick Buron +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Clouder Drupal', + 'version': '1.0', + 'category': 'Community', + 'depends': ['clouder_template_postgres', 'clouder_template_piwik'], + 'author': 'Yannick Buron', + 'license': 'AGPL-3', + 'website': 'https://github.com/YannickB', + 'description': """ + Clouder Drupal + """, + 'demo': [], + 'data': ['clouder_drupal_data.xml'], + 'installable': True, + 'application': True, +} diff --git a/saas_drupal/base.py b/clouder_template_drupal/base.py similarity index 91% rename from saas_drupal/base.py rename to clouder_template_drupal/base.py index bd0d3f8..8a252be 100644 --- a/saas_drupal/base.py +++ b/clouder_template_drupal/base.py @@ -25,17 +25,17 @@ from openerp.osv import fields, osv, orm from openerp.tools.translate import _ -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_base_link(osv.osv): - _inherit = 'saas.base.link' +class clouder_base_link(osv.osv): + _inherit = 'clouder.base.link' def deploy_piwik(self, cr, uid, vals, piwik_id, context={}): - super(saas_base_link, self).deploy_piwik(cr, uid, vals, piwik_id, context=context) + super(clouder_base_link, self).deploy_piwik(cr, uid, vals, piwik_id, context=context) if vals['link_target_app_code'] == 'piwik' and vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], context=context) execute.execute(ssh, ['drush', 'variable-set', 'piwik_site_id', piwik_id], context, path=vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']) diff --git a/saas_drupal/build.py b/clouder_template_drupal/build.py similarity index 77% rename from saas_drupal/build.py rename to clouder_template_drupal/build.py index af11778..6134aff 100644 --- a/saas_drupal/build.py +++ b/clouder_template_drupal/build.py @@ -29,21 +29,21 @@ from datetime import datetime, timedelta import subprocess import re -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_application(osv.osv): - _inherit = 'saas.application' +class clouder_application(osv.osv): + _inherit = 'clouder.application' -class saas_application_version(osv.osv): - _inherit = 'saas.application.version' +class clouder_application_version(osv.osv): + _inherit = 'clouder.application.version' def build_application(self, cr, uid, vals, context): - super(saas_application_version, self).build_application(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_application_version, self).build_application(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['archive_fullname'], context=context) execute.execute(ssh, ['apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y -qq install git php-pear'], context) @@ -51,8 +51,8 @@ def build_application(self, cr, uid, vals, context): execute.execute(ssh, ['pear install drush/drush'], context) execute.execute(ssh, ['echo "' + vals['app_buildfile'].replace('"', '\\"') + '" >> ' + vals['app_version_full_archivepath'] + '/drush.make'], context) execute.execute(ssh, ['drush', 'make', vals['app_version_full_archivepath'] + '/drush.make', './'], context, path=vals['app_version_full_archivepath']) - sftp.put(modules.get_module_path('saas_drupal') + '/res/wikicompare.script', vals['app_version_full_archivepath'] + '/wikicompare.script') - sftp.put(modules.get_module_path('saas_drupal') + '/res/patch/revisioning_postgres.patch', vals['app_version_full_archivepath'] + '/revisioning_postgres.patch') + sftp.put(modules.get_module_path('clouder_drupal') + '/res/wikicompare.script', vals['app_version_full_archivepath'] + '/wikicompare.script') + sftp.put(modules.get_module_path('clouder_drupal') + '/res/patch/revisioning_postgres.patch', vals['app_version_full_archivepath'] + '/revisioning_postgres.patch') execute.execute(ssh, ['patch', '-p0', '-d', vals['app_version_full_archivepath'] + '/sites/all/modules/revisioning/', '<', vals['app_version_full_archivepath'] + '/revisioning_postgres.patch'], context) execute.execute(ssh, ['mv', vals['app_version_full_archivepath'] + '/sites', vals['app_version_full_archivepath'] + '/sites-template'], context) execute.execute(ssh, ['ln', '-s', '../sites', vals['app_version_full_archivepath'] + '/sites'], context) @@ -63,7 +63,7 @@ def build_application(self, cr, uid, vals, context): # # if [[ $name == 'dev' ]] # then - # patch -p0 -d $archive_path/$app/${app}-${name}/archive/sites/all/themes/wikicompare_theme/ < $openerp_path/saas/saas/apps/drupal/patch/dev_zen_rebuild_registry.patch + # patch -p0 -d $archive_path/$app/${app}-${name}/archive/sites/all/themes/wikicompare_theme/ < $openerp_path/clouder/clouder/apps/drupal/patch/dev_zen_rebuild_registry.patch # fi diff --git a/saas_drupal/saas_drupal_data.xml b/clouder_template_drupal/clouder_drupal_data.xml similarity index 80% rename from saas_drupal/saas_drupal_data.xml rename to clouder_template_drupal/clouder_drupal_data.xml index d12bbe3..1c1fcfd 100644 --- a/saas_drupal/saas_drupal_data.xml +++ b/clouder_template_drupal/clouder_drupal_data.xml @@ -3,7 +3,7 @@ - + drupal www-data yodadmin @@ -12,27 +12,27 @@ /opt/versions /var/www - + install_modules application - + test_install_modules application - + theme application - + poweruser_group application - + port service @@ -40,10 +40,10 @@ - + img_drupal 8.0 - + - + /opt/versions /opt/services - + /var/www - + /etc/nginx - + ssh 22 internet - + nginx 80 @@ -99,7 +99,7 @@ VOLUME /base-backup - + Wikicompare wkc @@ -187,66 +187,66 @@ projects[wikicompare_theme][download][url] = "https://github.com/YannickB/wikico 90 5 - + piwik,admin_menu_toolbar,wikicompare,wikicompare_profiles,wikicompare_translation,wikicompare_inherit_product - + wikicompare_generate_demo - + wikicompare_theme - + wikicompare_admin - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/saas_drupal/deploy.py b/clouder_template_drupal/deploy.py similarity index 80% rename from saas_drupal/deploy.py rename to clouder_template_drupal/deploy.py index 1f6c1c7..4e434ae 100644 --- a/saas_drupal/deploy.py +++ b/clouder_template_drupal/deploy.py @@ -28,19 +28,19 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging _logger = logging.getLogger(__name__) -# class saas_container(osv.osv): -# _inherit = 'saas.container' +# class clouder_container(osv.osv): +# _inherit = 'clouder.container' # def add_links(self, cr, uid, vals, context={}): -# res = super(saas_container, self).add_links(cr, uid, vals, context=context) +# res = super(clouder_container, self).add_links(cr, uid, vals, context=context) # if 'application_id' in vals and 'server_id' in vals: -# application = self.pool.get('saas.application').browse(cr, uid, vals['application_id'], context=context) +# application = self.pool.get('clouder.application').browse(cr, uid, vals['application_id'], context=context) # if application.type_id.name == 'odoo': # if not 'linked_container_ids' in vals: # vals['linked_container_ids'] = [] @@ -49,14 +49,14 @@ # vals['linked_container_ids'].append((4,container.id)) # return vals -class saas_service(osv.osv): - _inherit = 'saas.service' +class clouder_service(osv.osv): + _inherit = 'clouder.service' def deploy_post_service(self, cr, uid, vals, context): - super(saas_service, self).deploy_post_service(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_service, self).deploy_post_service(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['cp', '-R', vals['service_full_localpath_files'] + '/sites-template', vals['service_full_localpath'] + '/sites'], context) @@ -66,17 +66,17 @@ def deploy_post_service(self, cr, uid, vals, context): return -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def deploy_build(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_build(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_build(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], context=context) config_file = '/etc/nginx/sites-available/' + vals['base_fullname'] - sftp.put(modules.get_module_path('saas_drupal') + '/res/nginx.config', config_file) + sftp.put(modules.get_module_path('clouder_drupal') + '/res/nginx.config', config_file) execute.execute(ssh, ['sed', '-i', '"s/BASE/' + vals['base_name'] + '/g"', config_file], context) execute.execute(ssh, ['sed', '-i', '"s/DOMAIN/' + vals['domain_name'] + '/g"', config_file], context) execute.execute(ssh, ['sed', '-i', '"s/PATH/' + vals['service_full_localpath_files'].replace('/','\/') + '/g"', config_file], context) @@ -114,13 +114,13 @@ def deploy_build(self, cr, uid, vals, context=None): # post restore # ssh $system_user@$server << EOF -# mkdir $instances_path/$instance/sites/$saas.$domain -# cp -r $instances_path/$instance/$db_type/sites/* $instances_path/$instance/sites/$saas.$domain/ -# cd $instances_path/$instance/sites/$saas.$domain -# sed -i "s/'database' => '[#a-z0-9_!]*'/'database' => '$unique_name_underscore'/g" $instances_path/$instance/sites/$saas.$domain/settings.php -# sed -i "s/'username' => '[#a-z0-9_!]*'/'username' => '$db_user'/g" $instances_path/$instance/sites/$saas.$domain/settings.php -# sed -i "s/'password' => '[#a-z0-9_!]*'/'password' => '$database_passwpord'/g" $instances_path/$instance/sites/$saas.$domain/settings.php -# sed -i "s/'host' => '[0-9.]*'/'host' => '$database_server'/g" $instances_path/$instance/sites/$saas.$domain/settings.php +# mkdir $instances_path/$instance/sites/$clouder.$domain +# cp -r $instances_path/$instance/$db_type/sites/* $instances_path/$instance/sites/$clouder.$domain/ +# cd $instances_path/$instance/sites/$clouder.$domain +# sed -i "s/'database' => '[#a-z0-9_!]*'/'database' => '$unique_name_underscore'/g" $instances_path/$instance/sites/$clouder.$domain/settings.php +# sed -i "s/'username' => '[#a-z0-9_!]*'/'username' => '$db_user'/g" $instances_path/$instance/sites/$clouder.$domain/settings.php +# sed -i "s/'password' => '[#a-z0-9_!]*'/'password' => '$database_passwpord'/g" $instances_path/$instance/sites/$clouder.$domain/settings.php +# sed -i "s/'host' => '[0-9.]*'/'host' => '$database_server'/g" $instances_path/$instance/sites/$clouder.$domain/settings.php # pwd # echo Title $title # drush vset --yes --exact site_name $title @@ -130,8 +130,8 @@ def deploy_build(self, cr, uid, vals, context=None): def deploy_post(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['drush', 'vset', '--yes', '--exact', 'site_name', vals['base_title']], context, path=vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']) @@ -139,8 +139,8 @@ def deploy_post(self, cr, uid, vals, context=None): sftp.close() def deploy_create_poweruser(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_create_poweruser(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_create_poweruser(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) @@ -154,8 +154,8 @@ def deploy_create_poweruser(self, cr, uid, vals, context=None): def deploy_test(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_test(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_test(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['drush', 'vset', '--yes', '--exact', 'wikicompare_test_platform', '1'],context, path=vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']) @@ -172,8 +172,8 @@ def deploy_test(self, cr, uid, vals, context=None): # def deploy_prepare_apache(self, cr, uid, vals, context=None): - # res = super(saas_base, self).deploy_prepare_apache(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_base, self).deploy_prepare_apache(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'odoo': # ssh, sftp = execute.connect(vals['proxy_fullname'], context=context) # execute.execute(ssh, ['sed', '-i', '"s/BASE/' + vals['base_name'] + '/g"', vals['base_apache_configfile']], context) @@ -187,8 +187,8 @@ def deploy_test(self, cr, uid, vals, context=None): def post_reset(self, cr, uid, vals, context=None): - res = super(saas_base, self).post_reset(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).post_reset(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) @@ -200,8 +200,8 @@ def post_reset(self, cr, uid, vals, context=None): def update_base(self, cr, uid, vals, context=None): - res = super(saas_base, self).update_base(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).update_base(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['drush', 'updatedb'], context, path=vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']) @@ -210,13 +210,13 @@ def update_base(self, cr, uid, vals, context=None): return res -class saas_save_save(osv.osv): - _inherit = 'saas.save.save' +class clouder_save_save(osv.osv): + _inherit = 'clouder.save.save' def deploy_base(self, cr, uid, vals, context=None): - res = super(saas_save_save, self).deploy_base(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_save_save, self).deploy_base(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['drush', 'archive-dump', vals['base_unique_name_'], '--destination=/base-backup/' + vals['saverepo_name'] + 'tar.gz'], context) @@ -227,8 +227,8 @@ def deploy_base(self, cr, uid, vals, context=None): def restore_base(self, cr, uid, vals, context=None): - res = super(saas_save_save, self).restore_base(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_save_save, self).restore_base(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['rm', '-rf', vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']], context) diff --git a/saas_drupal/purge.py b/clouder_template_drupal/purge.py similarity index 84% rename from saas_drupal/purge.py rename to clouder_template_drupal/purge.py index 9efab51..68a919f 100644 --- a/saas_drupal/purge.py +++ b/clouder_template_drupal/purge.py @@ -28,18 +28,18 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) # -# class saas_service(osv.osv): -# _inherit = 'saas.service' +# class clouder_service(osv.osv): +# _inherit = 'clouder.service' # # def purge_pre_service(self, cr, uid, vals, context): -# super(saas_service, self).purge_pre_service(cr, uid, vals, context) -# context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) +# super(clouder_service, self).purge_pre_service(cr, uid, vals, context) +# context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'odoo': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['rm', '/opt/odoo/etc/' + vals['service_name'] + '.config'], context) @@ -53,12 +53,12 @@ # # return -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def purge_post(self, cr, uid, vals, context): - super(saas_base, self).purge_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_base, self).purge_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], context=context) diff --git a/saas_drupal/res/apache-sslonly.config b/clouder_template_drupal/res/apache-sslonly.config similarity index 100% rename from saas_drupal/res/apache-sslonly.config rename to clouder_template_drupal/res/apache-sslonly.config diff --git a/saas_drupal/res/apache.config b/clouder_template_drupal/res/apache.config similarity index 100% rename from saas_drupal/res/apache.config rename to clouder_template_drupal/res/apache.config diff --git a/saas_drupal/res/nginx.config b/clouder_template_drupal/res/nginx.config similarity index 100% rename from saas_drupal/res/nginx.config rename to clouder_template_drupal/res/nginx.config diff --git a/saas_drupal/res/openerp.config b/clouder_template_drupal/res/openerp.config similarity index 100% rename from saas_drupal/res/openerp.config rename to clouder_template_drupal/res/openerp.config diff --git a/saas_drupal/res/openerp.init b/clouder_template_drupal/res/openerp.init similarity index 100% rename from saas_drupal/res/openerp.init rename to clouder_template_drupal/res/openerp.init diff --git a/saas_drupal/res/patch/dev_zen_rebuild_registry.patch b/clouder_template_drupal/res/patch/dev_zen_rebuild_registry.patch similarity index 100% rename from saas_drupal/res/patch/dev_zen_rebuild_registry.patch rename to clouder_template_drupal/res/patch/dev_zen_rebuild_registry.patch diff --git a/saas_drupal/res/patch/revisioning_postgres.patch b/clouder_template_drupal/res/patch/revisioning_postgres.patch similarity index 100% rename from saas_drupal/res/patch/revisioning_postgres.patch rename to clouder_template_drupal/res/patch/revisioning_postgres.patch diff --git a/saas_drupal/res/proxy-sslonly.config b/clouder_template_drupal/res/proxy-sslonly.config similarity index 100% rename from saas_drupal/res/proxy-sslonly.config rename to clouder_template_drupal/res/proxy-sslonly.config diff --git a/saas_drupal/res/proxy.config b/clouder_template_drupal/res/proxy.config similarity index 100% rename from saas_drupal/res/proxy.config rename to clouder_template_drupal/res/proxy.config diff --git a/saas_drupal/res/wikicompare.script b/clouder_template_drupal/res/wikicompare.script similarity index 100% rename from saas_drupal/res/wikicompare.script rename to clouder_template_drupal/res/wikicompare.script diff --git a/saas_git/__init__.py b/clouder_template_git/__init__.py similarity index 100% rename from saas_git/__init__.py rename to clouder_template_git/__init__.py diff --git a/saas_git/__openerp__.py b/clouder_template_git/__openerp__.py similarity index 94% rename from saas_git/__openerp__.py rename to clouder_template_git/__openerp__.py index 410f567..3fcff9f 100644 --- a/saas_git/__openerp__.py +++ b/clouder_template_git/__openerp__.py @@ -19,7 +19,7 @@ # ############################################################################## -{'name': 'SaaS Git', +{'name': 'Clouder Git', 'version': '1.0', 'category': 'Community', 'depends': ['base', @@ -28,10 +28,10 @@ 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ -SaaS Git +Clouder Git """, 'demo': [], - 'data': ['saas_git_data.xml' + 'data': ['clouder_git_data.xml' ], 'installable': True, 'application': True, diff --git a/saas_git/build.py b/clouder_template_git/build.py similarity index 81% rename from saas_git/build.py rename to clouder_template_git/build.py index d15a0bc..9630a70 100644 --- a/saas_git/build.py +++ b/clouder_template_git/build.py @@ -29,20 +29,20 @@ from datetime import datetime, timedelta import subprocess import re -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_application_version(osv.osv): - _inherit = 'saas.application.version' +class clouder_application_version(osv.osv): + _inherit = 'clouder.application.version' def build_application(self, cr, uid, vals, context): - super(saas_application_version, self).build_application(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_application_version, self).build_application(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['app_code'] == 'gitlab': - ssh, sftp = execute.connect('localhost', 22, 'saas-conductor', context) + ssh, sftp = execute.connect('localhost', 22, 'clouder-conductor', context) execute.execute(ssh,['git', 'clone', 'https://gitlab.com/gitlab-org/gitlab-ce.git', '-b', '7-5-stable', 'gitlab'], context, path=vals['app_version_full_archivepath']) execute.execute(ssh,['mv', 'gitlab/*', './'], context, path=vals['app_version_full_archivepath']) execute.execute(ssh,['rm', '-r', 'gitlab'], context, path=vals['app_version_full_archivepath']) diff --git a/saas_git/saas_git_data.xml b/clouder_template_git/clouder_git_data.xml similarity index 80% rename from saas_git/saas_git_data.xml rename to clouder_template_git/clouder_git_data.xml index 0de6f40..1166410 100644 --- a/saas_git/saas_git_data.xml +++ b/clouder_template_git/clouder_git_data.xml @@ -3,7 +3,7 @@ - + git git admin @@ -12,14 +12,14 @@ /opt/versions /opt/gitlab - + port service port - + img_gitlab 1 - + /opt/versions /opt/services - + /opt/gitlab git - + /home/git git - + ssh 22 internet - + port 80 @@ -109,7 +109,7 @@ VOLUME /base-backup - + Gitlab gitlab 1 @@ -124,47 +124,47 @@ VOLUME /base-backup 90 5 - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/saas_git/deploy.py b/clouder_template_git/deploy.py similarity index 89% rename from saas_git/deploy.py rename to clouder_template_git/deploy.py index dc11151..eaaf84f 100644 --- a/saas_git/deploy.py +++ b/clouder_template_git/deploy.py @@ -28,18 +28,18 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging _logger = logging.getLogger(__name__) -class saas_service(osv.osv): - _inherit = 'saas.service' +class clouder_service(osv.osv): + _inherit = 'clouder.service' def deploy_post_service(self, cr, uid, vals, context): - super(saas_service, self).deploy_post_service(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_service, self).deploy_post_service(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['app_code'] == 'gitlab': ssh, sftp = execute.connect(vals['container_fullname'], username='root', context=context) execute.execute(ssh, ['cp', vals['service_full_localpath_files'] + '/config/gitlab.yml.example', vals['service_full_localpath_files'] + '/config/gitlab.yml'], context) @@ -65,12 +65,12 @@ def deploy_post_service(self, cr, uid, vals, context): return -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def deploy_build(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_build(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_build(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['app_code'] == 'gitlab': ssh, sftp = execute.connect(vals['container_fullname'], username='root', context=context) database_file = vals['service_full_localpath_files'] + '/config/database.yml' diff --git a/saas_git/res/proxy-sslonly.config b/clouder_template_git/res/proxy-sslonly.config similarity index 100% rename from saas_git/res/proxy-sslonly.config rename to clouder_template_git/res/proxy-sslonly.config diff --git a/saas_git/res/proxy.config b/clouder_template_git/res/proxy.config similarity index 100% rename from saas_git/res/proxy.config rename to clouder_template_git/res/proxy.config diff --git a/saas_ldap/__init__.py b/clouder_template_ldap/__init__.py similarity index 100% rename from saas_ldap/__init__.py rename to clouder_template_ldap/__init__.py diff --git a/saas_cas/__openerp__.py b/clouder_template_ldap/__openerp__.py similarity index 91% rename from saas_cas/__openerp__.py rename to clouder_template_ldap/__openerp__.py index fb09bda..a458b1b 100644 --- a/saas_cas/__openerp__.py +++ b/clouder_template_ldap/__openerp__.py @@ -20,18 +20,18 @@ ############################################################################## { - 'name': 'SaaS CAS', + 'name': 'Clouder LDAP', 'version': '1.0', 'category': 'Community', - 'depends': ['saas'], + 'depends': ['clouder'], 'author': 'Yannick Buron', 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ - SaaS CAS + Clouder LDAP """, 'demo': [], - 'data': ['saas_cas_data.xml'], + 'data': ['clouder_ldap_data.xml'], 'installable': True, 'application': True, } diff --git a/saas_ldap/saas_ldap_data.xml b/clouder_template_ldap/clouder_ldap_data.xml similarity index 79% rename from saas_ldap/saas_ldap_data.xml rename to clouder_template_ldap/clouder_ldap_data.xml index f78dc76..e62dbe7 100644 --- a/saas_ldap/saas_ldap_data.xml +++ b/clouder_template_ldap/clouder_ldap_data.xml @@ -3,24 +3,24 @@ - + openldap openldap admin admin@localhost 389 - + domain container - + password container - + organization container @@ -28,10 +28,10 @@ - + img_openldap 1 - + - + /etc/ldap - + /var/lib/ldap - + ssh 22 internet - + openldap 389 internet - + phpldapadmin 80 @@ -77,7 +77,7 @@ RUN echo "command=/bin/bash -c 'source /etc/apache2/envvars && exec /usr/sbin/ap - + openldap openldap 1 diff --git a/saas_ldap/deploy.py b/clouder_template_ldap/deploy.py similarity index 87% rename from saas_ldap/deploy.py rename to clouder_template_ldap/deploy.py index 0d7536e..5e8a103 100644 --- a/saas_ldap/deploy.py +++ b/clouder_template_ldap/deploy.py @@ -28,7 +28,7 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging @@ -36,18 +36,18 @@ -class saas_container(osv.osv): - _inherit = 'saas.container' +class clouder_container(osv.osv): + _inherit = 'clouder.container' def create_vals(self, cr, uid, vals, context=None): - vals = super(saas_container, self).create_vals(cr, uid, vals, context=context) + vals = super(clouder_container, self).create_vals(cr, uid, vals, context=context) if 'application_id' in vals and vals['application_id']: - application = self.pool.get('saas.application').browse(cr, uid, vals['application_id'], context=context) + application = self.pool.get('clouder.application').browse(cr, uid, vals['application_id'], context=context) if application.type_id.name == 'openldap': if not 'option_ids' in vals: vals['options_ids'] = [] - password_option = self.pool.get('ir.model.data').get_object(cr, uid, 'saas_ldap', 'apptype_openldap_option2').id + password_option = self.pool.get('ir.model.data').get_object(cr, uid, 'clouder_ldap', 'apptype_openldap_option2').id flag = False for option in vals['option_ids']: if option[2]['name'] == password_option: @@ -60,8 +60,8 @@ def create_vals(self, cr, uid, vals, context=None): return vals def deploy_post(self, cr, uid, vals, context): - super(saas_container, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_container, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'openldap': ssh, sftp = execute.connect(vals['container_fullname'], context=context) @@ -74,7 +74,7 @@ def deploy_post(self, cr, uid, vals, context): execute.execute(ssh, ['dpkg-reconfigure', '-f', 'noninteractive', 'slapd'], context) config_file = '/etc/ldap/schema/' + vals['container_options']['domain']['value'] + '.ldif' - sftp.put(modules.get_module_path('saas_ldap') + '/res/ldap.ldif', config_file) + sftp.put(modules.get_module_path('clouder_ldap') + '/res/ldap.ldif', config_file) domain_dc = '' for dc in vals['container_options']['domain']['value'].split('.'): if domain_dc: diff --git a/saas_ldap/res/ldap.ldif b/clouder_template_ldap/res/ldap.ldif similarity index 100% rename from saas_ldap/res/ldap.ldif rename to clouder_template_ldap/res/ldap.ldif diff --git a/saas_mysql/__init__.py b/clouder_template_mysql/__init__.py similarity index 100% rename from saas_mysql/__init__.py rename to clouder_template_mysql/__init__.py diff --git a/saas_docker/__openerp__.py b/clouder_template_mysql/__openerp__.py similarity index 91% rename from saas_docker/__openerp__.py rename to clouder_template_mysql/__openerp__.py index adad135..cf15798 100644 --- a/saas_docker/__openerp__.py +++ b/clouder_template_mysql/__openerp__.py @@ -20,18 +20,18 @@ ############################################################################## { - 'name': 'SaaS Docker', + 'name': 'Clouder MySQL', 'version': '1.0', 'category': 'Community', - 'depends': ['saas'], + 'depends': ['clouder'], 'author': 'Yannick Buron', 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ - SaaS Docker + Clouder MySQL """, 'demo': [], - 'data': ['saas_docker_data.xml'], + 'data': ['clouder_mysql_data.xml'], 'installable': True, 'application': True, } diff --git a/saas_mysql/saas_mysql_data.xml b/clouder_template_mysql/clouder_mysql_data.xml similarity index 82% rename from saas_mysql/saas_mysql_data.xml rename to clouder_template_mysql/clouder_mysql_data.xml index 5924beb..215021e 100644 --- a/saas_mysql/saas_mysql_data.xml +++ b/clouder_template_mysql/clouder_mysql_data.xml @@ -3,27 +3,27 @@ - + mysql mysql mysql mysql@localhost 3306 - + network container 172.17.0.0/16 - + root_password container - + img_mysql 1 > /etc/supervisor/conf.d/supervisord.conf USER root ]]> - + /etc/mysql mysql - + /var/lib/mysql mysql - + ssh 22 internet - + mysql 3306 - + mysql mysql 1 diff --git a/saas_mysql/deploy.py b/clouder_template_mysql/deploy.py similarity index 84% rename from saas_mysql/deploy.py rename to clouder_template_mysql/deploy.py index 9384283..86b6bbe 100644 --- a/saas_mysql/deploy.py +++ b/clouder_template_mysql/deploy.py @@ -28,17 +28,17 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_container(osv.osv): - _inherit = 'saas.container' +class clouder_container(osv.osv): + _inherit = 'clouder.container' def deploy_post(self, cr, uid, vals, context): - super(saas_container, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_container, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'mysql': ssh, sftp = execute.connect(vals['container_fullname'], context=context) execute.execute(ssh, ['sed', '-i', '"/bind-address/d"', '/etc/mysql/my.cnf'], context) @@ -46,12 +46,12 @@ def deploy_post(self, cr, uid, vals, context): password =vals ['container_options']['root_password']['value'] else: password = execute.generate_random_password(20) - option_obj = self.pool.get('saas.container.option') + option_obj = self.pool.get('clouder.container.option') option_ids = option_obj.search(cr, uid, [('container_id','=',vals['container_id']),('name','=','root_password')]) if option_ids: option_obj.write(cr, uid, option_ids, {'value': password}, context=context) else: - type_obj = self.pool.get('saas.application.type.option') + type_obj = self.pool.get('clouder.application.type.option') type_ids = type_obj.search(cr, uid, [('apptype_id.name','=','mysql'),('name','=','root_password')]) if type_ids: option_obj.create(cr, uid, {'container_id': vals['container_id'], 'name': type_ids[0], 'value': password}, context=context) diff --git a/saas_odoo/__init__.py b/clouder_template_odoo/__init__.py similarity index 100% rename from saas_odoo/__init__.py rename to clouder_template_odoo/__init__.py diff --git a/saas_odoo/__openerp__.py b/clouder_template_odoo/__openerp__.py similarity index 81% rename from saas_odoo/__openerp__.py rename to clouder_template_odoo/__openerp__.py index f1cad3a..b969139 100644 --- a/saas_odoo/__openerp__.py +++ b/clouder_template_odoo/__openerp__.py @@ -20,26 +20,26 @@ ############################################################################## { - 'name': 'SaaS Odoo', + 'name': 'Clouder Odoo', 'version': '1.0', 'category': 'Community', 'depends': [ - 'saas_bind', - 'saas_shinken', - 'saas_postfix', - 'saas_proxy', - 'saas_postgres', - 'saas_piwik' + 'clouder_template_bind', + 'clouder_template_shinken', + 'clouder_template_postfix', + 'clouder_template_proxy', + 'clouder_template_postgres', + 'clouder_template_piwik' ], 'author': 'Yannick Buron', 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ - SaaS Odoo + Clouder Odoo """, 'demo': [], 'data': [ - 'saas_odoo_data.xml' + 'clouder_odoo_data.xml' ], 'installable': True, 'application': True, diff --git a/saas_odoo/base.py b/clouder_template_odoo/base.py similarity index 93% rename from saas_odoo/base.py rename to clouder_template_odoo/base.py index 095ae38..f52a799 100644 --- a/saas_odoo/base.py +++ b/clouder_template_odoo/base.py @@ -25,18 +25,18 @@ from openerp.osv import fields, osv, orm from openerp.tools.translate import _ -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging _logger = logging.getLogger(__name__) -class saas_base_link(osv.osv): - _inherit = 'saas.base.link' +class clouder_base_link(osv.osv): + _inherit = 'clouder.base.link' def deploy_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).deploy_link(cr, uid, vals, context=context) + super(clouder_base_link, self).deploy_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'postfix' and vals['apptype_name'] == 'odoo': try: execute.log("client = erppeek.Client('http://" + vals['server_domain'] + ":" + vals['service_options']['port']['hostport'] + "," + "db=" + vals['base_unique_name_'] + "," + "user=" + vals['apptype_admin_name'] + ", password=" + vals['base_admin_passwd'] + ")", context) @@ -59,7 +59,7 @@ def deploy_link(self, cr, uid, vals, context={}): sftp.close() def purge_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).purge_link(cr, uid, vals, context=context) + super(clouder_base_link, self).purge_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'postfix' and vals['apptype_name'] == 'odoo': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) execute.execute(ssh, ['sed', '-i', '"/^mydestination =/ s/, ' + vals['base_fulldomain'] + '//"', '/etc/postfix/main.cf'], context) diff --git a/saas_odoo/build.py b/clouder_template_odoo/build.py similarity index 86% rename from saas_odoo/build.py rename to clouder_template_odoo/build.py index 4899a9b..409d317 100644 --- a/saas_odoo/build.py +++ b/clouder_template_odoo/build.py @@ -28,18 +28,18 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_application_version(osv.osv): - _inherit = 'saas.application.version' +class clouder_application_version(osv.osv): + _inherit = 'clouder.application.version' def build_application(self, cr, uid, vals, context): - super(saas_application_version, self).build_application(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_application_version, self).build_application(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': execute.execute_local(['mkdir', '-p', vals['app_version_full_archivepath'] + '/extra'], context) execute.execute_write_file(vals['app_version_full_archivepath'] + '/buildout.cfg', vals['app_buildfile'], context) @@ -50,8 +50,8 @@ def build_application(self, cr, uid, vals, context): execute.execute_local(['bin/buildout'], context, vals['app_version_full_archivepath']) #Can't make sed work on local - ssh, sftp = execute.connect('localhost', 22, 'saas-conductor', context) - execute.execute(ssh, ['patch', vals['app_version_full_archivepath'] + '/parts/odoo/openerp/http.py', '<', modules.get_module_path('saas_odoo') + '/res/http.patch'], context) + ssh, sftp = execute.connect('localhost', 22, 'clouder-conductor', context) + execute.execute(ssh, ['patch', vals['app_version_full_archivepath'] + '/parts/odoo/openerp/http.py', '<', modules.get_module_path('clouder_odoo') + '/res/http.patch'], context) execute.execute(ssh, ['sed', '-i', '"s/' + vals['config_archive_path'].replace('/','\/') + '/' + vals['apptype_localpath'].replace('/','\/') + '/g"', vals['app_version_full_archivepath'] + '/bin/start_odoo'], context) execute.execute(ssh, ['sed', '-i', '"s/' + vals['config_archive_path'].replace('/','\/') + '/' + vals['apptype_localpath'].replace('/','\/') + '/g"', vals['app_version_full_archivepath'] + '/bin/buildout'], context) ssh.close() diff --git a/saas_odoo/saas_odoo_data.xml b/clouder_template_odoo/clouder_odoo_data.xml similarity index 77% rename from saas_odoo/saas_odoo_data.xml rename to clouder_template_odoo/clouder_odoo_data.xml index b7201d9..27295df 100644 --- a/saas_odoo/saas_odoo_data.xml +++ b/clouder_template_odoo/clouder_odoo_data.xml @@ -3,7 +3,7 @@ - + odoo odoo heathcliff @@ -13,39 +13,39 @@ /opt/versions /opt/odoo - + default_account_chart application - + account_chart base - + install_modules application - + test_install_modules application - + poweruser_group application - + port service odoo1 - + img_odoo 8.0 - + /opt/versions /opt/services - + /opt/odoo odoo - + /home/odoo odoo - + ssh 22 internet - + odoo1 8069 internet - + odoo2 7069 internet - + odoo3 6069 internet - + port-formation 5069 internet - + port-test 4069 @@ -141,7 +141,7 @@ VOLUME /base-backup - + Odoo Community Management ocm @@ -181,71 +181,71 @@ pypdf = 1.13 90 5 - + l10n_fr - + community - + community_blog,community_crm,community_event,community_forum,community_marketplace,community_project,project_marketplace,l10n_fr_wallet,website_community_template - + community.group_community_administrator - + - + - + - + - + - + - + - + - + - + - + - + - + Odoo odoo @@ -282,52 +282,52 @@ pypdf = 1.13 90 5 - + - + - + - + - + - + - + - + - + - + - + - + - + Orchestrator orchestrator @@ -365,47 +365,47 @@ pypdf = 1.13 90 5 - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/saas_odoo/deploy.py b/clouder_template_odoo/deploy.py similarity index 89% rename from saas_odoo/deploy.py rename to clouder_template_odoo/deploy.py index b98cad5..432fdae 100644 --- a/saas_odoo/deploy.py +++ b/clouder_template_odoo/deploy.py @@ -28,19 +28,19 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging _logger = logging.getLogger(__name__) -# class saas_container(osv.osv): -# _inherit = 'saas.container' +# class clouder_container(osv.osv): +# _inherit = 'clouder.container' # def add_links(self, cr, uid, vals, context={}): -# res = super(saas_container, self).add_links(cr, uid, vals, context=context) +# res = super(clouder_container, self).add_links(cr, uid, vals, context=context) # if 'application_id' in vals and 'server_id' in vals: -# application = self.pool.get('saas.application').browse(cr, uid, vals['application_id'], context=context) +# application = self.pool.get('clouder.application').browse(cr, uid, vals['application_id'], context=context) # if application.type_id.name == 'odoo': # if not 'linked_container_ids' in vals: # vals['linked_container_ids'] = [] @@ -49,12 +49,12 @@ # vals['linked_container_ids'].append((4,container.id)) # return vals -class saas_service(osv.osv): - _inherit = 'saas.service' +class clouder_service(osv.osv): + _inherit = 'clouder.service' def get_vals(self, cr, uid, id, context=None): - vals = super(saas_service, self).get_vals(cr, uid, id, context=context) + vals = super(clouder_service, self).get_vals(cr, uid, id, context=context) service = self.browse(cr, uid, id, context=context) @@ -66,8 +66,8 @@ def get_vals(self, cr, uid, id, context=None): return vals def deploy_post_service(self, cr, uid, vals, context): - super(saas_service, self).deploy_post_service(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_service, self).deploy_post_service(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['ln', '-s', vals['app_version_full_localpath'], '/opt/odoo/services/' + vals['service_name']], context) @@ -75,7 +75,7 @@ def deploy_post_service(self, cr, uid, vals, context): config_file = '/opt/odoo/' + vals['service_name'] + '/etc/config' execute.execute(ssh, ['mkdir', '-p', '/opt/odoo/' + vals['service_name'] + '/etc'], context) - sftp.put(modules.get_module_path('saas_odoo') + '/res/openerp.config', config_file) + sftp.put(modules.get_module_path('clouder_odoo') + '/res/openerp.config', config_file) addons_path = '/opt/odoo/' + vals['service_name'] + '/files/parts/odoo/addons,' for dir in sftp.listdir('/opt/odoo/' + vals['service_name'] + '/files/extra'): addons_path += '/opt/odoo/' + vals['service_name'] + '/files/extra/' + dir + ',' @@ -98,12 +98,12 @@ def deploy_post_service(self, cr, uid, vals, context): return -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def deploy_create_database(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_create_database(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_create_database(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['mkdir', '-p', '/opt/odoo/' + vals['service_name'] + '/filestore/' + vals['base_unique_name_']], context) @@ -129,8 +129,8 @@ def deploy_create_database(self, cr, uid, vals, context=None): return res def deploy_build(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_build(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_build(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': execute.log("client = erppeek.Client('http://" + vals['server_domain'] + ":" + vals['service_options']['port']['hostport'] + "," + "db=" + vals['base_unique_name_'] + "," + "user='admin', password=" + vals['base_admin_passwd'] + ")", context) client = erppeek.Client('http://' + vals['server_domain'] + ':' + vals['service_options']['port']['hostport'], db=vals['base_unique_name_'], user='admin', password=vals['base_admin_passwd']) @@ -161,8 +161,8 @@ def deploy_build(self, cr, uid, vals, context=None): return res def deploy_post(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': execute.log("client = erppeek.Client('http://" + vals['server_domain'] + ":" + vals['service_options']['port']['hostport'] + "," + "db=" + vals['base_unique_name_'] + "," + "user=" + vals['apptype_admin_name'] + ", password=" + vals['base_admin_passwd'] + ")", context) client = erppeek.Client('http://' + vals['server_domain'] + ':' + vals['service_options']['port']['hostport'], db=vals['base_unique_name_'], user=vals['apptype_admin_name'], password=vals['base_admin_passwd']) @@ -193,8 +193,8 @@ def deploy_post(self, cr, uid, vals, context=None): def deploy_create_poweruser(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_create_poweruser(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_create_poweruser(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': if vals['base_poweruser_name'] and vals['base_poweruser_email'] and vals['apptype_admin_name'] != vals['base_poweruser_name']: execute.log("client = erppeek.Client('http://" + vals['server_domain'] + ":" + vals['service_options']['port']['hostport'] + "," + "db=" + vals['base_unique_name_'] + "," + "user=" + vals['apptype_admin_name'] + ", password=" + vals['base_admin_passwd'] + ")", context) @@ -219,8 +219,8 @@ def deploy_create_poweruser(self, cr, uid, vals, context=None): def deploy_test(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_test(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_test(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': execute.log("client = erppeek.Client('http://" + vals['server_domain'] + ":" + vals['service_options']['port']['hostport'] + "," + "db=" + vals['base_unique_name_'] + "," + "user=" + vals['apptype_admin_name'] + ", password=" + vals['base_admin_passwd'] + ")", context) client = erppeek.Client('http://' + vals['server_domain'] + ':' + vals['service_options']['port']['hostport'], db=vals['base_unique_name_'], user=vals['apptype_admin_name'], password=vals['base_admin_passwd']) @@ -236,8 +236,8 @@ def deploy_test(self, cr, uid, vals, context=None): # # def deploy_prepare_apache(self, cr, uid, vals, context=None): - # res = super(saas_base, self).deploy_prepare_apache(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_base, self).deploy_prepare_apache(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'odoo': # ssh, sftp = execute.connect(vals['proxy_fullname'], context=context) # execute.execute(ssh, ['sed', '-i', '"s/BASE/' + vals['base_name'] + '/g"', vals['base_apache_configfile']], context) @@ -249,8 +249,8 @@ def deploy_test(self, cr, uid, vals, context=None): # return def post_reset(self, cr, uid, vals, context=None): - res = super(saas_base, self).post_reset(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).post_reset(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': execute.log("client = erppeek.Client('http://" + vals['server_domain'] + ":" + vals['service_options']['port']['hostport'] + "," + "db=" + vals['base_unique_name_'] + "," + "user=" + vals['apptype_admin_name'] + ", password=" + vals['base_admin_passwd'] + ")", context) client = erppeek.Client('http://' + vals['server_domain'] + ':' + vals['service_options']['port']['hostport'], db=vals['base_unique_name_'], user=vals['apptype_admin_name'], password=vals['base_admin_passwd']) @@ -273,8 +273,8 @@ def post_reset(self, cr, uid, vals, context=None): def update_base(self, cr, uid, vals, context=None): - res = super(saas_base, self).update_base(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).update_base(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': try: execute.log("client = erppeek.Client('http://" + vals['server_domain'] + ":" + vals['service_options']['port']['hostport'] + "," + "db=" + vals['base_unique_name_'] + "," + "user=" + vals['apptype_admin_name'] + ", password=" + vals['base_admin_passwd'] + ")", context) @@ -288,13 +288,13 @@ def update_base(self, cr, uid, vals, context=None): return res -class saas_save_save(osv.osv): - _inherit = 'saas.save.save' +class clouder_save_save(osv.osv): + _inherit = 'clouder.save.save' def deploy_base(self, cr, uid, vals, context=None): - res = super(saas_save_save, self).deploy_base(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_save_save, self).deploy_base(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['mkdir', '-p', '/base-backup/' + vals['saverepo_name'] + '/filestore'], context) @@ -305,8 +305,8 @@ def deploy_base(self, cr, uid, vals, context=None): def restore_base(self, cr, uid, vals, context=None): - res = super(saas_save_save, self).restore_base(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_save_save, self).restore_base(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['rm', '-rf', '/opt/odoo/' + vals['service_name'] + '/filestore/' + vals['base_unique_name_']], context) diff --git a/saas_odoo/purge.py b/clouder_template_odoo/purge.py similarity index 81% rename from saas_odoo/purge.py rename to clouder_template_odoo/purge.py index 102d552..41c3e9b 100644 --- a/saas_odoo/purge.py +++ b/clouder_template_odoo/purge.py @@ -28,18 +28,18 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_service(osv.osv): - _inherit = 'saas.service' +class clouder_service(osv.osv): + _inherit = 'clouder.service' def purge_pre_service(self, cr, uid, vals, context): - super(saas_service, self).purge_pre_service(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_service, self).purge_pre_service(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['sed', '-i', '"/program:' + vals['service_name'] + '/d"', '/opt/odoo/supervisor.conf'], context) @@ -49,12 +49,12 @@ def purge_pre_service(self, cr, uid, vals, context): return -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def purge_post(self, cr, uid, vals, context): - super(saas_base, self).purge_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_base, self).purge_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'odoo': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['rm', '-rf', '/opt/odoo/' + vals['service_name'] + '/filestore/' + vals['base_unique_name_']], context) diff --git a/saas_odoo/res/http.patch b/clouder_template_odoo/res/http.patch similarity index 100% rename from saas_odoo/res/http.patch rename to clouder_template_odoo/res/http.patch diff --git a/saas_odoo/res/openerp.config b/clouder_template_odoo/res/openerp.config similarity index 100% rename from saas_odoo/res/openerp.config rename to clouder_template_odoo/res/openerp.config diff --git a/saas_odoo/res/openerp.init b/clouder_template_odoo/res/openerp.init similarity index 100% rename from saas_odoo/res/openerp.init rename to clouder_template_odoo/res/openerp.init diff --git a/saas_odoo/res/proxy-sslonly.config b/clouder_template_odoo/res/proxy-sslonly.config similarity index 100% rename from saas_odoo/res/proxy-sslonly.config rename to clouder_template_odoo/res/proxy-sslonly.config diff --git a/saas_odoo/res/proxy.config b/clouder_template_odoo/res/proxy.config similarity index 100% rename from saas_odoo/res/proxy.config rename to clouder_template_odoo/res/proxy.config diff --git a/saas_piwik/__init__.py b/clouder_template_piwik/__init__.py similarity index 100% rename from saas_piwik/__init__.py rename to clouder_template_piwik/__init__.py diff --git a/clouder_template_piwik/__openerp__.py b/clouder_template_piwik/__openerp__.py new file mode 100644 index 0000000..72b9b04 --- /dev/null +++ b/clouder_template_piwik/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Yannick Buron +# Copyright 2013 Yannick Buron +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Clouder Piwik', + 'version': '1.0', + 'category': 'Community', + 'depends': ['clouder_template_mysql', 'clouder_template_bind', 'clouder_template_proxy', 'clouder_template_shinken'], + 'author': 'Yannick Buron', + 'license': 'AGPL-3', + 'website': 'https://github.com/YannickB', + 'description': """ + Clouder Piwik + """, + 'demo': [], + 'data': ['clouder_piwik_data.xml'], + 'installable': True, + 'application': True, +} diff --git a/saas_piwik/base.py b/clouder_template_piwik/base.py similarity index 93% rename from saas_piwik/base.py rename to clouder_template_piwik/base.py index 3235398..97eeeef 100644 --- a/saas_piwik/base.py +++ b/clouder_template_piwik/base.py @@ -25,20 +25,20 @@ from openerp.osv import fields, osv, orm from openerp.tools.translate import _ -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_base_link(osv.osv): - _inherit = 'saas.base.link' +class clouder_base_link(osv.osv): + _inherit = 'clouder.base.link' def deploy_piwik(self, cr, uid, vals, piwik_id, context={}): return def deploy_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).deploy_link(cr, uid, vals, context=context) + super(clouder_base_link, self).deploy_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'piwik': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) piwik_id = execute.execute(ssh, ['mysql', vals['link_target_base_unique_name_'], '-h ' + vals['link_target_database_server'], '-u ' + vals['link_target_service_db_user'], '-p' + vals['link_target_service_db_password'], '-se', @@ -57,7 +57,7 @@ def deploy_link(self, cr, uid, vals, context={}): self.deploy_piwik(cr, uid, vals, piwik_id, context=context) def purge_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).purge_link(cr, uid, vals, context=context) + super(clouder_base_link, self).purge_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'piwik': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) piwik_id = execute.execute(ssh, ['mysql', vals['link_target_base_unique_name_'], '-h ' + vals['link_target_database_server'], '-u ' + vals['link_target_service_db_user'], '-p' + vals['link_target_service_db_password'], '-se', diff --git a/saas_piwik/build.py b/clouder_template_piwik/build.py similarity index 80% rename from saas_piwik/build.py rename to clouder_template_piwik/build.py index 080a6d1..1fd3ca9 100644 --- a/saas_piwik/build.py +++ b/clouder_template_piwik/build.py @@ -29,23 +29,23 @@ from datetime import datetime, timedelta import subprocess import re -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_application(osv.osv): - _inherit = 'saas.application' +class clouder_application(osv.osv): + _inherit = 'clouder.application' -class saas_application_version(osv.osv): - _inherit = 'saas.application.version' +class clouder_application_version(osv.osv): + _inherit = 'clouder.application.version' def build_application(self, cr, uid, vals, context): - super(saas_application_version, self).build_application(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_application_version, self).build_application(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'piwik': - ssh, sftp = execute.connect('localhost', 22, 'saas-conductor', context) + ssh, sftp = execute.connect('localhost', 22, 'clouder-conductor', context) execute.execute(ssh, ['wget', '-q', 'http://builds.piwik.org/piwik.zip', 'piwik.zip'], context, path=vals['app_version_full_archivepath']) execute.execute(ssh, ['unzip', '-q', 'piwik.zip'], context, path=vals['app_version_full_archivepath']) execute.execute(ssh, ['mv', 'piwik/*', './'], context, path=vals['app_version_full_archivepath']) diff --git a/saas_piwik/saas_piwik_data.xml b/clouder_template_piwik/clouder_piwik_data.xml similarity index 80% rename from saas_piwik/saas_piwik_data.xml rename to clouder_template_piwik/clouder_piwik_data.xml index 91dcbd0..1127fd5 100644 --- a/saas_piwik/saas_piwik_data.xml +++ b/clouder_template_piwik/clouder_piwik_data.xml @@ -3,7 +3,7 @@ - + piwik www-data yodadmin @@ -12,7 +12,7 @@ /opt/versions /var/www - + port service @@ -20,7 +20,7 @@ - + img_piwik 8.0 - + /opt/versions /opt/services - + /var/www www-data - + /etc/nginx - + ssh 22 internet - + nginx 80 @@ -81,7 +81,7 @@ VOLUME /base-backup - + Piwik piwik @@ -97,39 +97,39 @@ VOLUME /base-backup 90 5 - + - + - + - + - + - + - + - + - + - + diff --git a/saas_piwik/deploy.py b/clouder_template_piwik/deploy.py similarity index 84% rename from saas_piwik/deploy.py rename to clouder_template_piwik/deploy.py index 8ce252e..467fa4d 100644 --- a/saas_piwik/deploy.py +++ b/clouder_template_piwik/deploy.py @@ -28,24 +28,24 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging _logger = logging.getLogger(__name__) -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def deploy_build(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_build(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_build(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'piwik': ssh, sftp = execute.connect(vals['container_fullname'], context=context) config_file = '/etc/nginx/sites-available/' + vals['base_fullname'] - sftp.put(modules.get_module_path('saas_piwik') + '/res/nginx.config', config_file) + sftp.put(modules.get_module_path('clouder_piwik') + '/res/nginx.config', config_file) execute.execute(ssh, ['sed', '-i', '"s/BASE/' + vals['base_name'] + '/g"', config_file], context) execute.execute(ssh, ['sed', '-i', '"s/DOMAIN/' + vals['domain_name'] + '/g"', config_file], context) execute.execute(ssh, ['sed', '-i', '"s/PATH/' + vals['service_full_localpath_files'].replace('/','\/') + '/g"', config_file], context) @@ -80,8 +80,8 @@ def deploy_build(self, cr, uid, vals, context=None): # def deploy_post(self, cr, uid, vals, context=None): - # res = super(saas_base, self).deploy_post(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_base, self).deploy_post(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['drush', 'vset', '--yes', '--exact', 'site_name', vals['base_title']], context, path=vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']) @@ -89,8 +89,8 @@ def deploy_build(self, cr, uid, vals, context=None): # sftp.close() # def deploy_create_poweruser(self, cr, uid, vals, context=None): - # res = super(saas_base, self).deploy_create_poweruser(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_base, self).deploy_create_poweruser(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) @@ -105,8 +105,8 @@ def deploy_build(self, cr, uid, vals, context=None): # # # def update_base(self, cr, uid, vals, context=None): - # res = super(saas_base, self).update_base(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_base, self).update_base(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['drush', 'updatedb'], context, path=vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']) @@ -115,13 +115,13 @@ def deploy_build(self, cr, uid, vals, context=None): # # return res -# class saas_save_save(osv.osv): -# _inherit = 'saas.save.save' +# class clouder_save_save(osv.osv): +# _inherit = 'clouder.save.save' # # # def deploy_base(self, cr, uid, vals, context=None): -# res = super(saas_save_save, self).deploy_base(cr, uid, vals, context) -# context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) +# res = super(clouder_save_save, self).deploy_base(cr, uid, vals, context) +# context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # # execute.execute(ssh, ['drush', 'archive-dump', vals['base_unique_name_'], '--destination=/base-backup/' + vals['saverepo_name'] + 'tar.gz'], context) @@ -132,8 +132,8 @@ def deploy_build(self, cr, uid, vals, context=None): # # # def restore_base(self, cr, uid, vals, context=None): -# res = super(saas_save_save, self).restore_base(cr, uid, vals, context) -# context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) +# res = super(clouder_save_save, self).restore_base(cr, uid, vals, context) +# context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['rm', '-rf', vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']], context) diff --git a/saas_piwik/purge.py b/clouder_template_piwik/purge.py similarity index 86% rename from saas_piwik/purge.py rename to clouder_template_piwik/purge.py index e38fd72..40bc0b3 100644 --- a/saas_piwik/purge.py +++ b/clouder_template_piwik/purge.py @@ -28,18 +28,18 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def purge_post(self, cr, uid, vals, context): - super(saas_base, self).purge_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_base, self).purge_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], context=context) diff --git a/saas_piwik/res/nginx.config b/clouder_template_piwik/res/nginx.config similarity index 100% rename from saas_piwik/res/nginx.config rename to clouder_template_piwik/res/nginx.config diff --git a/saas_piwik/res/proxy-sslonly.config b/clouder_template_piwik/res/proxy-sslonly.config similarity index 100% rename from saas_piwik/res/proxy-sslonly.config rename to clouder_template_piwik/res/proxy-sslonly.config diff --git a/saas_piwik/res/proxy.config b/clouder_template_piwik/res/proxy.config similarity index 100% rename from saas_piwik/res/proxy.config rename to clouder_template_piwik/res/proxy.config diff --git a/saas_postfix/__init__.py b/clouder_template_postfix/__init__.py similarity index 100% rename from saas_postfix/__init__.py rename to clouder_template_postfix/__init__.py diff --git a/clouder_template_postfix/__openerp__.py b/clouder_template_postfix/__openerp__.py new file mode 100644 index 0000000..7ff6320 --- /dev/null +++ b/clouder_template_postfix/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Yannick Buron +# Copyright 2013 Yannick Buron +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Clouder Postfix', + 'version': '1.0', + 'category': 'Community', + 'depends': ['clouder'], + 'author': 'Yannick Buron', + 'license': 'AGPL-3', + 'website': 'https://github.com/YannickB', + 'description': """ + Clouder Postfix + """, + 'demo': [], + 'data': ['clouder_postfix_data.xml'], + 'installable': True, + 'application': True, +} diff --git a/saas_postfix/saas_postfix_data.xml b/clouder_template_postfix/clouder_postfix_data.xml similarity index 85% rename from saas_postfix/saas_postfix_data.xml rename to clouder_template_postfix/clouder_postfix_data.xml index 6090999..4a5ecac 100644 --- a/saas_postfix/saas_postfix_data.xml +++ b/clouder_template_postfix/clouder_postfix_data.xml @@ -3,26 +3,26 @@ - + postfix postfix postfix postfix@localhost 25 - + mailchimp_username container - + mailchimp_apikey container - + img_postfix 1 > /etc/supervisor/conf.d/supervisord.conf RUN echo "[program:postfix]" >> /etc/supervisor/conf.d/supervisord.conf RUN echo "command=/etc/init.d/postfix start" >> /etc/supervisor/conf.d/supervisord.conf -ADD ./saas/saas_postfix/res/openerp_mailgate.py /bin/openerp_mailgate.py +ADD ./clouder/clouder_postfix/res/openerp_mailgate.py /bin/openerp_mailgate.py RUN chmod +x /bin/openerp_mailgate.py USER root ]]> - + /etc/postfix - + /etc/aliases-dir - + ssh 22 internet - + postfix 25 internet - + postfix postfix 1 diff --git a/saas_postfix/deploy.py b/clouder_template_postfix/deploy.py similarity index 89% rename from saas_postfix/deploy.py rename to clouder_template_postfix/deploy.py index b4ac905..2573aaf 100644 --- a/saas_postfix/deploy.py +++ b/clouder_template_postfix/deploy.py @@ -28,17 +28,17 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_container(osv.osv): - _inherit = 'saas.container' +class clouder_container(osv.osv): + _inherit = 'clouder.container' def deploy_post(self, cr, uid, vals, context): - super(saas_container, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_container, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'postfix': ssh, sftp = execute.connect(vals['container_fullname'], context=context) execute.execute(ssh, ['echo "relayhost = [smtp.mandrillapp.com]" >> /etc/postfix/main.cf'], context) diff --git a/saas_postfix/res/openerp_mailgate.py b/clouder_template_postfix/res/openerp_mailgate.py similarity index 100% rename from saas_postfix/res/openerp_mailgate.py rename to clouder_template_postfix/res/openerp_mailgate.py diff --git a/saas_postgres/__init__.py b/clouder_template_postgres/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from saas_postgres/__init__.py rename to clouder_template_postgres/__init__.py diff --git a/clouder_template_postgres/__openerp__.py b/clouder_template_postgres/__openerp__.py new file mode 100644 index 0000000..8d82400 --- /dev/null +++ b/clouder_template_postgres/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Yannick Buron +# Copyright 2013 Yannick Buron +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Clouder Postgres', + 'version': '1.0', + 'category': 'Community', + 'depends': ['clouder'], + 'author': 'Yannick Buron', + 'license': 'AGPL-3', + 'website': 'https://github.com/YannickB', + 'description': """ + Clouder Postgres + """, + 'demo': [], + 'data': ['clouder_postgres_data.xml'], + 'installable': True, + 'application': True, +} diff --git a/saas_postgres/saas_postgres_data.xml b/clouder_template_postgres/clouder_postgres_data.xml old mode 100755 new mode 100644 similarity index 80% rename from saas_postgres/saas_postgres_data.xml rename to clouder_template_postgres/clouder_postgres_data.xml index 33063e5..e16f4f8 --- a/saas_postgres/saas_postgres_data.xml +++ b/clouder_template_postgres/clouder_postgres_data.xml @@ -3,30 +3,30 @@ - + postgres postgres postgres postgres@localhost 5432 - + network container 172.17.0.0/16 - + listen container * - + img_postgres 9.1 - + - + /etc/postgresql postgres - + /var/log/postgresql postgres - + /var/lib/postgresql postgres - + ssh 22 internet - + postgres 5432 - + postgres postgres 9.1 diff --git a/saas_postgres/deploy.py b/clouder_template_postgres/deploy.py similarity index 86% rename from saas_postgres/deploy.py rename to clouder_template_postgres/deploy.py index 0db151e..e6e7eda 100644 --- a/saas_postgres/deploy.py +++ b/clouder_template_postgres/deploy.py @@ -28,17 +28,17 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_container(osv.osv): - _inherit = 'saas.container' +class clouder_container(osv.osv): + _inherit = 'clouder.container' def deploy_post(self, cr, uid, vals, context): - super(saas_container, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_container, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'postgres': ssh, sftp = execute.connect(vals['container_fullname'], context=context) execute.execute(ssh, ['echo "host all all ' + vals['container_options']['network']['value'] + ' md5" >> /etc/postgresql/' + vals['app_current_version'] + '/main/pg_hba.conf'], context) diff --git a/saas_proxy/__init__.py b/clouder_template_proxy/__init__.py similarity index 100% rename from saas_proxy/__init__.py rename to clouder_template_proxy/__init__.py diff --git a/clouder_template_proxy/__openerp__.py b/clouder_template_proxy/__openerp__.py new file mode 100644 index 0000000..561f3a5 --- /dev/null +++ b/clouder_template_proxy/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Yannick Buron +# Copyright 2013 Yannick Buron +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Clouder Proxy', + 'version': '1.0', + 'category': 'Community', + 'depends': ['clouder'], + 'author': 'Yannick Buron', + 'license': 'AGPL-3', + 'website': 'https://github.com/YannickB', + 'description': """ + Clouder Proxy + """, + 'demo': [], + 'data': ['clouder_proxy_data.xml'], + 'installable': True, + 'application': True, +} diff --git a/saas_proxy/base.py b/clouder_template_proxy/base.py similarity index 92% rename from saas_proxy/base.py rename to clouder_template_proxy/base.py index ccbfd52..e333caa 100644 --- a/saas_proxy/base.py +++ b/clouder_template_proxy/base.py @@ -25,24 +25,24 @@ from openerp.osv import fields, osv, orm from openerp.tools.translate import _ -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_base_link(osv.osv): - _inherit = 'saas.base.link' +class clouder_base_link(osv.osv): + _inherit = 'clouder.base.link' def deploy_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).deploy_link(cr, uid, vals, context=context) + super(clouder_base_link, self).deploy_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'proxy': if not vals['base_sslonly']: file = 'proxy.config' else: file = 'proxy-sslonly.config' ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) - execute.send(sftp, modules.get_module_path('saas_' + vals['apptype_name']) + '/res/' + file, vals['base_nginx_configfile'], context) + execute.send(sftp, modules.get_module_path('clouder_' + vals['apptype_name']) + '/res/' + file, vals['base_nginx_configfile'], context) execute.execute(ssh, ['sed', '-i', '"s/BASE/' + vals['base_name'] + '/g"', vals['base_nginx_configfile']], context) execute.execute(ssh, ['sed', '-i', '"s/DOMAIN/' + vals['domain_name'] + '/g"', vals['base_nginx_configfile']], context) execute.execute(ssh, ['sed', '-i', '"s/SERVER/' + vals['server_domain'] + '/g"', vals['base_nginx_configfile']], context) @@ -65,7 +65,7 @@ def deploy_link(self, cr, uid, vals, context={}): sftp.close() def purge_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).purge_link(cr, uid, vals, context=context) + super(clouder_base_link, self).purge_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'proxy': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) execute.execute(ssh, ['rm', '/etc/nginx/sites-enabled/' + vals['base_unique_name']], context) diff --git a/saas_proxy/saas_proxy_data.xml b/clouder_template_proxy/clouder_proxy_data.xml similarity index 84% rename from saas_proxy/saas_proxy_data.xml rename to clouder_template_proxy/clouder_proxy_data.xml index 58599f1..45b2106 100644 --- a/saas_proxy/saas_proxy_data.xml +++ b/clouder_template_proxy/clouder_proxy_data.xml @@ -3,7 +3,7 @@ - + proxy www-data admin @@ -11,12 +11,12 @@ 80 - + proxy proxy 2 - + 9999 30 90 diff --git a/saas_proxy/res/apache-sslonly.config b/clouder_template_proxy/res/apache-sslonly.config similarity index 100% rename from saas_proxy/res/apache-sslonly.config rename to clouder_template_proxy/res/apache-sslonly.config diff --git a/saas_proxy/res/apache.config b/clouder_template_proxy/res/apache.config similarity index 100% rename from saas_proxy/res/apache.config rename to clouder_template_proxy/res/apache.config diff --git a/saas_seafile/__init__.py b/clouder_template_seafile/__init__.py similarity index 100% rename from saas_seafile/__init__.py rename to clouder_template_seafile/__init__.py diff --git a/clouder_template_seafile/__openerp__.py b/clouder_template_seafile/__openerp__.py new file mode 100644 index 0000000..b682664 --- /dev/null +++ b/clouder_template_seafile/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Yannick Buron +# Copyright 2013 Yannick Buron +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Clouder Seafile', + 'version': '1.0', + 'category': 'Community', + 'depends': ['clouder'], + 'author': 'Yannick Buron', + 'license': 'AGPL-3', + 'website': 'https://github.com/YannickB', + 'description': """ + Clouder Seafile + """, + 'demo': [], + 'data': ['clouder_seafile_data.xml'], + 'installable': True, + 'application': True, +} diff --git a/saas_seafile/build.py b/clouder_template_seafile/build.py similarity index 84% rename from saas_seafile/build.py rename to clouder_template_seafile/build.py index 14ac35e..d60ed97 100644 --- a/saas_seafile/build.py +++ b/clouder_template_seafile/build.py @@ -29,20 +29,20 @@ from datetime import datetime, timedelta import subprocess import re -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_application_version(osv.osv): - _inherit = 'saas.application.version' +class clouder_application_version(osv.osv): + _inherit = 'clouder.application.version' def build_application(self, cr, uid, vals, context): - super(saas_application_version, self).build_application(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_application_version, self).build_application(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'seafile': - ssh, sftp = execute.connect('localhost', 22, 'saas-conductor', context) + ssh, sftp = execute.connect('localhost', 22, 'clouder-conductor', context) execute.execute(ssh,['wget', '-q', 'https://bitbucket.org/haiwen/seafile/downloads/seafile-server_' + vals['app_current_version'] + '_x86-64.tar.gz'], context, path=vals['app_version_full_archivepath']) execute.execute(ssh, ['tar', '-xzf', 'seafile-server_*'], context, path=vals['app_version_full_archivepath']) execute.execute(ssh, ['mv', 'seafile-server-' + vals['app_current_version'] + '/*', './'], context, path=vals['app_version_full_archivepath']) diff --git a/saas_seafile/saas_seafile_data.xml b/clouder_template_seafile/clouder_seafile_data.xml similarity index 78% rename from saas_seafile/saas_seafile_data.xml rename to clouder_template_seafile/clouder_seafile_data.xml index a8ebd0e..06384e5 100644 --- a/saas_seafile/saas_seafile_data.xml +++ b/clouder_template_seafile/clouder_seafile_data.xml @@ -3,7 +3,7 @@ - + seafile seafile heathcliff @@ -13,19 +13,19 @@ /opt/seafile ccnet,seafile,seahub - + manual_install base - + port service port - + img_seafile 8.0 - + /opt/versions /opt/services - + /opt/seafile seafile - + ssh 22 internet - + port 8000 internet - + seafile-fileserver 8082 internet - + seafile-ccnet 10001 internet - + seafile-server 12001 @@ -96,7 +96,7 @@ VOLUME /base-backup - + Seafile seafile @@ -113,39 +113,39 @@ VOLUME /base-backup 90 5 - + - + - + - + - + - + - + - + - + - + diff --git a/saas_seafile/deploy.py b/clouder_template_seafile/deploy.py similarity index 85% rename from saas_seafile/deploy.py rename to clouder_template_seafile/deploy.py index 1f11b19..5b79883 100644 --- a/saas_seafile/deploy.py +++ b/clouder_template_seafile/deploy.py @@ -28,7 +28,7 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging @@ -37,12 +37,12 @@ -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def deploy_build(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_build(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_build(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'seafile': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) install_args = ['\n', @@ -80,8 +80,8 @@ def deploy_build(self, cr, uid, vals, context=None): def deploy_post(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'seafile': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['echo "[program:' + vals['base_unique_name'] + '-seafile]" >> /opt/seafile/supervisor.conf'], context) @@ -93,13 +93,13 @@ def deploy_post(self, cr, uid, vals, context=None): sftp.close() return res -class saas_save_save(osv.osv): - _inherit = 'saas.save.save' +class clouder_save_save(osv.osv): + _inherit = 'clouder.save.save' # # def deploy_base(self, cr, uid, vals, context=None): - # res = super(saas_save_save, self).deploy_base(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_save_save, self).deploy_base(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['cp', '-R', vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain'], '/base-backup/' + vals['saverepo_name'] + '/site'], context) @@ -109,8 +109,8 @@ class saas_save_save(osv.osv): # # # def restore_base(self, cr, uid, vals, context=None): - # res = super(saas_save_save, self).restore_base(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_save_save, self).restore_base(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['rm', '-rf', vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']], context) diff --git a/saas_seafile/purge.py b/clouder_template_seafile/purge.py similarity index 88% rename from saas_seafile/purge.py rename to clouder_template_seafile/purge.py index fee6888..aeef914 100644 --- a/saas_seafile/purge.py +++ b/clouder_template_seafile/purge.py @@ -28,7 +28,7 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) @@ -36,12 +36,12 @@ -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def purge_post(self, cr, uid, vals, context): - super(saas_base, self).purge_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_base, self).purge_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'seafile': ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) execute.execute(ssh, ['sed', '-i', '"/program:' + vals['base_unique_name'] + '-seafile/d"', '/opt/seafile/supervisor.conf'], context) diff --git a/saas_seafile/res/apache-sslonly.config b/clouder_template_seafile/res/apache-sslonly.config similarity index 100% rename from saas_seafile/res/apache-sslonly.config rename to clouder_template_seafile/res/apache-sslonly.config diff --git a/saas_seafile/res/apache.config b/clouder_template_seafile/res/apache.config similarity index 100% rename from saas_seafile/res/apache.config rename to clouder_template_seafile/res/apache.config diff --git a/saas_seafile/res/nginx.config b/clouder_template_seafile/res/nginx.config similarity index 100% rename from saas_seafile/res/nginx.config rename to clouder_template_seafile/res/nginx.config diff --git a/saas_seafile/res/openerp.config b/clouder_template_seafile/res/openerp.config similarity index 100% rename from saas_seafile/res/openerp.config rename to clouder_template_seafile/res/openerp.config diff --git a/saas_seafile/res/openerp.init b/clouder_template_seafile/res/openerp.init similarity index 100% rename from saas_seafile/res/openerp.init rename to clouder_template_seafile/res/openerp.init diff --git a/saas_seafile/res/proxy-sslonly.config b/clouder_template_seafile/res/proxy-sslonly.config similarity index 100% rename from saas_seafile/res/proxy-sslonly.config rename to clouder_template_seafile/res/proxy-sslonly.config diff --git a/saas_seafile/res/proxy.config b/clouder_template_seafile/res/proxy.config similarity index 100% rename from saas_seafile/res/proxy.config rename to clouder_template_seafile/res/proxy.config diff --git a/saas_seafile/res/wikicompare.script b/clouder_template_seafile/res/wikicompare.script similarity index 100% rename from saas_seafile/res/wikicompare.script rename to clouder_template_seafile/res/wikicompare.script diff --git a/saas_shinken/__init__.py b/clouder_template_shinken/__init__.py similarity index 100% rename from saas_shinken/__init__.py rename to clouder_template_shinken/__init__.py diff --git a/saas_drupal/__openerp__.py b/clouder_template_shinken/__openerp__.py similarity index 89% rename from saas_drupal/__openerp__.py rename to clouder_template_shinken/__openerp__.py index e57003d..39f0bab 100644 --- a/saas_drupal/__openerp__.py +++ b/clouder_template_shinken/__openerp__.py @@ -20,18 +20,18 @@ ############################################################################## { - 'name': 'SaaS Drupal', + 'name': 'Clouder Shinken', 'version': '1.0', 'category': 'Community', - 'depends': ['saas_postgres', 'saas_piwik'], + 'depends': ['clouder_template_postfix'], 'author': 'Yannick Buron', 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ - SaaS Drupal + Clouder Shinken """, 'demo': [], - 'data': ['saas_drupal_data.xml'], + 'data': ['clouder_shinken_data.xml'], 'installable': True, 'application': True, } diff --git a/saas_shinken/base.py b/clouder_template_shinken/base.py similarity index 87% rename from saas_shinken/base.py rename to clouder_template_shinken/base.py index 3f50d4b..637af90 100644 --- a/saas_shinken/base.py +++ b/clouder_template_shinken/base.py @@ -25,23 +25,23 @@ from openerp.osv import fields, osv, orm from openerp.tools.translate import _ -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_base_link(osv.osv): - _inherit = 'saas.base.link' +class clouder_base_link(osv.osv): + _inherit = 'clouder.base.link' def deploy_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).deploy_link(cr, uid, vals, context=context) + super(clouder_base_link, self).deploy_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'shinken': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) file = 'base-shinken' if vals['base_nosave']: file = 'base-shinken-nosave' - sftp.put(modules.get_module_path('saas_shinken') + '/res/' + file + '.config', vals['base_shinken_configfile']) + sftp.put(modules.get_module_path('clouder_shinken') + '/res/' + file + '.config', vals['base_shinken_configfile']) execute.execute(ssh, ['sed', '-i', '"s/TYPE/base/g"', vals['base_shinken_configfile']], context) execute.execute(ssh, ['sed', '-i', '"s/UNIQUE_NAME/' + vals['base_unique_name_'] + '/g"', vals['base_shinken_configfile']], context) execute.execute(ssh, ['sed', '-i', '"s/DATABASES/' + vals['base_databases_comma'] + '/g"', vals['base_shinken_configfile']], context) @@ -54,7 +54,7 @@ def deploy_link(self, cr, uid, vals, context={}): sftp.close() def purge_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).purge_link(cr, uid, vals, context=context) + super(clouder_base_link, self).purge_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'shinken': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) execute.execute(ssh, ['rm', vals['base_shinken_configfile']], context) diff --git a/saas_shinken/saas_shinken_data.xml b/clouder_template_shinken/clouder_shinken_data.xml similarity index 80% rename from saas_shinken/saas_shinken_data.xml rename to clouder_template_shinken/clouder_shinken_data.xml index 9165029..b808ada 100644 --- a/saas_shinken/saas_shinken_data.xml +++ b/clouder_template_shinken/clouder_shinken_data.xml @@ -3,7 +3,7 @@ - + shinken shinken admin @@ -11,7 +11,7 @@ 7767 - + img_shinken 1 > /etc/supervisor/conf.d/supervisord.conf @@ -47,17 +47,17 @@ RUN chmod -R 700 /home/shinken/.ssh USER root ]]> - + /usr/local/shinken/etc - + ssh 22 internet - + shinken 7767 @@ -65,7 +65,7 @@ USER root - + shinken shinken 1 @@ -81,9 +81,9 @@ USER root 90 5 - + - + diff --git a/saas_shinken/container.py b/clouder_template_shinken/container.py similarity index 86% rename from saas_shinken/container.py rename to clouder_template_shinken/container.py index 603f827..be986b2 100644 --- a/saas_shinken/container.py +++ b/clouder_template_shinken/container.py @@ -25,23 +25,23 @@ from openerp.osv import fields, osv, orm from openerp.tools.translate import _ -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_container_link(osv.osv): - _inherit = 'saas.container.link' +class clouder_container_link(osv.osv): + _inherit = 'clouder.container.link' def deploy_link(self, cr, uid, vals, context={}): - super(saas_container_link, self).deploy_link(cr, uid, vals, context=context) + super(clouder_container_link, self).deploy_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'shinken': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) file = 'container-shinken' if vals['container_no_save']: file = 'container-shinken-nosave' - sftp.put(modules.get_module_path('saas_shinken') + '/res/' + file + '.config', vals['container_shinken_configfile']) + sftp.put(modules.get_module_path('clouder_shinken') + '/res/' + file + '.config', vals['container_shinken_configfile']) execute.execute(ssh, ['sed', '-i', '"s/METHOD/' + vals['config_restore_method'] + '/g"', vals['container_shinken_configfile']], context) execute.execute(ssh, ['sed', '-i', '"s/TYPE/container/g"', vals['container_shinken_configfile']], context) execute.execute(ssh, ['sed', '-i', '"s/CONTAINER/' + vals['backup_fullname'] + '/g"', vals['container_shinken_configfile']], context) @@ -54,7 +54,7 @@ def deploy_link(self, cr, uid, vals, context={}): sftp.close() def purge_link(self, cr, uid, vals, context={}): - super(saas_container_link, self).purge_link(cr, uid, vals, context=context) + super(clouder_container_link, self).purge_link(cr, uid, vals, context=context) if vals['link_target_app_code'] == 'shinken': ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) execute.execute(ssh, ['rm', vals['container_shinken_configfile']], context) diff --git a/saas_shinken/res/base-shinken-nosave.config b/clouder_template_shinken/res/base-shinken-nosave.config similarity index 100% rename from saas_shinken/res/base-shinken-nosave.config rename to clouder_template_shinken/res/base-shinken-nosave.config diff --git a/saas_shinken/res/base-shinken.config b/clouder_template_shinken/res/base-shinken.config similarity index 100% rename from saas_shinken/res/base-shinken.config rename to clouder_template_shinken/res/base-shinken.config diff --git a/saas_shinken/res/container-shinken-nosave.config b/clouder_template_shinken/res/container-shinken-nosave.config similarity index 100% rename from saas_shinken/res/container-shinken-nosave.config rename to clouder_template_shinken/res/container-shinken-nosave.config diff --git a/saas_shinken/res/container-shinken.config b/clouder_template_shinken/res/container-shinken.config similarity index 100% rename from saas_shinken/res/container-shinken.config rename to clouder_template_shinken/res/container-shinken.config diff --git a/saas_shinken/res/control_backup.sh b/clouder_template_shinken/res/control_backup.sh similarity index 100% rename from saas_shinken/res/control_backup.sh rename to clouder_template_shinken/res/control_backup.sh diff --git a/saas_shinken/res/general-shinken.config b/clouder_template_shinken/res/general-shinken.config similarity index 100% rename from saas_shinken/res/general-shinken.config rename to clouder_template_shinken/res/general-shinken.config diff --git a/saas_shinken/res/server-shinken.config b/clouder_template_shinken/res/server-shinken.config similarity index 100% rename from saas_shinken/res/server-shinken.config rename to clouder_template_shinken/res/server-shinken.config diff --git a/saas_wordpress/__init__.py b/clouder_template_wordpress/__init__.py similarity index 100% rename from saas_wordpress/__init__.py rename to clouder_template_wordpress/__init__.py diff --git a/saas_wordpress/__openerp__.py b/clouder_template_wordpress/__openerp__.py similarity index 90% rename from saas_wordpress/__openerp__.py rename to clouder_template_wordpress/__openerp__.py index 4d2cd21..1437269 100644 --- a/saas_wordpress/__openerp__.py +++ b/clouder_template_wordpress/__openerp__.py @@ -20,19 +20,19 @@ ############################################################################## { - 'name': 'SaaS Wordpress', + 'name': 'Clouder Wordpress', 'version': '1.0', 'category': 'Community', - 'depends': ['saas'], + 'depends': ['clouder'], 'author': 'Yannick Buron', 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ - SaaS Wordpress + Clouder Wordpress """, 'demo': [], 'data': [ - 'saas_wordpress_data.xml' + 'clouder_wordpress_data.xml' ], 'installable': True, 'application': True, diff --git a/saas_wordpress/build.py b/clouder_template_wordpress/build.py similarity index 80% rename from saas_wordpress/build.py rename to clouder_template_wordpress/build.py index faf4c24..aef6890 100644 --- a/saas_wordpress/build.py +++ b/clouder_template_wordpress/build.py @@ -29,23 +29,23 @@ from datetime import datetime, timedelta import subprocess import re -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_application(osv.osv): - _inherit = 'saas.application' +class clouder_application(osv.osv): + _inherit = 'clouder.application' -class saas_application_version(osv.osv): - _inherit = 'saas.application.version' +class clouder_application_version(osv.osv): + _inherit = 'clouder.application.version' def build_application(self, cr, uid, vals, context): - super(saas_application_version, self).build_application(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_application_version, self).build_application(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'wordpress': - ssh, sftp = execute.connect('localhost', 22, 'saas-conductor', context) + ssh, sftp = execute.connect('localhost', 22, 'clouder-conductor', context) execute.execute(ssh, ['wget', '-q', 'https://wordpress.org/latest.tar.gz', 'latest.tar.gz'], context, path=vals['app_version_full_archivepath']) execute.execute(ssh, ['tar', '-xzf', 'latest.tar.gz'], context, path=vals['app_version_full_archivepath']) execute.execute(ssh, ['mv', 'wordpress/*', './'], context, path=vals['app_version_full_archivepath']) diff --git a/saas_wordpress/saas_wordpress_data.xml b/clouder_template_wordpress/clouder_wordpress_data.xml similarity index 78% rename from saas_wordpress/saas_wordpress_data.xml rename to clouder_template_wordpress/clouder_wordpress_data.xml index 4dbc754..355d1cf 100644 --- a/saas_wordpress/saas_wordpress_data.xml +++ b/clouder_template_wordpress/clouder_wordpress_data.xml @@ -3,7 +3,7 @@ - + wordpress www-data yodadmin @@ -12,7 +12,7 @@ /opt/versions /var/www - + port service @@ -20,7 +20,7 @@ - + img_wordpress 8.0 - + /opt/versions /opt/services - + /var/www - + /etc/nginx - + ssh 22 internet - + nginx 80 @@ -79,7 +79,7 @@ VOLUME /base-backup - + Wordpress wp @@ -95,47 +95,47 @@ VOLUME /base-backup 90 5 - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/saas_wordpress/deploy.py b/clouder_template_wordpress/deploy.py similarity index 84% rename from saas_wordpress/deploy.py rename to clouder_template_wordpress/deploy.py index 05c1754..a66d5fa 100644 --- a/saas_wordpress/deploy.py +++ b/clouder_template_wordpress/deploy.py @@ -28,24 +28,24 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging _logger = logging.getLogger(__name__) -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def deploy_build(self, cr, uid, vals, context=None): - res = super(saas_base, self).deploy_build(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + res = super(clouder_base, self).deploy_build(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'wordpress': ssh, sftp = execute.connect(vals['container_fullname'], context=context) config_file = '/etc/nginx/sites-available/' + vals['base_fullname'] - sftp.put(modules.get_module_path('saas_wordpress') + '/res/nginx.config', config_file) + sftp.put(modules.get_module_path('clouder_wordpress') + '/res/nginx.config', config_file) execute.execute(ssh, ['sed', '-i', '"s/BASE/' + vals['base_name'] + '/g"', config_file], context) execute.execute(ssh, ['sed', '-i', '"s/DOMAIN/' + vals['domain_name'] + '/g"', config_file], context) execute.execute(ssh, ['sed', '-i', '"s/PATH/' + vals['service_full_localpath_files'].replace('/','\/') + '/g"', config_file], context) @@ -80,8 +80,8 @@ def deploy_build(self, cr, uid, vals, context=None): # def deploy_post(self, cr, uid, vals, context=None): - # res = super(saas_base, self).deploy_post(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_base, self).deploy_post(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['drush', 'vset', '--yes', '--exact', 'site_name', vals['base_title']], context, path=vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']) @@ -89,8 +89,8 @@ def deploy_build(self, cr, uid, vals, context=None): # sftp.close() # def deploy_create_poweruser(self, cr, uid, vals, context=None): - # res = super(saas_base, self).deploy_create_poweruser(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_base, self).deploy_create_poweruser(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) @@ -105,8 +105,8 @@ def deploy_build(self, cr, uid, vals, context=None): # # # def update_base(self, cr, uid, vals, context=None): - # res = super(saas_base, self).update_base(cr, uid, vals, context) - # context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + # res = super(clouder_base, self).update_base(cr, uid, vals, context) + # context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['drush', 'updatedb'], context, path=vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']) @@ -115,13 +115,13 @@ def deploy_build(self, cr, uid, vals, context=None): # # return res -# class saas_save_save(osv.osv): -# _inherit = 'saas.save.save' +# class clouder_save_save(osv.osv): +# _inherit = 'clouder.save.save' # # # def deploy_base(self, cr, uid, vals, context=None): -# res = super(saas_save_save, self).deploy_base(cr, uid, vals, context) -# context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) +# res = super(clouder_save_save, self).deploy_base(cr, uid, vals, context) +# context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # # execute.execute(ssh, ['drush', 'archive-dump', vals['base_unique_name_'], '--destination=/base-backup/' + vals['saverepo_name'] + 'tar.gz'], context) @@ -132,8 +132,8 @@ def deploy_build(self, cr, uid, vals, context=None): # # # def restore_base(self, cr, uid, vals, context=None): -# res = super(saas_save_save, self).restore_base(cr, uid, vals, context) -# context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) +# res = super(clouder_save_save, self).restore_base(cr, uid, vals, context) +# context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) # if vals['apptype_name'] == 'drupal': # ssh, sftp = execute.connect(vals['container_fullname'], username=vals['apptype_system_user'], context=context) # execute.execute(ssh, ['rm', '-rf', vals['service_full_localpath_files'] + '/sites/' + vals['base_fulldomain']], context) diff --git a/saas_wordpress/purge.py b/clouder_template_wordpress/purge.py similarity index 86% rename from saas_wordpress/purge.py rename to clouder_template_wordpress/purge.py index e38fd72..40bc0b3 100644 --- a/saas_wordpress/purge.py +++ b/clouder_template_wordpress/purge.py @@ -28,18 +28,18 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import logging _logger = logging.getLogger(__name__) -class saas_base(osv.osv): - _inherit = 'saas.base' +class clouder_base(osv.osv): + _inherit = 'clouder.base' def purge_post(self, cr, uid, vals, context): - super(saas_base, self).purge_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_base, self).purge_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'drupal': ssh, sftp = execute.connect(vals['container_fullname'], context=context) diff --git a/saas_wordpress/res/nginx.config b/clouder_template_wordpress/res/nginx.config similarity index 100% rename from saas_wordpress/res/nginx.config rename to clouder_template_wordpress/res/nginx.config diff --git a/saas_wordpress/res/proxy-sslonly.config b/clouder_template_wordpress/res/proxy-sslonly.config similarity index 100% rename from saas_wordpress/res/proxy-sslonly.config rename to clouder_template_wordpress/res/proxy-sslonly.config diff --git a/saas_wordpress/res/proxy.config b/clouder_template_wordpress/res/proxy.config similarity index 100% rename from saas_wordpress/res/proxy.config rename to clouder_template_wordpress/res/proxy.config diff --git a/saas_users/__init__.py b/clouder_users/__init__.py similarity index 100% rename from saas_users/__init__.py rename to clouder_users/__init__.py diff --git a/saas_users/__openerp__.py b/clouder_users/__openerp__.py similarity index 91% rename from saas_users/__openerp__.py rename to clouder_users/__openerp__.py index 69ea763..55c633f 100644 --- a/saas_users/__openerp__.py +++ b/clouder_users/__openerp__.py @@ -20,15 +20,15 @@ ############################################################################## { - 'name': 'SaaS Users', + 'name': 'Clouder Users', 'version': '1.0', 'category': 'Community', - 'depends': ['saas', 'saas_ldap','ldap_admin'], + 'depends': ['clouder', 'clouder_template_ldap','ldap_admin'], 'author': 'Yannick Buron', 'license': 'AGPL-3', 'website': 'https://github.com/YannickB', 'description': """ - SaaS Users + Clouder Users """, 'demo': [], 'data': [], diff --git a/saas_users/deploy.py b/clouder_users/deploy.py similarity index 86% rename from saas_users/deploy.py rename to clouder_users/deploy.py index 36acf12..429b4fb 100644 --- a/saas_users/deploy.py +++ b/clouder_users/deploy.py @@ -28,7 +28,7 @@ import time from datetime import datetime, timedelta import subprocess -import openerp.addons.saas.execute as execute +import openerp.addons.clouder.execute as execute import erppeek import logging @@ -36,12 +36,12 @@ -class saas_container(osv.osv): - _inherit = 'saas.container' +class clouder_container(osv.osv): + _inherit = 'clouder.container' def deploy_post(self, cr, uid, vals, context): - super(saas_container, self).deploy_post(cr, uid, vals, context) - context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid}) + super(clouder_container, self).deploy_post(cr, uid, vals, context) + context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid}) if vals['apptype_name'] == 'openldap': domain_dc = '' @@ -65,4 +65,4 @@ def purge(self, cr, uid, vals, context={}): server_obj = self.pool.get('ldap.server') server_ids = server_obj.search(cr, uid, [('host','=',vals['server_domain']),('port','=',vals['container_ports']['openldap']['hostport'])]) server_obj.unlink(cr, uid, server_ids, context=context) - return super(saas_container, self).purge(cr, uid, vals, context) \ No newline at end of file + return super(clouder_container, self).purge(cr, uid, vals, context) \ No newline at end of file diff --git a/saas_bind/base.py b/saas_bind/base.py deleted file mode 100644 index 17aa138..0000000 --- a/saas_bind/base.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Buron -# Copyright 2013 Yannick Buron -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -from openerp import netsvc -from openerp import pooler -from openerp.osv import fields, osv, orm -from openerp.tools.translate import _ - -import openerp.addons.saas.execute as execute - -import logging -_logger = logging.getLogger(__name__) - - -class saas_base_link(osv.osv): - _inherit = 'saas.base.link' - - def deploy_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).deploy_link(cr, uid, vals, context=context) - if vals['link_target_app_code'] == 'bind': - ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) - execute.execute(ssh, ['echo "' + vals['base_name'] + ' IN CNAME ' + ('proxy' in vals['base_links'] and vals['base_links']['proxy']['target']['link_server_domain'] or vals['server_domain']) + '." >> ' + vals['domain_configfile']], context) - if 'postfix' in vals['base_links']: - execute.execute(ssh, ['echo "IN MX 1 ' + vals['base_links']['postfix']['target']['link_server_domain'] + '. ;' + vals['base_name'] + ' IN CNAME" >> ' + vals['domain_configfile']], context) - execute.execute(ssh, ['/etc/init.d/bind9', 'restart'], context) - ssh.close() - sftp.close() - - def purge_link(self, cr, uid, vals, context={}): - super(saas_base_link, self).purge_link(cr, uid, vals, context=context) - if vals['link_target_app_code'] == 'bind': - ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context) - execute.execute(ssh, ['sed', '-i', '"/' + vals['base_name'] + '\sIN\sCNAME/d"', vals['domain_configfile']], context) - execute.execute(ssh, ['/etc/init.d/bind9', 'restart'], context) - ssh.close() - sftp.close() \ No newline at end of file diff --git a/saas_mysql/__openerp__.py b/saas_mysql/__openerp__.py deleted file mode 100644 index c63bafc..0000000 --- a/saas_mysql/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Buron -# Copyright 2013 Yannick Buron -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'SaaS MySQL', - 'version': '1.0', - 'category': 'Community', - 'depends': ['saas'], - 'author': 'Yannick Buron', - 'license': 'AGPL-3', - 'website': 'https://github.com/YannickB', - 'description': """ - SaaS MySQL - """, - 'demo': [], - 'data': ['saas_mysql_data.xml'], - 'installable': True, - 'application': True, -} diff --git a/saas_piwik/__openerp__.py b/saas_piwik/__openerp__.py deleted file mode 100644 index cd752a4..0000000 --- a/saas_piwik/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Buron -# Copyright 2013 Yannick Buron -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'SaaS Piwik', - 'version': '1.0', - 'category': 'Community', - 'depends': ['saas_mysql', 'saas_bind', 'saas_proxy', 'saas_shinken'], - 'author': 'Yannick Buron', - 'license': 'AGPL-3', - 'website': 'https://github.com/YannickB', - 'description': """ - SaaS Piwik - """, - 'demo': [], - 'data': ['saas_piwik_data.xml'], - 'installable': True, - 'application': True, -} diff --git a/saas_postfix/__openerp__.py b/saas_postfix/__openerp__.py deleted file mode 100644 index c6d7bf1..0000000 --- a/saas_postfix/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Buron -# Copyright 2013 Yannick Buron -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'SaaS Postfix', - 'version': '1.0', - 'category': 'Community', - 'depends': ['saas'], - 'author': 'Yannick Buron', - 'license': 'AGPL-3', - 'website': 'https://github.com/YannickB', - 'description': """ - SaaS Postfix - """, - 'demo': [], - 'data': ['saas_postfix_data.xml'], - 'installable': True, - 'application': True, -} diff --git a/saas_postgres/__openerp__.py b/saas_postgres/__openerp__.py deleted file mode 100755 index fcac7e9..0000000 --- a/saas_postgres/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Buron -# Copyright 2013 Yannick Buron -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'SaaS Postgres', - 'version': '1.0', - 'category': 'Community', - 'depends': ['saas'], - 'author': 'Yannick Buron', - 'license': 'AGPL-3', - 'website': 'https://github.com/YannickB', - 'description': """ - SaaS Postgres - """, - 'demo': [], - 'data': ['saas_postgres_data.xml'], - 'installable': True, - 'application': True, -} diff --git a/saas_proxy/__openerp__.py b/saas_proxy/__openerp__.py deleted file mode 100644 index 76735a0..0000000 --- a/saas_proxy/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Buron -# Copyright 2013 Yannick Buron -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'SaaS Proxy', - 'version': '1.0', - 'category': 'Community', - 'depends': ['saas'], - 'author': 'Yannick Buron', - 'license': 'AGPL-3', - 'website': 'https://github.com/YannickB', - 'description': """ - SaaS Proxy - """, - 'demo': [], - 'data': ['saas_proxy_data.xml'], - 'installable': True, - 'application': True, -} diff --git a/saas_seafile/__openerp__.py b/saas_seafile/__openerp__.py deleted file mode 100644 index 5167ecb..0000000 --- a/saas_seafile/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Buron -# Copyright 2013 Yannick Buron -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'SaaS Seafile', - 'version': '1.0', - 'category': 'Community', - 'depends': ['saas'], - 'author': 'Yannick Buron', - 'license': 'AGPL-3', - 'website': 'https://github.com/YannickB', - 'description': """ - SaaS Seafile - """, - 'demo': [], - 'data': ['saas_seafile_data.xml'], - 'installable': True, - 'application': True, -} diff --git a/saas_shinken/__openerp__.py b/saas_shinken/__openerp__.py deleted file mode 100644 index cbf8805..0000000 --- a/saas_shinken/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Buron -# Copyright 2013 Yannick Buron -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'SaaS Shinken', - 'version': '1.0', - 'category': 'Community', - 'depends': ['saas_postfix'], - 'author': 'Yannick Buron', - 'license': 'AGPL-3', - 'website': 'https://github.com/YannickB', - 'description': """ - SaaS Shinken - """, - 'demo': [], - 'data': ['saas_shinken_data.xml'], - 'installable': True, - 'application': True, -}