Example #1
0
def install() :
  if isInstalled() :
    return
  
  debugOutput("Installing utils")
  
  for app in APPS :
    interface.updateProgress(); apt.install(app)
Example #2
0
def install():
    debugOutput("Installing")
    if apt.isInstalled("php4"):
        debugOutput("php4 is installed")

    interface.updateProgress("Install php4")

    apt.install("php4 libapache2-mod-php4 php4-mysql")

    configure()
Example #3
0
def install():
    debugOutput("Installing")
    if apt.isInstalled("mysql-server"):
        debugOutput("mysql is installed")

    interface.updateProgress("Installing mysql (this takes a while!)")

    apt.install("mysql-server")

    configure()
Example #4
0
def install() :
  debugOutput("Installing")
  if apt.isInstalled("php4") :
    debugOutput("php4 is installed")

  interface.updateProgress("Install php4")

  apt.install("php4 libapache2-mod-php4 php4-mysql")

  configure()
Example #5
0
def install() :
  debugOutput("Installing")
  if apt.isInstalled("mysql-server") :
    debugOutput("mysql is installed")
  
  interface.updateProgress("Installing mysql (this takes a while!)")
  
  apt.install("mysql-server")

  configure()
Example #6
0
def install():
    debugOutput("Installing")
    if apt.isInstalled("apache2"):
        debugOutput("apache2 is installed")

    interface.updateProgress("Installing apache2")

    apt.install("apache2")

    # Enable mod_proxy.
    system.run("a2enmod proxy", exitOnFail=False)
    system.run("a2enmod proxy_http", exitOnFail=False)

    # Disable default apache site.
    setSiteEnabled("default", False)
Example #7
0
def install() :
  debugOutput("Installing")
  if apt.isInstalled("apache2") :
    debugOutput("apache2 is installed")

  interface.updateProgress("Installing apache2")
    
  apt.install("apache2")

  # Enable mod_proxy.
  system.run("a2enmod proxy", exitOnFail=False)
  system.run("a2enmod proxy_http", exitOnFail=False)

  # Disable default apache site.
  setSiteEnabled("default",False)
Example #8
0
def install(domain):

    if isInstalled():
        return

    debugOutput("Installing samba")

    apt.install("samba samba-common libcupsys2 libkrb53 winbind smbclient")

    interface.updateProgress()

    sambaConfig = _createConfig(domain)
    debugOutput(sambaConfig)
    # XXX: Warning, what if samba file exists.
    system.writeToConfigFile(SAMBA_CONFIG, sambaConfig)

    system.run("""mkdir -p "%s" """ % SAMBA_HOME)
    system.run("""mkdir -p "%s/netlogon" """ % SAMBA_HOME)
    system.run("""mkdir -p "%s/profiles" """ % SAMBA_HOME)
    system.run("""mkdir -p "%s/data" """ % SAMBA_HOME)
    system.run("""mkdir -p "%s" """ % SAMBA_USERS_PATH)
    system.run("""mkdir -p "%s" """ % SAMBA_SHARES_PATH)
    system.run("""mkdir -p /var/spool/samba""", exitOnFail=False)
    system.run("""chmod 777 /var/spool/samba/""")
    system.run("""chmod 770 "%s/profiles" """ % SAMBA_HOME)
    system.run("""chmod 770 "%s/netlogon" """ % SAMBA_HOME)
    system.run("""chmod 775 "%s" """ % SAMBA_USERS_PATH)
    system.run("""chown -R root:users "%s/" || chmod -R 771 "%s/" """ %
               (SAMBA_HOME, SAMBA_HOME))

    interface.updateProgress()

    restart()

    interface.updateProgress()

    nsswitchString = system.readFromFile("/etc/nsswitch.conf")
    onsswitchString = nsswitchString
    nsswitchString = nsswitchString.replace("files dns", "files wins dns")
    if nsswitchString != onsswitchString:
        system.writeToConfigFile("/etc/nsswitch.conf", nsswitchString)

    system.run("net groupmap add ntgroup='Domain Admins' unixgroup=root")
    system.run("net groupmap add ntgroup='Domain Users' unixgroup=users")
    system.run("net groupmap add ntgroup='Domain Guests' unixgroup=nogroup")

    # TODO: Check this has not been done.
    system.run("echo 'root = Administrator' > /etc/samba/smbusers")

    interface.updateProgress()

    # Add a default share that all users can access.
    if not "Files" in getShares():
        addShare("Files")
