-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
146 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% extends "appbuilder/base.html" %} | ||
|
||
{% block content %} | ||
<h3 align="left"><a href="/sampleindexview/list/">Go Back to run list</a></h3> | ||
<iframe src="{{url}}" frameborder='0' noresize='noresize' style='position: absolute; background: transparent; width: 100%; height:100%;' title="description" frameborder="0"></iframe> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
worker_processes 2; | ||
user nobody nogroup; | ||
|
||
error_log /var/nginx/error.log warn; | ||
pid /var/nginx/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; # increase if you have lots of clients | ||
accept_mutex off; # set to 'on' if nginx worker_processes > 1 | ||
# 'use epoll;' to enable for Linux 2.6+ | ||
# 'use kqueue;' to enable for FreeBSD, OSX | ||
} | ||
|
||
http { | ||
include mime.types; | ||
# fallback in case we can't determine a type | ||
default_type application/octet-stream; | ||
access_log /var/nginx/access.log combined; | ||
sendfile on; | ||
|
||
ssl_session_cache shared:SSL:10m; | ||
ssl_session_timeout 10m; | ||
|
||
upstream app_server { | ||
server webserver:8080 fail_timeout=0; | ||
} | ||
|
||
server { | ||
# if no Host match, close the connection to prevent host spoofing | ||
listen 80 default_server; | ||
return 444; | ||
} | ||
|
||
server { | ||
# Redirect http to https | ||
listen 80 default_server; | ||
server_name localhost; | ||
return 301 https://localhost$request_uri; | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
ssl_certificate /SSL/cert.pem; | ||
ssl_certificate_key /SSL/key.pem; | ||
keepalive_timeout 70s; | ||
server_name localhost; | ||
location / { | ||
# checks for static file, if not found proxy to app | ||
try_files $uri @proxy_to_app; | ||
} | ||
location @proxy_to_app { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Host $http_host; | ||
# we don't want nginx trying to do something clever with | ||
# redirects, we set the Host: header above already. | ||
proxy_redirect off; | ||
proxy_pass http://app_server; | ||
} | ||
|
||
error_page 500 502 503 504 /500.html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os, unittest, tempfile | ||
from flask.testing import FlaskClient | ||
from app import app, db, appbuilder | ||
from flask import Flask, g, url_for | ||
|
||
|
||
class TestCase1(unittest.TestCase): | ||
def setUp(self): | ||
app.app_context().push() | ||
app.config.from_object("flask_appbuilder.tests.config_api") | ||
db.create_all() | ||
self.client = app.test_client(use_cookies=True) | ||
app.appbuilder.sm.add_user( | ||
"admin", | ||
"admin", | ||
"user", | ||
"admin@fab.org", | ||
"Admin", | ||
"password") | ||
|
||
|
||
def tearDown(self): | ||
self.appbuilder = None | ||
db.drop_all() | ||
|
||
def test_access_server(self): | ||
uri = "/" | ||
rv = self.client.get(uri) | ||
#self.assertEqual(rv.status_code, 200) | ||
print(rv.status_code) | ||
|
||
|
||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |