예제 #1
0
def sftp():
    username = session_info()['username']
    sudoers = session_info()['sudoers']
    scheduler_ip = parameters.get_aligo_configuration()['SchedulerPublicIP']
    return render_template('sftp.html',
                           scheduler_ip=scheduler_ip,
                           username=username,
                           sudoers=sudoers)
예제 #2
0
def ssh():
    username = session_info()['username']
    sudoers = session_info()['sudoers']
    scheduler_ip = parameters.get_aligo_configuration()['SchedulerPublicIP']
    app.logger.warning(username + ' checking ssh')
    return render_template('ssh.html',
                           username=username,
                           scheduler_ip=scheduler_ip,
                           sudoers=sudoers)
예제 #3
0
def dashboard():
    analytics_dashboard = parameters.get_aligo_configuration(
    )['ESDomainEndpoint']
    username = session_info()['username']
    sudoers = session_info()['sudoers']
    analytics_url = 'https://' + analytics_dashboard + '/_plugin/kibana/'
    return render_template('dashboard.html',
                           username=username,
                           analytics_url=analytics_url,
                           sudoers=sudoers)
예제 #4
0
def update_yaml(yaml_file, exec_host):
    session_info = open_yaml(yaml_file)

    if session_info['host'] == 'tbd':
        session_info['host'] = exec_host
        session_info['state'] = 'running'
        session_info['yaml_file'] = yaml_file
        session_info['url'] = 'https://' + parameters.get_aligo_configuration()[
            'LoadBalancerDNSName'] + '/' + exec_host + '/?authToken=' + session_info['session_password'] + '#' + \
                              session_info['session_id']

        with open(yaml_file, "w") as f:
            yaml.dump(session_info, f, default_flow_style=False)
        os.chmod(yaml_file, 0o700)
예제 #5
0
def build_dcv_connect_client(user, session_number):
    yaml_file = 'dcv_' + user + '_' + str(session_number) + '.yml'
    session_data = open_yaml(
        parameters.get_parameter('dcv', 'session_location') + '/' + yaml_file)
    session_file = '''
[version]
format=1.0

[connect]
host=''' + parameters.get_aligo_configuration()['LoadBalancerDNSName'] + '''
port=443
weburlpath=/''' + session_data['host'] + '''
sessionid=''' + session_data['session_id'] + '''
user=''' + user + '''
authToken=''' + session_data['session_password'] + '''
    '''
    return session_file