Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge branch 'development'
  • Loading branch information
dvreed77 committed Jun 18, 2015
2 parents 67954dc + e231cc7 commit 67e117c4b328572206f4c057731e1d0cc4272988
Showing 5 changed files with 110 additions and 46 deletions.
@@ -3,13 +3,13 @@ Vagrant.configure(2) do |config|
# Setting proxy configurations for the host box. This also sets common proxy settings
# and files for other applications, such as apt-get/yum
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://plcyber06.draper.com:3128"
config.proxy.https = "http://plcyber06.draper.com:3128"
config.proxy.no_proxy = "localhost, 127.0.0.1"
end
config.proxy.http = "http://plcyber06.draper.com:3128"
config.proxy.https = "http://plcyber06.draper.com:3128"
config.proxy.no_proxy = "localhost, 127.0.0.1"
end

config.vm.define "elk" do |elk|
elk.vm.box = "ubuntu/trusty64"
config.vm.define "elk" do |elk|
elk.vm.box = "ubuntu/trusty64"

# Change the default elk vagrant box folder to point to the
# elk directory within the project. This will allow separation between
@@ -22,8 +22,8 @@ Vagrant.configure(2) do |config|
# boxes.
# - Expose the following ports to be used within this box to
# host data being sent between the web server and the ELK server.
elk.vm.network "private_network", ip: "192.168.1.100"
elk.vm.network "private_network", ip: "172.16.1.100"

# Provisioner: Runs the provisioning script that will provision
# the vagrant box for the first time, or forced.
elk.vm.provision "shell" do |s|
@@ -50,12 +50,12 @@ Vagrant.configure(2) do |config|
# Setup a static IP to allow both vagrant boxes to know where
# to contact each other. This will allow communication between the
# web developer and the logging server.
dev.vm.network "private_network", ip: "192.168.1.10"
dev.vm.network "private_network", ip: "172.16.1.10"

# Specify the provisioning script that will be used in order to
# install the necessary files needed for this vagrant box
dev.vm.provision "shell", inline: "twistd -y /vagrant/twisted_client.py &",
run: "always"
run: "always"

# Change the default client vagrant box folder to point to the
# client directory within the project. This will allow separation between
@@ -174,6 +174,7 @@ curl -XPUT 'http://localhost:9200/xdata_v3/testing/_mapping' -d '
"type" : "string"
},
"sessionID" : {
"index" : "not_analyzed",
"type" : "string"
},
"source" : {
@@ -53,12 +53,12 @@ function timerMethod() {
// If we don't have any logs to send to the server, just return
// back to the caller. There are no actions that need to be done
// when it comes to logging.
else
{
// If we have debugging enabled, send a debug message saying there
// are no logs present to be sent to the logging server.
debug('No log sent, buffer empty.');
}
//else
//{
// // If we have debugging enabled, send a debug message saying there
// // are no logs present to be sent to the logging server.
// debug('No log sent, buffer empty.');
//}
}

/**
@@ -58,9 +58,6 @@ ELEMENTS = [
'OTHER'
]


console.log('in userale')

extend = (objects...) ->
out = {}
for object in objects
@@ -97,14 +94,31 @@ default_msg = {
meta: {}
}

setCookie = (cname, cvalue, exdays) ->
d = new Date()
d.setTime(d.getTime() + (exdays*24*60*60*1000))
expires = "expires="+d.toUTCString()
document.cookie = cname + "=" + cvalue + "; " + expires

getCookie = (name) ->
nameEQ = name + "="
ca = document.cookie.split(";")
i = 0
while i < ca.length
c = ca[i]
c = c.substring(1, c.length) while c.charAt(0) is " "
return c.substring(nameEQ.length, c.length).replace(/"/g, '') if c.indexOf(nameEQ) is 0
i++
""

class userale
constructor: (options)->
@options = extend(defaults, options)

if @options.elementGroups.constructor is not Array
@options.elementGroups = [@options.elementGroups]

@options.version = '3.0.0'
@options.version = '3.0.1'

@worker = new Worker(@options.workerUrl)

@@ -117,19 +131,31 @@ class userale
@sendLogs(@options.sendLogs)

register: () ->
@options.sessionID = getParameterByName('USID')
@options.client = getParameterByName('client')

console.log(@options.sessionID)

if !@options.sessionID
if getParameterByName('USID')
@options.sessionID = getParameterByName('USID')
setCookie('USID', @options.sessionID, 2)
console.info('USERALE: SESSION ID FOUND IN URL - ' + @options.sessionID)
else if getCookie('USID')
@options.sessionID = getCookie('USID')
console.info('USERALE: SESSION ID FOUND IN COOKIE - ' + @options.sessionID)
else
@options.sessionID = @options.toolName[0..2].toUpperCase() + new Date().getTime()
setCookie('USID', @options.sessionID, 2)
console.warn('USERALE: NO SESSION ID, MAKING ONE UP. You can pass one in as url parameter (127.0.0.1?USID=12345)')

if !@options.client
if getParameterByName('client')
@options.client = getParameterByName('client')
setCookie('USERALECLIENT', @options.client, 2)
console.info('USERALE: CLIENT FOUND IN URL - ' + @options.client)
else if getCookie('USERALECLIENT')
@options.client = getCookie('USERALECLIENT')
console.info('USERALE: CLIENT FOUND IN COOKIE - ' + @options.client)
else
@options.client = 'UNK'
setCookie('USERALECLIENT', @options.client, 2)
console.warn('USERALE: NO CLIENT, MAKING ONE UP. You can pass one in as url parameter (127.0.0.1?client=roger)')


@worker.postMessage({cmd: 'sendBuffer', msg: ''})

window.onload = =>

Some generated files are not rendered by default. Learn more.

0 comments on commit 67e117c

Please sign in to comment.