Example #9
0
def install(domain) :
  
  if isInstalled() :
    return
  
  debugOutput("Installing samba")
  
  apt.install("samba samba-common libcupsys2 libkrb53 winbind smbclient")
 
  interface.updateProgress();
 
  sambaConfig = _createConfig(domain)
  debugOutput(sambaConfig)
  # XXX: Warning, what if samba file exists.
  system.writeToConfigFile(SAMBA_CONFIG, sambaConfig)
  
  system.run("""mkdir -p "%s" """ % SAMBA_HOME)
  system.run("""mkdir -p "%s/netlogon" """ % SAMBA_HOME)
  system.run("""mkdir -p "%s/profiles" """ % SAMBA_HOME)
  system.run("""mkdir -p "%s/data" """ % SAMBA_HOME)
  system.run("""mkdir -p "%s" """ % SAMBA_USERS_PATH)
  system.run("""mkdir -p "%s" """ % SAMBA_SHARES_PATH)
  system.run("""mkdir -p /var/spool/samba""", exitOnFail=False)
  system.run("""chmod 777 /var/spool/samba/""")
  system.run("""chmod 770 "%s/profiles" """ % SAMBA_HOME)
  system.run("""chmod 770 "%s/netlogon" """ % SAMBA_HOME)
  system.run("""chmod 775 "%s" """ % SAMBA_USERS_PATH)
  system.run("""chown -R root:users "%s/" || chmod -R 771 "%s/" """ % (SAMBA_HOME, SAMBA_HOME))

  interface.updateProgress();
  
  restart()

  interface.updateProgress();
  
  nsswitchString = system.readFromFile("/etc/nsswitch.conf")
  onsswitchString = nsswitchString
  nsswitchString = nsswitchString.replace("files dns","files wins dns")
  if nsswitchString != onsswitchString :
    system.writeToConfigFile("/etc/nsswitch.conf", nsswitchString)

  system.run("net groupmap add ntgroup='Domain Admins' unixgroup=root")
  system.run("net groupmap add ntgroup='Domain Users' unixgroup=users")
  system.run("net groupmap add ntgroup='Domain Guests' unixgroup=nogroup")

  # TODO: Check this has not been done.
  system.run("echo 'root = Administrator' > /etc/samba/smbusers")
  
  interface.updateProgress();
  
  # Add a default share that all users can access.
  if not "Files" in getShares() :
    addShare("Files")
Example #10
0
def install(backupSources=None) :
  debugOutput("Installing rsnapshot")
  apt.install("rsnapshot")


  # TODO: Sort out config file handling.
  system.run("mkdir /.rsnapshot", exitOnFail=False)
  system.run("chmod +rx /.rsnapshot")

  rsnapshotConf = system.readFromFile("/etc/rsnapshot.conf")
  rsnapshotConf = rsnapshotConf.replace("snapshot_root\t/var/cache/rsnapshot/","snapshot_root\t/.rsnapshot/")
  #rsnapshotConf = rsnapshotConf.replace("#no_create_root\t1","no_create_root\t0")
  rsnapshotConf = rsnapshotConf.replace("#interval","interval")
  rsnapshotConf = rsnapshotConf.replace("\nbackup","\n#backup")

  rsnapshotConf += "\n\n"

  for backupSource in backupSources :
    rsnapshotConf += "backup\t%s/\tbackups/\n" % backupSource.rstrip("/")
  rsnapshotConf += "backup\t/home/\t.system/\n"
  rsnapshotConf += "backup\t/etc/\t.system/\n"

  debugOutput(rsnapshotConf)

  system.writeToConfigFile("/etc/rsnapshot.conf",rsnapshotConf)
  
  cronConf = system.readFromFile("/etc/cron.d/rsnapshot")
  cronConf = cronConf.replace("# 0","0")
  cronConf = cronConf.replace("# 30","30")
  cronConf = cronConf.replace("*/4","*")
  
  debugOutput(cronConf)
  
  system.writeToConfigFile("/etc/cron.d/rsnapshot", cronConf)
  
  interface.updateProgress()

  system.run("rsnapshot hourly")

  interface.updateProgress()
