Skip to content
Closed
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
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ private/

.coveralls.yml

# ignore debugging certs
ssl/server.crt
ssl/server.key
# ignore debugging self-signed certs
# ssl/server.crt
# ssl/server.key
19 changes: 18 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ branches:
- master
- develop

# env: PATH="/usr/lib/chromium-browser:$PATH"

# __1 Use this to prepare the system to install prerequisites or dependencies
before_install:
- echo "Nothing to do"
# http://docs.travis-ci.com/user/gui-and-headless-browsers/
- echo "Init xvfb (X Virtual Framebuffer)"
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
# - sudo apt-get install -y chromium-chromedriver
# - echo "Current path: $PATH"
# - export PATH="/usr/lib/chromium-browser:$PATH"
# - ln -sf /usr/bin/chromium-browser /usr/bin/google-chrome

# __2 Use this to install any prerequisites or dependencies necessary to run your build
install:
Expand All @@ -32,6 +42,8 @@ script:
# put config file in the place expected by config.py
- cp deploy/sample.settings.conf deploy/settings.conf
- fab coverage
- fab run &
- behave

# __5a after_success
after_success:
Expand All @@ -44,3 +56,8 @@ after_failure:
# __6
after_script:
echo "Cleanup."

#addons:
# apt:
# packages:
# - chromium-chromedriver
7 changes: 7 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Authors

* Andrei Sura <sura.andrei@gmail.com>
* Ruchi Vivek Desai <ruchivdesai@gmail.com>
* Sanath Pasumarthy <sanath@ufl.edu>
* Taeber Rapczak <taeber@ufl.edu>
* Nicholas Rejack <nrejack@ufl.edu>
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
# barebones-flask-app

