Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to use local and production enviroments. #249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:
- sudo make install
- cd ..
install:
- pip install -r requirements.txt
- pip install -r requirements/local.txt
script:
- python cuckoo.py --debug --test
- nosetests
1 change: 1 addition & 0 deletions requirements.txt → requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ nose
jsbeautifier
pygal
dnspython
unipath
4 changes: 4 additions & 0 deletions requirements/local.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r base.txt
Werkzeug
django-extensions
django-debug-toolbar
2 changes: 2 additions & 0 deletions requirements/production.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r base.txt
gunicorn
2 changes: 1 addition & 1 deletion web/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings.production")

from django.core.management import execute_from_command_line

Expand Down
7 changes: 4 additions & 3 deletions web/templates/analysis/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<ul class="nav nav-tabs">
<li class="active"><a href="#files" data-toggle="tab">Files</a></li>
Expand Down Expand Up @@ -100,7 +101,7 @@ <h3 class="panel-title">Recent Files</h3>
{% endif %}
<td>
{% if analysis.malscore != None %}
<span
<span
{% if analysis.malscore <= 2.0 %}
class="label label-success"
{% elif analysis.malscore <= 6.0 %}
Expand Down Expand Up @@ -233,7 +234,7 @@ <h3 class="panel-title">Recent URLs</h3>
{% endif %}
<td>
{% if analysis.malscore != None %}
<span
<span
{% if analysis.malscore <= 2.0 %}
class="label label-success"
{% elif analysis.malscore <= 6.0 %}
Expand Down
7 changes: 4 additions & 3 deletions web/templates/analysis/network/_tcp.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script src="{{ STATIC_URL }}js/hexdump.js"></script>
{% load staticfiles %}
<script src="{% static 'js/hexdump.js' %}"></script>
<section id="tcp" class="tcpudp">
<h4>TCP</h4>
{% if analysis.network.tcp %}
Expand Down Expand Up @@ -33,7 +34,7 @@ <h4>TCP</h4>
var $section = $(this).closest("section");

$section.find("table tr.connrow").removeClass("row-active");
$(this).addClass("row-active");
$(this).addClass("row-active");

var choice = $(this).closest('tr').attr('data');

Expand All @@ -49,7 +50,7 @@ <h4>TCP</h4>
var tuple = p.src + ":" + p.sport + " &rarr; " + p.dst + ":" + p.dport;