Example #11
0
def install(backupSources=None):
    debugOutput("Installing rsnapshot")
    apt.install("rsnapshot")

    # TODO: Sort out config file handling.
    system.run("mkdir /.rsnapshot", exitOnFail=False)
    system.run("chmod +rx /.rsnapshot")

    rsnapshotConf = system.readFromFile("/etc/rsnapshot.conf")
    rsnapshotConf = rsnapshotConf.replace(
        "snapshot_root\t/var/cache/rsnapshot/", "snapshot_root\t/.rsnapshot/")
    #rsnapshotConf = rsnapshotConf.replace("#no_create_root\t1","no_create_root\t0")
    rsnapshotConf = rsnapshotConf.replace("#interval", "interval")
    rsnapshotConf = rsnapshotConf.replace("\nbackup", "\n#backup")

    rsnapshotConf += "\n\n"

    for backupSource in backupSources:
        rsnapshotConf += "backup\t%s/\tbackups/\n" % backupSource.rstrip("/")
    rsnapshotConf += "backup\t/home/\t.system/\n"
    rsnapshotConf += "backup\t/etc/\t.system/\n"

    debugOutput(rsnapshotConf)

    system.writeToConfigFile("/etc/rsnapshot.conf", rsnapshotConf)

    cronConf = system.readFromFile("/etc/cron.d/rsnapshot")
    cronConf = cronConf.replace("# 0", "0")
    cronConf = cronConf.replace("# 30", "30")
    cronConf = cronConf.replace("*/4", "*")

    debugOutput(cronConf)

    system.writeToConfigFile("/etc/cron.d/rsnapshot", cronConf)

    interface.updateProgress()

    system.run("rsnapshot hourly")

    interface.updateProgress()
Example #12
0
def install() :
  debugOutput("Installing")

  interface.updateProgress("Installing django")
  
  system.downloadUncompressInstall("http://media.djangoproject.com/releases/0.96/Django-0.96.tar.gz","cd Django-0.96 && python setup.py install")
  interface.updateProgress("")
  apt.install("libapache2-mod-python")
  interface.updateProgress("")
  apt.install("python-mysqldb")
Example #13
0
def install():
    debugOutput("Installing")

    interface.updateProgress("Installing django")

    system.downloadUncompressInstall(
        "http://media.djangoproject.com/releases/0.96/Django-0.96.tar.gz",
        "cd Django-0.96 && python setup.py install")
    interface.updateProgress("")
    apt.install("libapache2-mod-python")
    interface.updateProgress("")
    apt.install("python-mysqldb")
Example #14
0
def downloadUncompressInstall(source, installCommand=None) :
  debugOutput("source '%s' installCommand '%s'." % (source, installCommand))
  
  package = os.path.basename(source)
  tempDir = "/tmp"
 
  debugOutput("package '%s'" % package)
  
  if package.endswith("tar.gz") :
    uncompressCommand = "tar -xzf"
  else :
    interface.abort("I don't know how to uncompress '%s'."%package)

  if not os.path.exists(os.path.join(tempDir, package)) :
    run("cd %s && wget %s" % (tempDir, source))
  interface.updateProgress()
  run("cd %s && %s %s" % (tempDir, uncompressCommand, os.path.basename(source)))
  interface.updateProgress()
  if installCommand :
    run("cd %s && %s" % (tempDir, installCommand))
  interface.updateProgress()