[![Build Status](https://travis-ci.org/ctsit/barebones-flask-app.svg?branch=master)](https://travis-ci.org/ctsit/barebones-flask-app?branch=master)
[![Coverage Status](https://coveralls.io/repos/ctsit/barebones-flask-app/badge.svg?branch=master&service=github)](https://coveralls.io/github/ctsit/barebones-flask-app?branch=master)
| Branch | [Travis-CI](https://travis-ci.org/ctsit/barebones-flask-app/builds) | [Coveralls](https://coveralls.io/github/ctsit/barebones-flask-app) |
| :----- | :---------------------------: | :-------: |
| [Master](https://github.com/ctsit/barebones-flask-app/tree/master) | [![Build Status](https://travis-ci.org/ctsit/barebones-flask-app.svg?branch=master)](https://travis-ci.org/ctsit/barebones-flask-app?branch=master) | [![Coverage Status](https://coveralls.io/repos/ctsit/barebones-flask-app/badge.svg?branch=master&service=github)](https://coveralls.io/github/ctsit/barebones-flask-app?branch=master) |
| [Develop](https://github.com/ctsit/barebones-flask-app/tree/develop) | [![Build Status](https://travis-ci.org/ctsit/barebones-flask-app.svg?branch=develop)](https://travis-ci.org/ctsit/barebones-flask-app?branch=develop) | [![Coverage Status](https://coveralls.io/repos/ctsit/barebones-flask-app/badge.svg?branch=develop&service=github)](https://coveralls.io/github/ctsit/barebones-flask-app?branch=develop) |

[![Build Status](https://travis-ci.org/ctsit/barebones-flask-app.svg?branch=develop)](https://travis-ci.org/ctsit/barebones-flask-app?branch=develop)
[![Coverage Status](https://coveralls.io/repos/ctsit/barebones-flask-app/badge.svg?branch=develop&service=github)](https://coveralls.io/github/ctsit/barebones-flask-app?branch=develop)

This repo serves as an example of a python web application implemented using the
Flask micro-framework. It implements role-based authentication and can be used
for building more complex applications that interact with a database.

This is a basic python web app implemented using the Flask micro-framework

# Contributing

We encourage input and collaboration from the community.
Please fork the code, implement changes, and submit a
[pull request](https://github.com/ctsit/barebones-flask-app/pulls).

If you prefer to report a bug or make a suggestion, please create a GitHub
[issue](https://github.com/ctsit/barebone-flask-app/issues); issues are a great
place to ask public questions too. Please note that this project is released with
a [Contributor Code of Conduct](http://contributor-covenant.org/version/1/0/0/).
By participating in this project you agree to abide by its terms.


# Contributors

@see [AUTHORS.md](AUTHORS.md)
The application was written by Andrei Sura with tremendous support and fedback
from the entire
[CTS-IT team](https://www.ctsi.ufl.edu/research/study-development/informatics-consulting/).

For the complete list of contributors please see [AUTHORS.md](AUTHORS.md)
5 changes: 2 additions & 3 deletions app/static/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
z-index:80002; /* ensures box appears above overlay */
}

.red-background {
background-color: #a51a11;
.theme-background {
background-color: #123C84;
}

a.logo-name:hover, a.logo-name:active,
Expand Down Expand Up @@ -61,7 +61,6 @@ table.borderless td, table.borderless th {
.login-form-container {
margin-top: 3em;
padding: 3em;
background-color: #a51a11;
}

.footer {
Expand Down
10 changes: 4 additions & 6 deletions app/static/css/parallax.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@ This stylesheet and the associated (x)html may be modified in any way to fit you

/* additional sections */
#home {
background: url(/static/img/bottles.jpg) no-repeat center center fixed;
background: url(/static/img/code.jpg) no-repeat center center fixed;
display: table;
height: 50vh;
position: relative;
width: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

#about {
}

#services {
background-color: #a51a11;
background-color: #123C84;
color: #ffffff;
}

Expand All @@ -45,13 +42,14 @@ This stylesheet and the associated (x)html may be modified in any way to fit you
}

#information {
background: url(/static/img/oil.jpg) no-repeat center center fixed;
background: url(/static/img/code.jpg) no-repeat center center fixed;
display: table;
height: 300px;
position: relative;
width: 100%;
background-size: cover;
}

#information .panel {
opacity: 0.85;
}
Binary file removed app/static/img/bottles.jpg
Binary file not shown.
Binary file added app/static/img/code.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/static/img/oil.jpg
Binary file not shown.
Binary file removed app/templates/images/bottles.jpg
Binary file not shown.
Binary file removed app/templates/images/bottles_sm.jpg
Binary file not shown.
Binary file removed app/templates/images/drop-water.jpg
Binary file not shown.
Binary file not shown.
Binary file removed app/templates/images/oil_red.jpg
Binary file not shown.
Binary file removed app/templates/images/phone-handle.gif
Binary file not shown.
Binary file removed app/templates/images/phone_icon.png
Binary file not shown.
4 changes: 2 additions & 2 deletions app/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
{%endif%}

<!-- Sidebar -->
<div id="sidebar-wrapper" class="bg-primary red-background">
<div id="sidebar-wrapper" class="bg-primary theme-background">
<ul class="sidebar-nav">
{% for link in user_links %}
{{ render_nav_link(link[0], link[1]) }}
Expand All @@ -61,7 +61,7 @@

<div id="page-content-wrapper">
<nav class="navbar">
<div class="container-fluid bg-primary red-background">
<div class="container-fluid bg-primary theme-background">
<div class="navbar-header">
<div class="navbar-brand" href="/">
{% if current_user.is_authenticated() %}
Expand Down
7 changes: 3 additions & 4 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class DefaultConfig(object):
LOG_LEVEL = logging.INFO

# used for deployment
CONFIDENTIAL_SETTINGS_FILE = os.path.join(BASEDIR,
'/srv/apps/barebones/settings.conf')
CONFIDENTIAL_SETTINGS_FILE = '/srv/apps/barebones/settings.conf'

# Use local or shib sso auth
LOGIN_USING_SHIB_AUTH = True
Expand Down Expand Up @@ -74,5 +73,5 @@ class TestConfig(DefaultConfig):
""" Configuration for running tests """
TESTING = True
CSRF_ENABLED = False
CONFIDENTIAL_SETTINGS_FILE = os.path.join(BASEDIR,
'deploy/settings.conf')
SESSION_COOKIE_SECURE = False
CONFIDENTIAL_SETTINGS_FILE = os.path.join(BASEDIR, 'deploy/settings.conf')
8 changes: 8 additions & 0 deletions features/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Behave

behave is behaviour-driven development, Python style.

@see
* http://pythonhosted.org/behave/
* http://jenisys.github.io/behave.example/
* http://tott-meetup.readthedocs.org/en/latest/sessions/behave.html
19 changes: 19 additions & 0 deletions features/environment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from selenium import webdriver


def get_browser():
# @see http://selenium-python.readthedocs.org/en/latest/api.html
return webdriver.Firefox()
# desired_capabilities = {'ignore-certificate-errors': True}
# return webdriver.PhantomJS(desired_capabilities=desired_capabilities)
# return webdriver.Chrome(desired_capabilities=desired_capabilities)


def before_all(context):
context.browser = get_browser()
context.browser.set_window_size(1024, 768)
context.browser.implicitly_wait(3)


def after_all(context):
context.browser.quit()
5 changes: 5 additions & 0 deletions features/index.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: testing the index page

Scenario: visit index and check the page title
When we visit index
Then it should have a title "Barebones Web Application"
11 changes: 11 additions & 0 deletions features/steps/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from nose.tools import assert_equals
import time

@when('we visit index')
def step(context):
context.browser.get('https://127.0.0.1:5000/')
time.sleep(3)

@then('it should have a title "Barebones Web Application"')
def step(context):
assert_equals(context.browser.title, "Barebones Web Application")
2 changes: 2 additions & 0 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ pytest==2.7.0
pytest-cov==1.8.1
Flask-Testing==0.4.2
nose==1.3.6
behave==1.2.5
selenium==2.47.1
29 changes: 29 additions & 0 deletions ssl/server.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIFBjCCAu4CCQDQcRr8NX8uYzANBgkqhkiG9w0BAQ0FADBFMQswCQYDVQQGEwJB
VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMB4XDTE1MDgyMDIxMDkzMFoXDTE2MDgxOTIxMDkzMFowRTELMAkG
A1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0
IFdpZGdpdHMgUHR5IEx0ZDCCAiIwDQYJKoZIhvcNAQEBBQADgg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2r1NxSGj47660oYsRVQoDlSKIDYSkIB6JmME8wdMu+y3
ZGddqikdo6SMrpDVSr/xvDd1Yppp0ozKINsVgmFGCWI6bos0/dAcjTjX8rA/+At2
gFR03zKSRwWY6LMMuz1f6GNDas2sanAWeQOJ+HDOVwbMo1L+PSJyG5BRTeMFQ54x
kp4rRr4VH0dJtgKDz4V2agcIZZobCaGOgRmxTkMYTM0JH4Oiw5NqlprpjTuOwPU8
cwfVKFtDMC81a+C/3vDKfuzcGXaHeXyEV+FcQfjiNg69YhCM2yMiwEnFqJG78YXV
gLT4UGDgrOX6KMcgrt7Krgf3QVb5V4dgneCGZFBAE2dyZ9XacVM9B7RO
-----END CERTIFICATE-----
51 changes: 51 additions & 0 deletions ssl/server.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEAsrAMK4rUXnSbaVJYHsLNpqx5dwiukeAmxLAaSasq2lNGhv+U
QI5P6/WefKvmpsdywQaTAVBFks5SSOLrMRRizG01hOWWnt9YL4W4EOJOC1ZNxCkv
JDLuz+0bYjZCYXtO1Sm0pOf8a+fabrLxIdXhTAOxz9gPqNMG/5XFoif9WL/Py4+v
hMrf70IokjYv4rDPaB9eY8Kh79Keqr2ALDs/pTZ3squeaM4HICL8TWaNSWAX0p6u
3qZdxo8dCDsWazQfBWQFXO11FGTFtLXAZ6vDf/tRaAICQpvw733sQIbiZFJmwYaK
NPUOK4Dn+gO1juplOBAhWWSOaVs8Vx/bPPClue/5RAtYwlAPilfqexnUD3a1ZOzT
kBybW/wNTOldr7Gej8lJTCySU7HTDFkgnMXpVBMiJSCbkXrQKsY9QOG2G7Lwz7v7
rCDgR1phuMQpWkThZRqCABxgAjrkWs0qgaEbHLF+FFznskYj+4vIwslIcBSe2pQB
RJmMupbZNE3psGWpG/egENmy7ar1vkc01TMTNbz89PIg0AFQTIWVkxvBprqcHUdc
kRiWbIris6XmRBKRkcaTJzgGaAg3RUMt4DW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