aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/acme/acme-products.json (renamed from bin/acme_sample/acme-products.json_sample)7
-rwxr-xr-xbin/acme/acme-users.json (renamed from bin/acme_sample/acme-users.json_sample)2
-rwxr-xr-xbin/acme/datasource.json_sample (renamed from bin/acme_sample/datasource.json_sample)4
-rwxr-xr-xbin/acme/srtool_acme.py (renamed from bin/acme_sample/srtool_acme.py_sample)0
-rwxr-xr-xbin/acme/srtool_defect.py (renamed from bin/acme_sample/srtool_defect.py_sample)0
-rwxr-xr-xbin/acme/srtool_env.sh4
-rwxr-xr-xbin/acme/srtool_jira.py (renamed from bin/acme_sample/srtool_jira.py_sample)12
-rwxr-xr-xbin/common/srtool_env.sh3
-rwxr-xr-xbin/dev_tools/master_app.sh37
-rwxr-xr-xbin/srt41
-rwxr-xr-x[-rw-r--r--]bin/yp/datasource.json0
-rwxr-xr-xbin/yp/srtool_env.sh3
-rwxr-xr-xlib/acme/templates/base.html265
-rw-r--r--lib/orm/management/commands/checksettings.py10
-rw-r--r--lib/srtgui/views.py11
-rw-r--r--lib/srtmain/settings.py11
-rwxr-xr-xlib/yp/__init__.py0
-rwxr-xr-xlib/yp/admin.py3
-rwxr-xr-xlib/yp/apps.py5
-rwxr-xr-xlib/yp/migrations/__init__.py0
-rwxr-xr-xlib/yp/models.py3
-rwxr-xr-xlib/yp/tests.py3
-rwxr-xr-xlib/yp/views.py3
23 files changed, 392 insertions, 35 deletions
diff --git a/bin/acme_sample/acme-products.json_sample b/bin/acme/acme-products.json
index 78b83665..0d90be7d 100755
--- a/bin/acme_sample/acme-products.json_sample
+++ b/bin/acme/acme-products.json
@@ -2,10 +2,10 @@
"_comment_" : [
{
"_comment_" : "NOTE: _comment_ items are ignored",
- "anything" : "so you can put any internal documentation here",
+ "anything" : "so you can put any internal documentation here"
}
],
- "Product_Items" : [
+ "Product_Items" : [
{
"_comment_" : "NOTE: _comment_ elements are ignored",
"order" : "1",
@@ -16,7 +16,7 @@
"cpe" : "cpe:2.5:o:looneytunes:linux:2.5:*:*:*:*:*:*:*",
"defect_tags" : "{\"key\":\"looney\"}",
"product_tags" : "{\"key\":\"looney\"}"
- },
+ },
{
"order" : "2",
"key" : "mm",
@@ -26,5 +26,6 @@
"cpe" : "cpe:2.5:o:merriemelodies:linux:2.5:*:*:*:*:*:*:*",
"defect_tags" : "{\"key\":\"merrie\"}",
"product_tags" : "{\"key\":\"merrie\"}"
+ }
]
}
diff --git a/bin/acme_sample/acme-users.json_sample b/bin/acme/acme-users.json
index 897072fa..0be340e7 100755
--- a/bin/acme_sample/acme-users.json_sample
+++ b/bin/acme/acme-users.json
@@ -1,5 +1,5 @@
{
- "User_Items" : [
+ "User_Items" : [
{
"name" : "rrunner",
"first_name" : "Road",
diff --git a/bin/acme_sample/datasource.json_sample b/bin/acme/datasource.json_sample
index 4216ccd7..786d1105 100755
--- a/bin/acme_sample/datasource.json_sample
+++ b/bin/acme/datasource.json_sample
@@ -1,7 +1,7 @@
{
"srtsetting" : [
{
- "_comment_" : "NOTE: this is how you replace the default "yp" organization with ACME",
+ "_comment_" : "NOTE: this is how you replace the default 'yp' organization with ACME",
"name" : "datasource_org",
"helptext" : "Bin directory for ACME Corp.",
"value" : "acme"
@@ -17,7 +17,7 @@
"_comment_" : "NOTE: this is how you can insert your organization's logo in the top bar",
"name" : "SRTOOL_LOCAL_LOGO",
"helptext" : "The ACME Corp added logo",
- "value" : "ACME,/static/img/acme/acme_logo.png,https://www.acme.com/"
+ "value" : "ACME,/static/img/acme/acme_logo.png,/acme"
},
{
diff --git a/bin/acme_sample/srtool_acme.py_sample b/bin/acme/srtool_acme.py
index 02750ba5..02750ba5 100755
--- a/bin/acme_sample/srtool_acme.py_sample
+++ b/bin/acme/srtool_acme.py
diff --git a/bin/acme_sample/srtool_defect.py_sample b/bin/acme/srtool_defect.py
index 6178dcaf..6178dcaf 100755
--- a/bin/acme_sample/srtool_defect.py_sample
+++ b/bin/acme/srtool_defect.py
diff --git a/bin/acme/srtool_env.sh b/bin/acme/srtool_env.sh
new file mode 100755
index 00000000..4eac83b0
--- /dev/null
+++ b/bin/acme/srtool_env.sh
@@ -0,0 +1,4 @@
+# Main application shell settings
+
+export SRT_MAIN_APP="acme"
+
diff --git a/bin/acme_sample/srtool_jira.py_sample b/bin/acme/srtool_jira.py
index 04c772b5..4fd9d7bb 100755
--- a/bin/acme_sample/srtool_jira.py_sample
+++ b/bin/acme/srtool_jira.py
@@ -25,10 +25,10 @@
###
-### THIS IS A SAMPLE JIRA INTEGRATION SCRIPT FOR
+### THIS IS A SAMPLE JIRA INTEGRATION SCRIPT FOR
### MANAGING AN ORGANIZATION'S SRTOOL INTEGRATION
###
-### INSTALLATION INSTRUCTIONS AND DOCUMENATION OF THE JIRA PYTHON
+### INSTALLATION INSTRUCTIONS AND DOCUMENATION OF THE JIRA PYTHON
### LIBRARIES CAN BE FOUND HERE:
### https://jira.readthedocs.io
###
@@ -81,15 +81,15 @@ JIRA_TESTSERVER_LINK = 'https://jira.acmetest.com'
### These are example links that you can use to define and populate the respective fields for the SRTool
### These are not defined in the standard Jira schema, and would presumably be custom added
### You can extend and cusomize the Jira integration to SRTool by added additional custom fields using this model
-### The two indicated fields below are part of the SRTool design. They can be present as empty strings if they
+### The two indicated fields below are part of the SRTool design. They can be present as empty strings if they
### do not exist in your schema:
### The 'PUBLISHED' field is used to indicate if and when a Jira defect has been published to the customers
### The 'FIX_VERSION' field is used to indicate which version/release/update/service pack of the product has the fix
###
# Custom Jira fields
-JIRA_PUBLISHED_FIELD = 'customfield_10010' ### REPLACE WITH YOUR CUSTOM FIELD VALUE
-JIRA_FIX_VERSION_FIELD = 'customfield_10011' ### REPLACE WITH YOUR CUSTOM FIELD VALUE
+JIRA_PUBLISHED_FIELD = 'customfield_10010' ### REPLACE WITH YOUR CUSTOM FIELD VALUE
+JIRA_FIX_VERSION_FIELD = 'customfield_10011' ### REPLACE WITH YOUR CUSTOM FIELD VALUE
# ...
#################################
@@ -329,7 +329,7 @@ def translate_resolution(j,r):
return 0,0,0,0
#
-# Update the defect status from the Jira database
+# Update the defect status from the Jira database
#
#handles updating a list of issues for a single product/project
diff --git a/bin/common/srtool_env.sh b/bin/common/srtool_env.sh
new file mode 100755
index 00000000..31ecb6a9
--- /dev/null
+++ b/bin/common/srtool_env.sh
@@ -0,0 +1,3 @@
+# Common shell settings
+
+# none at this time
diff --git a/bin/dev_tools/master_app.sh b/bin/dev_tools/master_app.sh
new file mode 100755
index 00000000..4681e7fc
--- /dev/null
+++ b/bin/dev_tools/master_app.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+#
+# Set the master app by:
+# (a) renaming the other master(s) datasource files
+# (b) enabling the master datasource file
+#
+
+master_app=$1
+if [ -z "$master_app" ] ; then
+ master_app="yp"
+fi
+if [ ! -d "./bin/$master_app" ] ; then
+ echo "ERROR: master app directory missing"
+ exit 1
+fi
+
+FS=$'\n' # make newlines the only separator
+for p in $(find bin -name srtool_env.sh -exec grep -l "SRT_MAIN_APP" {} \;) ; do
+ if [ "${p}" != "${p/bin\/yp/}" ] ; then
+ # Always leave the 'yp' directory alone
+ continue
+ fi
+ echo "Check:$p"
+ ds_dir=$(dirname $p)
+ if [ "${p}" != "${p/bin\/$master_app/}" ] ; then
+ echo "SET_MASTER:$p"
+ mv $ds_dir/datasource.json_sample $ds_dir/datasource.json 2> /dev/null
+ else
+ echo "DISABLE_MASTER:$p"
+ mv $ds_dir/datasource.json $ds_dir/datasource.json_sample 2> /dev/null
+ fi
+done
+
+if [ "yp" = "$master_app" ] ; then
+ echo "SET_MASTER:./bin/$master_app"
+fi
diff --git a/bin/srt b/bin/srt
index 06940ee8..7af2491f 100755
--- a/bin/srt
+++ b/bin/srt
@@ -45,17 +45,34 @@ databaseCheck()
return $retval
}
+get_srt_env_settings() {
+ mainapp="yp"
+ # Apply all shell settings except default app 'yp'
+ # Only look in directories with proper 'datasource.json' files
+ for envscript in $(find ./bin -name "datasource.json") ; do
+ envscript=${envscript/datasource.json/srtool_env.sh}
+ if [ -f "$envscript" -a "$envscript" = "${envscript/bin\/yp/}" ] ; then
+ . $envscript
+ fi
+ done
+ # if no main app, default to 'yp'
+ if [ -z "$SRT_MAIN_APP" ] ; then
+ . ./bin/yp/srtool_env.sh
+ fi
+ echo "SRT_MAIN_APP=$SRT_MAIN_APP"
+}
+
webserverKillAll()
{
local pidfile
for pidfile in ${SRT_BASE_DIR}/.srtmain.pid ; do
if [ -f ${pidfile} ] ; then
pid=`cat ${pidfile}`
- while kill -0 $pid 2>/dev/null; do
- echo "KILL:$pid"
- kill -SIGTERM -9 $pid 2>/dev/null
- sleep 1
- done
+ while kill -0 $pid 2>/dev/null; do
+ echo "KILL:$pid"
+ kill -SIGTERM -9 $pid 2>/dev/null
+ sleep 1
+ done
rm ${pidfile}
fi
done
@@ -157,6 +174,9 @@ SRT_BASE_DIR=$(readlink -f $SRT_BASE_DIR)
SRT_BASE_DIR=$(dirname $SRT_BASE_DIR)
MANAGE="python3 $SRT_BASE_DIR/lib/manage.py"
+# Fetch the datasource environent settings
+get_srt_env_settings
+
# insure basic directories are present
mkdir -p $SRT_BASE_DIR/data
mkdir -p $SRT_BASE_DIR/data/cache
@@ -193,7 +213,7 @@ for param in $*; do
;;
*)
if [ "manage" == "$CMD" ] ; then
- cd $SRT_BASE_DIR/lib
+ cd $SRT_BASE_DIR/lib
manage_cmd="$manage_cmd $param"
else
echo "$HELP"
@@ -206,7 +226,6 @@ done
verify_prereq || exit 1
-
# this defines the dir SRTool will use for
# 1) the sqlite db if that is being used.
# 2) pid's we need to clean up on exit/shutdown
@@ -214,9 +233,9 @@ verify_prereq || exit 1
# Determine the action. If specified by arguments, fine, if not, toggle it
if [ "$CMD" = "start" ] ; then
if [ -n "$BBSERVER" ]; then
- echo " SRT is already running. Exiting..."
- exit 1
-fi
+ echo " SRT is already running. Exiting..."
+ exit 1
+ fi
elif [ "$CMD" = "" ]; then
echo "No command specified"
echo "$HELP"
@@ -230,7 +249,7 @@ case $CMD in
start )
# check if addr:port is not in use
if [ "$CMD" == 'start' ] ; then
- $MANAGE checksocket "$ADDR_PORT" || exit 1
+ $MANAGE checksocket "$ADDR_PORT" || exit 1
fi
if ! webserverStartAll; then
diff --git a/bin/yp/datasource.json b/bin/yp/datasource.json
index 694a325e..694a325e 100644..100755
--- a/bin/yp/datasource.json
+++ b/bin/yp/datasource.json
diff --git a/bin/yp/srtool_env.sh b/bin/yp/srtool_env.sh
new file mode 100755
index 00000000..c6c29c12
--- /dev/null
+++ b/bin/yp/srtool_env.sh
@@ -0,0 +1,3 @@
+# Main application shell settings
+
+export SRT_MAIN_APP="yp"
diff --git a/lib/acme/templates/base.html b/lib/acme/templates/base.html
new file mode 100755
index 00000000..5e1f847f
--- /dev/null
+++ b/lib/acme/templates/base.html
@@ -0,0 +1,265 @@
+<!DOCTYPE html>
+{% load static %}
+{% load projecttags %}
+{% load project_url_tag %}
+<html lang="en">
+ <head>
+ <title>
+ {% block title %} SRTool {% endblock %}
+ </title>
+ <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" type="text/css"/>
+ <!--link rel="stylesheet" href="{% static 'css/bootstrap-theme.css' %}" type="text/css"/-->
+ <link rel="stylesheet" href="{% static 'css/font-awesome.min.css' %}" type='text/css'/>
+ <link rel="stylesheet" href="{% static 'css/default.css' %}" type='text/css'/>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
+ <script src="{% static 'js/jquery-2.0.3.min.js' %}">
+ </script>
+ <script src="{% static 'js/jquery.cookie.js' %}">
+ </script>
+ <script src="{% static 'js/bootstrap.min.js' %}">
+ </script>
+ <script src="{% static 'js/typeahead.jquery.js' %}">
+ </script>
+ <script src="{% static 'js/jsrender.min.js' %}">
+ </script>
+ <script src="{% static 'js/highlight.pack.js' %}">
+ </script>
+ <script src="{% static 'js/libtoaster.js' %}">
+ </script>
+ {% if DEBUG %}
+ <script>
+ libtoaster.debug = true;
+ </script>
+ {% endif %}
+ <script>
+ $.views.settings.delimiters("<%", "%>");
+
+ libtoaster.ctx = {
+ jsUrl : "{% static 'js/' %}",
+ htmlUrl : "{% static 'html/' %}",
+ };
+ </script>
+ {% block extraheadcontent %}
+ {% endblock %}
+
+<style>
+.dropbtn {
+ background-color: white;
+ color: black;
+ font-size: 14px;
+ cursor: pointer;
+
+ border: 2px solid grey;
+ border-radius: 5px;
+
+ padding: 5px 12px !important;
+ margin: 10px 10px 10px 10px;
+}
+
+.dropbtn:hover, .dropbtn:focus {
+ background-color: grey;
+}
+
+.dropdown {
+ position: relative;
+ display: inline-block;
+}
+
+.dropdown-content {
+ display: none;
+ position: absolute;
+ background-color: #f9f9f9;
+ min-width: 160px;
+ overflow: auto;
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
+ z-index: 1;
+}
+
+.dropdown-content a {
+ color: black;
+ padding: 12px 16px;
+ text-decoration: none;
+ display: block;
+}
+
+.dropdown a:hover {background-color: #f1f1f1}
+
+.show {display:block;}
+
+.localblue {
+ color: blue;
+}
+
+.blueborder {
+ border: 2px solid blue;
+}
+
+.fieldset-auto-width {
+ display: inline-block;
+}
+
+</style>
+
+ </head>
+
+ <body>
+
+<script>
+/* When the user clicks on the button,
+toggle between hiding and showing the dropdown content */
+function myFunction() {
+ document.getElementById("myDropdown").classList.toggle("show");
+}
+
+// Close the dropdown if the user clicks outside of it
+window.onclick = function(event) {
+ if (!event.target.matches('.dropbtn')) {
+
+ var dropdowns = document.getElementsByClassName("dropdown-content");
+ var i;
+ for (i = 0; i < dropdowns.length; i++) {
+ var openDropdown = dropdowns[i];
+ if (openDropdown.classList.contains('show')) {
+ openDropdown.classList.remove('show');
+ }
+ }
+ }
+}
+</script>
+
+
+ {% csrf_token %}
+ <div id="loading-notification" class="alert alert-warning lead text-center" style="display:none">
+ Loading <i class="fa-pulse icon-spinner"></i>
+ </div>
+
+ <div id="change-notification" class="alert alert-info alert-dismissible change-notification" style="display:none">
+ <button type="button" class="close" id="hide-alert" data-toggle="alert">&times;</button>
+ <span id="change-notification-msg"></span>
+ </div>
+
+ <nav class="navbar navbar-default navbar-fixed-top">
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#global-nav" aria-expanded="false">
+ <span class="sr-only">Toggle navigation</span>
+ </button>
+ <div class="toaster-navbar-brand">
+
+ {% if srt_local_logo.0 %}
+ <a href="{{ srt_local_logo.2 }}">
+ <img class="logo" src="{{ srt_local_logo.1 }}" alt="{{srt_local_logo.0}}"/>
+ </a>
+ {% endif %}
+ <a href="/">
+ <img class="logo" src="{% static 'img/logo.png' %}" alt="Yocto Project logo"/>
+ </a>
+ <a class="brand" href="/">SRTool:Security Response Tool [ACME]</a>
+ {% if DEBUG %}
+ <span class="glyphicon glyphicon-info-sign" title="<strong>SRTool version information</strong>" data-content="<dl><dt>Git branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Git revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
+ {% endif %}
+ </div>
+ </div>
+ <div class="collapse navbar-collapse" id="global-nav">
+ <ul class="nav navbar-nav">
+
+ <li id="navbar-home" {% if request.resolver_match.url_name == 'landing' %}class="active"{% endif %}>
+ <a href="{% url 'landing' %}">
+ <i class="glyphicon glyphicon-tasks"></i>
+ Home [ACME]
+ </a>
+ </li>
+
+ {% if user.is_authenticated %}
+ {% if request.user.is_contributor %} <!-- greater than a Reader -->
+ <li id="navbar-manage" {% if request.resolver_match.url_name == 'manage' %}class="active"{% endif %}>
+ <a href="{% url 'manage' %}">
+ <i class="glyphicon glyphicon-tasks"></i>
+ Management
+ </a>
+ </li>
+ {% endif %}
+
+ {% if request.user.is_contributor %} <!-- greater than a Reader -->
+ {% if request.resolver_match.url_name == 'cve' or request.resolver_match.url_name == 'cves' %}
+ <li id="navbar-cve">
+ <a href="{% url 'cve_create' %}">
+ <i class="glyphicon glyphicon-tasks"></i>
+ New Cve
+ <!-- <span class="glyphicon glyphicon-question-sign get-help" title="Create a new Cve"></span> -->
+ </a>
+ </li>
+ {% endif %}
+ {% if request.resolver_match.url_name == 'vulnerability' or request.resolver_match.url_name == 'vulnerabilities' %}
+ <li id="navbar-vulnerability">
+ <a href="{% url 'vulnerability_create' %}">
+ <i class="glyphicon glyphicon-tasks"></i>
+ New vunerability
+ <!-- <span class="glyphicon glyphicon-question-sign get-help" title="Create a new Vulnerability"></span> -->
+ </a>
+ </li>
+ {% endif %}
+ {# FYI: investigation must be created from vulnerabilities and also attached to products #}
+ {% endif %}
+
+ {% endif %} <!-- user.is_authenticated -->
+
+ {% if request.resolver_match.url_name == 'cve' %}
+ <li id="navbar-altcves">
+ <a id="alternate_cve_link" href="{% url 'cve_alternates' 1 %}">
+ <i class="glyphicon glyphicon-tasks"></i>
+ Fetch alt data
+ <!-- <span class="glyphicon glyphicon-question-sign get-help" title="Fetch the alternate CVE data sources"></span> -->
+ </a>
+ </li>
+ {% endif %}
+
+ <li id="navbar-docs">
+ {% if srt_documentation_link %}
+ <a target="_blank" href="{{srt_documentation_link}}"><i class="glyphicon glyphicon-book"></i> Documentation [ACME]</a>
+ {% endif %}
+ </li>
+
+ <li id="navbar-export">
+ {% if request.resolver_match.url_name == 'landing' %}
+ <a href="{% url 'report' request.resolver_match.url_name %}"><i class="glyphicon glyphicon-tasks"></i> Export</a>
+ {% else %}
+ <a id="report_link" href="{% url 'report' request.resolver_match.url_name %}"><i class="glyphicon glyphicon-tasks"></i> Export</a>
+ {% endif %}
+ </li>
+
+ <div class="dropdown navbar-right">
+ {% if user.is_authenticated %}
+ <button onclick="myFunction()" class="dropbtn ">Hello '{{user.username}}'</button>
+ {% else %}
+ <button onclick="myFunction()" class="dropbtn ">Hello 'Guest' (Login here)</button>
+ {% endif %}
+ <div id="myDropdown" class="dropdown-content navbar-right">
+ {% if user.is_authenticated %}
+ <a href="{% url 'logout' %}">Logout</a>
+ <a href="{% url 'password_change' %}">Change password</a>
+ <a href="{% url 'edit_user' user.pk %}">Edit user settings</a>
+<!--
+ <a href="{% url 'password_reset' %}">Reset password</a>
+ <a href="{% url 'tbd' %}">Request permissions</a>
+-->
+ {% else %}
+ <a href="{% url 'login' %}">Login</a>
+ <a href="{% url 'signup' %}">Request account</a>
+ {% endif %}
+ </div>
+ </div>
+
+ </ul>
+ </div>
+ </div>
+ </nav>
+
+ <div class="container-fluid">
+ {% block pagecontent %}
+ {% endblock %}
+ </div>
+ </body>
+</html>
diff --git a/lib/orm/management/commands/checksettings.py b/lib/orm/management/commands/checksettings.py
index 1fc224fb..b1157c8e 100644
--- a/lib/orm/management/commands/checksettings.py
+++ b/lib/orm/management/commands/checksettings.py
@@ -191,10 +191,18 @@ class Command(BaseCommand):
else:
key_record.value = 'no'
key_record.save()
- #print("SOO:%s = %s" % (key,key_record.value))
# This is run after the absolute-positioned fixture entries so that these records are not overwriten
def _init_default_settings(self):
+ # Set the main application
+ mainapp,create = SrtSetting.objects.get_or_create(name='SRT_MAIN_APP')
+ if 'SRT_MAIN_APP' in os.environ.keys():
+ mainapp.value = os.environ['SRT_MAIN_APP']
+ else:
+ mainapp.value = 'yp'
+ mainapp.helptext = 'The main application name'
+ mainapp.save()
+
# TEST: set up the test flags based on ENVIRONMENT values
# * export SRTDBG_SKIP_CVE_IMPORT=1: we do not need to (re-)scan the CVE data
# * export SRTDBG_SKIP_CPE_IMPORT=1: we do not need to (re-)scan the CPE data
diff --git a/lib/srtgui/views.py b/lib/srtgui/views.py
index 06d02e77..dfdad602 100644
--- a/lib/srtgui/views.py
+++ b/lib/srtgui/views.py
@@ -103,12 +103,11 @@ def toaster_render(request, page, context):
# variables referred to in templates, which used to determine the
# visibility of UI elements like the "Management" button
def managedcontextprocessor(request):
- ret = {
-# "non_cli_projects": projects.exclude(is_default=True),
-# "DEBUG" : srtmain.settings.DEBUG,
-# "TOASTER_BRANCH": srtmain.settings.TOASTER_BRANCH,
-# "TOASTER_REVISION" : srtmain.settings.TOASTER_REVISION,
- }
+ ret = {}
+ # Add documentation link
+ ret['srt_documentation_link'] = SrtSetting.objects.get(name='SRTOOL_DOCUMENATION_URL').value
+ # Add optional local logo link
+ ret['srt_local_logo'] = SrtSetting.objects.get(name='SRTOOL_LOCAL_LOGO').value.split(',')
return ret
# determine in which mode we are running in, and redirect appropriately
diff --git a/lib/srtmain/settings.py b/lib/srtmain/settings.py
index 15fdbd24..df08ea93 100644
--- a/lib/srtmain/settings.py
+++ b/lib/srtmain/settings.py
@@ -257,7 +257,8 @@ ROOT_URLCONF = 'srtmain.urls'
WSGI_APPLICATION = 'srtmain.wsgi.application'
-# NOTE: the "srtmain" app automagicaly registers all other apps in top directory
+# Application priority order
+SRT_MAIN_APP = os.environ.get('SRT_MAIN_APP', 'yp')
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
@@ -271,19 +272,19 @@ INSTALLED_APPS = (
'django.contrib.humanize',
# Make the application order deterministic, where the custom application wins first
- 'acme',
+ SRT_MAIN_APP,
# Default applications
'srtmain',
'srtgui',
'users',
)
-
+#print("DEBUG:INSTALLED_APPS:%s,%s" % (SRT_MAIN_APP,INSTALLED_APPS))
INTERNAL_IPS = ['127.0.0.1', '192.168.2.28']
-# Load django-fresh is TOASTER_DEVEL is set, and the module is available
+# Load django-fresh is SRT_DEVEL is set, and the module is available
FRESH_ENABLED = False
-if os.environ.get('TOASTER_DEVEL', None) is not None:
+if os.environ.get('SRT_DEVEL', None) is not None:
try:
import fresh
MIDDLEWARE_CLASSES = ("fresh.middleware.FreshMiddleware",) + MIDDLEWARE_CLASSES
diff --git a/lib/yp/__init__.py b/lib/yp/__init__.py
new file mode 100755
index 00000000..e69de29b
--- /dev/null
+++ b/lib/yp/__init__.py
diff --git a/lib/yp/admin.py b/lib/yp/admin.py
new file mode 100755
index 00000000..8c38f3f3
--- /dev/null
+++ b/lib/yp/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/lib/yp/apps.py b/lib/yp/apps.py
new file mode 100755
index 00000000..2c92449e
--- /dev/null
+++ b/lib/yp/apps.py
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class YpConfig(AppConfig):
+ name = 'yp'
diff --git a/lib/yp/migrations/__init__.py b/lib/yp/migrations/__init__.py
new file mode 100755
index 00000000..e69de29b
--- /dev/null
+++ b/lib/yp/migrations/__init__.py
diff --git a/lib/yp/models.py b/lib/yp/models.py
new file mode 100755
index 00000000..71a83623
--- /dev/null
+++ b/lib/yp/models.py
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
diff --git a/lib/yp/tests.py b/lib/yp/tests.py
new file mode 100755
index 00000000..7ce503c2
--- /dev/null
+++ b/lib/yp/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/lib/yp/views.py b/lib/yp/views.py
new file mode 100755
index 00000000..91ea44a2
--- /dev/null
+++ b/lib/yp/views.py
@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.