if (first == undefined) first = tuple;
if (first != tuple) {
if (first != tuple) {
tcpclass = "tcp-in";
icon = "<i class=\"glyphicon glyphicon-chevron-down\" title=\"Inbound\"></i>";
} else {
Expand Down
3 changes: 2 additions & 1 deletion web/templates/analysis/network/_udp.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script src="{{ STATIC_URL }}js/hexdump.js"></script>
{% load staticfiles %}
<script src="{% static 'js/hexdump.js' %}"></script>
<section id="udp" class="tcpudp">
<h4>UDP</h4>
{% if analysis.network.udp %}
Expand Down
3 changes: 2 additions & 1 deletion web/templates/analysis/pending.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<div class="panel panel-primary">
<div class="panel-heading">
Expand Down
3 changes: 2 additions & 1 deletion web/templates/analysis/report.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<script>
$(function() {
Expand All @@ -18,7 +19,7 @@
});
</script>
<div class="row">
<div class="col-md-6"><p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p></div>
<div class="col-md-6"><p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p></div>
{% if analysis.info.category == "file" and analysis.target %}
<div class="col-md-6" style="text-align: right;"><a class="btn btn-primary" href="{% url "compare.views.left" analysis.info.id %}">Compare this analysis to...</a></div>
{% endif %}
Expand Down
5 changes: 3 additions & 2 deletions web/templates/analysis/search.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<div class="row">
<div class="col-md-6 col-md-offset-3 center">
<p><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<form class="form-inline" role="form" action="{% url "analysis.views.search" %}" enctype="multipart/form-data" method="post">{% csrf_token %}
<p class="text-muted" style="margin-top: 5px;">For details on how to perform searches, get some <a href="#help" data-toggle="collapse">help</a>.</p>
Expand Down Expand Up @@ -227,7 +228,7 @@ <h3 class="panel-title">Search Results</h3>
{% endif %}
<td>
{% if analysis.malscore != None %}
<span
<span
{% if analysis.malscore <= 2.0 %}
class="label label-success"
{% elif analysis.malscore <= 6.0 %}
Expand Down
3 changes: 2 additions & 1 deletion web/templates/api/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<div class="panel panel-primary">
<div class="panel-heading">
Expand Down
5 changes: 3 additions & 2 deletions web/templates/compare/both.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<script type='text/javascript'>
$(function () {
Expand All @@ -25,7 +26,7 @@ <h4>Execution Graph</h4>
<span class="badge registry" style="color:black;">registry</span>
<span class="badge filesystem" style="color:black;">filesystem</span>
<span class="badge system" style="color:black;">system</span>
<span class="badge network" style="color:black;">network</span>
<span class="badge network" style="color:black;">network</span>
<span class="badge process" style="color:black;">process</span>
<span class="badge services" style="color:black;">services</span>
<span class="badge synchronization" style="color:black;">synchronization</span>
Expand Down
3 changes: 2 additions & 1 deletion web/templates/compare/hash.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<div class="row">
<div class="col-md-6" style="border-right: 1px dashed #ddd;">
Expand Down
3 changes: 2 additions & 1 deletion web/templates/compare/left.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<script type='text/javascript'>
$(function () {
Expand Down
3 changes: 2 additions & 1 deletion web/templates/dashboard/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<div class="alert alert-info" style="text-align: center;font-size: 22px;">
Estimating ~<b>{{report.estimate_hour}}</b> analysis per hour, <b>{{report.estimate_day}}</b> per day.
Expand Down
5 changes: 3 additions & 2 deletions web/templates/error.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>
<div class="alert alert-danger"><b>ERROR :-(</b><br />{{error}}</div>
{% endblock %}
{% endblock %}
15 changes: 8 additions & 7 deletions web/templates/footer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load staticfiles %}
<!-- Footer
================================================== -->
<footer>
Expand All @@ -10,12 +11,12 @@
<div>&copy;2010-2015 <a href="http://www.cuckoosandbox.org" target="_blank">Cuckoo Sandbox</a></div>
</div>
</div>
<script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap-fileupload.js"></script>
<script src="{{ STATIC_URL }}js/lightbox.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap-transition.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap-collapse.js"></script>
<script src="{{ STATIC_URL }}js/moment.min.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap-datetimepicker.min.js"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/bootstrap-fileupload.js' %}"></script>
<script src="{% static 'js/lightbox.js' %}"></script>
<script src="{% static 'js/bootstrap-transition.js' %}"></script>
<script src="{% static 'js/bootstrap-collapse.js' %}"></script>
<script src="{% static 'js/moment.min.js' %}"></script>
<script src="{% static 'js/bootstrap-datetimepicker.min.js' %}"></script>
</body>
</html>
11 changes: 6 additions & 5 deletions web/templates/header.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
Expand All @@ -8,11 +9,11 @@
<meta name="author" content="Cuckoo Sandbox">

<!-- Le styles -->
<link href="{{ STATIC_URL }}css/bootstrap.min.css" rel="stylesheet">
<link href="{{ STATIC_URL }}css/style.css" rel="stylesheet">
<link href="{{ STATIC_URL }}css/lightbox.css" rel="stylesheet">
<link href="{{ STATIC_URL }}css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="{{ STATIC_URL }}js/jquery.js"></script>
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
<link href="{% static 'css/style.css' %}" rel="stylesheet">
<link href="{% static 'css/lightbox.css' %}" rel="stylesheet">
<link href="{% static 'css/bootstrap-datetimepicker.min.css' %}" rel="stylesheet">
<script src="{% static 'js/jquery.js' %}"></script>
</head>
<body>
<header>
Expand Down
15 changes: 8 additions & 7 deletions web/templates/statistics/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<style>
.btn-file {
Expand Down Expand Up @@ -35,29 +36,29 @@

$(document).ready( function() {
$('.btn-file :file').on('fileselect', function(event, numFiles, label) {

var input = $(this).parents('.input-group').find(':text'),
log = numFiles > 1 ? numFiles + ' files selected' : label;

if( input.length ) {
input.val(log);
} else {
if( log ) alert(log);
}

});
});
});
</script>
<div class="row">
<div class="col-md-6 col-md-offset-3 center">
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<div class="row-fluid">
<div class="span8">
<h3>Statistics</h3>
{% for he, desc, im in stat_items %}
<h2>{{he}}</h2>
<img src="{{ STATIC_URL }}{{im}}"/>
<img src="{% static im %}"/>
{{desc}}
{% endfor %}
</div>
Expand All @@ -66,4 +67,4 @@ <h2>{{he}}</h2>

</div>
</div>
{% endblock %}
{% endblock %}
3 changes: 2 additions & 1 deletion web/templates/submission/complete.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>
<div class="alert alert-success"><h4>Submission complete!</h4>
The following tasks were added successfully:
{% for task in tasks %}
Expand Down
3 changes: 2 additions & 1 deletion web/templates/submission/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<style>
.btn-file {
Expand Down Expand Up @@ -50,7 +51,7 @@
</script>
<div class="row">
<div class="col-md-6 col-md-offset-3 center">
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>

<form role="form" action="" method="post" enctype="multipart/form-data">{% csrf_token %}
<div class="tabbable">
Expand Down
3 changes: 2 additions & 1 deletion web/templates/submission/status.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>
{% if completed %}
<div class="alert alert-success"><h4>Good news! :-)</h4>The analysis is completed, you can view it <a href="{% url "analysis.views.report" task_id %}">here</a>.</div>
{% else %}
Expand Down
3 changes: 2 additions & 1 deletion web/templates/success.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>
<div class="alert alert-success"><h4>Submission complete!</h4>
The following tasks were added successfully:
{% for task in tasks %}
Expand Down
5 changes: 3 additions & 2 deletions web/templates/success_simple.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<p style="margin-bottom: 10px;"><img src="{{ STATIC_URL }}graphic/cuckoo.png" /></p>
<p style="margin-bottom: 10px;"><img src="{% static 'graphic/cuckoo.png' %}" /></p>
<div class="alert alert-success">{{message}}</div>
{% endblock %}
{% endblock %}
38 changes: 0 additions & 38 deletions web/web/local_settings.py

This file was deleted.

Empty file added web/web/settings/__init__.py
Empty file.
Loading