Modularisation

From stoney cloud
Revision as of 14:52, 23 October 2013 by Michael (Talk | contribs)


Jump to: navigation, search

Requirements

Core

  • User, Customer, Reseller
  • Roles and rights
  • Billing
  • Forgot Password
  • ...

Modules: Service/Product specific:

  • Online Backup (stoney safe)
  • Mail Hosting (stoney mail)
  • VM-Manager (stoney conductor)
  • VM-Manager light (stoney vm): Start, stop, access a VM.

GitHub:

  • Form follows function: we choose the functionality name (so we are backwards compatible)
  • Web Modules are collected in one repository (create a skeleton module as an example):
    • Data (LDAP): load.ldif
    • API (PHP): api.php
    • Web Interface (HTML/JS/CSS, uses API): gui.js
    • Tests (GUI, Unit-Tests, ...): test.xml
    • CLI (Python, Perl, PHP, Bash with curl ... uses API): api.sh
  • Service Modules
    • Provisioning (Perl, ...): prov.pl
    • Helper Scripts, like notifications (quota, backup failed, rsnapshot, ...): helper.pl
    • Tests (CLI, Unit-Tests, ...): test.sh

Module Naming

Web Module

  • web-backup
  • web-storage
  • web-web
  • (web-database) -> may be part of web-web
  • web-dns (currently API code only)

Service Modules

  • service-web-apache
  • service-database-mariadb
  • service-database-mysql
  • service-database-postgresql
  • service-dns-powerdns
  • service-backup-kvm
  • service-backup-rsnapshot

GitHub

Proposed directory structure on GitHub.

Directory Structure Web Module

/data             # 
/data/ldif        # LDAP: load.ldif
/api              # API (PHP): api.php
/api/...          # Structure from CWI according to best practice from the Yii-Framework (a separation of configuration and code would be nice).
/api/...          # It would be nice, if the configuration files could be outside the web root (htdocs), so that a miss-configuration of 
/api/...          # the web server does not lead to password leaks.
/web              # Web Interface (HTML/JS/CSS, uses API): gui.js
/web/...          # 
/cli              # CLI (Python, Perl, PHP, Bash with curl ... uses API): api.sh
/cli/...          # 
/test             # Tests (GUI, Unit-Tests, ...): test.xml
/test/...         # 

It would be nice to be able to install new modules without the need to modify the main configuration file. Maybe with single configuration files per module? Or do you have other suggestions?

Directory Structure Service Module

Example for service-backup-rsnapshot:

/bin                                    # Helper Scripts, like notifications (quota, backup failed, rsnapshot, ...): helper.pl
/etc                                    # Configuration
/etc/Provsioning                        #
/etc/Provsioning/Backup                 #
/etc/Provsioning/Backup                 #
/lib                                    # Provisioning Perl-Modules for a dedicated Service: KVM.pm or rsnapshot.pm
/lib/perl                               #
/lib/perl/Provisioning                  #
/lib/perl/Provisioning/Backup           #
/lib/perl/Provisioning/Backup/Rsnapshot # 
/libexec                                #
/test                                   # Tests (CLI, Unit-Tests, ...): test.sh