Example #15
0
def downloadUncompressInstall(source, installCommand=None):
    debugOutput("source '%s' installCommand '%s'." % (source, installCommand))

    package = os.path.basename(source)
    tempDir = "/tmp"

    debugOutput("package '%s'" % package)

    if package.endswith("tar.gz"):
        uncompressCommand = "tar -xzf"
    else:
        interface.abort("I don't know how to uncompress '%s'." % package)

    if not os.path.exists(os.path.join(tempDir, package)):
        run("cd %s && wget %s" % (tempDir, source))
    interface.updateProgress()
    run("cd %s && %s %s" %
        (tempDir, uncompressCommand, os.path.basename(source)))
    interface.updateProgress()
    if installCommand:
        run("cd %s && %s" % (tempDir, installCommand))
    interface.updateProgress()
Example #16
0
def install(upgrade=False):

    debugOutput("Installing smartbox")

    interface.startProgress("%s and configuring Smartbox" %
                            (upgrade and "Upgrading" or "Installing"),
                            noSteps=NO_INSTALLATION_STEPS)

    interface.updateProgress("Installing boot records on raid devices")
    raid.updateGrub()

    interface.updateProgress("Installing pexpect")
    sbpexpect.install()
    interface.updateProgress("Installing utilities")
    utilapps.install()

    # Add the smartbox ssh port
    smartbox.ssh.addSSHPort(SMARTBOX_SSH_PORT)

    if not upgrade:
        interface.updateProgress("Installing samba")
        samba.install(domain=DEFAULT_DOMAIN)

    interface.updateProgress("Installing internal backup system")
    rsnapshot.install(
        backupSources=[samba.SAMBA_USERS_PATH, samba.SAMBA_SHARES_PATH])
    interface.updateProgress("Installing external backup system")
    smartbox.remotebackup.install()

    #sbmysql.install()
    sbapache.install()
    #sbphp.install()

    sbdjango.install()

    #interface.updateProgress("Installing groupware: wikidbase"); sbwikidbase.install()

    interface.updateProgress("Installing control panel")
    controlpanel.install()

    # Set the default admin password.
    if not upgrade:
        setAdminPassword(DEFAULT_ADMIN_PASS)

    # Install the cron file.
    installCronScript()

    interface.updateProgress("Completed", 100)
    interface.stopProgress()
Example #17
0
def install(upgrade=False):

    debugOutput("Installing smartbox")

    interface.startProgress(
        "%s and configuring Smartbox" % (upgrade and "Upgrading" or "Installing"), noSteps=NO_INSTALLATION_STEPS
    )

    interface.updateProgress("Installing boot records on raid devices")
    raid.updateGrub()

    interface.updateProgress("Installing pexpect")
    sbpexpect.install()
    interface.updateProgress("Installing utilities")
    utilapps.install()

    # Add the smartbox ssh port
    smartbox.ssh.addSSHPort(SMARTBOX_SSH_PORT)

    if not upgrade:
        interface.updateProgress("Installing samba")
        samba.install(domain=DEFAULT_DOMAIN)

    interface.updateProgress("Installing internal backup system")
    rsnapshot.install(backupSources=[samba.SAMBA_USERS_PATH, samba.SAMBA_SHARES_PATH])
    interface.updateProgress("Installing external backup system")
    smartbox.remotebackup.install()

    # sbmysql.install()
    sbapache.install()
    # sbphp.install()

    sbdjango.install()

    # interface.updateProgress("Installing groupware: wikidbase"); sbwikidbase.install()

    interface.updateProgress("Installing control panel")
    controlpanel.install()

    # Set the default admin password.
    if not upgrade:
        setAdminPassword(DEFAULT_ADMIN_PASS)

    # Install the cron file.
    installCronScript()

    interface.updateProgress("Completed", 100)
    interface.stopProgress()