Exemple #1
0
def _configure_novnc(env):
    if not _read_boolean(env, "configure_novnc", False):
        # Longer term would like this enabled by default. -John
        return
    if not "novnc_install_dir" in env:
        env.novnc_install_dir = "/opt/novnc"
    if not "vnc_password" in env:
        env.vnc_password = "******"
    if not "vnc_user" in env:
        env.vnc_user = env.user
    if not "vnc_display" in env:
        env.vnc_display = "1"
    if not "vnc_depth" in env:
        env.vnc_depth = "16"
    if not "vnc_geometry" in env:
        env.vnc_geometry = "1024x768"

    _configure_vncpasswd(env)

    novnc_dir = env.novnc_install_dir
    env.safe_sudo("mkdir -p '%s'" % novnc_dir)
    env.safe_sudo("chown %s '%s'" % (env.user, novnc_dir))
    clone_cmd = "NOVNC_DIR='%s'; rm -rf $NOVNC_DIR; git clone https://github.com/kanaka/noVNC.git $NOVNC_DIR" % novnc_dir
    run(clone_cmd)
    ## Move vnc_auto.html which takes vnc_password as query argument
    ## to index.html and rewrite it so that password is autoset, no
    ## need to specify via query parameter.
    run("sed s/password\\ =\\ /password\\ =\\ \\\'%s\\\'\\;\\\\\\\\/\\\\\\\\// '%s/vnc_auto.html' > '%s/index.html'" % (env.vnc_password, novnc_dir, novnc_dir))

    _setup_conf_file(env, "/etc/init.d/novnc", "novnc_init", default_source="novnc_init")
    _setup_conf_file(env, "/etc/default/novnc", "novnc_default", default_source="novnc_default.template")
    _setup_conf_file(env, "/etc/init.d/vncserver", "vncserver_init", default_source="vncserver_init")
    _setup_conf_file(env, "/etc/default/vncserver", "vncserver_default", default_source="vncserver_default.template")
    _setup_simple_service("novnc")
    _setup_simple_service("vncserver")
Exemple #2
0
def _configure_novnc(env):
    if not _read_boolean(env, "configure_novnc", False):
        # Longer term would like this enabled by default. -John
        return
    if not "novnc_install_dir" in env:
        env.novnc_install_dir = "/opt/novnc"
    if not "vnc_password" in env:
        env.vnc_password = "******"
    if not "vnc_user" in env:
        env.vnc_user = env.user
    if not "vnc_display" in env:
        env.vnc_display = "1"
    if not "vnc_depth" in env:
        env.vnc_depth = "16"
    if not "vnc_geometry" in env:
        env.vnc_geometry = "1024x768"

    _configure_vncpasswd(env)

    novnc_dir = env.novnc_install_dir
    env.safe_sudo("mkdir -p '%s'" % novnc_dir)
    env.safe_sudo("chown %s '%s'" % (env.user, novnc_dir))
    clone_cmd = "NOVNC_DIR='%s'; rm -rf $NOVNC_DIR; git clone https://github.com/kanaka/noVNC.git $NOVNC_DIR" % novnc_dir
    run(clone_cmd)
    ## Move vnc_auto.html which takes vnc_password as query argument
    ## to index.html and rewrite it so that password is autoset, no
    ## need to specify via query parameter.
    run("sed s/password\\ =\\ /password\\ =\\ \\\'%s\\\'\\;\\\\\\\\/\\\\\\\\// '%s/vnc_auto.html' > '%s/index.html'" % (env.vnc_password, novnc_dir, novnc_dir))

    _setup_conf_file(env, "/etc/init.d/novnc", "novnc_init", default_source="novnc_init")
    _setup_conf_file(env, "/etc/default/novnc", "novnc_default", default_source="novnc_default.template")
    _setup_conf_file(env, "/etc/init.d/vncserver", "vncserver_init", default_source="vncserver_init")
    _setup_conf_file(env, "/etc/default/vncserver", "vncserver_default", default_source="vncserver_default.template")
    _setup_simple_service("novnc")
    _setup_simple_service("vncserver")
Exemple #3
0
def _configure_desktop(env):
    """
    Configure a desktop manager to work with VNC. At the moment, this is tailored
    to `JWM` (and `jwm` and `vnc4server` packages need to be installed).
    """
    if not _read_boolean(env, "configure_desktop", False):
        return
    # Create a start script for X
    _setup_conf_file(env, "/home/ubuntu/.vnc/xstartup", "xstartup", default_source="xstartup")
    # Create jwmrc config file
    _setup_conf_file(env, "/home/ubuntu/.jwmrc", "jwmrc.xml",
        default_source="jwmrc.xml", mode="0644")
    env.logger.info("----- Done configuring desktop -----")
Exemple #4
0
def _configure_desktop(env):
    """
    Configure a desktop manager to work with VNC. Note that `xfce4` (or `jwm`)
    and `vnc4server` packages need to be installed for this to have effect.
    """
    if not _read_boolean(env, "configure_desktop", False):
        return
    # Set nginx PAM module to allow logins for any system user
    if env.safe_exists("/etc/pam.d"):
        env.safe_sudo('echo "@include common-auth" > /etc/pam.d/nginx')
    env.safe_sudo('usermod -a -G shadow galaxy')
    # Create a start script for X
    _setup_conf_file(env, "/home/ubuntu/.vnc/xstartup", "xstartup", default_source="xstartup")
    # Create jwmrc config file (uncomment this if using jwm window manager)
    # _setup_conf_file(env, "/home/ubuntu/.jwmrc", "jwmrc.xml",
    #     default_source="jwmrc.xml", mode="0644")
    env.logger.info("----- Done configuring desktop -----")
Exemple #5
0
def _configure_desktop(env):
    """
    Configure a desktop manager to work with VNC. Note that `xfce4` (or `jwm`)
    and `vnc4server` packages need to be installed for this to have effect.
    """
    if not _read_boolean(env, "configure_desktop", False):
        return
    # Set nginx PAM module to allow logins for any system user
    if env.safe_exists("/etc/pam.d"):
        env.safe_sudo('echo "@include common-auth" > /etc/pam.d/nginx')
    env.safe_sudo('usermod -a -G shadow galaxy')
    # Create a start script for X
    _setup_conf_file(env, "/home/ubuntu/.vnc/xstartup", "xstartup", default_source="xstartup")
    # Create jwmrc config file (uncomment this if using jwm window manager)
    # _setup_conf_file(env, "/home/ubuntu/.jwmrc", "jwmrc.xml",
    #     default_source="jwmrc.xml", mode="0644")
    env.logger.info("----- Done configuring desktop -----")