Modularisation
From stoney cloud
Contents
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
The names of the modules are derived from the service functionality. They are different from the marketing names. These marketing names should be configurable per reseller. Needs a schema modification.
Selfcare Module
- selfcare-backup (on-line backup module, marketing name is stoney safe)
- selfcare-storage (on-line storage module, marketing name is stoney box)
- selfcare-web
- (selfcare-database) -> may be part of web-web
- selfcare-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 Selfcare 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?
- Use memcached?
- Use a file with one include per module?
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