Changeset 785

Show
Ignore:
Timestamp:
09/05/08 21:50:55 (3 months ago)
Author:
free
Message:

Added _Squirrelmail class

Location:
ares/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ares/trunk/ares.py

    r779 r785  
    5656        self.monit    = _Monit(self) 
    5757        self.ssl      = _Ssl(self) 
     58        self.squirrel = _Squirrel(self) 
    5859 
    5960if __name__ == '__main__': 
     
    322323        dst = self._ares.root + dir + '/ssl.conf' 
    323324        src = '../mods-available/ssl.conf' 
    324         if not os.path.exists(dst): 
     325        if not os.path.islink(dst): 
    325326            os.symlink(src,dst) 
    326327 
    327328        dst = self._ares.root + dir + '/ssl.load' 
    328329        src = '../mods-available/ssl.load' 
    329         if not os.path.exists(dst): 
     330        if not os.path.islink(dst): 
    330331            os.symlink(src,dst) 
     332 
     333# 
     334# Squirrelmail 
     335# 
     336class _Squirrel: 
     337 
     338    def __init__(self, ares): 
     339        self._ares = ares 
     340 
     341    def setup(self): 
     342        f = open(self._ares.root + 'etc/mailname', 'w+') 
     343        f.write("%s\n" % (self._ares.fqdn)) 
     344        f.close() 
     345 
     346        f = open(self._ares.root + 'etc/apache2/conf.d/squirrelmail.conf', 'w+') 
     347        f.write('<VirtualHost *>\n') 
     348        f.write('  DocumentRoot /usr/share/squirrelmail\n') 
     349        f.write('  ServerName %s\n' % (self._ares.fqdn)) 
     350        f.write('  SSLEngine on\n') 
     351        f.write('  SSLCertificateFile /etc/apache2/apache.pem\n') 
     352        f.write('</VirtualHost>\n') 
     353        f.close() 
     354 
     355        aug = self._ares.aug 
     356 
     357        cfg = '/files/etc/default/locale' 
     358        loc = aug.get(cfg + '/LANG').lstrip('"').rstrip('"').split('.')[0] 
     359 
     360        cfg = '/files/etc/squirrelmail/config.php' 
     361        aug.set(cfg + '/$squirrelmail_default_language', '\'%s\'' % loc) 
     362 
     363        cfg = '/files/etc/php5/apache2/php.ini' 
     364        aug.set(cfg + '/PHP/memory_limit', '32M') 
     365 
  • ares/trunk/tests/TestAres.py

    r779 r785  
    2222        ares.monit.setup() 
    2323        ares.ssl.setup() 
     24        ares.squirrel.setup() 
    2425        ares.aug.save() 
    2526